* periods? fragments?
@ 2003-05-19 3:53 David Stuart
2003-05-19 4:12 ` Paul Davis
2003-05-19 8:04 ` Giuliano Pochini
0 siblings, 2 replies; 5+ messages in thread
From: David Stuart @ 2003-05-19 3:53 UTC (permalink / raw)
To: alsa-devel
Greetings! Fledgeling alsa developer here,
After reading a bunch of documentation, it's unclear to me exactly what
a period/fragment is used for. Could anyone expand on it a bit to fill
me in?
And since I'm on the topic of documents .. I've obviously found the
tutorials off the ALSA documentation page, and am leafing through the
"doxygen" docs included in the devel package, but I was wondering if
there was anything else that I should be looking at?
Dave
-------------------------------------------------------
This SF.net email is sponsored by: If flattening out C++ or Java
code to make your application fit in a relational database is painful,
don't do it! Check out ObjectStore. Now part of Progress Software.
http://www.objectstore.net/sourceforge
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: periods? fragments?
2003-05-19 3:53 periods? fragments? David Stuart
@ 2003-05-19 4:12 ` Paul Davis
2003-05-19 8:06 ` Abramo Bagnara
2003-05-19 8:04 ` Giuliano Pochini
1 sibling, 1 reply; 5+ messages in thread
From: Paul Davis @ 2003-05-19 4:12 UTC (permalink / raw)
To: David Stuart; +Cc: alsa-devel
>Greetings! Fledgeling alsa developer here,
>
>After reading a bunch of documentation, it's unclear to me exactly what
>a period/fragment is used for. Could anyone expand on it a bit to fill
>me in?
there is a hardware buffer. its N frames long. you rarely want to deal
with the entire buffer at once. its therefore divided into sections of
a certain length, often (but not always) specified in numbers of
frames. these sections are called "periods" and typically (but not
always) the hardware will interrupt the CPU every time it finishes
dealing with a "period", and you in turn get to deal with it in 1 (or
more) periods at a time. the number of periods per h/w buffer (or
alternately, their size) is a hardware parameter; how many periods
have to have been processed by the h/w before the driver will wake up
your code to read/write more data is a software parameter.
a "fragment" is an older OSS term for the same concept.
-------------------------------------------------------
This SF.net email is sponsored by: If flattening out C++ or Java
code to make your application fit in a relational database is painful,
don't do it! Check out ObjectStore. Now part of Progress Software.
http://www.objectstore.net/sourceforge
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: periods? fragments?
2003-05-19 3:53 periods? fragments? David Stuart
2003-05-19 4:12 ` Paul Davis
@ 2003-05-19 8:04 ` Giuliano Pochini
2003-05-19 8:12 ` Jaroslav Kysela
1 sibling, 1 reply; 5+ messages in thread
From: Giuliano Pochini @ 2003-05-19 8:04 UTC (permalink / raw)
To: David Stuart; +Cc: alsa-devel
On 19-May-2003 David Stuart wrote:
> Greetings! Fledgeling alsa developer here,
>
> After reading a bunch of documentation, it's unclear to me exactly what
> a period/fragment is used for. Could anyone expand on it a bit to fill
> me in?
You need an audio buffer to send/receive data from the audio
chip. The buffer is made of two or more periods.
Bye.
-------------------------------------------------------
This SF.net email is sponsored by: If flattening out C++ or Java
code to make your application fit in a relational database is painful,
don't do it! Check out ObjectStore. Now part of Progress Software.
http://www.objectstore.net/sourceforge
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: periods? fragments?
2003-05-19 4:12 ` Paul Davis
@ 2003-05-19 8:06 ` Abramo Bagnara
0 siblings, 0 replies; 5+ messages in thread
From: Abramo Bagnara @ 2003-05-19 8:06 UTC (permalink / raw)
To: Paul Davis; +Cc: David Stuart, alsa-devel
Paul Davis ha scritto:
>>Greetings! Fledgeling alsa developer here,
>>
>>After reading a bunch of documentation, it's unclear to me exactly what
>>a period/fragment is used for. Could anyone expand on it a bit to fill
>>me in?
>
>
> there is a hardware buffer. its N frames long. you rarely want to deal
> with the entire buffer at once. its therefore divided into sections of
> a certain length, often (but not always) specified in numbers of
> frames. these sections are called "periods" and typically (but not
> always) the hardware will interrupt the CPU every time it finishes
> dealing with a "period", and you in turn get to deal with it in 1 (or
> more) periods at a time. the number of periods per h/w buffer (or
> alternately, their size) is a hardware parameter; how many periods
> have to have been processed by the h/w before the driver will wake up
> your code to read/write more data is a software parameter.
>
> a "fragment" is an older OSS term for the same concept.
Caution there Paul, your definitions are wrong.
A period in ALSA is exactly the distance (measured in frames or time)
between two consecutive periodic interrupts generated by PCM hardware.
There is no mandatory correlation between buffer size and period for
ALSA (as there is no mandatory correlation in all hardware).
This is fundamentally different from OSS where a fragment sizes are
forced to be buffer_size/K (with an integer K).
This is exactly the reason why I've substituted fragment concept with
period some time ago.
--
Abramo Bagnara mailto:abramo.bagnara@libero.it
Opera Unica Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy
-------------------------------------------------------
This SF.net email is sponsored by: If flattening out C++ or Java
code to make your application fit in a relational database is painful,
don't do it! Check out ObjectStore. Now part of Progress Software.
http://www.objectstore.net/sourceforge
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: periods? fragments?
2003-05-19 8:04 ` Giuliano Pochini
@ 2003-05-19 8:12 ` Jaroslav Kysela
0 siblings, 0 replies; 5+ messages in thread
From: Jaroslav Kysela @ 2003-05-19 8:12 UTC (permalink / raw)
To: Giuliano Pochini; +Cc: David Stuart, alsa-devel@lists.sourceforge.net
On Mon, 19 May 2003, Giuliano Pochini wrote:
>
> On 19-May-2003 David Stuart wrote:
> > Greetings! Fledgeling alsa developer here,
> >
> > After reading a bunch of documentation, it's unclear to me exactly what
> > a period/fragment is used for. Could anyone expand on it a bit to fill
> > me in?
>
> You need an audio buffer to send/receive data from the audio
> chip. The buffer is made of two or more periods.
Note really. One fragment can be used too. In that case, application must
do timing itself (using an external timer).
Jaroslav
-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
-------------------------------------------------------
This SF.net email is sponsored by: If flattening out C++ or Java
code to make your application fit in a relational database is painful,
don't do it! Check out ObjectStore. Now part of Progress Software.
http://www.objectstore.net/sourceforge
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-05-19 8:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-19 3:53 periods? fragments? David Stuart
2003-05-19 4:12 ` Paul Davis
2003-05-19 8:06 ` Abramo Bagnara
2003-05-19 8:04 ` Giuliano Pochini
2003-05-19 8:12 ` Jaroslav Kysela
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.