[00:06:49.411,024] <inf> i2s_nrfx: I2S MCK frequency: 256000, actual PCM rate: 8000
Hi,
Error code 11 is -EAGAIN, which simply means the I2S TX queue was full and i2s_write() timed out waiting for a free slot. This is expected if audio buffers are queued faster than the I2S hardware can transmit them. When this happens, one of the way could be to wait for some micro seconds and retry i2s_write().
Also note that as previously recommended increasing NUM_BLOCKS only adds more application buffers; it doesn’t change the driver’s internal TX queue size. To check that part, could you please share the relevant section of your prj.conf, especially any I2S or nrfx-related options?
Regarding MCK, you don’t need to generate it separately in code when I2S is set up as master.
Best Regards,
Syed Maysum
i2s require 4mhz
Thanks for sharing the details and prj.conf. With retry pacing in place and CONFIG_I2S_NRFX_TX_BLOCK_COUNT=8, the earlier -EAGAIN TX queue behavior should now be handled correctly on the application side.
i got same -eagen error
Hi,
On nRF54L15, the master clock (MCK) is generated by a frequency generator based on the MCKFREQ register and the sample rate (LRCK) is then derived as LRCK = MCK / RATIO.
Your log shows the I2S driver is currently selecting MCK=256 kHz with LRCK=8 kHz, which implies a 32x ratio. That is why the codec (which expects ~4 MHz MCK) does not match. If the codec requires ~4 MHz MCK, the I2S clocks should be configured for RATIO=512x so that at 8 kHz sample rate you get MCK = 8 kHz Ă— 512 = 4.096 MHz.
So if you want to get a higher MCK (~4 MHz), you should switch to using the nrfx_i2s driver directly. In nrfx_i2s, you can explicitly set:
Hopefully it should work. Best Regards,
Syed Maysum
One of another issue related to i2c communicatrion-
Initially the I2C communication works correctly, but after next debugg it starts failing with error -5 (I/O error) again another debugg it would be work correct again it will fail - I am confused with thi bug
Hi Sharon,
Thanks for your feedback. Just thinking if you are able to solve your request regarding higher MCK and it would be great if we could discuss issues one by one to avoid any confusion. So please correct me if I am wrong that according to your latest update there are 2 main issues. First you want to set the MCK to around 4 MHz and secondly you are getting -eagain error and error -5 errors both?
Could you please also share the output log around these errors (with logging enabled for the I2S driver), so we can see exactly where they occur?
Best Regards,
Syed Maysum
sure
The issue is not solved yet.