periods? fragments?
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
Quoted 5 lines
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
Paul Davis ha scritto:
Quoted 16 lines
Quoted 3 lines
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.
Quoted 1 line
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.
Signature · 12 lines
Abramo Bagnara mailto:[email protected] 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
Quoted 5 lines · 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
Quoted 10 lines · Giuliano Pochini
Quoted 5 lines · 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 <[email protected]>
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