Hello,
Could someone advice how the Zephyr I2S (i2s_nrfx.c) modules or Nordic Module (nrfx_i2s.c) should be used to I2S TX a USB ISOCH stream (1msec), when the 2 rates (USB source and I2S TX destination) drift with respect to each other?
Previously, I have handled this with drop/insert techniques on ring buffers. However the Zephyr/Nordic implemented I2S driver has FIXED buffer sizes which makes this type of technique difficult with low latency.
I guess I am looking for information on how to use the Zephyr / Nordic I2S driver (as written) with USB ISOCH when the source/destination clocks are drifting WRT each other. The problem is exacerbated if the nRF52840 is used as the I2S master - then the USB source rate is 48Khz and the I2S TX rate is 47.619kHz.
Notes.
- The nrf52840 was chosen for the product because it is cheaper than the nrf5340.
- The nRF52840 has no adjustable Audio clock (nrf5340 has the adjustable HF Audio clock)
- With the nRF52840 I2S in Master mode it has limited capability to meet different Audio rates e.g 48KHz can only be achieved with a MCLK = SCK = 1523809 Hz, LRCLK=47619 Hz (0.8% error). This makes the problem much harder.
- With the nRF52840 in Slave mode and using a HW CODED that can generate 48kHz, we will still have the clock drift problem.
- We are not fixed at a 48kHz audio rate, I can use any of the following rates - but which ever I chose the clock drift issue will still be present.
Any help appreciated.
Regards
Wayne