You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Distorted sound from right speaker on Dell XPS 17 9710 #3896
Describe the bug
Everytime I reproduce a sound or avideo, I can hear the sound distorted from the left speaker and even I can hear it if a switch back to Windows, and I have to flash my laptop bios from windows to restore the normal sound from the right speaker. I use debian with the kernel 5.19.x and the version 2.1.1-1 of this driver.
To Reproduce
Play any videos from youtube.
Reproduction Rate
All the time.
Expected behavior
Both speakers sound clear and without any distorted sound.
Impact
It's very annoying when reproducing any video to hear the distorted sound from the right speaker. The left one works pretty fine.
Environment
Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
Kernel: 5.19.12
SOF: 2.1.1-1
Name of the topology file
Topology: intel/sof-tplg/sof-tgl-rt711-rt1308-rt715.tplg
Name of the platform(s) on which the bug is observed.
Platform: Dell XPS 17 9710
Bios version: 1.13.1
@JuanFcoMiranda in your topology you have a single amplifier which deals with both left and right channels.
I don't see what the BIOS would have to do with the audio subsystem and what reflashing it would do.
I would recommend creating two stereo files at 48kHz, one with a 440Hz sine wave on the left channel and one with the sine wave in the right channel. Try to record what happens then and provide wav files. I was not able to listen to your m4a provided earlier.
IMHO it's likely that you are missing some alsa mixer values or something related to the configuration of the amplifier.
You also want to attach the results of 'alsa-info' since we only track Dell platforms by SKU number, not product codes.
@shumingfan do you know if the BIOS or UEFI layers configure the rt1308 amplifier with some presets? I don't have any explanation for the behavior reported by @JuanFcoMiranda other than the kernel drivers setting a state that can only be restored by re-executing basic configurations - but that's a theory only.
@plbossart Sorry, I have no idea if the BIOS or UEFI layers configure the rt1308 amplifier. @JuanFcoMiranda May I ask if the normal status (left/right speaker are normal after BIOS updated) is temporary?
Could you also provide the kernel log when the distorted sound from the right speaker?
Please enable dynamic debug. Copy this file sof-dyndbg.conf.txt
as /etc/modprobe.d/sof-dyndbg.conf, then reboot.
@shumingfan If I run only Windows, the speakers sound normal, always, but when I switch to debian, the distortioned sound starts on the right speaker. I have tried several kernels, 5.19.11, 5.19.12 and 6.0.0, and it happens in all of them.
@JuanFcoMiranda I checked the thesofproject/sof#5436 which is the popping noise issue, not the distorted sound problem. Do you have the distorted sound issue at that time after the popping noise fixes?
Another question is that you said
I don't know why, but if I reflash the bios, the distortioned sound disappears after reboot.
Does the distorted sound happen again after the cold reboot?
I also use the same machine with the same kernel version and SOF version to test this issue.
Unfortunately, I can't reproduce this issue. alsa-info.txt
Could you test the amixer controls below to change the channel and test again?
$ amixer cset name='rt1308-1 RX Channel Select' 'RR'
$ amixer cset name='rt1308-2 RX Channel Select' 'LL'
I also want to check the register dump. Please keep the playback while dumping the registers.
$ cat /sys/kernel/debug/regmap/sdw:1:025d/1308:00/registers
$ cat /sys/kernel/debug/regmap/sdw:2:025d/1308:00/registers
@JuanFcoMiranda I checked the thesofproject/sof#5436 which is the popping noise issue, not the distorted sound problem. Do you have the distorted sound issue at that time after the popping noise fixes?
No, with the patches from kernel 5.18.x and bios v1.12, I had no problems at all, both speakers sounded good.
Another question is that you said
I don't know why, but if I reflash the bios, the distortioned sound disappears after reboot.
Does the distorted sound happen again after the cold reboot?
If I only reboot the laptop, the distortion persists, but, after the bios reflash, the sound becomes normal on the right speaker.
I also use the same machine with the same kernel version and SOF version to test this issue. Unfortunately, I can't reproduce this issue. alsa-info.txt
It's like the popping sound bug, it's pretty weird.
Could you test the amixer controls below to change the channel and test again?
$ amixer cset name='rt1308-1 RX Channel Select' 'RR'
$ amixer cset name='rt1308-2 RX Channel Select' 'LL'
I also want to check the register dump. Please keep the playback while dumping the registers.
$ cat /sys/kernel/debug/regmap/sdw:1:025d/1308:00/registers
$ cat /sys/kernel/debug/regmap/sdw:2:025d/1308:00/registers
$ sudo cat /sys/kernel/debug/regmap/sdw:1:025d/1308:00/registers
cat: '/sys/kernel/debug/regmap/sdw:1:025d/1308:00/registers': No such file or directory
$ sudo cat /sys/kernel/debug/regmap/sdw:2:025d/1308:00/registers
cat: '/sys/kernel/debug/regmap/sdw:2:025d/1308:00/registers': No such file or directory
How about the test result? Does the right speaker still have the distorted sound?
$ sudo cat /sys/kernel/debug/regmap/sdw:1:025d/1308:00/registers
cat: '/sys/kernel/debug/regmap/sdw:1:025d/1308:00/registers': No such file or directory
$ sudo cat /sys/kernel/debug/regmap/sdw:2:025d/1308:00/registers
cat: '/sys/kernel/debug/regmap/sdw:2:025d/1308:00/registers': No such file or directory
How about the test result? Does the right speaker still have the distorted sound?
Yes, the distorted sound is still here.
$ sudo cat /sys/kernel/debug/regmap/sdw:1:025d/1308:00/registers
cat: '/sys/kernel/debug/regmap/sdw:1:025d/1308:00/registers': No such file or directory
$ sudo cat /sys/kernel/debug/regmap/sdw:2:025d/1308:00/registers
cat: '/sys/kernel/debug/regmap/sdw:2:025d/1308:00/registers': No such file or directory
@JuanFcoMiranda Could you also try to test with this patch (917d105)?
I checked with our hardware engineer, then there are some different settings between version C and D of rt1308.
This patch will check the chip version to set the different settings.
@JuanFcoMiranda Oh, that is bad news to me.
I discussed this with the hardware engineer, but we have no idea to figure out what's the root cause.
I want to do some experiments. That needs your help to test the scripts.
Please run the script while the right speaker outputs the distorted sound.
And check if the distorted sound becomes normal or not.
It needs to cold reboot the system if you will run another script.
Before the test, you should enable the 'REGMAP_ALLOW_WRITE_DEBUGFS' and rebuild the kernel.
@plbossart Do you mean that the BQ settings could be set in the sof_sdw_rt1308.c?
If yes, I will try to move the settings to the m/c driver level.
I checked with the hardware engineer about the BQ settings. He said each model has its own BQ settings if it needs to be set.
There are no common settings for all 4-speaker models. I am also not sure if the 4-speaker model all uses the tweeter/woofer speakers.
@plbossart@JuanFcoMiranda
I updated the patches. (81fd109, 15b82d3, 94fb79b)
I tried to implement your concept at the machine driver level. If there is any suggestion, please let me know. Thanks.
@plbossart Do you mean that the BQ settings could be set in the sof_sdw_rt1308.c? If yes, I will try to move the settings to the m/c driver level. I checked with the hardware engineer about the BQ settings. He said each model has its own BQ settings if it needs to be set. There are no common settings for all 4-speaker models. I am also not sure if the 4-speaker model all uses the tweeter/woofer speakers.
I don't know what BQ stands for.
My point is that we assume that the two amps are handled in symmetrical ways without any specific settings other than enabling DACs.
it seems obvious to me that if the two amps deal with two woofers and two tweaters each, obviously the default settings cannot be the same. That is what @JuanFcoMiranda has been complaining.
My question is whether this hardware topology change can be entirely handled in the driver, or if userpace needs to know about it with some controls being applied.
@plbossart@JuanFcoMiranda
I updated the patches. (81fd109, 15b82d3, 94fb79b)
I tried to implement your concept at the machine driver level. If there is any suggestion, please let me know. Thanks.
Hi, I tried all those patches with latest kernel, 6.0.2, and the distortion has disappeared.
@plbossart
Sorry, there are some misunderstandings the with hardware engineer.
The correct tweeter/woofer arrangement is:
The left channel of rt1308-1/rt1308-2 connects to a woofer speaker.
The right channel of rt1308-1/rt1308-2 connects to a tweeter speaker.
The hardware engineer will use the crossover filter (biquad filter) to control the frequency for the woofer (left channel) and tweeter (right channel).
Therefore, it uses the same settings of biqual filter for rt1308-1 and rt1308-2.
The hardware engineer calls the design the 2-way speaker amplifier. There is an illustration below.
The tweeter speaker is upper side and the woofer is the bigger one on the bottom side.
@shumingfan thanks for the explanations, this is what I was expected, it's also aligned with the SDCA definitions. So if we are in agreement on what amplifiers do, why do we need a set of DMI-dependent patches, what do they fix?
@plbossart The hardware engineer said that each model may have different speakers (different transducers), hence they will tune the different biquad settings for them.
Thanks @shumingfan that tuning should not be in the kernel but the values stored in UCM or other configuration files. It'll be an endless battle to get this right, i.e. we don't even have a description of all the SKUs, just today we learned about a new 0B14 that we didn't know about.
Thanks @shumingfan, in that case we'll have to track the Windows changes and use your suggested solution with tables in the machine driver that are applied as codec properties. One day SDCA will solve all this but until then we have to handle such quirks manually. Gah.
Activity
plbossart commentedon Sep 30, 2022
@JuanFcoMiranda in your topology you have a single amplifier which deals with both left and right channels.
I don't see what the BIOS would have to do with the audio subsystem and what reflashing it would do.
I would recommend creating two stereo files at 48kHz, one with a 440Hz sine wave on the left channel and one with the sine wave in the right channel. Try to record what happens then and provide wav files. I was not able to listen to your m4a provided earlier.
IMHO it's likely that you are missing some alsa mixer values or something related to the configuration of the amplifier.
You also want to attach the results of 'alsa-info' since we only track Dell platforms by SKU number, not product codes.
JuanFcoMiranda commentedon Oct 2, 2022
Hi, I have updated the info in the first post, attached the alsa-info and the bios version installed.
I don't know why, but if I reflash the bios, the distortioned sound disappears after reboot.
plbossart commentedon Oct 3, 2022
@shumingfan do you know if the BIOS or UEFI layers configure the rt1308 amplifier with some presets? I don't have any explanation for the behavior reported by @JuanFcoMiranda other than the kernel drivers setting a state that can only be restored by re-executing basic configurations - but that's a theory only.
shumingfan commentedon Oct 3, 2022
@plbossart Sorry, I have no idea if the BIOS or UEFI layers configure the rt1308 amplifier.
@JuanFcoMiranda May I ask if the normal status (left/right speaker are normal after BIOS updated) is temporary?
Could you also provide the kernel log when the distorted sound from the right speaker?
Please enable dynamic debug. Copy this file
sof-dyndbg.conf.txt
as /etc/modprobe.d/sof-dyndbg.conf, then reboot.
JuanFcoMiranda commentedon Oct 3, 2022
@shumingfan If I run only Windows, the speakers sound normal, always, but when I switch to debian, the distortioned sound starts on the right speaker. I have tried several kernels, 5.19.11, 5.19.12 and 6.0.0, and it happens in all of them.
I'll add the kernel logs ASAP.
I also reported this bug some time ago:
thesofproject/sof#5436
Another rare bug.
Thank you very much for your help.
Edit, here are the logs:
mess2.txt
shumingfan commentedon Oct 4, 2022
@JuanFcoMiranda I checked the thesofproject/sof#5436 which is the popping noise issue, not the distorted sound problem. Do you have the distorted sound issue at that time after the popping noise fixes?
Another question is that you said
Does the distorted sound happen again after the cold reboot?
I also use the same machine with the same kernel version and SOF version to test this issue.
Unfortunately, I can't reproduce this issue.
alsa-info.txt
Could you test the amixer controls below to change the channel and test again?
$ amixer cset name='rt1308-1 RX Channel Select' 'RR'
$ amixer cset name='rt1308-2 RX Channel Select' 'LL'
I also want to check the register dump. Please keep the playback while dumping the registers.
$ cat /sys/kernel/debug/regmap/sdw:1:025d/1308:00/registers
$ cat /sys/kernel/debug/regmap/sdw:2:025d/1308:00/registers
JuanFcoMiranda commentedon Oct 4, 2022
No, with the patches from kernel 5.18.x and bios v1.12, I had no problems at all, both speakers sounded good.
If I only reboot the laptop, the distortion persists, but, after the bios reflash, the sound becomes normal on the right speaker.
It's like the popping sound bug, it's pretty weird.
shumingfan commentedon Oct 5, 2022
Could you use bios v1.12 + kernel 5.19.x to test?
You just bios reflash with the same version v1.13.1, right?
How about the test result? Does the right speaker still have the distorted sound?
sorry, typo.
$ sudo cat /sys/kernel/debug/regmap/sdw:1:025d:1308:00/registers
$ sudo cat /sys/kernel/debug/regmap/sdw:2:025d:1308:00/registers
JuanFcoMiranda commentedon Oct 5, 2022
I tried, but the bios downgrade does not work well.
Yes, correct.
Yes, the distorted sound is still here.
registers1.txt
registers2.txt
shumingfan commentedon Oct 6, 2022
Could you try to update BIOS manually?
Please check the Dell website (https://www.dell.com/support/kbdoc/zh-tw/000124211/dell-bios-updates?lang=en).
a. Download the BIOS update file (https://www.dell.com/support/home/en-ai/drivers/driversdetails?driverid=3gdt5&oscode=wt64a&productcode=xps-17-9710-laptop) and save it to the USB drive.
b. Power off the Dell computer.
c. Connect the USB drive and restart the Dell computer.
d. Press F12 key at the Dell logo screen to enter One Time Boot Menu.
e. Using the arrow keys, select BIOS UPDATE -> Flash from file -> USB Storage Device and select the file name (XPS_17_9710_Precision_5760_1.12.0.exe), then press Enter key.
f. Follow the instructions in the BIOS Update Utility screen to complete the update process.
shumingfan commentedon Oct 6, 2022
@JuanFcoMiranda Could you also try to test with this patch (917d105)?
I checked with our hardware engineer, then there are some different settings between version C and D of rt1308.
This patch will check the chip version to set the different settings.
JuanFcoMiranda commentedon Oct 6, 2022
Hi, @shumingfan, I tried the patch, but the distortion is still here.
shumingfan commentedon Oct 7, 2022
@JuanFcoMiranda Oh, that is bad news to me.
I discussed this with the hardware engineer, but we have no idea to figure out what's the root cause.
I want to do some experiments. That needs your help to test the scripts.
Please run the script while the right speaker outputs the distorted sound.
And check if the distorted sound becomes normal or not.
It needs to cold reboot the system if you will run another script.
Before the test, you should enable the 'REGMAP_ALLOW_WRITE_DEBUGFS' and rebuild the kernel.
rt1308_presetD_test1.sh.txt
rt1308_presetD_test2.sh.txt
rt1308_presetD_test3.sh.txt
rt1308_presetD_test4.sh.txt
rt1308_presetD_test5.sh.txt
7 remaining items
shumingfan commentedon Oct 14, 2022
@plbossart Do you mean that the BQ settings could be set in the sof_sdw_rt1308.c?
If yes, I will try to move the settings to the m/c driver level.
I checked with the hardware engineer about the BQ settings. He said each model has its own BQ settings if it needs to be set.
There are no common settings for all 4-speaker models. I am also not sure if the 4-speaker model all uses the tweeter/woofer speakers.
shumingfan commentedon Oct 14, 2022
@plbossart @JuanFcoMiranda
I updated the patches. (81fd109, 15b82d3, 94fb79b)
I tried to implement your concept at the machine driver level. If there is any suggestion, please let me know. Thanks.
plbossart commentedon Oct 14, 2022
I don't know what BQ stands for.
My point is that we assume that the two amps are handled in symmetrical ways without any specific settings other than enabling DACs.
https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/sof-soundwire/rt1308-1.conf
https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/sof-soundwire/rt1308-2.conf
it seems obvious to me that if the two amps deal with two woofers and two tweaters each, obviously the default settings cannot be the same. That is what @JuanFcoMiranda has been complaining.
My question is whether this hardware topology change can be entirely handled in the driver, or if userpace needs to know about it with some controls being applied.
JuanFcoMiranda commentedon Oct 14, 2022
Hi, I tried all those patches with latest kernel, 6.0.2, and the distortion has disappeared.
Thank you very much for your help.
shumingfan commentedon Oct 17, 2022
@plbossart

Sorry, there are some misunderstandings the with hardware engineer.
The correct tweeter/woofer arrangement is:
The left channel of rt1308-1/rt1308-2 connects to a woofer speaker.
The right channel of rt1308-1/rt1308-2 connects to a tweeter speaker.
The hardware engineer will use the crossover filter (biquad filter) to control the frequency for the woofer (left channel) and tweeter (right channel).
Therefore, it uses the same settings of biqual filter for rt1308-1 and rt1308-2.
The hardware engineer calls the design the 2-way speaker amplifier. There is an illustration below.
The tweeter speaker is upper side and the woofer is the bigger one on the bottom side.
plbossart commentedon Oct 17, 2022
@shumingfan thanks for the explanations, this is what I was expected, it's also aligned with the SDCA definitions. So if we are in agreement on what amplifiers do, why do we need a set of DMI-dependent patches, what do they fix?
shumingfan commentedon Oct 18, 2022
@plbossart The hardware engineer said that each model may have different speakers (different transducers), hence they will tune the different biquad settings for them.
plbossart commentedon Oct 18, 2022
Thanks @shumingfan that tuning should not be in the kernel but the values stored in UCM or other configuration files. It'll be an endless battle to get this right, i.e. we don't even have a description of all the SKUs, just today we learned about a new 0B14 that we didn't know about.
plbossart commentedon Oct 19, 2022
@shumingfan would you happen to know how those filter coefficients are stored in Windows? Are they read from the DSDT/BIOS or from some .INI file?
shumingfan commentedon Oct 20, 2022
@plbossart I checked with the Windows software engineer. Those filter coefficients are hard coding in the driver.
plbossart commentedon Oct 20, 2022
Thanks @shumingfan, in that case we'll have to track the Windows changes and use your suggested solution with tables in the machine driver that are applied as codec properties. One day SDCA will solve all this but until then we have to handle such quirks manually. Gah.
shumingfan commentedon Oct 21, 2022
@plbossart Hmm, I understand that pain. I think I send the PR here first. Thanks.
JuanFcoMiranda commentedon Oct 21, 2022
Hi, I have tried the sound recorded from the mic, and seems it also sounds like distorted.
plbossart commentedon Oct 31, 2022
@JuanFcoMiranda please file another issue for microphones, different chip and different problem. Thanks