|
Sound Open Firmware
|
Audio stream is a circular buffer aware of audio format of the data in the buffer so provides API for reading and writing not only bytes, but also samples and frames. More...
#include <audio_stream.h>
Data Fields | |
| uint32_t | size |
| Runtime buffer size in bytes (period multiple). | |
| uint32_t | avail |
| Available bytes for reading. | |
| uint32_t | free |
| Free bytes for writing. | |
| void * | w_ptr |
| Buffer write pointer. | |
| void * | r_ptr |
| Buffer read position. | |
| void * | addr |
| Buffer base address. | |
| void * | end_addr |
| Buffer end address. | |
| uint8_t | byte_align_req |
| uint8_t | frame_align_req |
| struct sof_audio_stream_params | runtime_stream_params |
Audio stream is a circular buffer aware of audio format of the data in the buffer so provides API for reading and writing not only bytes, but also samples and frames.
Audio stream does not perform any memory allocations. A client (a component buffer or dma) must allocate the memory for the underlying data buffer and provide it to the initialization routine.
Once the client is done with reading/writing the data, it must commit the consumption/production and update the buffer state by calling audio_stream_consume()/audio_stream_produce() (just a single call following series of reads/writes).
| void* audio_stream::addr |
Buffer base address.
| uint32_t audio_stream::avail |
Available bytes for reading.
| uint8_t audio_stream::byte_align_req |
| void* audio_stream::end_addr |
Buffer end address.
| uint8_t audio_stream::frame_align_req |
| uint32_t audio_stream::free |
Free bytes for writing.
| void* audio_stream::r_ptr |
Buffer read position.
| struct sof_audio_stream_params audio_stream::runtime_stream_params |
| uint32_t audio_stream::size |
Runtime buffer size in bytes (period multiple).
| void* audio_stream::w_ptr |
Buffer write pointer.