thesofproject / linux

Linux kernel source tree
Other
89 stars 128 forks source link

[BUG] Very weak sound on XPS 15 model 9530 (2023) #4624

Closed berbmit closed 3 months ago

berbmit commented 9 months ago

Describe the bug XPS 15 laptop, model 9530 (2023) with latest Linux Mint installed and all updates applied, the sound is soft and tinny. It seems the woofers are not being detected and with only the 2 top tweeters firing. Have tried suggestions I can find on the web, tried kernels up to 6.5, made sure all updates from repositories are applied.

Reproduction Rate 100% Have googled extensively, and seems this problem is prevalent on the XPS 15 9530.

Expected behavior The sound works well under Windows (from testing before deleting windows and installing Linux)

Impact This is a huge frustration for music and games and Zoom calls for work.

Environment I do not know how to get all the template's information

From dmesg: [ 4.817359] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100 [ 4.817376] sof-audio-pci-intel-tgl 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver [ 4.817382] sof-audio-pci-intel-tgl 0000:00:1f.3: enabling device (0000 -> 0002) [ 4.817579] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100 [ 4.817633] sof-audio-pci-intel-tgl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915]) [ 4.825894] sof-audio-pci-intel-tgl 0000:00:1f.3: use msi interrupt mode [ 4.852090] sof-audio-pci-intel-tgl 0000:00:1f.3: hda codecs found, mask 5 [ 4.852093] sof-audio-pci-intel-tgl 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now [ 4.852095] sof-audio-pci-intel-tgl 0000:00:1f.3: DMICs detected in NHLT tables: 2 [ 4.854782] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864 [ 4.854784] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0 [ 4.854786] sof-audio-pci-intel-tgl 0000:00:1f.3: unknown sof_ext_man header type 3 size 0x30 [ 4.949656] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864 [ 4.949663] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0 [ 4.957446] sof-audio-pci-intel-tgl 0000:00:1f.3: Topology: ABI 3:20:0 Kernel ABI 3:23:0 [ 5.706027] input: sof-hda-dsp Headphone Mic as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input17 [ 5.706071] input: sof-hda-dsp HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input18 [ 5.706100] input: sof-hda-dsp HDMI/DP,pcm=4 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input19 [ 5.706130] input: sof-hda-dsp HDMI/DP,pcm=5 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input20

Output from alsa-info attached alsa-info.txt

lgirdwood commented 9 months ago

@berbmit ok, thanks for the dmesg and closing the duplicate bug. @bardliao who would be able to help from Realtek, I assume we are missing HDA verbs to enable the amplifiers ?

angioli commented 9 months ago

I'm exactly in the same situation; I tried in ubuntu 23.04 and manjaro linux

System: Kernel: 6.5.5-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.2.1 clocksource: tsc available: acpi_pm parameters: BOOT_IMAGE=/boot/vmlinuz-6.5-x86_64 root=UUID=7b963b00-a2a6-4e87-b512-1ffc311f1c5c rw btusb.enable_autosuspend=0 quiet splash Desktop: GNOME v: 44.5 tk: GTK v: 3.24.38 wm: gnome-shell dm: GDM v: 44.1 Distro: Manjaro Linux base: Arch Linux Machine: Type: Laptop System: Dell product: XPS 15 9530 v: N/A serial: Chassis: type: 10 serial: Mobo: Dell model: 0P6GXD v: A00 serial: UEFI: Dell v: 1.7.0 date: 08/14/2023

Ruddle commented 9 months ago

Same here. The volume is less than a quarter what it is on windows, and there is a frequency cut off at 150hz, instead of 50-60hz. Let me recap all the info I found on this matter.

I tried the patch from the previous xps 9520 with a 6.5.4 kernel, no luck. It consists in adding this line to /sound/pci/hda/patch_realtek.c in the kernel:

SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530", ALC289_FIXUP_DUAL_SPK),

