Home > OS >  With alsa buffer concept of how to understand?
With alsa buffer concept of how to understand?

Time:10-24

Are using with alsa development, reviewed the relevant information online, found on different versions of the buffer with alsa online!

Main confusion is at the bottom of the ring buffer how to understand?

Question 1: use snd_pcm_hw_params_set_buffer_size function setting buffer, I understand that is set to the underlying buffer size?

Question 2: at the bottom of the ring buffer in where? On the hardware sound card or driver in memory? Still exist in hardware sound CARDS and memory buffer?

Question 3: how is the audio stream data flow between the buffer?

My current understanding is the (only), assuming that exist in the hardware sound card and memory buffer, are: the upper user space snd_pcm_writei function are used to convert the data into the underlying drive maintenance of buffer, the DMA buffer data in handling the drives to sound card ring buffer,

Because it is assumption, the understanding of the in the mind is not steadfast, hope have related to the great god, thank you very much!

CodePudding user response:

There are three buffer, a LIB library user space, the kernel layer with ALSA driver has a ring, have a sound card, the user space and sound don't care, mainly is the kernel layer,
1. Setup is driven buffer;
2. The ring buffer in with ALSA driver, concrete is in the PLATFORM with ALSA driver drive the DMA driver;
3. The application layer according to the frame to the DMA ring buffer, start, DMA transfer data automatically to the sound card, a frame done an interrupt, again the next frame address and length is set to the DMA, continue to transmit,
Generally this is the case,
  • Related