|
From: | Martin Herren |
Subject: | [Protux-devel] [Fwd: Re: [Alsa-devel] available sampling rate detection] |
Date: | Tue, 11 Feb 2003 10:09:02 +0100 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 |
At Tue, 11 Feb 2003 08:53:59 +0100, Martin Herren wrote:
Hej, i'm new on this list as well as to alsa. We need to find out the supported sampling rates (and other parameters) for the pcm devices of soundcards. We used snd_pcm_hw_params_test_rate() for this, which according to the documentation (http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m___h_w___params.html#a53) should return 1 if the rate is available, 0 otherwise. The problem is that it always returned an non-null value, for any rate even if we knew it wasn't supported. Then we found out that we need to call snd_pcm_hw_params_any() first, and then snd_pcm_hw_params_test_rate() returns 0 for supported rates, and a negativ value (-22) otherwise.
the documentation is wrong. the test functions return zero if supported and a negative value if not supported, as well as the set functions do. Takashi ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ Alsa-devel mailing list address@hidden https://lists.sourceforge.net/lists/listinfo/alsa-devel
[Prev in Thread] | Current Thread | [Next in Thread] |