(I adapted the SDevice to the xps 9530's one) Didn't work.

I also tried hdajackretask with nearly all possible combinations of enabling disconnected pins. Didn't work.

There are some efforts shared on reddit here, and here. But no solutions yet.

Apparently, the xps 15 9530 share some audio hardware with recent Asus laptops, where the problem was solved

Unfortunately the work done is above my current skills.

berbmit commented 9 months ago

Apparently, the xps 15 9530 share some audio hardware with recent Asus laptops, where the problem was solved

Unfortunately the work done is above my current skills.

Above mine too ... but thanks for the link. I was amused by the ASUS link ending with "The goal of this article was to provide an easily accessible guide for people to work from". That's above my pay grade but hopefully this will help others more competent to move this forward to something I can implement.

plbossart commented 9 months ago

Try this: https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html#disable-sof-on-pci-hdaudio-devices-to-test-audio-playback

If the volume remains low, it's a codec configuration issue and it needs to be worked-around using the other suggestions - it's clearly not simple to reverse-engineer this flow.

plbossart commented 9 months ago

if there's no difference between two drivers using a common codec configuration, the issue is the codec configuration...

Ruddle commented 9 months ago

Try this: https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html#disable-sof-on-pci-hdaudio-devices-to-test-audio-playback

If the volume remains low, it's a codec configuration issue and it needs to be worked-around using the other suggestions - it's clearly not simple to reverse-engineer this flow.

Thanks. I just tried. The volume remains low, and the low frequencies are still entirely missing.

Note, probably expected: After the change, in my sound settings (pop os / ubuntu interface) the name of the Output Device changed and the settings now allows for surround configuration. But whatever I choose, only front left and front right outputs sounds.

Anyway, it seems that the problem is the codec configuration. It is not clear to me, are the instructions in the rest of page you shared meant to solve an issue with the codec configuration ?

plbossart commented 9 months ago

There's a patch that was posted today for what looks like the same Dell model:

https://lore.kernel.org/alsa-devel/9c7b08fc-7f00-4894-a5b2-f3fc5f99e022@gmail.com/

diff -r -up a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
--- a/sound/pci/hda/patch_realtek.c     2023-10-07 22:16:36.129618972 +1100
+++ b/sound/pci/hda/patch_realtek.c     2023-10-07 22:16:52.645258218 +1100
@@ -9412,6 +9412,7 @@ static const struct snd_pci_quirk alc269
       SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
       SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
       SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
+       SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530", ALC289_FIXUP_DUAL_SPK),
       SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
       SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
       SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), 
Ruddle commented 9 months ago

There's a patch that was posted today for what looks like the same Dell model:

https://lore.kernel.org/alsa-devel/9c7b08fc-7f00-4894-a5b2-f3fc5f99e022@gmail.com/

diff -r -up a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
--- a/sound/pci/hda/patch_realtek.c     2023-10-07 22:16:36.129618972 +1100
+++ b/sound/pci/hda/patch_realtek.c     2023-10-07 22:16:52.645258218 +1100
@@ -9412,6 +9412,7 @@ static const struct snd_pci_quirk alc269
       SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
       SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
       SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
+       SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530", ALC289_FIXUP_DUAL_SPK),
       SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
       SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
       SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), 

Interesting, but as mentioned before, that patch doesn't work on its own, it has been tested at least 3 times in the last 3 months according to my research.

btantlinger commented 9 months ago

I can confirm the

There's a patch that was posted today for what looks like the same Dell model: https://lore.kernel.org/alsa-devel/9c7b08fc-7f00-4894-a5b2-f3fc5f99e022@gmail.com/

diff -r -up a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
--- a/sound/pci/hda/patch_realtek.c     2023-10-07 22:16:36.129618972 +1100
+++ b/sound/pci/hda/patch_realtek.c     2023-10-07 22:16:52.645258218 +1100
@@ -9412,6 +9412,7 @@ static const struct snd_pci_quirk alc269
       SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
       SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
       SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
+       SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530", ALC289_FIXUP_DUAL_SPK),
       SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
       SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
       SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), 

Interesting, but as mentioned before, that patch doesn't work on its own, it has been tested at least 3 times in the last 3 months according to my research.

I can confirm this patch does not work on the 9530.

Ruddle commented 9 months ago

Can someone more knowledgeable confirm that this is what needs to be done to solve what seems to be a codec configuration issue ? How to sniff verbs from a Windows sound driver I can attempt that.

Ruddle commented 9 months ago

I tried the 2 reverse engineering suggestions from this page

Both are outdated.

This one suggests to boot on windows (no VM) and launch a utility supposed to dump audio codec data. The utility crashes on windows 11. Maybe it should be tried again with windows 10 ?

