snd_pcm_query_channel_map()

Retrieve a playback or capture channel

Synopsis:

#include <sys/asoundlib.h>

int snd_pcm_query_channel_map(snd_pcm_t       *pcm,
                              snd_pcm_chmap_t *map);

Since:

BlackBerry 10.3.0

Arguments:

pcm
The handle that is returned after a call to snd_pcm_open_* functions.
map
A pointer to an array which contains a map containing the playback or capture channels.

Library:

libasound.so

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

Description:

This function retrieves a map of speakers for microphones based on whether it's a playback or capture channel. When this function successfully returns, the map array contains a map of speakers. If you don't specify an array that's large enough to store the number of channels in map.pos, the function returns with ENOMEM. When the function returns with ENOMEM, map.channels is updated with the minimum size of array that is required for map.pos.

If you want to determine the correct size for the array, you can call this function the first time, to determine the array size to allocate for map.pos. Then, call the function a second time to retrieve the PCM channels.
Note: In general, a size of four works for most BlackBerry devices because there are at most four microphones and three speakers on any device.

Returns:

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

Errors:

The following list contains the relevant values that are returned:
ENOMEM
Indicates that there are more channels available than what you had specified in map.channels

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.