[alsa-devel] How to tell user level hardware not support a certain format in a certain sample rate

Richard Zhao linuxzsc at gmail.com
Sun Mar 15 11:38:13 CET 2009

On Mon, Mar 2, 2009 at 11:58 PM, Clemens Ladisch <clemens at ladisch.de> wrote:
> Richard Zhao wrote:
>> runtime->hw.rates and runtime->hw.formats indicate the rate and
>> formats hardware can support, so the user level plugins can
>> auto-convert the audio data. But hardware may not support a certain
>> combin of sample rate and format,
> Did you install your own constraint rules, as described in section
> "Constraints" of "Writing an ALSA Driver"?
> Best regards,
> Clemens

Sure I can add rules. but the rules will be checked as hw_param. If
hw_param failed, does alsalib convert fmt or sample rate

For example:
One codec, support:
44.1k : s8 s16 s24 s32
96k:  s24 s32

When user try to play s8/s16 96k audio file, hw_param will fail. I
don't know, how to let alsalib convert s8/s16 to s32 or convert 96k to
44.1k automatically?


More information about the Alsa-devel mailing list