Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
singalsu opened this issue Oct 14, 2020 · 11 comments
Closed
Assignees
Labels
bug Something isn't working as expected BYT Applies to Baytrail platform channel swap L/R channel swap is observed for stereo output or input P1 Blocker bugs or important features won't fix This will not be worked on atm (e.g. a bug closed for lack of user request, hardware etc)

Comments

@singalsu
Copy link
Collaborator

singalsu commented Oct 14, 2020

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

@singalsu singalsu added bug Something isn't working as expected BYT Applies to Baytrail platform P2 Critical bugs or normal features labels Oct 14, 2020
keyonjie added a commit to keyonjie/sof that referenced this issue Oct 20, 2020
We should make sure the SSP port is disabled when trying to start new
transmission or reception, to avoid any potential race between
transmission and the reception on the same SSP port.

Fixes thesofproject#3520 thesofproject#3525

Signed-off-by: Keyon Jie <[email protected]>
@keyonjie
Copy link
Contributor

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

keyonjie added a commit to keyonjie/sof that referenced this issue Oct 20, 2020
Add the similar fix to baytrail ssp which disabling the SSP port during
ssp_start(), to avoid any potential race between transmission and the
reception on the same SSP port.

Fixes thesofproject#3520

Signed-off-by: Keyon Jie <[email protected]>
@slawblauciak slawblauciak added the P1 Blocker bugs or important features label Oct 20, 2020
@singalsu
Copy link
Collaborator Author

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

@slawblauciak slawblauciak removed the P2 Critical bugs or normal features label Dec 1, 2020
keyonjie added a commit to keyonjie/sof that referenced this issue Dec 1, 2020
Mimid the SSP RX FIFO flushing logic which verified work on CNL/WHL.

We need to read out entries every time the FIFO is not empty. This
flushing may need take place several rounds, and we need to wait 1
sample time between 2 flushing rounds.

Fixes thesofproject#3520

Signed-off-by: Keyon Jie <[email protected]>
@keyonjie
Copy link
Contributor

keyonjie commented Dec 1, 2020

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.

@keyonjie
Copy link
Contributor

keyonjie commented Dec 2, 2020

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.

@lgirdwood
Copy link
Member

@lyakh fyi

lyakh added a commit to lyakh/sof that referenced this issue Jan 22, 2021
Commit 05e1c26 ("byt-ssp: fixes for DSP modes") removed a
work-around for known hardware bugs, causing channel swapping
in I2S mode. Restore the work-around but make sure it's only
enabled in I2S and LEFT_J modes.

Fixes: thesofproject#3699, thesofproject#3520

Signed-off-by: Guennadi Liakhovetski <[email protected]>
keyonjie pushed a commit that referenced this issue Jan 25, 2021
Commit 05e1c26 ("byt-ssp: fixes for DSP modes") removed a
work-around for known hardware bugs, causing channel swapping
in I2S mode. Restore the work-around but make sure it's only
enabled in I2S and LEFT_J modes.

Fixes: #3699, #3520

Signed-off-by: Guennadi Liakhovetski <[email protected]>
@lyakh
Copy link
Collaborator

lyakh commented Feb 1, 2021

presumably fixed by #3777

@lyakh lyakh closed this as completed Feb 1, 2021
@singalsu
Copy link
Collaborator Author

singalsu commented Feb 2, 2021

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

@singalsu singalsu reopened this Feb 2, 2021
@keyonjie
Copy link
Contributor

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

@lyakh
Copy link
Collaborator

lyakh commented Jun 11, 2021

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?

@keyonjie keyonjie added the won't fix This will not be worked on atm (e.g. a bug closed for lack of user request, hardware etc) label Jun 11, 2021
@keyonjie
Copy link
Contributor

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

@keyonjie
Copy link
Contributor

closing this as wont_fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected BYT Applies to Baytrail platform channel swap L/R channel swap is observed for stereo output or input P1 Blocker bugs or important features won't fix This will not be worked on atm (e.g. a bug closed for lack of user request, hardware etc)
Projects
None yet
6 participants