This other one suggests to build and launch a windows VM with a custom qemu supposed to dump audio codec data too. Building this custom qemu proved to be too hard, I gave up after a 2-3 hours of fighting error messages. I tried with a recent qemu version. Once the qemu and VM is setup, you have to launch qemu with a passthrough for the audio device.

lspci -nn | grep 00\:1f

00:1f.0 ISA bridge [0601]: Intel Corporation Device [8086:519d] (rev 01)
00:1f.3 Multimedia audio controller [0401]: Intel Corporation Device [8086:51ca] (rev 01)
00:1f.4 SMBus [0c05]: Intel Corporation Alder Lake PCH-P SMBus Host Controller [8086:51a3] (rev 01)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Alder Lake-P PCH SPI Controller [8086:51a4] (rev 01)

00:1f.3 on the xps 15 9530 is the right device to passthrough. But I get this error from qemu no available reset mechanism The VM boots fine, but audio is not working inside the VM. Maybe someone else knows how to get past that ?

VladStulikov commented 9 months ago

Hey guys, the same problem has been existing for years with the ALC289 chip on Dell XPS and other laptops. I have XPS 9510 with the same issue and have tried everything I found, nothing helped. Any kernel, Ubuntu/Debian, pulseaudio, pipewire, no combinatiion work. The patches for the kernel do not work as they seems to be adding the same configuration you can set up via hdajackretask. But I did not make hdajackretask work too.

Let me know if I can be of any help here.

marcSoda commented 9 months ago

I'm having the same issue on the 9530, however, in response to the above comment by @VladStulikov, the issue does not exist on the 9510. I have had it since it came out and the audo works just fine.

