* How is buffer size, periode size and periods determined?
@ 2006-05-12 13:55 Hans-Christian Egtvedt
2006-05-17 7:47 ` How is buffer size, periode size and periods de Giuliano Pochini
0 siblings, 1 reply; 2+ messages in thread
From: Hans-Christian Egtvedt @ 2006-05-12 13:55 UTC (permalink / raw)
To: alsa-devel
Hi
I'm experiencing that my aplay/arecord (1.0.11) is setting up a bit
weird values for buffer size, period size and periods.
For example when trying to record S16_LE 44100 Hz Mono I get the
following parameters:
buffer size: 44100
period size: 4094
periods : 10
10 * 4094 = 40940 != 44100, the player asks for a bigger buffer than needed.
Other example, S16_LE 32000 Hz Mono:
buffer size: 32752
period size: 4094
periods : 8
8 * 4094 = 32752 == 32752, which is a correct buffer size.
How come the alsa-lib/aplay behaves like this? I would like to see the
last behaviour all the time. Does this point to a bug on my platform, or
is this the way alsa-lib can calculate the buffers?
The reason I'm asking is that it wastes some memory and the DMA
controller currently in the Linux for my platform doesn't like the
buffersize to be greater than periode size * periods.
--
With kind regards,
Med vennlig hilsen,
Hans-Christian Egtvedt
Applications Engineer - AVR Applications Lab
Atmel Norway
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: How is buffer size, periode size and periods de
2006-05-12 13:55 How is buffer size, periode size and periods determined? Hans-Christian Egtvedt
@ 2006-05-17 7:47 ` Giuliano Pochini
0 siblings, 0 replies; 2+ messages in thread
From: Giuliano Pochini @ 2006-05-17 7:47 UTC (permalink / raw)
To: Hans-Christian Egtvedt; +Cc: alsa-devel
On 12-May-2006 Hans-Christian Egtvedt wrote:
> I'm experiencing that my aplay/arecord (1.0.11) is setting up a bit
> weird values for buffer size, period size and periods.
>
> For example when trying to record S16_LE 44100 Hz Mono I get the
> following parameters:
> buffer size: 44100
> period size: 4094
> periods : 10
>
> 10 * 4094 = 40940 != 44100, the player asks for a bigger buffer than needed.
Someone should add this issue the the FAQs.
ALSA is not required to make the buffer size multiple than
the period size, unless the driver asks for it. If it doesn't,
then the driver must be able to manage the case when the IRQs
happen at different points of the ring buffer each round.
Anyway, n*persize <= bufsize < (n+1)*persize
ALSA middle layer is robust enough to cope with unevenly sizes
periods well (eg. buf=1000 per=400 -> 3 periods of 400, 400, 200).
I wouldn't be surprised if some drivers still use periods of
different sizes because ALSA doesn't complain (mine did it at the
beginning).
--
Giuliano.
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-05-17 7:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-12 13:55 How is buffer size, periode size and periods determined? Hans-Christian Egtvedt
2006-05-17 7:47 ` How is buffer size, periode size and periods de Giuliano Pochini
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.