From 6c99f9f2fee0928987fe944c8ed29878064df87a Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 8 Aug 2023 11:36:10 +1000 Subject: Fix resampler issue, do a little performance tuning --- src/audio/fatfs_audio_input.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/audio/fatfs_audio_input.cpp') diff --git a/src/audio/fatfs_audio_input.cpp b/src/audio/fatfs_audio_input.cpp index 0c3ef20d..73586f09 100644 --- a/src/audio/fatfs_audio_input.cpp +++ b/src/audio/fatfs_audio_input.cpp @@ -30,6 +30,7 @@ #include "freertos/portmacro.h" #include "freertos/projdefs.h" #include "future_fetcher.hpp" +#include "idf_additions.h" #include "span.hpp" #include "stream_info.hpp" #include "tag_parser.hpp" @@ -40,8 +41,8 @@ static const char* kTag = "SRC"; namespace audio { -static constexpr UINT kFileBufferSize = 4096 * 2; -static constexpr UINT kStreamerBufferSize = 4096; +static constexpr UINT kFileBufferSize = 8 * 1024; +static constexpr UINT kStreamerBufferSize = 64 * 1024; static StreamBufferHandle_t sForwardDest = nullptr; @@ -143,7 +144,9 @@ FatfsAudioInput::FatfsAudioInput( : IAudioSource(), tag_parser_(tag_parser), has_data_(xSemaphoreCreateBinary()), - streamer_buffer_(xStreamBufferCreate(kStreamerBufferSize, 1)), + streamer_buffer_(xStreamBufferCreateWithCaps(kStreamerBufferSize, + 1, + MALLOC_CAP_SPIRAM)), streamer_(new FileStreamer(streamer_buffer_, has_data_)), input_buffer_(new RawStream(kFileBufferSize)), source_mutex_(), -- cgit v1.2.3