Get the current PCM setup
#include <sys/asoundlib.h>
int snd_pcm_channel_setup(
snd_pcm_t * handle,
snd_pcm_channel_setup_t * setup );
libasound.so
The snd_pcm_channel_setup() function fills the setup structure with data about the PCM channel settings selected by handle. The channel member specifies the direction. Other members are read-only.
typedef struct snd_pcm_channel_setup
{
int32_t channel;
int32_t mode;
snd_pcm_format_t format;
snd_pcm_digital_t digital;
union
{
struct
{
int32_t queue_size;
uint8_t reserved[124]; /* must be filled with zero */
} stream;
struct
{
int32_t frag_size;
int32_t frags;
int32_t frags_min;
int32_t frags_max;
uint8_t reserved[128]; /* must be filled with zero */
} block;
uint8_t reserved[128]; /* must be filled with zero */
} buf;
int16_t msbits_per_sample;
int16_t pad1;
int32_t mixer_device; /* mixer device */
snd_mixer_eid_t *mixer_eid; /* pcm source mixer element */
snd_mixer_gid_t *mixer_gid; /* lowest level mixer group subchn specific */
uint8_t reserved[112]; /* must be filled with zero */
} snd_pcm_channel_setup_t;
where:
Zero on success, or an error code.
See the example in Configuring the Audio channel in the Playing Audio Data chapter This call is used identically to snd_pcm_plugin_setup().
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |