Hi, I cannot get clean 192kHz I2S0 loopback (SDOx -> SDIy) on Pi S, despite the RK3308 I2S0 192kHz specs.
I am testing maximum working I2S samplerates. Simple kernel modification allows samplerates up to 768kHz (just increasing limits in the alsa drivers).
I have already tested other RKs:
RK3566 (Radxa CM3) - clean 192kHz, clean 384kHz, few issues at 768kHz
RK3588S (Radxa CM5) - clean 192kHz, few issues at 384kHz, many issues at 768kHz
By “issues” I mean dropped samples and added zero samples in the captured stream, clearly visible on the sine signal in audacity. These are not alsa xruns (none reported), it’s always just a few samples (1 to 10). My hypothesis is the I2S FIFO - AHB - DMACx - RAM chain does not keep up transferring samples reliably: dropped samples in the captured stream are I2S FIFO overflows on the RX side, zero samples are I2S FIFO underflows on the TX side (I2S sending zeros instead).
The RK3566 and RK3588S “issues” are OK, the interfaces are specced only up to 192kHz where their performance is flawless. But I get consistent “issues” on RK3308 8ch I2S interface at 192kHz, even if transferring only 2 channels. 96kHz performance is OK.
I tried changing DMA burst size to the maximum 16 and to small 4 in https://elixir.bootlin.com/linux/latest/source/sound/soc/rockchip/rockchip_i2s_tdm.c#L1634 + https://elixir.bootlin.com/linux/latest/source/sound/soc/rockchip/rockchip_i2s_tdm.c#L1640 , with more “issues” than the original 8.
On RK3308 the HCLK (the AHB clock, IIUC) runs at 98MHz which perhaps may be too low for 192kHz samplerate. AHB clock on RK3566 runs at 150MHz default (I actually increased that to 200MHz by reverting the patch https://github.com/radxa/u-boot/commit/65bd598f415b92d2165e52a757e70f85352eba25 ). I think AHB clock of RK3588 is at least 200MHz, IIRC.
Cpufreq governor is set to “performance” on all cores, no switching cpu frequencies. Only ethernet is being used, no USB gadget etc.
Please has anyone had consistent success with 192kHz I2S0 on the Pi S?
Please see the attached spectrogram - 8ch 192kHz 1kHz signal - first 4 secs issues, then suddenly perfectly clean. Somehow the transport “recovered”. Next time issues again. The captured wav was stored to tmpfs, no slow SD card involved. Is there any way to troubleshoot these low-level issues?