FS#79081 - [linux] [linux-zen] >= 6.4 causes audio distortion

Attached to Project: Arch Linux
Opened by tux (Unsecured443) - Wednesday, 12 July 2023, 23:18 GMT
Last edited by Toolybird (Toolybird) - Friday, 18 August 2023, 23:37 GMT
Task Type Bug Report
Category Kernel
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

I have a Lenovo ThinkPad X1 Yoga Gen 7. Linux 6.4 and higher, both the regular and zen kernels, cause audio distortion. Sometimes, this occurs to the point that nearly nothing is discernible. This carries over to wired headphones.

Linux kernels 6.3.x are not affected and neither is the 6.1 LTS kernel series which is what I am temporarily using. On Windows too, the audio works as it should. This indicates that my hardware is not at fault. Bluetooth audio is not impacted from my testing, either.

The distortion doesn't start immediately. It either occurs automatically after a random amount of time, or when I increase/decrease the volume, or when I skip forward/backward to a section. In order to stop the distortion, I have to either increase/decrease the volume until it stops, or skip forward/backward until it stops, or restarting Pipewire via systemd, however it starts again due to one of the aforementioned reasons.

At the time of this report, I am running Pipewire 0.3.73 and Wireplumber 0.4.14. Also, at the time of this report, linux and linux-zen are both versions 6.4.3. Linux LTS is version 6.1.38.

I wrote about this on the Arch Linux forums, too, and seems like at least two other people are facing this issue. Here's the forum post: https://bbs.archlinux.org/viewtopic.php?id=287068

I have attached the dmesg outputs of the Arch distributed linux, linux-zen, and linux-lts kernels.

Here's some audio related hardware information:

inxi -A

Audio:
Device-1: Intel Alder Lake PCH-P High Definition Audio
driver: sof-audio-pci-intel-tgl
API: ALSA v: k6.1.38-1-lts status: kernel-api


pactl info

Server String: /run/user/1000/pulse/native
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: yes
Client Index: 1119
Tile Size: 65472
User Name: tux
Host Name: NSA-Terminal-4
Server Name: PulseAudio (on PipeWire 0.3.73)
Server Version: 15.0.0
Default Sample Specification: float32le 2ch 48000Hz
Default Channel Map: front-left,front-right
Default Sink: bluez_output.58_FC_C6_58_83_AB.1
Default Source: alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_6__source
Cookie: 96a0:1a1e


pactl list cards

Card #48
Name: alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic
Driver: alsa
Owner Module: n/a
Properties:
api.acp.auto-port = "false"
api.acp.auto-profile = "false"
api.alsa.card = "0"
api.alsa.card.longname = "LENOVO-21CDCTO1WW-ThinkPadX1YogaGen7"
api.alsa.card.name = "sof-hda-dsp"
api.alsa.path = "hw:0"
api.alsa.use-acp = "true"
api.dbus.ReserveDevice1 = "Audio0"
device.api = "alsa"
device.bus = "pci"
device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
device.description = "Alder Lake PCH-P High Definition Audio Controller"
device.enum.api = "udev"
device.icon_name = "audio-card-analog-pci"
device.name = "alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic"
device.nick = "sof-hda-dsp"
device.plugged.usec = "6708312"
device.product.id = "0x51c8"
device.product.name = "Alder Lake PCH-P High Definition Audio Controller"
device.subsystem = "sound"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
device.vendor.id = "0x8086"
device.vendor.name = "Intel Corporation"
media.class = "Audio/Device"
factory.id = "14"
client.id = "34"
object.id = "47"
object.serial = "48"
object.path = "alsa:pcm:0"
alsa.card = "0"
alsa.card_name = "sof-hda-dsp"
alsa.long_card_name = "LENOVO-21CDCTO1WW-ThinkPadX1YogaGen7"
alsa.driver_name = "snd_soc_skl_hda_dsp"
device.string = "0"
Profiles:
off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
HiFi: Play HiFi quality Music (sinks: 4, sources: 2, priority: 8000, available: yes)
pro-audio: Pro Audio (sinks: 5, sources: 3, priority: 1, available: yes)
Active Profile: HiFi
Ports:
[Out] HDMI3: HDMI / DisplayPort 3 Output (type: HDMI, priority: 700, latency offset: 0 usec, availability group: HDMI/DP,pcm=5, not available)
Properties:
port.type = "hdmi"
port.availability-group = "HDMI/DP,pcm=5"
device.icon_name = "video-display"
card.profile.port = "0"
Part of profile(s): HiFi
[Out] HDMI2: HDMI / DisplayPort 2 Output (type: HDMI, priority: 600, latency offset: 0 usec, availability group: HDMI/DP,pcm=4, not available)
Properties:
port.type = "hdmi"
port.availability-group = "HDMI/DP,pcm=4"
device.icon_name = "video-display"
card.profile.port = "1"
Part of profile(s): HiFi
[Out] HDMI1: HDMI / DisplayPort 1 Output (type: HDMI, priority: 500, latency offset: 0 usec, availability group: HDMI/DP,pcm=3, not available)
Properties:
port.type = "hdmi"
port.availability-group = "HDMI/DP,pcm=3"
device.icon_name = "video-display"
card.profile.port = "2"
Part of profile(s): HiFi
[Out] Speaker: Speaker (type: Speaker, priority: 100, latency offset: 0 usec, availability unknown)
Properties:
port.type = "speaker"
device.icon_name = "audio-speakers"
card.profile.port = "3"
Part of profile(s): HiFi
[Out] Headphones: Headphones (type: Headphones, priority: 200, latency offset: 0usec, availability group: Headphone, not available)
Properties:
port.type = "headphones"
port.availability-group = "Headphone"
device.icon_name = "audio-headphones"
card.profile.port = "4"
Part of profile(s): HiFi
[In] Mic2: Headphones Stereo Microphone (type: Mic, priority: 200, latency offset: 0 usec, availability group: Mic, not available)
Properties:
port.type = "mic"
port.availability-group = "Mic"
device.icon_name = "audio-input-microphone"
card.profile.port = "5"
Part of profile(s): HiFi
[In] Mic1: Digital Microphone (type: Mic, priority: 100, latency offset: 0 usec,availability unknown)
Properties:
port.type = "mic"
device.icon_name = "audio-input-microphone"
card.profile.port = "6"
Part of profile(s): HiFi


