snd_pcm_channel_read_event()

Get a PCM event

Synopsis:

#include <sys/asoundlib.h>

int snd_pcm_channel_read_event (snd_pcm_t * pcm,
                                int channel, 
                                snd_pcm_event_t * event);

Arguments:

pcm
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 retrieve an event for; SND_PCM_CHANNEL_CAPTURE or SND_PCM_CHANNEL_PLAYBACK.
event
A pointer to a snd_pcm_event_t in which snd_pcm_channel_read_event() retrieve to get information about the event.

Library:

libasound.so

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

Description:

This function retrieves the PCM events (snd_pcm_event_t) for the specified channel. To receive events, the client application must first register for event using snd_pcm_set_filter(). This call is a non-blocking call. Use select() (with excepttfds) or poll (with POLLRDBAND).

Returns:

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

Errors:

-EINVAL
The state of the pcm or event is invalid or the specified channel doesn't exist.
-EGAIN
There weren't any events available. You can call the function again.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Read the Caveats

Caveats:

This function is not thread safe if pcm (snd_pcm_t) is used across multiple threads.