snd_pcm_set_apx_data()

Set data within the acoustic library in an APX module

Synopsis:

#include <sys/asoundlib.h>

int snd_pcm_set_apx_data( snd_pcm_t *pcm,
                          uint32_t apx_id,
                          snd_pcm_apx_param_t *param,
                          const void *data );

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().
apx_id
The ID of the APX module you want to access.
param
The library parameter information and the size of the data to set.
data
A pointer to the location of the data to set.

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_data() function retrieves data from the acoustic library in an APX, as specified in the snd_pcm_apx_param_t structure that param points to. For information on snd_pcm_apx_param_t, see snd_pcm_get_apx_data().

This API should not be used to set the external or user volume in the library because the change will not be reflected in the structures io-audio uses to automatically calculate these values and the change will be overwritten. Instead, use snd_pcm_set_apx_external_volume() and snd_pcm_set_apx_user_volume().

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

Returns:

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

Note: You should check both the return value of snd_pcm_get_apx_data() and the status member of snd_pcm_apx_param_t to determine if a call is successful.

This function can also return the return values of devctl() (see devctl() in the QNX Neutrino C Library Reference).

Errors:

EINVAL

One of the following causes:

  • The handle pcm is not opened.
  • The value of apx_id is not valid.
  • The value of pcm or data is NULL.
ENOMEM
Not enough memory was available to copy the buffer.
ENODEV
The APX module specified by apx_id is not configured.

Classification:

QNX Neutrino

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

Caveats:

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