Replies: 1 comment
-
I'm traveling this week so can't really get into your code on my phone but I'll give you a few tips. Yes, you need to use your own buffers. The I2S ones are owned by the DMA engines and can't be accessed by you. The read call will only block of there are no samples available. From a callback you are guaranteed at least one buffer is ready so you can blindly read that many samples. There is also a non blocking version of read, check the I2S header. Your setBuffers call looks wrong, please verify you're seeing the right number of samples and buffers. One of those looks to be set to 0 which is going to hurt when the defaults are used instead. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
I am trying to set up ping pong buffers to read I2S input and send it over UDP using interrupts or callbacks. It looks like the correct function to use is I2S.onReceive(). I am unsure if I am supposed to read buffers already set up in the I2S software or if I am supposed to use my own. I have guessed some code using my own, but I don't . See below. I see some packets with wireshark, but only a few (30 kBytes/s, significantly less than I got here, not the number I expect. The flag dataReady does get set. I am also confused about how I'm supposed to use it without using the blocking read() call that it warns not to use in the Arduino-Pico Docs. It seems it should be okay because I already know there is data waiting for me, so it should not block, but I'm probably wrong. Can anyone help?
Beta Was this translation helpful? Give feedback.
All reactions