On 01/16/2014 04:37 AM, Takashi Sakamoto wrote: >> Hmm, I expected the stereo playback to only go to the first two >> channels. Let me try this later. > > I re-check it but it reappears. > >> No, if only "10 channels" is supported, then when trying "8 channels" >> and "12 channels" (and so on), it should not come as far as to starting >> and stopping streams - the driver should return earlier with some error, >> because the channel count does not match with the hw params constraint. > > Oops. Yes, you're correct. Thank for your indication. > > But then, I mind line 381 in /src/modules/alsa/alsa-util.c. > http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/alsa-util.c#n381 > > > if ((ret = snd_pcm_prepare(pcm_handle)) < 0) { > pa_log_info("snd_pcm_prepare() failed: %s", pa_alsa_strerror(ret)); > goto finish; > } > > When snd_pcm_hw_params() is success, process reaches this line. Then > snd_pcm_prepare() is already executed by snd_pcm_hw_params(). So we can > remove this line. Hmm, it seems you're right, as this is done in alsa-lib. But I guess it's mostly a minor optimisation to remove it. Calling snd_pcm_prepare an extra time should not have any effect, I guess... > > I think that snd_pcm_prepare() should be called when recovering from any > XRUNs or suspend. > > > Regards > > Takashi Sakamoto > -- David Henningsson, Canonical Ltd. https://launchpad.net/~diwic