Skip to content

[BUG] Distorted sound from right speaker on Dell XPS 17 9710 #3896

Closed

Description

@JuanFcoMiranda

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

Example sound:
New Recording 14.zip
alsa-info.txt

Activity

  1. plbossart commented on Sep 30, 2022

    @plbossart
    Member

    @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.

  2. JuanFcoMiranda commented on Oct 2, 2022

    @JuanFcoMiranda
    Author

    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.

  3. plbossart commented on Oct 3, 2022

    @plbossart
    Member

    @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.

  4. added
    SDWApplies to SoundWire bus for codec connection
    Communityend-user or distro-reported issues
    on Oct 3, 2022
  5. shumingfan commented on Oct 3, 2022

    @shumingfan

    @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.

  6. JuanFcoMiranda commented on Oct 3, 2022

    @JuanFcoMiranda
    Author

    @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

  7. shumingfan commented on Oct 4, 2022

    @shumingfan

    @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

  8. JuanFcoMiranda commented on Oct 4, 2022

    @JuanFcoMiranda
    Author

    @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 amixer cset name='rt1308-1 RX Channel Select' 'RR'
    numid=9,iface=MIXER,name='rt1308-1 RX Channel Select'
      ; type=ENUMERATED,access=rw------,values=1,items=4
      ; Item #0 'LR'
      ; Item #1 'LL'
      ; Item #2 'RL'
      ; Item #3 'RR'
      : values=3
    
    $ sudo amixer cset name='rt1308-2 RX Channel Select' 'LL'
    numid=10,iface=MIXER,name='rt1308-2 RX Channel Select'
      ; type=ENUMERATED,access=rw------,values=1,items=4
      ; Item #0 'LR'
      ; Item #1 'LL'
      ; Item #2 'RL'
      ; Item #3 'RR'
      : values=1
    
    $ 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
    
  9. shumingfan commented on Oct 5, 2022

    @shumingfan

    No, with the patches from kernel 5.18.x and bios v1.12, I had no problems at all, both speakers sounded good.

    Could you use bios v1.12 + kernel 5.19.x to test?

    If I only reboot the laptop, the distortion persists, but, after the bios reflash, the sound becomes normal on the right speaker.

    You just bios reflash with the same version v1.13.1, right?

    $ sudo amixer cset name='rt1308-1 RX Channel Select' 'RR'
    numid=9,iface=MIXER,name='rt1308-1 RX Channel Select'
    ; type=ENUMERATED,access=rw------,values=1,items=4
    ; Item #0 'LR'
    ; Item #1 'LL'
    ; Item #2 'RL'
    ; Item #3 'RR'
    : values=3
    $ sudo amixer cset name='rt1308-2 RX Channel Select' 'LL'
    numid=10,iface=MIXER,name='rt1308-2 RX Channel Select'
    ; type=ENUMERATED,access=rw------,values=1,items=4
    ; Item #0 'LR'
    ; Item #1 'LL'
    ; Item #2 'RL'
    ; Item #3 'RR'
    : values=1

    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

    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

  10. JuanFcoMiranda commented on Oct 5, 2022

    @JuanFcoMiranda
    Author

    No, with the patches from kernel 5.18.x and bios v1.12, I had no problems at all, both speakers sounded good.

    Could you use bios v1.12 + kernel 5.19.x to test?

    I tried, but the bios downgrade does not work well.

    If I only reboot the laptop, the distortion persists, but, after the bios reflash, the sound becomes normal on the right speaker.

    You just bios reflash with the same version v1.13.1, right?

    Yes, correct.

    $ sudo amixer cset name='rt1308-1 RX Channel Select' 'RR'
    numid=9,iface=MIXER,name='rt1308-1 RX Channel Select'
    ; type=ENUMERATED,access=rw------,values=1,items=4
    ; Item #0 'LR'
    ; Item #1 'LL'
    ; Item #2 'RL'
    ; Item #3 'RR'
    : values=3
    $ sudo amixer cset name='rt1308-2 RX Channel Select' 'LL'
    numid=10,iface=MIXER,name='rt1308-2 RX Channel Select'
    ; type=ENUMERATED,access=rw------,values=1,items=4
    ; Item #0 'LR'
    ; Item #1 'LL'
    ; Item #2 'RL'
    ; Item #3 'RR'
    : values=1

    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

    sorry, typo.
    $ sudo cat /sys/kernel/debug/regmap/sdw:1:025d:1308:00/registers

    registers1.txt

    $ sudo cat /sys/kernel/debug/regmap/sdw:2:025d:1308:00/registers

    registers2.txt

  11. shumingfan commented on Oct 6, 2022

    @shumingfan

    Could you use bios v1.12 + kernel 5.19.x to test?

    I tried, but the bios downgrade does not work well.

    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.

  12. shumingfan commented on Oct 6, 2022

    @shumingfan

    @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.

  13. JuanFcoMiranda commented on Oct 6, 2022

    @JuanFcoMiranda
    Author

    Hi, @shumingfan, I tried the patch, but the distortion is still here.

  14. shumingfan commented on Oct 7, 2022

    @shumingfan

    @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.

    --- a/drivers/base/regmap/regmap-debugfs.c
    +++ b/drivers/base/regmap/regmap-debugfs.c
    @@ -290,7 +290,7 @@ static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf,
                                       count, ppos);
     }
    
    -#undef REGMAP_ALLOW_WRITE_DEBUGFS
    +#define REGMAP_ALLOW_WRITE_DEBUGFS
     #ifdef REGMAP_ALLOW_WRITE_DEBUGFS
    

    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

  15. 7 remaining items

  16. shumingfan commented on Oct 14, 2022

    @shumingfan

    @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.

  17. shumingfan commented on Oct 14, 2022

    @shumingfan

    @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.

  18. plbossart commented on Oct 14, 2022

    @plbossart
    Member

    @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.

    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.

  19. JuanFcoMiranda commented on Oct 14, 2022

    @JuanFcoMiranda
    Author

    @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.

    Thank you very much for your help.

  20. shumingfan commented on Oct 17, 2022

    @shumingfan

    @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.
    2-way-speaker

  21. plbossart commented on Oct 17, 2022

    @plbossart
    Member

    @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?

  22. shumingfan commented on Oct 18, 2022

    @shumingfan

    @plbossart The hardware engineer said that each model may have different speakers (different transducers), hence they will tune the different biquad settings for them.

  23. plbossart commented on Oct 18, 2022

    @plbossart
    Member

    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.

  24. plbossart commented on Oct 19, 2022

    @plbossart
    Member

    @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?

  25. shumingfan commented on Oct 20, 2022

    @shumingfan

    @plbossart I checked with the Windows software engineer. Those filter coefficients are hard coding in the driver.

  26. plbossart commented on Oct 20, 2022

    @plbossart
    Member

    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.

  27. shumingfan commented on Oct 21, 2022

    @shumingfan

    @plbossart Hmm, I understand that pain. I think I send the PR here first. Thanks.

  28. JuanFcoMiranda commented on Oct 21, 2022

    @JuanFcoMiranda
    Author

    Hi, I have tried the sound recorded from the mic, and seems it also sounds like distorted.

  29. plbossart commented on Oct 31, 2022

    @plbossart
    Member

    @JuanFcoMiranda please file another issue for microphones, different chip and different problem. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Communityend-user or distro-reported issuesSDWApplies to SoundWire bus for codec connection

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions