At Thu, 20 Mar 2003 10:04:39 +0100 (CET),
Giuliano Pochini wrote:
> 
> 
> >> 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.
> 
> 
> Ok, but how do I build the sg list when bufsize!=sz*periods ? Take
> the example above: have I to build 4 periods and let the last one
> smaller than 22052 ?

it depends on the hardware.

if you need to set up a buffer-descriptor list like via82xx, the above
h/w constraint (integer periods) will be most likely necessary.
then the buffer size will be aligned to the period size
automatically.

otherwise, you'll need to change the BD list dynamically with
different sizes.


Takashi


-------------------------------------------------------
This SF.net email is sponsored by: Tablet PC.  
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

Reply via email to