All of lore.kernel.org
 help / color / mirror / Atom feed
* Possible bug in alsa-lib. snd_pcm_hw_params_get_periods_max() returning 512 instead of 2.
@ 2004-06-09 11:52 James Courtier-Dutton
  2004-06-10 16:45 ` Clemens Ladisch
  0 siblings, 1 reply; 5+ messages in thread
From: James Courtier-Dutton @ 2004-06-09 11:52 UTC (permalink / raw)
  To: ALSA development

I have the following settings(see below) in my test audigyls driver 
version. Note the periods_min and periods_max both set to 2.
If the application opens the device with "plug:front".
Source code extract: -
dir=0;
err = snd_pcm_hw_params_get_periods_min(params, &periods_min,&dir);
dir=0;
err = snd_pcm_hw_params_get_periods_max(params, &periods_max,&dir);
printf("Periods range from %u to %u\n",periods_min, periods_max);

That will print the message: -
Periods range from 0 to 512

I thought that this should have printed: -
Periods range from 2 to 2

If my app sets the period size first, the buffer size can only be set to 
2*period size, so I would have expected the 
snd_pcm_hw_params_get_periods_max() to return 2 instead of 512.

Is this an alsa-lib bug ?

Cheers
James




static snd_pcm_hardware_t snd_audigyls_playback_hw = {
         .info =                 (SNDRV_PCM_INFO_MMAP |
                                  SNDRV_PCM_INFO_INTERLEAVED |
                                  SNDRV_PCM_INFO_BLOCK_TRANSFER |
                                  SNDRV_PCM_INFO_MMAP_VALID),
         .formats =              SNDRV_PCM_FMTBIT_S16_LE,
         .rates =                SNDRV_PCM_RATE_48000,
         .rate_min =             48000,
         .rate_max =             48000,
         .channels_min =         1,
         .channels_max =         6,
         .buffer_bytes_max =     (32*1024),
         .period_bytes_min =     64,
         .period_bytes_max =     (16*1024),
         .periods_min =          2,
         .periods_max =          2,
         .fifo_size =            0,


-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite!  GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-06-11 15:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-09 11:52 Possible bug in alsa-lib. snd_pcm_hw_params_get_periods_max() returning 512 instead of 2 James Courtier-Dutton
2004-06-10 16:45 ` Clemens Ladisch
2004-06-11 14:26   ` James Courtier-Dutton
2004-06-11 14:54     ` Clemens Ladisch
2004-06-11 15:07       ` James Courtier-Dutton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.