[alsa-devel] External samplerate changes, UAC2 clock topologies
clemens at ladisch.de
Thu Jun 10 08:19:41 CEST 2010
Daniel Mack wrote:
> On Wed, Jun 09, 2010 at 11:16:28AM +0200, Daniel Mack wrote:
> > On Fri, Jun 04, 2010 at 09:49:36PM +0200, Jaroslav Kysela wrote:
> > > If a stream parameter changes, the driver should interrupt streaming
> > > immediatelly. The check should be in the trigger() callback (-EIO
> > > error code) and if the stream is already running - it should be put
> > > to the
> > > SNDRV_PCM_STATE_DRAINING (capture) to let the application obtain the
> > > captured samples until the parameter change. Just call
> > > snd_pcm_stop() with the new state for the substream. For playback,
> > > the stream should be put to the SNDRV_PCM_STATE_OPEN state to wait
> > > to settle new parameters from an application (it means that all I/O
> > > ops will return -EBADFD).
> > Hmm. I implemented this now, but at least aplay won't stop when this
> > code path is triggered. Is there anything else I should do, except for
> > calling snd_pcm_stop()?
> Strange enough, aplay doesn't even quit when the device is unplugged.
> Can anyone confirm this with an UAC1 device?
Unplugging works just fine (i.e., stops).
When unpluggin, the stream should go into XRUN state.
I doublt if it is allowed to go from RUNNING to OPEN, because then the
driver's hw_free callback might not be called.
More information about the Alsa-devel