snd_ctl_read()

Updated: April 19, 2023

Read pending control events

Synopsis:

#include <sys/asoundlib.h>

int snd_ctl_read( snd_ctl_t *handle, 
                  snd_ctl_callbacks_t *callbacks );

Arguments:

handle
The handle for the control connection to the card. This must be a handle created by snd_ctl_open().
callbacks
A pointer to a snd_ctl_callbacks_t structure that defines the callbacks for the events.

Library:

libasound.so

Use the -l asound option with qcc to link against this library.

Description:

The snd_ctl_read() function reads pending control events from the control handle. As each event is read, the list of callbacks is checked for a handler for this event. If a match is found, the callback is invoked. This function is usually called on the return of the select() library call (see the QNX Neutrino C Library Reference).

By default, events are disabled and an application must enable them using snd_ctl_set_filter(). Use snd_ctl_set_filter() and snd_ctl_get_filter() to tell io-audio which events you are interested in monitoring, handling, or both.

Returns:

The number of events read from the handle, or a negative value on error.

Errors:

-EBADF
Invalid file descriptor. Your handle may be corrupt.
-EINTR
The read operation was interrupted by a signal, and either no data was transferred, or the resource manager responsible for that file doesn't report partial transfers.
-EIO
An event I/O error occurred.

Classification:

QNX Neutrino

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