EDIT: One interesting thing that I noticed is that the XPS15 9530 has the Realtek ALC3281 chip, but my system references the ALC289 (which was present on the 9510 and on the 9520 (I think). I posted my alsa-info.sh dump for both my 9510 and 9530 (running the same kernel) in a message a few below this one.

bardliao commented 9 months ago

@berbmit ok, thanks for the dmesg and closing the duplicate bug. @bardliao who would be able to help from Realtek, I assume we are missing HDA verbs to enable the amplifiers ?

Shui-Wen Hsu swhsu4021@realtek.com and Kailang kailang@realtek.com may help.

berbmit commented 9 months ago

@berbmit ok, thanks for the dmesg and closing the duplicate bug. @bardliao who would be able to help from Realtek, I assume we are missing HDA verbs to enable the amplifiers ?

Shui-Wen Hsu swhsu4021@realtek.com and Kailang kailang@realtek.com may help.

Who would make this contact? I have no track record (credibility?) in this.

VladStulikov commented 9 months ago

, the issue does not exist on the 9510. I have had it since it came out and the audio works just fine

Really interesting, can you post/send me you alsa-info.sh output please?

I have XPS 9510 from when it came out and no version of Ubuntu/Debian/kernel fixed the issue.

And just to make sure: the issue is not a complete absence of sound but a cutoff of low frequencies as the bass speakers are not activated at all. You can check it playing 20-20000Hz video from Youtube, I bet you hear no sound lower 150Hz on your laptop.

image

marcSoda commented 9 months ago

, the issue does not exist on the 9510. I have had it since it came out and the audio works just fine

Really interesting, can you post/send me you alsa-info.sh output please?

I have XPS 9510 from when it came out and no version of Ubuntu/Debian/kernel fixed the issue.

And just to make sure: the issue is not a complete absence of sound but a cutoff of low frequencies as the bass speakers are not activated at all. You can check it playing 20-20000Hz video from Youtube, I bet you hear no sound lower 150Hz on your laptop.

image

Yessir I will post it below. Another interesting thing to note is that the XPS15 9510 uses the ALC298 codec where the XPS15 9530 uses the ALC3281. I see several places in my system and on the kernel where the XPS9530 references the ALC298 (which it does NOT have) and NEVER the ALC3281 (which it DOES have). You will notice this in the alsa-info dump.

And yes, on my 9530, the issue described is exactly my experience. The sound is present, but there is 0 bass. However, on my 9510, everything works just fine and it has been working for years. I am happy to give you whatever information you think would be helpful to solve your issue on the 9510, but as I am a little out of my depth with this audio driver and kernel stuff, I am not exactly sure what is relevent. Feel free to followup and I'll send you whatever output or system configuration information you want.

FYI my kernel is 6.5.7-arch1-1 on BOTH machines.

I attached the alsa-info.sh dumps as files to this post. One for the 9530, and one for the 9510. alsa-info_9510.txt alsa-info_9530.txt

btantlinger commented 9 months ago

And just to make sure: the issue is not a complete absence of sound but a cutoff of low frequencies as the bass speakers are not activated at all. You can check it playing 20-20000Hz video from Youtube, I bet you hear no sound lower 150Hz on your laptop.

No, on the 9530, the subwoofers (woofers?) make no sound at all. The sound only comes out of the top speakers.

The title of this bug says "weak sound" but I think it would be more accurate to say "weak sound caused by non-functional bottom speakers" (woofers, subwoofers, not sure what you call them)

marcSoda commented 9 months ago

And just to make sure: the issue is not a complete absence of sound but a cutoff of low frequencies as the bass speakers are not activated at all. You can check it playing 20-20000Hz video from Youtube, I bet you hear no sound lower 150Hz on your laptop.

No, on the 9530, the subwoofers (woofers?) make no sound at all. The sound only comes out of the top speakers.

The title of this bug says "weak sound" but I think it would be more accurate to say "weak sound caused by non-functional bottom speakers" (woofers, subwoofers, not sure what you call them)

This is my expereice on the 9530 as well. I think that's exactly what @VladStulikov was describing.

btantlinger commented 9 months ago

And just to make sure: the issue is not a complete absence of sound but a cutoff of low frequencies as the bass speakers are not activated at all. You can check it playing 20-20000Hz video from Youtube, I bet you hear no sound lower 150Hz on your laptop.

No, on the 9530, the subwoofers (woofers?) make no sound at all. The sound only comes out of the top speakers. The title of this bug says "weak sound" but I think it would be more accurate to say "weak sound caused by non-functional bottom speakers" (woofers, subwoofers, not sure what you call them)

This is my expereice on the 9530 as well. I think that's exactly what @VladStulikov was describing.

You're right, I read @VladStulikov comment wrong. Sorry about that. Thought he meant that only certain frequencies were not coming out of the speakers, but yes - the bottoms speakers are totally not working.

Ruddle commented 9 months ago

Recap of everything

The Dell 9530 has 2 tweeters 2x2W, and 2 woofers 2x3W It uses the Realtek ALC3281 audio controller, but linux reports ALC289.

Problem : the woofers do not output any sound on linux. Most of the loudness, and all low frequencies are supposed to come from the woofers. This results in very low quality audio, with insufficient loudness. The tweeters output audio, but it is unclear if they fully work themselves, as the perceived loudness is extremely low (way less than 4W/10W).

What has been tried unsuccessfully:

ThomasWMarshall commented 9 months ago

I am also affected by this.

It didn't work, but I have tried the instructions given here: https://asus-linux.org/wiki/cirrus-amps/

This is a different model laptop, but when I grep dmesg, it appears that there is at some hardware similarity:

[    3.221718] Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices.
[    3.745957] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Error: ACPI _DSD Properties are missing for HID CSC3551.
[    3.745970] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: error -EINVAL: Platform not supported
[    3.745973] cs35l41-hda: probe of spi1-CSC3551:00-cs35l41-hda.0 failed with error -22
[    3.754819] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Error: ACPI _DSD Properties are missing for HID CSC3551.
[    3.754827] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: error -EINVAL: Platform not supported
[    3.754831] cs35l41-hda: probe of spi1-CSC3551:00-cs35l41-hda.1 failed with error -22

I'm happy to help however I can.

VladStulikov commented 9 months ago

Just notice that ALC289 and ALC3281 is the same controller. Both 9510 and 9530 have ALC3281 in the specifications https://www.dell.com/support/manuals/en-ca/xps-15-9510-laptop/xps-15-9510-setup-and-specifications/audio?guid=guid-6878b68f-ccfb-4c6a-9f62-3ed941403f53&lang=en-us https://www.dell.com/support/manuals/en-ca/xps-15-9530-laptop/xps-15-9530-setup-and-specifications/audio?guid=guid-6878b68f-ccfb-4c6a-9f62-3ed941403f53&lang=en-us

But ALC3281 is actually rebranded ALC289 and is recognised by kernel as ALC289 (see the alsa screenshots)

VladStulikov commented 9 months ago

This kernel patch that worked for the Dell 9510 (and 9520). However those laptops use a different audio controller (ALC289). They also use 2 tweeters and 2 woofers though.

My point is that it is the same controller, not another one. So the patch should work for 9530 as well, but it does not and it does not work for every 9510 as it turns out. This part is really intriguing.

VladStulikov commented 9 months ago

I attached the alsa-info.sh dumps as files to this post. One for the 9530, and one for the 9510. alsa-info_9510.txt alsa-info_9530.txt

Much appreciate it!

Both of them are not complete, there are no two parts in the end of report !!ALSA/HDA dmesg and !!Packages installed.

Can you run the alsa-info.sh under sudo?

Or another way run "sudo dmesg | grep snd" and paste the output here please?

VladStulikov commented 9 months ago

Thought he meant that only certain frequencies were not coming out of the speakers, but yes - the bottoms speakers are totally not working.

Right, the low frequencies are not coming out exactly because the bass speakers are not working at all. The topicstarter described it as "weak sound", this is the same, weak high-frequency sound because from 4 speakers only 2 are working, the tweeters.

VladStulikov commented 9 months ago

@marcSoda I see in the reports that on your 9530 the pin 0x17 is not connected whereas it is connected on your 9510. So I think in your case hdajackretask may help. Can you try this one https://www.dell.com/community/en/conversations/precision-mobile-workstations/precision-5560-fix-for-linux-audio-alsa/647f9780f4ccf8a8dea807cf if it helps on your 9530?

marcSoda commented 9 months ago

@marcSoda I see in the reports that on your 9530 the pin 0x17 is not connected whereas it is connected on your 9510. So I think in your case hdajackretask may help. Can you try this one https://www.dell.com/community/en/conversations/precision-mobile-workstations/precision-5560-fix-for-linux-audio-alsa/647f9780f4ccf8a8dea807cf if it helps on your 9530?

Thanks for your reply. I checked hdajackretask on the 9530, and you're right, 0x17 is not connected. I played around with it for a bit and nothing seemed to do anything (mind you, I am out of my depth here). I then took a look at hdajackretest on the 9510 (where the woofers are working great), and 0x17 also is not mounted there for the ALC298.

Based on hdajackretask, the only mounted pins for the ALC298 (which, again, the 9530 doesn't even have btw) on both the 9510 and 9530 are 0x14 and 0x21. I'm not sure why alsa-info for the 9510 claims that 0x17 is mounted. To me, it does not appear to be. I can confirm that both the alsa-infos that I posted are correct and correspond to their respective device.

Thanks again, I appreciate you mentioning that.

VladStulikov commented 9 months ago

@marcSoda

Thank you for trying and the information. On your 9510

/sys/class/sound/hwC0D0/init_pin_configs: 0x12 0xb7a60130 0x13 0x40000000 0x14 0x90170110 0x16 0x411111f0 0x17 0x411111f0 0x18 0x411111f0 0x19 0x411111f0 0x1a 0x411111f0 0x1b 0x411111f0 0x1d 0x40139bf3 0x1e 0x411111f0 0x21 0x03211020

/sys/class/sound/hwC0D0/driver_pin_configs: 0x17 0x90170130 0x19 0x01a1913c 0x1b 0x01a1913d

From my understanding it means that 0x17 is not connected by default but driver connects it. hdajackretask takes the info from /sys/class/sound/hwC0D0/init_pin_config that is why it thinks it is not connected as it does not see the override made by driver. This override is what actually this patch does: https://github.com/kristinpaget/xps-15-9510-audio/blob/main/kernel.patch

This is your 9530:

/sys/class/sound/hwC0D0/init_pin_configs: 0x12 0x40000000 0x13 0x411111f0 0x14 0x90170110 0x16 0x411111f0 0x17 0x411111f0 0x18 0x411111f0 0x19 0x411111f0 0x1a 0x411111f0 0x1b 0x411111f0 0x1d 0x40400001 0x1e 0x411111f0 0x21 0x03211030

/sys/class/sound/hwC0D0/driver_pin_configs: 0x19 0x01a1913c 0x1b 0x01a1913d

Meaning that on 9530 the driver does not assign the pin.

I would really appreciate if you post the output of "sudo dmesg | grep snd" here?

marcSoda commented 9 months ago

Thanks for the message, I wouldn't have figured all that out. I'm going to try messing with that now. The dump you requested is attached. I did one for each machine, they are named accordingly. dmesg_snd_9510.txt dmesg_snd_9530.txt

VladStulikov commented 9 months ago

@marcSoda

Cool, the logs confirm my hypothesis:

9510:

[ 3.249468] snd_hda_codec_realtek hdaudioC0D0: autoconfig for ALC289: line_outs=2 (0x14/0x17/0x0/0x0/0x0) type:speaker

9530:

[ 15.487748] snd_hda_codec_realtek ehdaudio0D0: autoconfig for ALC289: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker

marcSoda commented 9 months ago

@marcSoda

Cool, the logs confirm my hypothesis:

9510:

[ 3.249468] snd_hda_codec_realtek hdaudioC0D0: autoconfig for ALC289: line_outs=2 (0x14/0x17/0x0/0x0/0x0) type:speaker

9530:

[ 15.487748] snd_hda_codec_realtek ehdaudio0D0: autoconfig for ALC289: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker

Yes, I see. I tried connecting the pin via sudo hda-verb /dev/snd/hwC1D0 0x17 0x707 0x90170130 (note that my audio codec is /dev/hwC1D0 on 9530 and /dev/hwC0D0 on 9510), but it didn't seem to work. I get 'invalid param 0x90170130'. Why might this be?

marcSoda commented 9 months ago

I got some great info from someone working on this issue here. https://unix.stackexchange.com/questions/758803/dell-xps15-9530-horrible-audio?noredirect=1#comment1446025_758803. take a look at the answer from alex.vin. It's not a solution, but it's good info.

berbmit commented 9 months ago

Thanks @marcSoda and others ... I am the orig bug filer and yes, it should have been titled "subs don't work!" ... am following this conversation and learning, so much thanks to all who are finding new doors to open in search of a solution.

ThomasWMarshall commented 9 months ago

@berbmit Seconded! Let me know if I can help with anything. I don't know much about this kind of troubleshooting, but I am in possession of a 9530 with non-functioning subs which I'm happy to use to help with testing!

berbmit commented 9 months ago

I don't know if this helps. Following the rabbit trail of links I came across https://asus-linux.org/RtHDDump_V236.zip from this Asus page https://asus-linux.org/blog/sound-2021-01-11/

I made a bootable Win10 USB disk, so I could get Windows without deleting my Linux install on the system disk. Booted Win10, and loaded all recommended drivers from the Dell website. After driver install the sound under windows was great. I ran the ulitlity referenced above and got the attached dump which has a section called Audio Verb Setting ... does this help anyone more knowledgeable than me?

RtHDDump.txt

josbeir commented 9 months ago

I don't know if this helps. Following the rabbit trail of links I came across https://asus-linux.org/RtHDDump_V236.zip from this Asus page https://asus-linux.org/blog/sound-2021-01-11/

I made a bootable Win10 USB disk, so I could get Windows without deleting my Linux install on the system disk. Booted Win10, and loaded all recommended drivers from the Dell website. After driver install the sound under windows was great. I ran the ulitlity referenced above and got the attached dump which has a section called Audio Verb Setting ... does this help anyone more knowledgeable than me?

RtHDDump.txt

Great to see this conversion is going! I'm having my XPS for some weeks now and it is the only real thing that frustrates me about it (except from some annoying wake from long suspend crashes i get from time to time).

It looks like the pin addresses seem to match with the ones already detected on the sound card (/proc/asound/card2/codec#0 in my case).

I think that the issue has more to do with the Cirrus amplifier cs35l41 device that is not getting activated (the code is not present in ACPI) https://asus-linux.org/wiki/cirrus-amps/ so we probably need to get the correct acpi firmware for that device somewhere and patch it so the driver is loaded correctly.

It will probably be a combination of ACPI patching and adding a quirk in the kernel to make this work. Hope someone who knows a thing or two about these things will use an 9530 soon...

Update: following the guide mentioned above i extracted the dsdt code and searched for the mentioned reference (in the file CSC3551) but to my surprise it's nowhere to be found.

I attached it in case someone needs it.

dsdt.zip

VladStulikov commented 9 months ago

Yes, I see. I tried connecting the pin via sudo hda-verb /dev/snd/hwC1D0 0x17 0x707 0x90170130 (note that my audio codec is /dev/hwC1D0 on 9530 and /dev/hwC0D0 on 9510), but it didn't seem to work. I get 'invalid param 0x90170130'. Why might this be?

Pin config cannot be set via verbs. hdajackretask sets pin config via passing "patch" option to snd-hda-intel module:

1) it creates a file usr/lib/firmware/hda-jack-retask.fw with the pincfg you specified in the GUI 2) it creates /etc/modprobe.d/hda-jack-retask.conf with the line options snd-hda-intel patch=hda-jack-retask.fw

I think there are two parts in the problem:

1) correct pincfg. for 9510 and 9520 this is already done by the patch setting correct pins which is already in the kernel: https://github.com/torvalds/linux/blob/master/sound/pci/hda/patch_realtek.c#L9546 https://github.com/torvalds/linux/blob/master/sound/pci/hda/patch_realtek.c#L9550

