[Previous] [Contents] [Next]

snd_pcm_info()

Get general information about the PCM device

Synopsis:

#include <sys/asoundlib.h>

int snd_pcm_info( snd_pcm_t * handle, 
                  snd_pcm_info_t * info );

Library:

libasound.so

Description:

The snd_pcm_info() function fills the info structure with data about the PCM device selected by handle.

typedef struct snd_pcm_info {
    int card;               
    unsigned int device;    
    unsigned int type;      
    unsigned int flags;     
    unsigned char id[64];   
    unsigned char name[80]; 
    int playback;           
    int capture;            
    int shared_card;        
    int shared_device;      
    char reserved[64];    
} snd_pcm_info_t;

where

card
Card number.
device
Device number
type
Soundcard type. The number corresponds to a value in <sys/asoundid.h>.
flags
One of:
SND_PCM_INFO_CAPTURE
Capture channel is present.
SND_PCM_INFO_DUPLEX
Hardware is capable the duplex operation.
SND_PCM_INFO_DUPLEX_RATE
Playback and capture rates must be same for the duplex operation.
SND_PCM_INFO_DUPLEX_MONO
Playback and capture must be monophonic for the duplex operation.
SND_PCM_INFO_PLAYBACK
Playback channel is present.
id[64]
ID of this PCM device (user selectable).
name[80]
Name of the device.
playback
Number of playback subdevices - 1.
capture
Number of capture subdevices - 1
shared_card
Number of shared cards for this PCM device.
shared_device
Number of shared devices for this PCM device.

Returns:

Zero on success, or an error code.

Errors:

-EINVAL
Invalid handle.

Classification:

ALSA

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

[Previous] [Contents] [Next]