Data structure that describes the configuration of a PCM subchannel
struct ado_pcm_config { snd_pcm_format_t format; union { struct { int32_t frag_size; int32_t frags_min; int32_t frags_max; int32_t frags_total; ado_pcm_mmap_t mmap; } block; } mode; ado_pcm_dmabuf_t dmabuf; int32_t mixer_device; /* mixer device */ snd_mixer_eid_t mixer_eid; /* pcm subchn source element */ snd_mixer_gid_t mixer_gid; /* lowest-level mixer group subchn specific */ };
This structure is passed to the aquire, prepare, and trigger device PCM callback functions, and defines how the PCM subchannel is to be configured. For more information about these callbacks, see ado_pcm_hw_t.
The members are:
typedef struct snd_pcm_format { int32_t interleave:1; int32_t format; int32_t rate; int32_t voices; int32_t special; uint8_t reserved[124]; } snd_pcm_format_t;
In most cases, the DMA buffer allocated in the aquire callback is frags_total × frag_size in length. But if the hardware has special requirements such that frag_size must be changed, the other members are there to help you select the best buffer size.
struct ado_pcm_dmabuf { uint8_t *addr; off64_t phys_addr; size_t size; int8_t name[QNX_SHM_NAME_LEN]; };
QNX Neutrino