This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

usb asynchronous

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.

Parents
  • 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.

Reply
  • 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.

Children
  • 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.