Re: USB Synchronization w/ALSA via g_audio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Chris,

My goal is a low latency USB microphone that's always on; similar to an intercom system.

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".  As this happens, I start to notice more and more latency between my device's capture and the host's playback, as I eventually have a whole buffer's worth of "old" audio I'm queuing "now's audio" data behind. If I modify the UAC driver to provide a larger buffer size, my pcm_write of "not a full buffer" takes longer to happen, but when it does, my latency has gone from unnoticeable to several seconds.

I figured (and may very well be wrong), that this was due to my device clocks sending buffers at a rate *slightly* faster than the USB is able to sink it to the host. Could this be something else?

Thanks,
Rob




On Thu, Jul 12, 2018 at 8:13 PM, chris hermansen <clhermansen@xxxxxxxxx> wrote:
Rob and list,

On Thu, Jul 12, 2018, 19:27 Rob <alsa@xxxxxxxxxxxxx> wrote:
Hi all,

I'm reading about the feedback mechanism for USB audio. I'm trying to see if I can implement asynchronous mode.

What makes you think asynchronous mode isn't already implemented?

Chris Hermansen

------------------------------------------------------------------------------
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

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux