Skip to content

Commit

Permalink
fix(audio): clipped SPI audio on nv14/el18/x12s (#5905)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardclli authored and pfeerick committed Feb 13, 2025
1 parent 0f76828 commit bd79a6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions radio/src/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ constexpr uint8_t AUDIO_FILENAME_MAXLEN = (AUDIO_LUA_FILENAME_MAXLEN > AUDIO_MOD

#if defined(SIMU) && defined(SIMU_AUDIO)
#define AUDIO_BUFFER_COUNT (10) // simulator needs more buffers for smooth audio
#elif defined(PCBX12S)
#elif defined(AUDIO_SPI)
#define AUDIO_BUFFER_COUNT (2) // smaller than Taranis since there is also a buffer on the ADC chip
#elif defined(PCBPL18)
#define AUDIO_BUFFER_COUNT (10) // PL18 need more buffer for smooth audio
#elif defined(STORAGE_USE_SPI_FLASH)
#define AUDIO_BUFFER_COUNT (10) // SPI Flash need more buffer for smooth audio
#else
#define AUDIO_BUFFER_COUNT (3)
#endif
Expand Down
5 changes: 3 additions & 2 deletions radio/src/targets/common/arm/stm32/vs1053b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
#define SM_LINE1 0x4000
#define SM_CLK_RANGE 0x8000

#define SPI_LOW_SPEED 1755000
#define SPI_HIGH_SPEED 9216000
#define SPI_LOW_SPEED 1500000
#define SPI_HIGH_SPEED 12000000

#define VS1053_BUFFER_SIZE 32

Expand Down Expand Up @@ -305,6 +305,7 @@ static void vs1053b_mute()
if (!_last_play_ts) {
// we start the mute delay now
_last_play_ts = now;
return;
} else if (now - _last_play_ts < _instance->mute_delay_ms) {
// delay not expired, we may not mute yet
return;
Expand Down

0 comments on commit bd79a6c

Please sign in to comment.