Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

native: inject ±1 LSB dither to prevent SOF silence-detect amp shutdown

The SOF DSP's internal silence detector powers down the SSP1 BE DAI
after ~20-40s of all-zero frames, which drops MAX98360A sdmode to 0
(speaker amp off, never comes back). sysfs power/control override
failed on this platform ("Could not set runtime-PM: …/power/control").

Inject ±1 LSB alternating dither into every otherwise-zero sample.
At S16_LE this is -96 dBFS — utterly inaudible even at max volume —
but it keeps non-zero data flowing through the PGA/DAI so the
pipeline stays active and the amp stays powered.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+12
+12
fedac/native/src/audio.c
··· 1489 1489 buffer[i * 2] = (int16_t)(mix_l * 26000); 1490 1490 buffer[i * 2 + 1] = (int16_t)(mix_r * 26000); 1491 1491 1492 + /* DAPM keepalive: inject ±1 LSB dither when the buffer 1493 + * would otherwise be pure zeros. SOF DSP's internal 1494 + * silence detector powers down the SSP1 BE DAI after 1495 + * ~20-40s of all-zero frames, which drops MAX98360A 1496 + * sdmode to 0 (speaker amp off). ±1 at 16-bit S16_LE 1497 + * is -96 dBFS — utterly inaudible, but keeps the 1498 + * pipeline alive and the amp powered. */ 1499 + if (buffer[i * 2] == 0 && buffer[i * 2 + 1] == 0) { 1500 + buffer[i * 2] = (i & 1) ? 1 : -1; 1501 + buffer[i * 2 + 1] = (i & 1) ? -1 : 1; 1502 + } 1503 + 1492 1504 // HDMI audio: 1-pole low-pass filter + downsample 1493 1505 // (volume already applied above to mix_l/mix_r) 1494 1506 if (audio->hdmi_pcm) {