so to make this part work on 9530 we need the same patch applied for 9530 in the kernel. Or the patch (pin reconfig) can be done via hdajackretask. That is why I want first to make the pin 0x17 connected on your 9530. If we can do it via hdajackretask then next we create a line SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530", ALC289_FIXUP_DUAL_SPK)

0x1028, 0x0beb are from Subsystem Id: 0x10280beb from your alsa-info_9530

But first we need to figure out what is the correct pin cfg for your 9530.

2) correct amplifier coefficients. These are done via verbs.

VladStulikov commented 9 months ago

@marcSoda Okay I figured out that hdajackretask just is not able to create a proper pin config. Whatever you select for pin 0x17 you do not get the proper override 0x17 0x90170130 in the patch.

Can you try to remove the override made by hdajackretask on your 9530 and then create a file usr/lib/firmware/hda-jack-retask.fw with content

[pincfg]
0x17 0x90170130 

Then create another file /etc/modprobe.d/hda-jack-retask.conf

with the line options snd-hda-intel patch=hda-jack-retask.fw, then reboot.

After rebooting

cat /sys/class/sound/hwC0D0/user_pin_configs should have the line

0x17 0x90170130

Then try to play a sound < 150Hz on max volume to check if subwoofers work now.

If it does not help let us try the another address from @berbmit's RtHDDump.txt ( I much appreciate it @berbmit !)

