native: SOF-aware audio period sizing (fixes G7 DAPM amp storm) master
Root cause of silent G7 speakers with everything else correct: the old audio.c config hardcoded ~1ms ALSA period (rate/1000 frames) + 4ms total buffer. Works fine on HDA-direct codecs (ThinkPad X13 etc.) but on SOF+MAX98360A the boot log shows **10,686 sdmode toggles per boot** — once per period, matching the ~5ms toggle spacing exactly. Mechanism: MAX98357A's DAPM event handler flips SD_MODE high on POST_PMU and low on PRE_PMD. At 4ms buffer depth, ac-native's 16ms paint-loop audio submission cadence misses every period = constant underrun = stream bounces PMU/PMD every period = amp physically toggles faster than it can stabilize = silence even though the ALSA layer looks fine. Probe sound/soc/sof's presence (card0 exists AND no legacy HDA codec97 node) and bump to 10ms period / 40ms buffer — same shape ChromeOS uses on Dedede. HDA paths unaffected; ThinkPad keeps its tight latency. Also: drop loglevel=7 + per-subsystem dyndbg from kernel cmdline now that we've extracted the diagnosis. Flooding tty0 with kernel messages was slowing userspace enough that the trackpad's HID polling was failing to register. Keep only max98357a dyndbg so the next boot confirms sdmode stays HIGH during playback instead of cycling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>