From 6482c7964469b4aaef99efcb98c2fcde037ffdcb Mon Sep 17 00:00:00 2001 From: MarcelineVPQ Date: Sun, 7 Jun 2026 11:50:37 -0600 Subject: [PATCH] fix(audio): fold the crackle fix (RX buffer 3x->16x) into the native-trigger firmware The speaker-crackle root cause -- USB-audio OUT endpoint software buffer overflow at 3x the max packet size -- was fixed on the audio branch (de37e00) but never on this branch. Bumping CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ from 3x to 16x removes the crackle; verified by A/B tone test (440 Hz) through the DS5 speaker. A faint residual cadence "warble" remains (a separate root cause, not the buffer) and is left for a later pass. Net: one firmware with BOTH native adaptive triggers and a crackle-free speaker. Co-Authored-By: Claude Opus 4.8 --- src/tusb_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tusb_config.h b/src/tusb_config.h index 875d63a..520f37f 100644 --- a/src/tusb_config.h +++ b/src/tusb_config.h @@ -127,7 +127,7 @@ #define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_OUT #define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_IN -#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ (3 * CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX) +#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ (16 * CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX) #define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ (4 * CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX) // Enable OUT EP (speaker) and IN EP (mic)