snd_afm_set_audio_mode()
Set the audio mode used to tune acoustic processing parameters
Synopsis:
#include <sys/asoundlib.h>
int snd_afm_set_audio_mode( snd_afm_t *handle,
const char *mode );
Arguments:
- handle
- The handle for the AFM device, which you must have opened by calling snd_afm_open_name() or snd_afm_open().
- mode
- A string containing the mode.
Library:
libasound
Use the -l asound option with qcc to link against this library.
Description:
The snd_afm_set_audio_mode() function sets the audio mode that's used to tune acoustic processing parameters.
The mode string is appended to ap_qcf_ to create a .conf key used to look up the acoustic tuning file path. Passing an empty string sets the mode back to default. An error is returned and the mode remains unchanged if the key can't be found in the .conf or if the associated path can't be found in the filesystem.
You should call snd_afm_set_audio_mode() only when the AFM is stopped or idle.
Returns:
EOK on success, or a negative errno value upon failure.
This function can also return the return values of devctl() (see devctl() in the QNX Neutrino C Library Reference).
Errors:
- -EINVAL
- The value of handle or mode is NULL.
- -ENOENT
- The ap_qcf_* key doesn't exist in the configuration file.
- -ENOTSUP
- The AFM doesn't support setting the audio mode.
Classification:
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |
Caveats:
This function is not thread safe if the handle (snd_afm_t) is used across multiple threads.
