Repository navigation
Conversation
I have been seeing this recently too. It might be because a build in process was cancelled by pushing a new commit, and there is some recovery issue. |
dhalbert
left a comment
There was a problem hiding this comment.
The ring buffer impl here is a complex, single-use piece of code. We have ringbuf.h already, but it is not atomic and is byte-oriented. Its operations are meant to be called inside critical regions if that is necessary. I don't know if it could be substituted easily.
If not, would it be possible to factor out the ring code into some general purpose atomic ring buffer, so the mechanics are not in the USBIn code? Maybe ringbuf.h could be made better. I rewrote it a long time ago to be simpler because it was very hard to understand how much storage should be allocated. There were lots of off-by-one errors due to how it used to work in MicroPython.
|
This is updated to use the existing ringbuf now. I added I changed I tested the audiofilewriter example code from the original post successfully with the latest version |

Adds a ring buffer to hold data from isochronous USB while the VM is busy with other work. Tinyusb host task is used for this as was suggested in hathach/tinyusb#4579. This implementation requires no further changes in upstream tinyusb.
The usage of that task was modeled after existing implementation of the Max3421E.
The goal of this work is to get an example like this one that records audio from USB mic directly to an SD card working on Metro ESP32-P4
There are still a few tweaks that will be needed in audiofilewriter on top of this PR to get things working fully.