Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Thanks. It helps, however using this method would there not still be a possibility that the channels may be swapped? Will this ensure that the first member of the pair is always the LEFT or RIGHT (e.g.)? I find that the Arduino documentation, library and examples are extremely lacking with this regard and to my astonishment does not seem to concern most folk in the community Commented May 19, 2021 at 11:13
  • Your always dealing with an entire dma buffer, so should always be the same. Commented May 19, 2021 at 11:35
  • Thanks, I have tested this however occasionally I am getting all LEFT and sometimes all RIGHT on pair[0] depending when I start reading. which is my main problem Commented May 19, 2021 at 12:08
  • 1
    I think part of the problem is that the whole library's methodology is flawed. You hjave DMA driven ping-pong buffers which receive the data constantly, and you must deal with an entire buffer in less time that it takes to fill the other buffer. You may be better off using the onReceive() callback to run a function at the moment the buffers swap, at which point you must read the entirety of the buffer, otherwise it will stall (by the looks of things). Commented May 19, 2021 at 12:14
  • thanks for the help - you've certainly understood the problem and it is worth recording (no pun intended) for others to know about. For now as my project only requires one channel I can simply put split the one channel into both left and right so that in this case it doesn't matter and I will always read the same channel regardless, however that's just a sticking plaster. Commented May 19, 2021 at 12:21