I2S - How to sync the start of another DMA with the begin() of the I2S (get access of the DMA pointer of the AudioBufferManager of I2S) #3108
-
Hello, I try to get a sync buffer with I2S to generate TTL signals (with PIO) synchronise with I2S generation. But I got a last problem, I'm not able to perfectly synchronied their start together. One solution seems to get access to the the DMA pointers of both AudioBufferManager. That could allow to use the option Is there the possibility to get access to them that I didn't get ? Thanks for any help, LD |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I think you need to synchronize the PIO and not the DMA to do what you want. The DMA runs basically async to the PIO, filling the PIO FIFO when it can. If you need something to flip the exact CPU clock the I2S starts, I think you need to write a custom PIO assembly file with an additional sideset pin. Tour main code could set it to 0 and the PIO code, as soon as it emits the 1st I2S bit could set it to 1 at the exact same instant. As far as exposing the underlying ABM for I2S, I don't think that's a good idea in general because you can break things in strange and unusual ways . For very advanced users who want to program their own DMA controls they can either hack their own installation or rewrite their own I2S and ABM to provide that very specific functionality using the code here as a base. For all other general users, they just want to output sound in whatever format and speed... |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for this clarifications and ideas. The problem make more sense now. I will try to write a custom PIO, seems a really good exercise to learn more about it ! |
Beta Was this translation helpful? Give feedback.
I think you need to synchronize the PIO and not the DMA to do what you want. The DMA runs basically async to the PIO, filling the PIO FIFO when it can. If you need something to flip the exact CPU clock the I2S starts, I think you need to write a custom PIO assembly file with an additional sideset pin. Tour main code could set it to 0 and the PIO code, as soon as it emits the 1st I2S bit could set it to 1 at the exact same instant.
As far as exposing the underlying ABM for I2S, I don't think that's a good idea in general because you can break things in strange and unusual ways . For very advanced users who want to program their own DMA controls they can either hack their own installation o…