snd_pcm_channel_status

Name

snd_pcm_channel_status -- obtain current PCM run-time status

Synopsis

int snd_pcm_channel_status(snd_pcm_t *handle, snd_pcm_channel_status_t *status);

Description

Fills the status structure with data about the PCM channel run-time status selected by handle. The channel member specifies the direction. Other members are read-only. Function returns zero if successful, otherwise it returns an error code.

typedef struct snd_pcm_channel_status {
        int channel;                    /* channel information */
        int mode;                       /* transfer mode */
        int status;                     /* channel status - SND_PCM_STATUS_XXXX */
        unsigned int scount;            /* number of bytes processed from playback/capture start */
        struct timeval stime;           /* time when playback/capture was started */
        long long ust_stime;            /* UST time when playback/capture was started */
        int frag;                       /* current fragment */
        int count;                      /* number of bytes in queue/buffer */
        int free;                       /* bytes in queue still free */
        int underrun;                   /* count of underruns (playback) from last status */
        int overrun;                    /* count of overruns (capture) from last status */
        int overrange;                  /* count of ADC (capture) overrange detections from last status */
        char reserved[64];              /* must be filled with zero */
} snd_pcm_channel_status_t;

MemberDescription
channelSpecifies channel (direction). Can be SND_PCM_CHANNEL_PLAYBACK or SND_PCM_CHANNEL_CAPTURE.
modeShows channel mode. Can be SND_PCM_MODE_STREAM or SND_PCM_MODE_BLOCK.
statusShows channel status. See to SND_PCM_STATUS_* constants.
scountShows the count of processed bytes from start of transfer. This value is clipped when reaches the SND_PCM_BOUNDARY value.
stimeShows the start time in gettimeofday format. This member is valid only when the time flags was active in the snd_pcm_channel_params_t structure.
ust_stimeShows the start time in UST format. This member is valid only when the ust_time flags was active in the snd_pcm_channel_params_t structure.
fragShows the current fragment number (available only in the block mode).
countCount of bytes in queue.
freeBytes in queue still free.
underrunCount of playback underruns from last status.
overrunCount of capture overruns from last status.
overrangeCount of capture overrange detections from last status.