-
Notifications
You must be signed in to change notification settings - Fork 319
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][CHT] Output channel left/right swap on various BYT/CHT devices with various codecs #3699
Comments
@jwrdegoede Thanks for testing! We have one bug open for channel swapping for BYT: |
Fwiw, this could be some extra step that is needed in the SSP or DMA shutdown so that the DMA/SSP state is consistent on stream start. The DMA IP on CHT/BYT has is the same IP as on other DSPs (Designware) but it has a slightly different IP configuration so some programming flows may need to be different. |
@jwrdegoede can you confirm if the issue happen for S24/S32 only, and works fine with S16 format? if so, maybe remove the ssp_empty_rx_fifo() might help. |
@keyonjie @plbossart I'm thinking this is a step or register programming order that we are missing in the SSP or DMA shutdown logic (but is being corrected by the subsequent stream start), hence why it works every second playback |
Note AFAIK it does not work every second playback. It works about 50/50 but it is like flipping a coin not every other playback. Next time I'm testing this I will pay extra attention to this but I'm pretty sure it is NOT every other / second playback. |
I'll try to make some time to test this soonish. |
thanks @jwrdegoede what you described are expected result to me. @lgirdwood it is not related with SSP/DMA shutdown logic, it is because of the flushing doesn't work on BYT/CHT as the capture/playback can't be stopped separately there. |
I just hit this issue on a BYTCR device using SSP0 connected to AIF1 of a RT5640 codec. SSP0 always uses S16_LE format, so this means that:
|
@keyonjie can you expand a bit on that? Do you know which flushing is insufficient? SSP or DMA? |
@lyakh it seems that the flipping is random and if so, could be a race between enabling DMA and SSP e.g. enabling certain SSP bits wrt DMA channel enable (like wise on disable flow too). |
one would hope that the DMA is armed first, and the FIFO full when the SSP is enabled? |
@lgirdwood @plbossart @keyonjie BYT is one of several (legacy) platforms, where |
@lyakh check the reference I sent you as the correct flow. |
@jwrdegoede Hi Hans! Interesting that you're saying, that it's only happening after 10 seconds, since SOF on CHT and BYT doesn't support runtime-PM... I can reproduce the problem but with a much lower success rate than 50 / 50. But what I did hear a couple of times: I use |
@lyakh I'm testing with a full-blown GNOME desktop using pulseaudio, it takes 10 seconds for pulseaudio to close the audio-device after the last app stops using it. So it seems to me that the coin-toss for swapping gets done on every opening of a playback-stream. This also seems to match with your experience when repeatedly running speaker-test. |
@jwrdegoede same here - Ubuntu with PA. And the speaker-test uses PA too. But I don't see PA holding sound devices open after speaker-test terminates. Maybe it's the settings application that does that? |
@jwrdegoede could you attach your |
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]>
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]>
Describe the bug
Because of the plan to drop the old SST Linux driver for BYT/CHT devices, replacing it with the SOF driver, I have been testing the Linux SOF driver on various BYT and CHT devices.
Things mostly work well, but there is one bug when using the SOF driver which is not present when using the SST driver. Sometimes the left and right playback channels are swapped. This happens with both stereo speakers and headphones (as is to be expected).
To Reproduce
Run the GNOME control-panel speaker test (which allows testing the left/right speakers separately) on a Cherry Trail device. I've seen this on the following devices:
Reproduction Rate
50/50
Expected behavior
Hitting the "Left speaker" button in the GNOME control-panel speaker test produces sound on the left speaker,
(and the same for the right button + speaker.
Impact
I'm planning on submitting an official Fedora change for flipping the default sound driver on BYT/CHT platforms to the SOF driver to help with testing the switch to SOF so that the SST driver can be dropped (lowering the maintenance burden) sometime during 2021. The deadline for submitting a Fedora change for this is Jan 19th 2021. For me to be able to move ahead with this, this issue needs to be resolved in at least the SOF master branch before the deadline.
Environment
Observations
The text was updated successfully, but these errors were encountered: