Open kv2019i opened 1 year ago
@Vamshigopal @juimonen can you comment on the bug description?
Hi @kv2019i
In above mentioned scenario by peter, SSP2 (BT offload) here the master clock source is BT controller (38.4MHz) and for SSP1 (Speaker pipeline) master clock source is DSP (19.2MHz) , Can we have 2 different clock source with different frequencies for SSP ?
@Vamshigopal, I need to find some documentation, but is it possible that the MCLK frequency only matters when the SSP is the clock provider and it can be anything when it is not providing the clocks on the bus? The functional clock is different for the IP, so in theory the SSP can run w/o MCLK since the shift logic is driven by the I2S clocks?
Not sure about this and I don't have a setup where it can be tested, verified.
One solution to this issue is at https://github.com/thesofproject/sof/pull/7741
Describe the bug Follow-up to https://github.com/thesofproject/sof/issues/7548
Description form @ujfalusi in the above bug I think there is another angle to this issue which is brought to light by the TX FIFO drain simplifications. The setup is SSP1 - clock provider, playback only to speaker, want MCLK as 19200000 SSP2 - clock receiver, playback/capture to BT, want MCLK as 38400000
We see this sequence in case of a failure: SSP2 start (sets MCLK to 38400000)
SSP2 start (clocks have been configured for SSP2 already)
SSP2 RX stop SSP2 start
SSP2 TX stop
At this point we have
SSP2 RX
still running, MCLK is configured for 38400000SSP1 start (fails to set the MCLK to 19200000)
Note that the MCLK request fails since the same clock is already used by
SSP2
and it is set to 38400000, the MCLK request fail is handled by skipping the BCLK setup for SSP1 but the error fromssp_pre_start()
is ignored, so we go on and start the SSP1 anyways. This will lead to:Which is not a surprise without BCLK setup for a clock provider.
I think this setup is not correct. SSP1 and SSP2 can be used at the same time and they want the very same MCLK to run in different speeds. A clock cannot be 38400000 and 19200000 at the same time. Either both SSPs should be asking for the same MCLK rate or the two SSP should use different mclk_id from topology (if it is possible at all).