Skip to content

[BUG] Intermittent audio distortion on Dell 9700 / sof-cml-rt711-rt1308-rt715.tplg / firmware 1.6 #3499

Closed

Description

@maaarghk

Intermittent audio distortion is experienced on firmware 1.6.

Videos of the issue:

the relevant outputs in alsamixer (distortion goes away when muted) are rt1308-1 DAC L and rt1308-1 DAC R - if you're unfamiliar with the hardware, as a reminder, these are both for the left channel despite the name but one seems to be doing a woofer and another a tweeter.

I used 1.5.1 for a long time and never experienced this issue.

To Reproduce
The issue occurs when the pcm stream is first opened and continues until it is closed. Stopping all sound until the stream closes and then starting up again is enough to stop the issue.

Reproduction Rate
I can't see anything in the logs which indicates the issue occurred but I would estimate to be 1/30 or thereabouts. It seems to be more common with notification sounds than, for example, music or a video playing, but I couldn't say for sure, because of course I just have more notifications going off than starting videos like that.

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
  2. Name of the topology file
    • Topology: intel/sof-tplg/sof-cml-rt711-rt1308-rt715.tplg
  3. Name of the platform(s) on which the bug is observed.
    • Platform: Dell 9700 - 0x098F

Screenshots or console output
dmesg and soflog whilst I played a notification sound on repeat roughly 100 times.

soflog-20201006-2126-dmesg.log
soflog-20201006-2126-soflog.log

Audio distortion was heard around the following timestamps

  • dmesg 98395.48 / soflog 70109...
  • dmesg 98506.40 / soflog 70292...
  • dmesg 98606.48 / soflog 70482...
  • dmesg 98727.29 / soflog 70711...
  • dmesg 98780.62 / soflog 70806..

The rate of occurrence is therefore slightly above 5%.

