[alsa-devel] Dummy module and sample rates

Clemens Ladisch clemens at ladisch.de
Thu Sep 24 20:40:00 CEST 2015


Uli Franke wrote:
>>> I set the hw params sample rate to 44k1 without error, but a subsequent
>>> call of snd_pcm_start returns EPIPE.
>>
>> In theory, this error code is returned if you didn't write any samples
>> into the buffer before starting.

> T(snd_pcm_start(pcm));
>
> n = snd_pcm_writei(pcm,
> 	             buffer,
> 	             ARRAY_SIZE(buffer) / channels);

And indeed this code tries to start the device without any samples in
the buffer.

>>> When setting hw params sample rate to 4k this does not happen.

This appears to be an artifact of the resampler.

> When I write samples before starting the stream, snd_pcm_start returns
>
>    File descriptor in bad state (-77)
>
> which is obvious as the state of the stream changes from PREPARED to
> RUNNING.

To prevent the device from starting automatically, change the
start_threshold.


Regards,
Clemens


More information about the Alsa-devel mailing list