On 19 Mar 2003, Giuliano Pochini wrote: > > > I'm facing another *Ł%@ problem. When period size is a multiple or > > > submultiple of PAGE_SIZE, it works fine, but when it isn't, sound > > > clicks, pops, repeapeapeats, skps :(( And since the period never crosses > > > physically the page boundary because I split it when it happens, I can't > > > imagine what's wrong. Perhaps some of you had the same problem. > > > > > > .period callback does this: > > > > do you mean pointer callback? > > Yes, sorry. > > > > bufsize=substream->runtime->periods*substream->runtime->period_size; > > > > you already have substream->runtime->buffer_size for this. > They are different: > > [aplay <no options> track.wav] > Mar 19 19:21:23 localhost kernel: pcm_hw_params (bufsize=88200 periods=3 > persize=22052) > > bufsize==88200 != 3*22052 == 66156
Note that there is no guarantee that the periods == integer value. If your hardware doesn't allow to set period_size and buffer_size independently (if buffer_size must be multiple of period_size) then put this code to the open callback: if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) return err; See alsa-kernel/pci/via82xx.c for an example. In other cases, runtime->buffer_size MUST BE USED. Jaroslav ----- Jaroslav Kysela <[EMAIL PROTECTED]> Linux Kernel Sound Maintainer ALSA Project, SuSE Labs ------------------------------------------------------- This SF.net email is sponsored by: Does your code think in ink? You could win a Tablet PC. Get a free Tablet PC hat just for playing. What are you waiting for? http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel