Retrieve data from the acoustic library in an AFM


#include <sys/asoundlib.h>

int snd_afm_get_ap_data( snd_afm_t *handle,
                         snd_afm_ap_param_t *param,
                         void *data );


The handle for the AFM device, which you must have opened by calling snd_afm_open_name() or snd_afm_open().
A pointer to a snd_afm_ap_param_t structure that specifies the library parameter information and the size of the data buffer.
NULL, or a pointer to the location where the function can store the retrieved data.



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


(QNX Software Development Platform 6.6 io-audio patch [patch ID 4687] or later) The snd_afm_get_ap_data() function retrieves data from the acoustic library in an AFM, as specified in the snd_afm_ap_param_t structure that param points to:

typedef struct snd_afm_ap_param {
    uint32_t size;
    uint32_t dataId;
    int32_t  channel;
    int32_t  status;
} snd_afm_ap_param_t;

This structure includes the following members:

The size of the buffer that data points to. On return, this member is updated with the actual size of the retrieved data.
The identifier for the parameter whose value you want to get. Each AFM has its own set of IDs; see the AFM's <qwa_afmdefs.h> header file (e.g., <qwa_icc_defs.h>). The comments for each parameter indicate the data type and when it's valid to get and set the parameter.
The channel identifier, which is applicable only for selected channel-based parameters (see the AFM's documentation). The channel number is zero-based and should be from 0 to one less than the maximum number of channels valid for the specified parameter.
The return code from the library; one of the QWA_* codes defined in <qwa_err.h>.

If you specify NULL for data, no data is returned, but the size member is set to the minimum size required for the data buffer.

This function is applicable only to acoustic (asd, icc, voice) AFMs. For more information about getting and setting parameters, see the documentation for the specific AFM.


EOK if the request was successfully issued to the library and a response was returned, or a negative errno value if an error occurred.

Note: You should check both the function's return value and the status member of the snd_afm_ap_param_t structure to determine if a call is successful.


The value of handle or param is NULL.


QNX Neutrino

Cancellation point No
Interrupt handler No
Signal handler No
Thread No