[ALSA] usb-audio: start submitting URBs in the prepared state
authorClemens Ladisch <clemens@ladisch.de>
Wed, 2 Nov 2005 10:32:52 +0000 (11:32 +0100)
committerJaroslav Kysela <perex@suse.cz>
Fri, 4 Nov 2005 12:25:06 +0000 (13:25 +0100)
commitb55bbf06e850d7561ad7bdded1f4d8c08b1e1f11
tree6a556b8170c354224a8c5a4400524bc59f0101db
parent091e95ee7febf894603475c44d51f8ec4fab4328
[ALSA] usb-audio: start submitting URBs in the prepared state

Modules: USB generic driver

If we submit all our URBs when a playback stream is started, the first
hwptr_done update for each URB happens at the same time.  This results
in an underrun when there isn't enough PCM data available at this
point for all URBs.

To avoid this, we begin submitting our URBs earlier (when the stream
is prepared), with empy packets.  When the stream is started, the
prepare_playback_urb() call for each URB will be run only when the
respective URB has completed previously, so the first hwptr_done
updates will be done nicely staggered.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/usbaudio.c