Rob wrote: > I am capturing data from my microphone, and transmitting it via > pcm_write() to the USB gadget card, and arecording on the USB host. > If I query the buffer, I begin to see a creeping fill on the device > side buffers, such that after a few hours of constant streaming, the > buffer is filled, and my pcm_write is returning "we only wrote SOME > of your data". The ALSA API was designed for 'normal' sound cards where only the hardware itself can control the sample clock. This means that the USB audio gadget does not give you control over its clock, and that samples are moved synchronously with the USB bus clock. You'd have to measure the clock difference, and dynamically resample the stream. (Zita-ajbridge does something like this.) Alternatively, it might be possible to extend the audio gadget driver to add a mechanism to slightly adjust the sample rate, relative to the bus clock. Regards, Clemens ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Alsa-user mailing list Alsa-user@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-user