snd_pcm_set_apx_external_volume()

Load volume controls external to io-audio

Synopsis:

#include <sys/asoundlib.h>

int snd_pcm_set_apx_external_volume( snd_pcm_t *pcm,
                                     int nVoices,
                                     int16_t *vol_mB );

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().
nVoices
The number of voices that is inside the vol_mB buffer. Can be -1 to set all voices to one value. If nVoices is greater than 1, it is assumed that the volume parameter provided is an array of size nVoices (i.e., that specifies a separate volume for each channel).
vol_mB
A pointer to an array of volumes in millibels (mB).

Library:

libasound.so

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

Description:

Note: This function can only be used if you have QNX Acoustic Management Platform 3.0 installed.

The snd_pcm_set_apx_external_volume() function allows clients to let an APX module know about volume controls that are external to io-audio (e.g., an external amplifier).

The nVoices and vol_mB arguments allow you to specify an array for cases where there are differences among channels. The external volume is used in SPM's speaker protection as well as SFO's default user volume calculation (when it is not overriden).

Because this function is only used with acoustic (SFO, SPM) APX modules, it must be called on the playback PCM device.

Returns:

EOK on success, or a negative errno value if an error occurred.

This function can also return the negative values that ioctl() can assign to errno (see ioctl() in the QNX Neutrino C Library Reference).

Errors:

EINVAL

One of the following causes:

  • The handle pcm is not opened.
  • The value of pcm or vol_mB is NULL.
  • The software mixer is not set up on the pcm device.
ENODEV
No APX module is configured.

Classification:

QNX Neutrino

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