Activity

  1. added
    bugSomething isn't working as expected
    on Oct 6, 2020
  2. plbossart commented on Oct 6, 2020

    @plbossart
    Member

    @maaarghk you only made references to rt1308-1 and the video seems to hint at a problem on the left speaker. Can you confirm if you hear this distorsion on the right speakers as well?

    This is important for us, what happens is that the firmware will push exactly the same content to both amplifiers which are located on separate SoundWire links. rt1308-1 then picks the left channels and rt1308-2 pick the right channel only.

  3. maaarghk commented on Oct 6, 2020

    @maaarghk
    Author

    I can confirm for sure it is on left speaker only.

  4. plbossart commented on Oct 6, 2020

    @plbossart
    Member

    @maaarghk thanks, this is super-useful information. I will try to cook a patch that ignores the right amplifier completely and uses the 'other' topology for Dell devices, where there is only a single amp. If you still hear the distorsion, it might be your hardware. if you don't then it's likely a problem in the firmware demux functionality.

  5. plbossart commented on Oct 6, 2020

    @plbossart
    Member

    @maaarghk can you try this patch on top of your kernel:
    soundwire-left-amp.diff.txt

    This should disable the right amp entirely as well as the demux in the firmware. You will need a different topology (-mono suffix) and a different UCM file will be loaded, but that should be fine if you have the latest stuff installed.

    if you can confirm before and after applying the patch the results of amixer -Dhw:0 info that will help check that you've indeed move from 2 amps to one.

    Thanks for your patience and help in tracking down this issue.

    Edit: to be clearer, the right amp will still be detected but it'll be ignored by SOF. There's no hardware change or any side effect...

  6. maaarghk commented on Oct 6, 2020

    @maaarghk
    Author

    Hi Pierre, I retried the same test of 100 notification sounds with your patch applied. As expected, audio from left speaker only. There was no distortion present.

    soflog-20201006-2340-soflog.log
    soflog-20201006-2340-dmesg.log
    amixer-after-patch.txt
    amixer-before-patch.txt

  7. added this to the v1.6 milestone on Oct 7, 2020
  8. lgirdwood commented on Oct 7, 2020

    @lgirdwood
    Member
  9. plbossart commented on Oct 7, 2020

    @plbossart
    Member

    @maaarghk thank you for your tests. This rules out a broken speaker or hardware and points to the firmware demux in my opinion. That's really the only difference with the single amp mode, the driver uses the same sequence in single and multi-link cases.

    @bardliao @slawblauciak @RanderWang do you concur with my analysis?

  10. juimonen commented on Oct 7, 2020

    @juimonen

    @plbossart @maaarghk demux is very likely cause of this (or pipeline setup/timing causing wrong configuration in demux). In that case this won't show up in dmesg, we would need sof firmware logs when distortion occurs, and not sure how verbose it should be to make this visible...

  11. lgirdwood commented on Oct 7, 2020

    @lgirdwood
    Member

    @juimonen btw are we able to validate demux routing logic in test bench yet ? Would be good to have such tests in CI

  12. maaarghk commented on Oct 7, 2020

    @maaarghk
    Author

    Hi @juimonen - is the "soflog.log" file I attached not what you need? I am happy to do whatever other traces you need, but might need talked through it in a bit of detail because I have no familiarity with alsa nevermind sof or soundwire.

  13. juimonen commented on Oct 7, 2020

    @juimonen

    @maaarghk yeah, sorry I should read more carefully. I'm not sure can we set the firmware debug level to be more verbose, we should see inside the mux_params and others what it is actually setting. I remember these kind of issues happening when for some reason the demux parameter forwarding logic goes wrong, so some audio branch thinks it using 24 bits etc. even though it is not.

  14. maaarghk commented on Oct 7, 2020

    @maaarghk
    Author

    If you want to email me some firmware build with extra debug info feel free.

    Edit / or if it's easy to compile with a patch?

  15. 24 remaining items

  16. juimonen commented on Nov 4, 2020

    @juimonen

    @libinyang thanks! @bardliao if Bard's test is good, @bkokoszx please make a proper PR, this is the right way to fix this.

  17. bardliao commented on Nov 4, 2020

    @bardliao
    Collaborator

    @libinyang
    Apart from topology change mentioned above by @juimonen, could you try to reproduce this issue with following patch?
    bkokoszx@da1a5cd

    I tested it and I can't find the distortion with bkokoszx@da1a5cd on my side

  18. bkokoszx commented on Nov 4, 2020

    @bkokoszx
    Collaborator

    @lgirdwood
    I've performed tests with slim driver with format: 48 kHz, 32/32, 8, on the following topology:
    image

    And I've got following MCPS value for DEMUX:

    [  1051521.562500] (       32.005207) c0 demux        1.1       src/audio/pipeline.c:206  perf comp_copy peak plat 1031 cpu 10787
    
  19. plbossart commented on Nov 4, 2020

    @plbossart
    Member

    And I've got following MCPS value for DEMUX:

    [  1051521.562500] (       32.005207) c0 demux        1.1       src/audio/pipeline.c:206  perf comp_copy peak plat 1031 cpu 10787
    

    What are the units for 1031 and 10787?

  20. bkokoszx commented on Nov 4, 2020

    @bkokoszx
    Collaborator

    The units are plat_ticks/pipeline_period or cpu_ticks/pipeline_period. In above case (pipeline_period = 1ms):

    1031 plat_ticks/pipeline_period = 1031 plat_ticks/1ms = 1031000 plat_ticks/1s
    10787 cpu_ticks/pipeline_period = 10787 cpu_ticks/1ms = 10787000 cpu_ticks/1s = 10,787 MCPS
    
  21. plbossart commented on Nov 4, 2020

    @plbossart
    Member

    @bkokoszx ~10 MCPS doesn't seem super-optimized for a plain data mover. We handle 48kHz data, that means an average of ~200 cycles per sample frame. DSPs should be able to do better.

    It's not the end of the world for now but we will have to use an 8-ch MUX to deal with speaker-protection with I/V feedback and the number will start to be significant. see thesofproject/linux#2514 for more details.

  22. juimonen commented on Nov 4, 2020

    @juimonen

    @bkokoszx just for comparison can you provide the figure without your patch with same settings?

  23. bkokoszx commented on Nov 5, 2020

    @bkokoszx
    Collaborator

    @juimonen
    Do you mean without PR #3583 or without whole simplification in PR #3000 ?

  24. juimonen commented on Nov 5, 2020

    @juimonen

    @bkokoszx I meant without #3583. As I understood that @lgirdwood concern was that we are introducing more mips compared to the previous simplification. Or maybe you already have the figures from last simplification?

  25. bkokoszx commented on Nov 5, 2020

    @bkokoszx
    Collaborator

    @juimonen
    Without #3000 (I've reverted 5bf8188) and without #3586 :

    [  1840382.864583] (    42163.125000) c0 demux        1.1       src/audio/pipeline.c:206  perf comp_copy peak plat 6317 cpu 65785
    

    Without #3583 (actual master):

    [  1005080.442708] (       29.635416) c0 demux        1.1       src/audio/pipeline.c:206  perf comp_copy peak plat 947 cpu 9860
    
  26. juimonen commented on Nov 5, 2020

    @juimonen

    @bkokoszx ok so 1mpcs addition to the previous 9 (9->10)? I think that's ok then...

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

Metadata

Metadata

Assignees

Labels

CMLApplies to Comet Lake platformFix confirmedFix for the issue has been found and verifiedMux/DemuxP1Blocker bugs or important featuresSDWSoundWirebugSomething isn't working as expected

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions