Alan Stern wrote:
> On Thu, 5 Oct 2006, Christopher "Monty" Montgomery wrote:
> > Are overrun and underrun synonyms here?
> 
> Sorry, a persistent thinko.  s/overrun/underrun/g.

Except when doing input.  In ALSA, we just call them xruns.  :-)

> > What happens when, eg, an application does not submit more audio to
> > the usbaudio layer in time to avoid an underrun in playback?  In that
> > case, all the completion handlers would return and the stream would be
> > released.
> 
> I don't know the details of how usbaudio works.  If it suffers an underrun 
> from an application, it has a choice: submit meaningless URBs -- silence, 
> or repeat the previous data -- or lose its bandwidth reservation.

All three choices are possible, depending on how the application has
configured the device.  Either application xruns get ignored, in which
case snd-usb-audio will continue submitting URBs from its completion
handlers, or the stream will be stopped (and then must be explicitly
restarted, and that can fail for various reasons).

> > The intent is that endpoint_disable is called upon close(); in my
> > testing (and from the code I read), close would in fact always result
> > in an endpoint_disable.
> 
> No, it doesn't.  endpoint_disable() happens only at a few specific times: 
> when an altsetting or configuration is set or when the USB device is
> unregistered.  Of course, if usbaudio decides to call usb_set_interface() 
> whenever its device file was closed then you would be okay.

snd-usb-audio actually does call usb_set_interface() when closing a
device, but snd-usx2y does not because the endpoints of several devices
(PCM and MIDI) share the same interface.

With the current API, the only reliable way of detecting a stopped
stream is indeed the absence of resubmits from the completion handlers.


Regards,
Clemens

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to