On Sun, 29 Feb 2004, Russell King wrote:

> On Sun, Feb 29, 2004 at 01:31:01PM +0100, Jaroslav Kysela wrote:
> > On Sun, 29 Feb 2004, Russell King wrote:
> > > Could someone enlighten me about the way alsa-lib / alsa-driver are
> > > supposed to work when using mmap mode please?  I'm looking at the 1.0.2
> > > code, along with madplay and Linux 2.6.4-rc1.
> > > 
> > > madplay sets the start_threshold to the size of the buffer, and min_avail
> > > to one period size - in much the same way as the alsa-lib test/pcm.c
> > > program.
> > 
> > We know about this problem. The start_threshold must be equal or less than
> > (buffer_size / avail_min) * avail_min in this case.
> 
> I think it's a little more complex than that.  In my case,
> buffer_size = 16384, avail_min = 256, so:
> 
>       (buffer_size / avail_min) * avail_min = 16384
> 
> which is what was being programmed anyway.  However,
> 
>       (int(buffer_size / avail_min) - 1) * avail_min = 16128
> 
> would make more sense.  Do you agree?

No, this combination should work. In your first mail, the avail_min was 
2047 bytes and buffer_size 16384 bytes. Note that xfer_align must pass 
same expression:

         start_threshold = (buffer_size / xfer_align) * xfer_align

But xfer_align is usually 1 or avail_min anyway.

                                                Jaroslav

-----
Jaroslav Kysela <[EMAIL PROTECTED]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to