From 0a928b5b41dd6283b24d006fb756e5d3d3adb1d2 Mon Sep 17 00:00:00 2001 From: Filip Date: Mon, 21 Oct 2024 18:00:47 +0200 Subject: [PATCH] feat: Update bell to develop --- cspot/bell | 2 +- cspot/include/Logger.h | 11 +++++++---- targets/cli/CliPlayer.cpp | 9 +++++---- targets/cli/main.cpp | 1 - targets/esp32/main/main.cpp | 1 - 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/cspot/bell b/cspot/bell index e8373736..e7325dd0 160000 --- a/cspot/bell +++ b/cspot/bell @@ -1 +1 @@ -Subproject commit e83737367a08b5a5a1f652a7ecb97a0d926929dd +Subproject commit e7325dd06e8988dc781982ada12f58b2f1c152e9 diff --git a/cspot/include/Logger.h b/cspot/include/Logger.h index 60864ff8..c0882235 100644 --- a/cspot/include/Logger.h +++ b/cspot/include/Logger.h @@ -2,7 +2,10 @@ #include -#define CSPOT_LOG(type, ...) \ - do { \ - bell::bellGlobalLogger->type(__FILE__, __LINE__, "cspot", __VA_ARGS__); \ - } while (0) +#define CSPOT_LOG(type, ...) \ + { \ + std::scoped_lock lock(bell::bellRegisteredLoggersMutex); \ + for (auto& logger : bell::bellRegisteredLoggers) { \ + logger->type(__FILE__, __LINE__, "cspot", __VA_ARGS__); \ + } \ + } diff --git a/targets/cli/CliPlayer.cpp b/targets/cli/CliPlayer.cpp index 69cbfba7..e1b67421 100644 --- a/targets/cli/CliPlayer.cpp +++ b/targets/cli/CliPlayer.cpp @@ -29,7 +29,7 @@ CliPlayer::CliPlayer(std::unique_ptr sink, std::make_shared(128 * 1024); #ifndef BELL_DISABLE_CODECS - this->dsp = std::make_shared(this->centralAudioBuffer); + this->dsp = std::make_shared(); #endif auto hashFunc = std::hash(); @@ -111,8 +111,8 @@ void CliPlayer::runTask() { if (!chunk || chunk->pcmSize == 0) { if (this->playlistEnd) { - this->handler->notifyAudioEnded(); - this->playlistEnd = false; + this->handler->notifyAudioEnded(); + this->playlistEnd = false; } BELL_SLEEP_MS(10); continue; @@ -123,7 +123,8 @@ void CliPlayer::runTask() { } #ifndef BELL_DISABLE_CODECS - this->dsp->process(chunk->pcmData, chunk->pcmSize, 2, 44100, + this->dsp->process(chunk->pcmData, chunk->pcmSize, chunk->pcmData, + chunk->pcmSize, 2, bell::SampleRate::SR_44100, bell::BitWidth::BW_16); #endif this->audioSink->feedPCMFrames(chunk->pcmData, chunk->pcmSize); diff --git a/targets/cli/main.cpp b/targets/cli/main.cpp index a4249875..3b0a60b3 100644 --- a/targets/cli/main.cpp +++ b/targets/cli/main.cpp @@ -114,7 +114,6 @@ int main(int argc, char** argv) { exit(1); #endif bell::setDefaultLogger(); - bell::enableTimestampLogging(); #ifdef CSPOT_ENABLE_ALSA_SINK auto audioSink = std::make_unique(); #elif defined(CSPOT_ENABLE_PORTAUDIO_SINK) diff --git a/targets/esp32/main/main.cpp b/targets/esp32/main/main.cpp index d0ba2ba5..5b4ded89 100644 --- a/targets/esp32/main/main.cpp +++ b/targets/esp32/main/main.cpp @@ -277,7 +277,6 @@ void app_main(void) { //auto taskHandle = xTaskCreatePinnedToCore(&cspotTask, "cspot", 12*1024, NULL, 5, NULL, 1); /*auto taskHandle = */ bell::setDefaultLogger(); - bell::enableTimestampLogging(); auto task = std::make_unique(); vTaskSuspend(NULL); }