We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
How do I set the usb audio code up for usb asynchronous transfers.
Do I just have to change bmAttributes
USB_ENDPOINT_TYPE_ISOCHRONOUS,
to
USB_ENDPOINT_SYNC_ASYNCHRONOUS
or is it more complexed than that.
Tsuneo,
I don't have debugger or fancy scope or a fancy jitter scope, or a hardware usb analyser, I am just guessing at this problem, I thought increasing the iso transfer might help, only going all the way down to 8000khz does. because the ticker is increased to I don't know above 60 us perhaps
Does anybody have any suggestion of what to do here. I know if I could separate the code and have two timers might work or if I could store the audio in memory
have a timer on the original code and then store this data in a big memory thing and then another timer on the other code that reads the memory.
but then would be more of a delay..
ideas anyone.
I think I got the answer anyway don't want to ruin this thread maybe you should delete the last couple of posts
use a ringbuffer and read and write in opposite directions. DMA can only do one direction AFAIK (counting up) so you need to write a buffer in reverse direction in software and let the DMA do the playback part. You can use two buffers and switch them on the 'end-of-DMA' interrupt for example. You can also use a simple ticker interrupt and read and write a ringbuffer on each 'tick', again with opposite directions.