snd_pcm_load_apx_dataset()

Updated: May 06, 2022

Load an acoustic processing dataset into a running APX module

Synopsis:

#include <sys/asoundlib.h>

int snd_pcm_load_apx_dataset( snd_pcm_t *pcm,
                              uint32_t apx_id,
                              const char *dataset,
                              int *ap_status );

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.
dataset
The name of the dataset to load.
ap_status
A pointer to the location to store the acoustic library return code.

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_load_apx_dataset() function loads an acoustic processing data set into a running APX. A .conf key apx_dataset_qcf_dataset-name is created to look up the acoustic data set filepath, where apx is the type of APX module and dataset-name is the string specified by the dataset argument. For example, for SFO and a dataset name foo: sfo_dataset_qcf_foo.

An error is returned if the data set file can't be found; otherwise, the name of the data set is stored and one of the following actions is taken:
  • If the APX module is running, the data set is loaded immediately. The library return code is returned in the ap_status argument. An application should check both the return value of snd_pcm_load_apx_dataset() and the ap_status argument to determine if a call is successful.
  • If the APX module isn't running, the data set is loaded when the APX starts, after the library is initialized with the qcf configuration file for the specified mode, but before processing starts. If an error occurs when loading the data set, the APX continues to run.

After it is set, the data set is loaded each time the APX module is started until a new data set is applied.

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 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, dataset, or ap_status is NULL.
ENOMEM
Not enough memory to copy the data set string was available.
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.