Switching I2S Slave mode to Master mode on the fly
our development involves an Arm processor using SigmaDSP to output Audio to Headphones/Speakers.
Following is a simplified sequence of operations from ARM's point of view:
starts up (I2S is not yet setup)
Loads SigmaDSP VIA I2C (is programmed as I2S Master)
via I2C, command is sent to SigmaDSP to switch to I2S Slave (main intention is to stop the Master Clock from SigmaDSP)
ARM I2S is programmed as a slave and transmit buffer is loaded
via I2C, command is sent to SigmaDSP to switch to I2S Master to start normal I2S audio transfer
The above either works or is out of sync; almost 50-50 chance.
Note: The ARM I2S stipulation is that it is a Slave and so should be fully loaded and ready before the Master Clock arrives. Thats the reason for this Master/Slave mode switching.
Is there any reason SigmaDSP (I2S) should not be switched from SLAVE to MASTER on the fly?
Any guidance in this matter is greatly appreciated.
switching
i2s
master
slave
Hello,
There is no problem with switching the SigmaDSP from an I2S slave to I2S master on the fly. However, be aware that there will be brief clock contention when you do this, which may cause a few samples to be skipped or corrupted. That will cause an audible artifact on the output. It might be wise to do a slew mute (in software) prior to switching the clocks, and then un-mute after the clocks have been handed over.
Thanks for taking the time to reply.
What you suggested definitely helped, but unfortunately did not eliminate the sync problem.
Finally, I decided to sync explicitly. I kept the SigmaDSP in I2S Master mode (without any mode switching) and waited for the WS LINE to be high before enabling the I2S Slave. This seems to have solved the problem.
Again, thanks for your response.
This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.
Thank you,
EZ Admin
Please log in to reply.