[alsa-devel] [PATCH] pcm: Don't store the state for SND_PCM_STATE_SUSPENDED

Takashi Iwai tiwai at suse.de
Wed Jun 1 07:15:34 CEST 2016


On Wed, 01 Jun 2016 05:10:41 +0200,
Shengjiu Wang wrote:
> 
> I test this patch, it is ok. But I have some questions.
> 
> 1. Why do you add snd_pcm_drop()? It seems only adding snd_pcm_resume(spcm)
> can fix this issue also.

The point is, that dmix *cannot* support resume by design.  It's very
same as dmix can't support pause, too.  The multiple streams on the
same slave can't be paused and restarted individually.

In ALSA scheme, the resume is triggered explicitly by app, not
automatically done in the driver.  Now imagine two streams running on
dmix.  The first stream resumes the slave, and both streams are
resumed.  Then, what is the state of the second stream?  It should
have been still suspended, but now it is running secretly.

> 2. Does the snd_pcm_drop cause some several period data be dropped?

Yes.  Very much same as others.

> 3. The return values -ENOSYS, always cause error print "Failed. Restarting
> stream." in aplay. Can it be fixed?

No, this is the expected behavior.  It's no error.


Takashi


More information about the Alsa-devel mailing list