[alsa-devel] Wrong period size interval with hda-intel makes snd_pcm_set_params() fail

Christian Morales Vega cmorve69 at yahoo.es
Sun Jun 8 10:18:19 CEST 2008


I looked deeper into the problem and looks like a hda-intel problem.

This code fails with "ALSA lib pcm.c:7193:(snd_pcm_set_params) Unable
to get period size for PLAYBACK: Invalid argument"

#include <alsa/asoundlib.h>

int main(){
   snd_pcm_t *handle;
   if(snd_pcm_open(&handle, "default:1", SND_PCM_STREAM_PLAYBACK, 0) < 0) {
     exit(1);
   }

   if(snd_pcm_set_params(handle, SND_PCM_FORMAT_S16_LE,
SND_PCM_ACCESS_RW_INTERLEAVED, 2, 24000, 1, 100000) < 0) {
     exit(2);
   }
}


The "Invalid argument" comes from pcm_params.c:145. The test
"!snd_interval_single(i)" fails since the interval for
SND_PCM_HW_PARAM_PERIOD_SIZE ends being min=511 and max=513.
I understand that this interval is set at the driver, correct? I don't
know where exactly, so some help in finding it or a patch would be
welcome.


I'm using alsa-driver-kmp-default-1.0.16.20080608,
libasound2-1.0.16.hg20080510 and
alsa-1.0.16.hg20080510 RPM packages from multimedia:audio openSUSE
Build Service repository (from Takashi Iwai) and an AD1988 (hda-intel)
codec. A XUbuntu user also has the same problem with an hda-intel
codec (that I suppose uses stable 1.0.16).
With a SB Live! in the same computer there are no problems.


More information about the Alsa-devel mailing list