fix(audio): clipped SPI audio on nv14/el18/x12s (#5905)

This commit is contained in:
richardclli
2025-02-14 08:51:05 +10:00
committed by GitHub
parent d644f73f4a
commit c766a0dcff
2 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -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
@@ -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
@@ -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;