snd_pcm_set_filter()

Enable or disable the generation of PCM events

Synopsis:

#include <sys/asoundlib.h>

int snd_pcm_set_filter(snd_pcm_t *handle,
                       int channel,
                       const snd_pcm_filter_t * filter)

Arguments:

handle
The handle for the PCM device, which you must have opened by calling snd_pcm_open_name(), snd_pcm_open(), or snd_pcm_open_preferred().
channel
The channel to use. SND_PCM_CHANNEL_CAPTURE or SND_PCM_CHANNEL_PLAYBACK.
filter
A const pointer to a snd_pcm_filter_t structure that defines a mask of events to track.

Library:

libasound.so

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

Description:

The snd_pcm_set_filter() function uses the snd_pcm_filter_t structure to set the mask of all PCM events for the channel that the handle was opened on. Only those events that are specified in the mask are tracked; all others are discarded as they occur.

You can arrange to have your application receive notification when an event occurs by calling select() on the channel. You can use snd_pcm_channel_read_event() to read the event's data.

Returns:

EOK on success, a negative errno upon failure. The errno values are available in the errno.h file.

Errors:

-EINVAL
Invalid handle or filter is NULL.

Classification:

QNX Neutrino

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