I have a rather interesting issue on HP EliteBook 1040, with Intel ADL HDA. Sometimes (often) audio output is heavily distorted, but then opening pavucontrol or just launching `parecord /dev/null` fixes the issue instantly. But, when the mixer or recording is closed, then few seconds later issue comes back.
You can hear this at https://cloud.marmarek.net/s/46prqZnwrqDkBdD Initially recording was running, then about 10s stopped and you can hear the issue few seconds later. Then I starter recording again, and the issue is gone. This is how it should sound: https://youtube.com/watch?v=4Tr0otuiQuU I do not see any kernel messages when issue happens.
The issue happens on Linux 6.1.26, 6.2.10, and 6.3.2. I haven't tested other versions. It happens only when running under Xen (in PV dom0). The very same Linux started directly works fine. Full dmesg of both native and Xen boots is at https://gist.github.com/marmarek/548ee79282446344a172109bcd943930
When running Linux 6.3.2 there, I noticed that just after boot first playback is okay, but if I start and stop recording it breaks. And then after some time of idle it fixes itself again. I have not observed this behavior on 6.2.10 (it was broken initially too), but I could be also doing some things differently.
I have few other ADL-based systems (but not HP), and they do not show this issue, only this HP laptop is affected. Example dmesg from another ADL-based system: https://gist.github.com/marmarek/38c5ba3ec58f9300fbc1842ddc9fa4f5
Could you try to switch to the legacy HD-audio driver (e.g. by passing snd_intel_dspcfg.dsp_driver=1 option) and check whether the issue persists or not? This will narrow down whether it's SOF-specific problem or not, at least.
This does help! With snd_intel_dspcfg.dsp_driver=1 the issue doesn't happen anymore, the audio output just works the whole time. But, the built-in microphone disappeared, only external (unplugged) is listed. I guess that's kind-of expected.
Can you check what happens with a headphone and the SOF driver?
The SOF driver doesn't really know/care what is on the other side of the HDaudio bus, so it'd be good to rule-out an amplifier-specific configuration issue.