fix: SOF mis-detection silenced HDA codecs (Realtek ALC257 etc.)
Two bugs that combined to produce silent audio on every non-SOF Linux
device (ThinkPads, generic laptops):
1. The SOF probe at audio.c:2130 fired TRUE on any modern non-AC97
system because both gates were trivially satisfied:
- /sys/class/sound/card0/id → exists everywhere
- /proc/asound/card0/codec97#0 → absent on every non-AC97 codec
Replaced with a real check for the SOF kernel module:
/sys/module/snd_sof{,_pci}/initstate exists iff SOF is loaded.
2. The S32_LE write path uses `(int32_t)int16 << 8`, placing the int16
sample in the LOW 24 bits of int32. That's correct for SOF MAX98360A
(24-bit DSP at the SSP1 BE DAI), but 256× too quiet (-48 dB) for
HDA-direct codecs that interpret S32_LE as a true 32-bit DAC value.
Many HDA codecs (incl. ALC257) accept S32_LE in hw_params but expect
the sample in the high bits. Easier than a per-codec shift: only
try S32_LE when sof_active. Force S16_LE everywhere else.
flash-mac.sh: also bake user identity (handle/sub/email) into config.json
on both partitions by reading ~/.ac-token via SUDO_USER's home — same
flow as ac-os require_login. Empty fields fall back to anon if the user
hasn't run `ac-login` yet.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>