Skip to contentSkip to conversation

Buffer management in ALSA

DISCUSSION Aggarwal, Anuj 2 participants 2 messages Mar 19, 2008 – Mar 20, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi All,

Can anyone throw some light on the buffer management part in the ALSA framework? How and where it is implemented? And what is expected from the driver, which is hooking its code to the framework?

Thanks in advance,
Anuj Aggarwal

#2 lore raw
Quoted 5 lines · Anuj

Hi All,

Can anyone throw some light on the buffer management part in the ALSA framework? How and where it is implemented? And what is expected from the driver, which is hooking its code to the framework?

Since each card has different requirements the driver has to manage its buffers. Usually the driver has just to set up the buffer and the scatter-gather list and then ALSA accesses it with no other support from the driver. The buffer is supposed di be a "ring", ie. when the card reaches the end of the buffer, it restarts automatically from the beginning. If the cards needs the CPU to copy or process the data (e.g. it doesn't support DMA), then the driver has to provide a callback function which will be called at the end of each period.

--
Giuliano.