Skip to content

Commit

Permalink
feat: Update bell to develop
Browse files Browse the repository at this point in the history
  • Loading branch information
feelfreelinux committed Oct 21, 2024
1 parent 5c35a33 commit 0a928b5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cspot/bell
Submodule bell updated 79 files
+1 −0 .clang-tidy
+1 −2 .clangd
+6 −4 .github/workflows/c-cpp.yml
+3 −4 .github/workflows/clang-format.yml
+2 −0 .gitignore
+69 −49 CMakeLists.txt
+189 −0 docs/dsp.md
+ example/aactest.aac
+0 −40 example/iwyu.imp
+0 −13 example/scripts/dsp_spectogram.py
+4 −4 examples/dsp/CMakeLists.txt
+27 −28 examples/dsp/main.cpp
+1 −1 external/libhelix-mp3/assembly.h
+2 −0 external/libhelix-mp3/mp3dec.h
+2 −2 external/opencore-aacdec/CMakeLists.txt
+7 −0 external/opus-resample/CMakeLists.txt
+216 −0 external/opus-resample/src/arch.h
+1,239 −0 external/opus-resample/src/resample.c
+128 −0 external/opus-resample/src/resample_sse.h
+343 −0 external/opus-resample/src/speex_resampler.h
+5 −22 flake.lock
+31 −42 flake.nix
+1 −1 main/audio-codec/OPUSDecoder.cpp
+1 −1 main/audio-codec/VorbisDecoder.cpp
+6 −6 main/audio-dsp/AudioMixer.cpp
+57 −0 main/audio-dsp/AudioResampler.cpp
+78 −41 main/audio-dsp/BellDSP.cpp
+3 −6 main/audio-dsp/Biquad.cpp
+0 −2 main/audio-dsp/BiquadCombo.cpp
+2 −2 main/audio-dsp/Compressor.cpp
+1 −1 main/audio-dsp/Gain.cpp
+8 −34 main/audio-dsp/include/AudioMixer.h
+32 −0 main/audio-dsp/include/AudioResampler.h
+1 −1 main/audio-dsp/include/AudioTransform.h
+33 −8 main/audio-dsp/include/BellDSP.h
+2 −1 main/audio-dsp/include/Biquad.h
+3 −0 main/audio-dsp/include/Gain.h
+28 −0 main/audio-dsp/include/JSONTransformConfig.h
+162 −0 main/audio-dsp/include/NlohmannJSONTransformConfig.h
+65 −5 main/audio-dsp/include/StreamInfo.h
+7 −1 main/audio-dsp/include/TransformConfig.h
+1 −1 main/audio-sinks/include/unix/PortAudioSink.h
+8 −1 main/audio-sinks/unix/PortAudioSink.cpp
+2 −2 main/io/BellHTTPServer.cpp
+4 −0 main/io/BellMQTTClient.cpp
+7 −3 main/io/BellTar.cpp
+26 −1 main/io/BinaryStream.cpp
+11 −0 main/io/SocketStream.cpp
+95 −0 main/io/SocketUtils.cpp
+28 −11 main/io/TLSSocket.cpp
+1 −1 main/io/include/BellHTTPServer.h
+2 −1 main/io/include/BellSocket.h
+8 −1 main/io/include/BellTar.h
+2 −0 main/io/include/BinaryStream.h
+1 −1 main/io/include/BufferedStream.h
+20 −23 main/io/include/FileStream.h
+9 −0 main/io/include/SocketStream.h
+16 −0 main/io/include/SocketUtils.h
+32 −2 main/io/include/StreamUtils.h
+50 −40 main/io/include/TCPSocket.h
+2 −1 main/io/include/TLSSocket.h
+134 −0 main/io/include/UDPSocket.h
+92 −0 main/platform/MDNSBrowser.h
+1 −1 main/platform/MDNSService.h
+265 −0 main/platform/apple/MDNSBrowser.cpp
+115 −0 main/platform/esp/MDNSBrowser.cpp
+199 −0 main/platform/linux/MDNSBrowser.cpp
+1 −0 main/platform/linux/MDNSService.cpp
+21 −8 main/utilities/BellLogger.cpp
+2 −8 main/utilities/NanoPBHelper.cpp
+127 −0 main/utilities/SyslogLogger.cpp
+40 −17 main/utilities/include/BellLogger.h
+48 −57 main/utilities/include/BellUtils.h
+0 −1 main/utilities/include/NanoPBHelper.h
+72 −0 main/utilities/include/SyslogLogger.h
+27 −0 package.nix
+145 −0 test/BinaryStreamTest.cpp
+17 −0 test/CMakeLists.txt
+2 −0 test/main.cpp
11 changes: 7 additions & 4 deletions cspot/include/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

#include <BellLogger.h>

#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__); \
} \
}
9 changes: 5 additions & 4 deletions targets/cli/CliPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ CliPlayer::CliPlayer(std::unique_ptr<AudioSink> sink,
std::make_shared<bell::CentralAudioBuffer>(128 * 1024);

#ifndef BELL_DISABLE_CODECS
this->dsp = std::make_shared<bell::BellDSP>(this->centralAudioBuffer);
this->dsp = std::make_shared<bell::BellDSP>();
#endif

auto hashFunc = std::hash<std::string_view>();
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down
1 change: 0 additions & 1 deletion targets/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ALSAAudioSink>();
#elif defined(CSPOT_ENABLE_PORTAUDIO_SINK)
Expand Down
1 change: 0 additions & 1 deletion targets/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<CSpotTask>();
vTaskSuspend(NULL);
}

0 comments on commit 0a928b5

Please sign in to comment.