Hi there.
I am trying to implement a 16-bit, 32kHz, 2 channel i2s interface which is being fed by a FIFO (the final source of this FIFO will be a DAB/FM radio module but could be any audio source). I am running on an nrf5340dk. I am witnessing the i2s say that it is not being supplied data fast enough (based on log messages) but I can't see why this is as the i2s interface is being fed as fast as the FIFO will allow it. What can I do to get around this?
The current output looks like this:
```
[00:00:00.407,989] <inf> i2s_transmission: Start of main
[00:00:00.408,020] <dbg> i2s_transmission: audio_receive: inside
[00:00:00.411,041] <dbg> i2s_transmission: write_to_i2s_buffer: Inside
[00:00:00.411,071] <inf> i2s_nrfx: I2S MCK frequency: 1026327, actual PCM rate: 32072
[00:00:00.411,132] <dbg> i2s_transmission: i2s_init: i2s transmission started
[00:00:00.411,193] <dbg> i2s_transmission: i2s_init: Finished
[00:00:00.411,224] <dbg> i2s_transmission: write_to_i2s_buffer: Size of FIFO after initialising i2s = 3
[00:00:01.062,713] <err> i2s_nrfx: Next buffers not supplied on time
[00:00:01.063,690] <err> i2s_nrfx: Cannot write in state: 4
--- 9 messages dropped ---
[00:00:01.072,753] <err> i2s_nrfx: Cannot write in state: 4
```
based on the following main:
```
```
Notice a commented out `k_free` in there. It seems that if I include this the program fails due to a memory access error. My guess is that I'm freeing the memory before i2s_buf_write gets a chance to write to the i2s buffer. Would a K_WAIT or equivalent help here?
If you would like to see all of the code it lives here.