So next to try would be

[pincfg]
0x17 0x90170110
VladStulikov commented 9 months ago

Overall the proper pin config for 9530 seems to be (from the Windows config):

0x12 0x40000000 0x13 0x411111f0 0x14 0x90170110 0x16 0x411111f0 0x17 0x90170110 0x18 0x81d111f0 0x19 0x03a11880 0x1a 0x411111f0 0x1b 0x03a11cc0 0x1d 0x40400001 0x1e 0x411111f0 0x21 0x03211430

Whereas currently under Linux it is

0x12 0x40000000 0x13 0x411111f0 0x14 0x90170110 0x16 0x411111f0 0x17 0x411111f0 0x18 0x411111f0 0x19 0x01a1913c 0x1a 0x411111f0 0x1b 0x01a1913d 0x1d 0x40400001 0x1e 0x411111f0 0x21 0x03211030

Thus the difference is not in pin 0x17 only. So maybe it is worth to try usr/lib/firmware/hda-jack-retask.fw with contents:

[pincfg]
0x12 0x40000000
0x13 0x411111f0
0x14 0x90170110
0x16 0x411111f0
0x17 0x90170110
0x18 0x81d111f0
0x19 0x03a11880
0x1a 0x411111f0
0x1b 0x03a11cc0
0x1d 0x40400001
0x1e 0x411111f0
0x21 0x03211430
VladStulikov commented 9 months ago

