protux-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Protux-devel] Good news about 0.17.1


From: Martin Herren
Subject: Re: [Protux-devel] Good news about 0.17.1
Date: Mon, 10 Feb 2003 08:41:28 +0100

On Mon, 10 Feb 2003 02:30:23 -0200
Luciano Giordana <address@hidden> wrote:

> if the snd_pcm_...._test_....() functions worked in ALSA, the supports() 
> method, in MustuxAudioDEviceMapper, would mark this bus out as supporting 
> only 48 Khz 
> and would not let use try in 44100.
> 
> but they dont work, and ALSA says that all buses supports everthing (such 
> 96Hkz in a SBLive !!!)
> 
> I need to find a way to check the bus capabilities, otherwise, it will keep 
> happening...

the example code from the alsa-doc to generate a sinus does the following to 
set the rate:

  /* set the stream rate */
  rrate = rate;
  err = snd_pcm_hw_params_set_rate_near(handle, params, &rrate, 0);
  if (err < 0) {
    printf("Rate %iHz not available for playback: %s\n",rate, 
snd_strerror(err));
    return err;
  }
  if (rrate != rate) {
    printf("Rate doesn't match (requested %iHz, get %iHz)\n", rate, err);
    return -EINVAL;
  }

if it try to output > 48kHz on my SB Live analog out or != 48kHz on the digital 
out, i get the second error (Rate doesn't match (requested 96000Hz, get 0Hz)).

!! At no place in the code a function snd_pcm_..._test_...() is used !!

from alsa doxygen doc:
  int snd_pcm_hw_params_test_rate()
    Verify if a rate is available inside a configuration space for a PCM.
    Returns: 1 if available 0 otherwise

and there is a function:
  int snd_pcm_hw_params_set_rate_minmax() 
    Restrict a configuration space to have rates in a given range.

so perhaps snd_pcm_hw_params_test_rate() tests if the rate is allowed by the 
restriction applied by you to the card, not the cards physical restrictions ?

Or why don't they use any _test_ function on their code themselve ?

hth

/Martin

-- 
Martin Herren

Protux - A Free Professional Audio Tool for GNU/Linux:
-> http://www.nongnu.org/protux/
Open your Windows - Free your Mind - Enjoy:
->http://gnuwin.epfl.ch

Attachment: pgpEnYVcjgqwC.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]