[alsa-devel] How to Configure Appropriate runtime->hw in ALSA Driver

Clemens Ladisch clemens at ladisch.de
Sun Jul 5 19:20:04 CEST 2015


Azizul Hakim wrote:
> What is the best way to set the *runtime->hw* parameter in ALSA driver.

Set it to the capabilities of your hardware.

> From sample ALSA driver tutorial I understand we have to declare a
> *structure snd_pcm_hardware*  where we define all sound parameters
> like *STEREO/MONO,
> RATES* etc. Now at run time we can play sound files of different
> parameters. How ALSA behaves if the audio file parameters doesn't match
> with the *structure_snd_pcm_hardware* parameters?

Applications are not able to set unsupported parameter values.

However, alsa-lib can automatically convert rates/formats.

> If we want our driver to play any sound file

Your driver is supposed to driver your hardware.
What would you do with an unsupported format?


Regards,
Clemens


More information about the Alsa-devel mailing list