What triggers the callback, etc.?
Hi:
Thank you for the examples and the explanations.
One thing that I don't quite understand. What exactly triggers the callback, etc.? Presumably, it must be that there is some pointer in the DMA system but I was wondering how much "space" is available at that point.
If you have you have a DMA buffer of 10000 bytes then the callback is at about 5000 bytes or something like that?
Thank for any insight.
For an I2S.write(), the callback happens as soon as the last byte of the "user buffer" is copied into the "internal buffer" (ibuf in the I2S constructor). For example, say the ibuf=40000 bytes, and the user buffer is 10000 bytes. The callback will happen when the final byte of the 10000 byte buffer is copied into the internal buffer. The sound associated with the 10000 byte buffer may be heard immediately in the case that the ibuf was empty, or it could be heard later if the ibuf contains buffered audio samples that have not yet been processed by the I2S peripheral.
Does that make sense?
On Tue, May 10, 2022 at 10:15 PM james-drummond @.***> wrote:
Hi:
Thank you for the examples and the explanations.
One thing that I don't quite understand. What exactly triggers the callback, etc.? Presumably, it must be that there is some pointer in the DMA system but I was wondering how much "space" is available at that point.
If you have you have a DMA buffer of 10000 bytes then the callback is at about 5000 bytes or something like that?
Thank for any insight.
— Reply to this email directly, view it on GitHub https://github.com/miketeachman/micropython-i2s-examples/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADBAUOE4BYDWUA7MHIZUJ3TVJM7A3ANCNFSM5VTUZOXQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>