snd_pcm_plugin_find_stereo_pair_from_map()

Determine the best speakers or microphones to produce a mono signal based on various conditions

Synopsis:

#include <sys/asoundlib.h>

int snd_pcm_plugin_find_stereo_pair_from_map(int                 direction, 
                                             int                 hand_occlusion,
                                             int                 angle, 
                                             unsigned int        pos,
                                             unsigned int        hw_channels,
                                             const unsigned int *hw_channel_map,
                                             unsigned int        avoid_channels,
                                             const unsigned int *avoid_channel_map);

Since:

BlackBerry 10.3.0

Arguments:

direction
The direction the sound is coming from relative to the device. You can specify SND_PCM_CHANNEL_PLAYBACK to that sound is coming out of the device (speaker) or SND_PCM_CHANNEL_CAPTURE to indicate that sound is going into the device (microphone).
hand_occlusion
Whether the sound is restricted in some manner by the user's hand, which can cause a reduction in the volume or a reduction in the distinction of sound.
angle
The clockwise orientation of the device, in degrees. For example, specify 90 when the top of the device is physically to the right.
pos
An array that stores the location the speakers that produce the best mono signal on the device.
hw_channels
The number of hardware channels available for the device.
hw_channel_map
A pointer to an array of channels.
avoid_channels
The number of channels that should be avoided because the audio quality is not good because of occlusion.
avoid_channel_map
The map of channels to avoid because the audio quality is not good because of occlusion.

Library:

libasound.so

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

Description:

To determine the best microphones or speakers to use, an average of the input from the microphones is taken. The system tries to pick microphones that are near the center of the device or an equal distance from the center. If microphones are requested, microphones that are near speakers are avoided. As part of a separate selection process, speakers or microphones that are near a user's hand are avoided.

Returns:

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

Classification:

QNX Neutrino

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