Steps to reproduce:
1. Upgrade to Linux kernel 6.4 or higher.
2. Play a video or music, increase/decrease the volume, or seek forward/backward.
This task depends upon

Closed by  Toolybird (Toolybird)
Friday, 18 August 2023, 23:37 GMT
Reason for closing:  Upstream
Additional comments about closing:  "A patch for this bug has been merged into the mainline 6.5 kernel."
Comment by Toolybird (Toolybird) - Wednesday, 12 July 2023, 23:43 GMT
Please test pipewire 1:0.3.74-1 in [extra-testing]. If that doesn't fix it, it's a kernel regression. General advice for debugging kernel regressions [1]. It's definitely not an Arch packaging issue. You might have to report it upstream. Please let us know what you find out.

[1] https://wiki.archlinux.org/title/Kernel#Debugging_regressions
Comment by tux (Unsecured443) - Thursday, 13 July 2023, 18:56 GMT
Sorry for the delay in replying. I tested pipewire 1:0.3.74-1 in the testing repository, but that did not fix that.
Comment by tux (Unsecured443) - Thursday, 13 July 2023, 22:29 GMT
Furthermore, I was just able to test 6.5rc1 and the issue still persists in that version. It really does seem like a kernel regression.
Comment by tux (Unsecured443) - Friday, 14 July 2023, 22:49 GMT
I have filed a bug report regarding this issue to upstream here: https://bugzilla.kernel.org/show_bug.cgi?id=217673

Kindly let me know if there's something else I need to do.
Comment by David Rosenstrauch (darose) - Wednesday, 19 July 2023, 14:00 GMT Comment by David Rosenstrauch (darose) - Wednesday, 26 July 2023, 14:12 GMT
Looks like there's a patch available for this. (See https://bugzilla.suse.com/show_bug.cgi?id=1213583#c7 ) Any change of getting that patch included in the next Arch kernel build?
Comment by loqs (loqs) - Wednesday, 26 July 2023, 14:58 GMT
@darose as mentioned in the thread you linked and the upstream report the patch does not apply to linux 6.4. There is a use at your own risk version I back-ported to 6.4 in the forum thread [1].

[1] https://bbs.archlinux.org/viewtopic.php?pid=2111520#p2111520
Comment by David Rosenstrauch (darose) - Wednesday, 26 July 2023, 15:02 GMT
? The commenter wrote: "As mentioend in comment 3, it was modified to fit with 6.4.x kernel"
Comment by loqs (loqs) - Wednesday, 26 July 2023, 15:09 GMT
Yes I modified it. The patch from upstream authored by the SOF developers does not.
Edit:
Backport by Takashi Iwai for SUSE https://github.com/openSUSE/kernel/commit/c9eb7dc726631d39f11ea17e6db6fe7ad5c0e5d9
Comment by tux (Unsecured443) - Friday, 18 August 2023, 23:25 GMT
A patch for this bug has been merged into the mainline kernel: https://github.com/torvalds/linux/commit/ce03e1807c1f71abcba185e6052cbef250600514

Loading...