@marcSoda

note that my audio codec is /dev/hwC1D0 on 9530 and /dev/hwC0D0 on 9510

I still think you need to use hwC0D0 as per the docs https://www.kernel.org/doc/html/v5.18/sound/hd-audio/notes.html#hd-audio-reconfiguration

marcSoda commented 9 months ago

cat /sys/class/sound/hwC0D0/user_pin_configs

I followed these steps exactly and cat /sys/class/sound/hwC0D0/user_pin_configs never returns anything. Note that I double checked, and cat /sys/class/sound/hwC0D0/chip_name is `ALC298. What do I need to do to get the pin configs to propagate?

VladStulikov commented 9 months ago

cat /sys/class/sound/hwC0D0/user_pin_configs

I followed these steps exactly and cat /sys/class/sound/hwC0D0/user_pin_configs never returns anything. Note that I double checked, and cat /sys/class/sound/hwC0D0/chip_name is `ALC298. What do I need to do to get the pin configs to propagate?

Should be ALC289, not ALC298, can you double check?

VladStulikov commented 9 months ago

What is in the cat /sys/class/sound/hwC0D0/driver_pin_configs?

marcSoda commented 9 months ago

cat /sys/class/sound/hwC0D0/user_pin_configs

I followed these steps exactly and cat /sys/class/sound/hwC0D0/user_pin_configs never returns anything. Note that I double checked, and cat /sys/class/sound/hwC0D0/chip_name is `ALC298. What do I need to do to get the pin configs to propagate?

Should be ALC289, not ALC298, can you double check?

Yeah, sorry I mistyped. It's 289.

cat /sys/class/sound/hwC0D0/driver_pin_configs is 0x19 0x01a1913c 0x1b 0x01a1913d

And this is after I created /usr/lib/firmware/hda-jack-retask.fw and /etc/modprobe.d/hda-jack-retask.conf

VladStulikov commented 9 months ago

Still not connected... somehow driver does not want to set the custom pin config from '/usr/lib/firmware/hda-jack-retask.fw'

marcSoda commented 9 months ago

Still not connected... somehow driver does not want to set the custom pin config from '/usr/lib/firmware/hda-jack-retask.fw'

Would this interaction have been logged somewhere?

VladStulikov commented 9 months ago

Still not connected... somehow driver does not want to set the custom pin config from '/usr/lib/firmware/hda-jack-retask.fw'

Would this interaction have been logged somewhere?

sudo dmesg | grep snd

Should be like

[ 3.953590] snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040380 [ 3.953634] snd_hda_intel 0000:00:1f.3: enabling device (0000 -> 0002) [ 3.953765] snd_hda_intel 0000:00:1f.3: Applying patch firmware 'hda-jack-retask.fw' [ 3.953869] snd_hda_intel 0000:00:1f.3: firmware: direct-loading firmware hda-jack-retask.fw [ 3.953911] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915]) [ 3.986665] snd_hda_codec_realtek hdaudioC0D0: autoconfig for ALC289: line_outs=2 (0x14/0x17/0x0/0x0/0x0) type:speaker [ 3.986668] snd_hda_codec_realtek hdaudioC0D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0) [ 3.986669] snd_hda_codec_realtek hdaudioC0D0: hp_outs=1 (0x21/0x0/0x0/0x0/0x0) [ 3.986670] snd_hda_codec_realtek hdaudioC0D0: mono: mono_out=0x0 [ 3.986670] snd_hda_codec_realtek hdaudioC0D0: inputs: [ 3.986671] snd_hda_codec_realtek hdaudioC0D0: Headset Mic=0x19 [ 3.986672] snd_hda_codec_realtek hdaudioC0D0: Headphone Mic=0x1b [ 3.986672] snd_hda_codec_realtek hdaudioC0D0: Internal Mic=0x12

marcSoda commented 9 months ago

Still not connected... somehow driver does not want to set the custom pin config from '/usr/lib/firmware/hda-jack-retask.fw'

Would this interaction have been logged somewhere?

sudo dmesg | grep snd

[    4.047045] snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    4.047092] snd_hda_intel 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    4.457393] snd_hda_codec_realtek ehdaudio0D0: autoconfig for ALC289: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
[    4.457397] snd_hda_codec_realtek ehdaudio0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    4.457398] snd_hda_codec_realtek ehdaudio0D0:    hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[    4.457400] snd_hda_codec_realtek ehdaudio0D0:    mono: mono_out=0x0
[    4.457400] snd_hda_codec_realtek ehdaudio0D0:    inputs:
[    4.457401] snd_hda_codec_realtek ehdaudio0D0:      Headset Mic=0x19
[    4.457402] snd_hda_codec_realtek ehdaudio0D0:      Headphone Mic=0x1b
[    5.123387] snd_hda_codec_realtek ehdaudio0D0: ASoC: sink widget AIF1TX overwritten
[    5.123394] snd_hda_codec_realtek ehdaudio0D0: ASoC: source widget AIF1RX overwritten