aes67_tx: mono sum; the source always delivers stereo

The pull callback's contract said "stream channels", but the player always
delivers stereo, so a 1-channel stream went out as L,R,L,R at half speed.
Sources now always deliver AES67_TX_SRC_CHANNELS (2); TX maps to the stream:
2 ch as is, 1 ch = (L+R)/2 in 64 bit with mono_sum (can't clip), else L.
Checked: mono packets 156 B, 1000/s, 48 samples each, SDP L24/48000/1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 23:26:48 +10:00
parent faf427c897
commit c9e06da47c
4 changed files with 22 additions and 5 deletions
+1 -1
View File
@@ -18,7 +18,7 @@
#include "spotify.h"
#define RATE 48000
#define CHANNELS 2
#define CHANNELS AES67_TX_SRC_CHANNELS // the ring holds what TX pulls: stereo
#define RING_FRAMES (4 * RATE) // 4 s in PSRAM
#define PREFILL_FRAMES (RATE) // 1 s before (re)starting output
#define FADE_FRAMES (RATE * 30 / 1000) // 30 ms ramp at a source switch