Skip to content

[BUG] BYT: Random stereo channels swaps happen with sof-byt-nocodec.tplg #3520

Closed

Description

@singalsu

Describe the bug
I have developed a test that plays different frequency sine waves in each channel to PCM0P and captures from PCM0C. The purpose of the test is volume control testing but it detects also basic issues like channel swap. The reported error indicates that the playback, ssp-loopback, or capture channels got swapped.

The topology contains also volume components and mixer in the playback path. Though since a similar topology passes in APL platform the bug in those components is unlikely. But I'll try to replicate with a minimized topology later.

To Reproduce
With PR thesofproject/sof-test#410 (to add the test) and sof PR #3509 (add the volume switch to nocodec topologies) run:
sof-test/test-case/check-volume-levels.sh
Reproduction Rate
For one sub-test (play-capture) about 50% occurrence. Below 2 of 3 sub-tests failed.

Expected behavior
No channels swapped, the test passed as it does in cAVS platforms.

Impact
Annoyance for stereo music, showstopper for applications where channels order is critical.

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
    • Kernel: {SHA}
    • SOF: {SHA}
  2. Name of the topology file
    • Topology: sof-byt-nocodec.tplg
  3. Name of the platform(s) on which the bug is observed.
    • Platform: Baytrail

Screenshots or console output

2020-10-14 11:20:57 UTC [INFO] Measuring volume gains
File /tmp/tmp.iat6kH01et.wav:
pass (1/3)
File /tmp/tmp.EIsHmXIzcE.wav:
Channel 1 failed lower gain limit at  0.5 -  0.9s, gain -47.2 dB, min -10.5 dB
Channel 2 failed lower gain limit at  0.5 -  0.9s, gain -27.1 dB, min   9.5 dB
Channel 2 failed lower gain limit at  1.5 -  1.9s, gain -37.1 dB, min  -0.5 dB
fail (2/3)
Note: The test would pass with swapped channels.
File /tmp/tmp.3pEPEAF8DL.wav:
Channel 1 failed lower gain limit at  2.5 -  2.9s, gain -37.2 dB, min  -0.5 dB
Channel 1 failed lower gain limit at  3.5 -  3.9s, gain -37.2 dB, min  -0.5 dB
Channel 2 failed lower gain limit at  3.5 -  3.9s, gain -37.1 dB, min  -0.5 dB
fail (3/3)
Note: The test would pass with swapped channels.
FAIL
2020-10-14 11:21:11 UTC [ERROR] Error: Failed one or more tests in volume levels check.
2020-10-14 11:21:11 UTC [ERROR] Please inspect files: /tmp/tmp.iat6kH01et.wav, /tmp/tmp.EIsHmXIzcE.wav, and /tmp/tmp.3pEPEAF8DL.wav.
2020-10-14 11:21:11 UTC [ERROR] Starting func_exit_handler(), exit status=1, FUNCNAME stack:
2020-10-14 11:21:11 UTC [ERROR]  die()  @  /home/singalsu/git/sof-test/case-lib/lib.sh
2020-10-14 11:21:11 UTC [ERROR]  measure_levels()  @  sof-test/test-case/check-volume-levels.sh:328
2020-10-14 11:21:11 UTC [ERROR]  main()  @  sof-test/test-case/check-volume-levels.sh:84
2020-10-14 11:21:11 UTC [ERROR]  main()  @  sof-test/test-case/check-volume-levels.sh:336
2020-10-14 11:21:11 UTC [INFO] Test Result: FAIL!

Please also include the relevant sections from the firmware log and kernel log in the report (and attach the full logs for complete reference). Kernel log is taken from dmesg and firmware log from sof-logger. See https://thesofproject.github.io/latest/developer_guides/debugability/logger/index.html

Activity

  1. added
    bugSomething isn't working as expected
    BYTApplies to Baytrail platform
    P2Critical bugs or normal features
    on Oct 14, 2020
  2. added a commit that references this issue on Oct 20, 2020
    1ec4384
  3. keyonjie commented on Oct 20, 2020

    @keyonjie
    Contributor

    @singalsu I figured out a fix for this issue here #3535, could you please help try if it works for you also?

  4. added a commit that references this issue on Oct 20, 2020
    32c70c4
  5. singalsu commented on Nov 18, 2020

    @singalsu
    CollaboratorAuthor

    @keyonjie The channels swap issue happens still with BYT nocodec topology (LBM quirk is set). The kernel, firmware etc. are from git today.

    Kernel Branch: topic/sof-dev
    Kernel Commit: cfa9a863e20a
    SOF Branch: master
    SOF Commit: e7a339bd4
    
    

    When I last tested near month ago #3535 it didn't help with LBM, didn't help with Tx-Rx wire and no LBM quirk.

  6. removed
    P2Critical bugs or normal features
    on Dec 1, 2020
  7. added a commit that references this issue on Dec 1, 2020
    162a43a
  8. keyonjie commented on Dec 1, 2020

    @keyonjie
    Contributor

    Hi @singalsu can you help to try if the PR #3656 can help on BYT for external wired loopback?

    For the internal LBM, the channel random swapped in the capture is the expected behavior.

  9. keyonjie commented on Dec 2, 2020

    @keyonjie
    Contributor

    Hi @singalsu unfortunately, after several hours debugging, it looks to me that the external wired mode looks quite similar to internal LBM for BYT SSP, the capture can't be stopped separately so the RX FIFO watermark(RFL) keep increasing even we have cleared the RSRE (while SSE is set), so, to me, this issue looks is not easy to be fixed.

  10. added
    channel swapL/R channel swap is observed for stereo output or input
    on Jan 19, 2021
  11. lgirdwood commented on Jan 19, 2021

    @lgirdwood
    Member

    @lyakh fyi

  12. added a commit that references this issue on Jan 22, 2021
  13. added a commit that references this issue on Jan 25, 2021
  14. lyakh commented on Feb 1, 2021

    @lyakh
    Collaborator

    presumably fixed by #3777

  15. singalsu commented on Feb 2, 2021

    @singalsu
    CollaboratorAuthor

    @lyakh I got still error and detected channels swap from check-volume-levels.sh. The same happens with LBM quirk an without with Tx-Rx jumper wire.

  16. keyonjie commented on Jun 11, 2021

    @keyonjie
    Contributor

    @singalsu @lyakh looks we have to close this as wont_fix, no advance effort is planned to work on it.

  17. lyakh commented on Jun 11, 2021

    @lyakh
    Collaborator

    do we have a list of "known won't-fix issues" to be tracked in case they do get fixed by accident or they have to be re-opened and we can benefit from earlier discussions?

  18. added
    won't fixThis will not be worked on atm (e.g. a bug closed for lack of user request, hardware etc)
    on Jun 11, 2021
  19. keyonjie commented on Jun 11, 2021

    @keyonjie
    Contributor

    yes, we have a label for that, just add it to this issue

  20. keyonjie commented on Jun 15, 2021

    @keyonjie
    Contributor

    closing this as wont_fix.

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

Metadata

Metadata

Assignees

Labels

BYTApplies to Baytrail platformP1Blocker bugs or important featuresbugSomething isn't working as expectedchannel swapL/R channel swap is observed for stereo output or inputwon't fixThis will not be worked on atm (e.g. a bug closed for lack of user request, hardware etc)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions