[alsa-devel] [Alsa-user] How to get set/fixed sample rate of ALSA device?

Rene Herman rene.herman at keyaccess.nl
Mon Oct 8 01:52:26 CEST 2007


On 10/08/2007 12:41 AM, Mark Constable wrote:

> Any chance that your program could take an arg to investigate
> other cards (or perhaps plugins) and also return an errno so
> it could be used in scripts ?

Only if you promise to never drop CCs again (although I don't know about 
plugins).

>  # gcc -W -Wall -o snd_rate snd_rate.c -l asound
>  snd_rate.c: In function 'main':
>  snd_rate.c:14: warning: the address of ‘params’ will always evaluate as 'true'

That's the ALSA snd_pcm_hw_params_alloca(). No such warning here, but I've 
made it a regular malloc.

>  # snd_rate
>  snd_pcm_open: Device or resource busy
> 
> In fact, why isn't there a single simple "alsainfo" type
> program that tells a user some (or a lot) of info about
> their hardware and alsa-lib install ?

I guess because noone wrote one :-)

It seems by the way that dir != 0 _can_ be returned for hw devices, and this 
just ignores it. Just some rounding issue I guess.

Rene.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: alsa-rate.c
Url: http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20071008/49d3fdb0/attachment.bat 


More information about the Alsa-devel mailing list