Repository navigation
Conversation
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 <yang.jie@linux.intel.com>
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 <yang.jie@linux.intel.com>
lgirdwood
left a comment
There was a problem hiding this comment.
Can you confirm there are no audio artifacts caused by disabling SSP and then re-enabling during active playback or capture ? I would assume clocks would stop if in master/producer mode ?
|
@keyonjie looks like there is CI issue on pause and release too ? |
|
@keyonjie |
|
SOFCI TEST |
|
I'm not a fan of this since it switches OFF the SSP port. |
That seems completely bonkers to me. |
|
@plbossart @lgirdwood this is actually referring to pxa-ssp from the kernel written by Mark and Liam here: The switching off (then on) takes place pretty fast (e.g. 5us), but you are right, we do need to check if it will introduce any artifacts on any platforms, I will try it more. |
I had tried what you mentioned with all possible configurations that I can figure out without good enough solution to cover both internal/external loopback mode, the tricky thing is that even the SSRSA_RXEN is cleared but the RX FIFO and RNE can keep changing for ever. So to me, to reset the RX FIFO cleanly (while playback keeps active), a fast/rapid toggle of SSCR0_SSE is the only way we have. |
It fails CI - See the internal CI dashboard, it's shows lots of RED in the SSP tests. |
|
@lgirdwood @plbossart I do observe artifact on playback when stop/start capture frequently, so let me drop this solution. @singalsu @jdrzaszcz and all, please be noticed that for internal SSP loopback capture (SSC1.LBM set), the capture channel can swap for different capture iteration, this is a known limitation as the Rx FIFO shifter is connected to the Tx one and the Rx FIFO entry is not guaranteed to be aligned with the channel index. I don't plan to fix it anymore. For External loopback, we will add more test cases to our CI, I believe we should not hit channel swapped issue on cAVS, though it could happen on BYT/BSW (I will mimic a fix of 242be34 to fix it). @jdrzaszcz if that is not true for you in #3525, please raise. |
|
@keyonjie can you confirm for clarity this only affects the LBM mode and regular audio playback and capture are not affected ? |
|
@keyonjie agree that for LBM to work we probably need to start capture and playback at the same time, otherwise the phase of the capture will not be deterministic. I also think external loopback is the only 'safe' solution - though this could lead to other issues on when to sample/hold timing. I vaguely recall we had to play with some obscure bits of the SSP on APL. |
Ack - an atomic SSP enable from LBM makes perfect sense i.e. if LBM is true then do atomic SSP start for both directions. |
|
Yes, @lgirdwood @plbossart if we intend to fix for the LBM, looks SSP 'restart' solution is inevitable, do you expect for this fix or let's just keep this as a known limitation for LBM? For external loopback, we still have issues with results from @jdrzaszcz , we are trying to figure out a solution for that. |
Yes, we need a different start/stop flow for LBM only. |
|
@keyonjie I added to MB Max the SSP external loopback wire and removed LBM set from topology. However this about 1 or 2 errors per 5 runs seems to remain. Are you able to do this same test? I'm trying to confirm the LBM is really cleared. I don't understand why I can't trace from ssp.c. I can't see in trace any ssp_set_config messages. Tried dai_info() and dai_err(). Also verbose trace. I'm checking with md5sum that the image that I run is correct and tried add the trace to all ssp.c modules but no luck. |
|
Anyway this, was my patch for topology that I used in test: |
|
Hi @singalsu I am planning to split the internal LBM and the external one, I am working on the external fixes, will submit PR soon once @jdrzaszcz confirmed it work. For the internal LBM, I would leave the fix as stretch goal, I have the fix(quite similar to the previous stop/start trigger one) for the channel swap issue on TGL, but definitely it will introduce jitter on playback while performing pause/release on capture stream frequently. If that is acceptable, I can submit it later on. |
Are you seeing other dai_info() outputs? if not, it could be filtered out by the recent added logger filter feature by default? |
this is correct, but please remember to run your test on SSP2 only with this change applied. |
|
@singalsu @lgirdwood @plbossart the PR to fix the external channel swap issue is here: It is for cAVS only @singalsu we might need to mimic the fix once it is verified work by @jdrzaszcz . |
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 #3520 #3525
Signed-off-by: Keyon Jie yang.jie@linux.intel.com