Retrieve data from 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,
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 to store the retrieved data. If data is NULL,
the size member of param is still updated with the minimum size
required for the data buffer.
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_get_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:
typedef struct snd_pcm_apx_param {
uint32_t size;
uint32_t dataId;
int32_t channel;
int32_t status;
} snd_pcm_apx_param_t;
This structure includes the following members:
- size
- The size of the buffer that the data argument points to for
snd_pcm_set_apx_data() and
snd_pcm_get_apx_data(). For
snd_pcm_get_apx_data(), the data argument can be
NULL. On return, the size member is updated with the actual size of
the retrieved data.
- dataId
- The identifier for the parameter whose value you want to access.
- channel
- The channel identifier. Used only for selected channel-based parameters. 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.
- status
- The return code from the library; one of the QWA_* codes defined in
qwa_err.h.
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
- The handle pcm is not opened, the value of param is
NULL, or apx_id is invalid.
- 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.