Bug 1213583 - Distorted audio with kernel >= 6.4.2
Summary: Distorted audio with kernel >= 6.4.2
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Sound (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Major with 3 votes (vote)
Target Milestone: ---
Assignee: Takashi Iwai
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-24 08:13 UTC by Tristan Miller
Modified: 2024-06-25 17:51 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Output of alsa-info.txt (74.82 KB, text/plain)
2023-07-24 08:13 UTC, Tristan Miller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tristan Miller 2023-07-24 08:13:59 UTC
Created attachment 868391 [details]
Output of alsa-info.txt

I have a Lenovo ThinkPad T14s.  Since upgrading from kernel-default 6.3.9 to 6.4.2 (and then again to 6.4.3), I have been experiencing severe audio distortion.  The problem doesn't occur right away, but seemingly at random after several minutes or hours.  It can also often (fairly reliably, but not 100%) be triggered in an application that plays audio by seeking forwards in an audio stream.  Once the distortion happens, it usually persists as long as the application remains open. Restarting the application sometimes solves the issue temporarily, but more often the distortion remains for all audio applications until the entire OS is rebooted. Simply restarting alsa or pipewire has no effect.

There is a similar report for Arch Linux at <https://bugs.archlinux.org/task/79081?project=1&pagenum=10> which links to Kernel and thesofproject bugs at <https://bugzilla.kernel.org/show_bug.cgi?id=217673> and <https://github.com/thesofproject/linux/issues/4455>, respectively.  If this is indeed the same problem, then it would be nice if Tumbleweed could apply whatever patches are provided.

I'm running alsa 1.2.9 and pipewire 0.3.72.

Here is information on my hardware:

# inxi -A
Audio:
  Device-1: Intel Comet Lake PCH-LP cAVS driver: sof-audio-pci-intel-cnl
  Device-2: Lenovo ThinkPad Dock USB Audio driver: hid-generic,snd-usb-audio,usbhid type: USB
  API: ALSA v: k6.4.3-1-default status: kernel-api

Output of alsa-info.sh is attached.
Comment 1 Takashi Iwai 2023-07-24 09:11:39 UTC
Likely an issue of SOF.

Could you try to switch to the legacy HDA-Intel by passing
  snd_intel_dspcfg.dsp_driver=1
boot option?

It's just for verifying the problem, not meant as a fix, as you'll loose the built-in mic with that.
Comment 2 Tristan Miller 2023-07-24 10:08:45 UTC
Yes, I'm no longer able to reproduce the problem when using that kernel parameter.
Comment 3 Takashi Iwai 2023-07-24 12:26:42 UTC
OK, thanks for confirmation.

I'm building a test kernel with a backport patch that was suggested in the SOF issue page.  The patch was modified for 5.4.x, so it's totally untested.
The package is being built in OBS home:tiwai:bsc1213583.  Please check it once after the package build finishes.
Comment 4 Tristan Miller 2023-07-25 08:15:04 UTC
(In reply to Takashi Iwai from comment #3)
> I'm building a test kernel with a backport patch that was suggested in the
> SOF issue page.  The patch was modified for 5.4.x, so it's totally untested.
> The package is being built in OBS home:tiwai:bsc1213583.  Please check it
> once after the package build finishes.


Yes, with that kernel (and without the snd_intel_dspcfg.dsp_driver=1 parameter) the problem is no longer reproducible for me.
Comment 5 Takashi Iwai 2023-07-25 13:41:25 UTC
Then please update the info on the upstream bug tracker.

The patch is still a downstream one, and we need to wait at least for the upstream submission to be taken into TW kernel.
Comment 6 Tristan Miller 2023-07-25 14:26:32 UTC
Could you be more specific as to what information I should provide in the upstream tracker?  It's not clear to me what patch you applied and whether the upstream developers have it.  The upstream report links to a patch at <https://github.com/thesofproject/linux/pull/4484> but this looks to be slightly different from the ASoC-SOF-intel-hda-Clean-up-link-DMA-for-IPC3-during-stop.patch one included in the patches.suse.tar.bz2 of your kernel package.
Comment 7 Takashi Iwai 2023-07-25 14:35:26 UTC
Yes, it's the patch ASoC-SOF-intel-hda-Clean-up-link-DMA-for-IPC3-during-stop.patch, from the github issue you mentioned.  As mentioend in comment 3, it was modified to fit with 6.4.x kernel, but it should be equivalent.  You can report that the modified patch successfully worked for 6.4.x.
Comment 8 Tristan Miller 2023-07-26 06:31:31 UTC
(In reply to Takashi Iwai from comment #7)
> Yes, it's the patch
> ASoC-SOF-intel-hda-Clean-up-link-DMA-for-IPC3-during-stop.patch, from the
> github issue you mentioned.  As mentioend in comment 3, it was modified to
> fit with 6.4.x kernel, but it should be equivalent.  You can report that the
> modified patch successfully worked for 6.4.x.


OK, I think part of the confusion was that you wrote that the patch was modified for 5.4.x, not 6.4.x.  I've now reported the result upstream, though it seems that the bug has already been closed in the meantime.
Comment 9 Takashi Iwai 2023-07-27 09:53:11 UTC
Ah sorry for the typo.

Now I took the latest patch from SOF git repo, backported to stable branch, and sent a PR for merge.  Hopefully this will be included in near future (I guess it slipped from 6.4.7 TW kernel update, though).