[Previous] [Contents] [Next]

snd_pcm_channel_info()

Get information about the PCM direction

Synopsis:

#include <sys/asoundlib.h>

int snd_pcm_channel_info( snd_pcm_t * handle, 
                          snd_pcm_channel_info_t * info );

Library:

libasound.so

Description:

The snd_pcm_channel_info() function fills the info structure with data about the PCM channel selected by handle. The channel member specifies the direction. Other members are read-only.

typedef union snd_pcm_sync
{
    uint8_t     id[16];
    uint16_t    id16[8];
    uint32_t    id32[4];
    uint64_t    id64[2];
}       snd_pcm_sync_t;
typedef struct snd_pcm_digital
{
    uint8_t     dig_status[24];         /* AES/EBU/IEC958 channel status bits */
    uint8_t     dig_subcode[147];       /* AES/EBU/IEC958 subcode bits */
    uint8_t     dig_valid:1;            /* must be non-zero to accept these values */
    uint8_t     dig_subframe[4];        /* AES/EBU/IEC958 subframe bits */
    uint8_t     reserved[128];          /* must be filled with zero */
}       snd_pcm_digital_t;

where:

dig_status[24]
AES/EBU/IEC958 channel status bits.
dig_subcode[147]
AES/EBU/IEC958 subcode bits.
dig_valid: 1
Must be nonzero to accept these values.
dig_subframe[4]
AES/EBU/IEC958 subframe bits.
typedef struct snd_pcm_channel_info
{
    int32_t     subdevice;              
    int8_t      subname[36];            
    int32_t     channel;                
    int32_t     zero1;                  
    int32_t     zero2[4];               
    uint32_t    flags;                  
    uint32_t    formats;                
    uint32_t    rates;                  
    int32_t     min_rate;               
    int32_t     max_rate;               
    int32_t     min_voices;             
    int32_t     max_voices;             
    int32_t     max_buffer_size;        
    int32_t     min_fragment_size;      
    int32_t     max_fragment_size;      
    int32_t     fragment_align;         
    int32_t     fifo_size;              
    int32_t     transfer_block_size;    
    uint8_t     zero3[4];               

    snd_pcm_digital_t dig_mask;         
    uint32_t    zero4;                  
    int32_t     mixer_device;           
    snd_mixer_eid_t mixer_eid;          
    snd_mixer_gid_t mixer_gid;          
    uint8_t     reserved[128];          
}       snd_pcm_channel_info_t;

where:

subdevice
Subdevice number.
subname[32]
Subdevice name.
channel
Channel information.
flags
One of:
SND_PCM_CHNINFO_BLOCK
Hardware supports block mode.
SND_PCM_CHNINFO_BLOCK_TRANSFER
Hardware transfers samples by chunks (for example PCI burst transfers).
SND_PCM_CHNINFO_INTERLEAVE
Hardware accepts interleaved stream samples.
SND_PCM_CHNINFO_MMAP
Hardware supports mmap access.
SND_PCM_CHNINFO_MMAP_VALID
Fragment samples are valid during transfer. It means that the fragment samples may be used when the io member from the mmap control structure snd_pcm_mmap_control_t is set (the fragment is being transferred).
SND_PCM_CHNINFO_NONINTERLEAVE
Hardware accepts non-interleaved stream samples.
SND_PCM_CHNINFO_OVERRANGE
Hardware supports ADC (capture) overrange detection.
SND_PCM_CHNINFO_PAUSE
Hardware supports pause (playback only).
SND_PCM_CHNINFO_STREAM
Hardware supports stream mode.
formats
Supported formats.
rates
Hardware rates.
min_rate
Minimum rate (in Hz).
max_rate
Maximum rate (in Hz).
min_voices
Minimum voices (probably always 1).
max_voices
Maximum voices.
max_buffer_size
Maximum buffer size in bytes.
min_fragment_size
Minimum fragment size in bytes.
max_fragment_size
Maximum fragment size in bytes.
fragment_align
Align fragment value.
fifo_size
Stream FIFO size in bytes.
transfer_block_size
Bus transfer block size in bytes.
dig_mask
AES/EBU/IEC958 supported bits, zero = no AES/EBU/IEC958.
mixer_device
Mixer device for this channel.
mixer_eid
Mixer element identification for this channel.
mixer_gid
Mixer group identification for this channel.

Returns:

Zero on success, or an error code.

Errors:

-EINVAL
Invalid handle.

Examples:

See the example in Configuring the Audio channel in the Playing Audio Data chapter. This call is identical to the snd_pcm_plugin_info() call.

Classification:

ALSA

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

snd_pcm_plugin_info()


[Previous] [Contents] [Next]