snd_afm_open_name()

Updated: April 19, 2023

Create a handle and open a connection to an AMP functional module specified by name

Synopsis:

#include <sys/asoundlib.h>

int snd_afm_open_name( snd_afm_t **handle, 
                       char *filename );

Arguments:

handle
A pointer to a location where snd_afm_open_name() can store a handle for the AMP functional module. You'll need this handle when you call the other snd_afm_* functions.
filename
The name of the AFM to open. Can be one of the following names (all found under /dev/snd):
  • a symbolic name (for example, voice, or a name specified by the sym_name key in the audio configuration file).
  • a system-assigned name in the form afmCxDy, where x is the card number, and y is the device number.

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_afm_open_name() function creates a handle and opens a connection to the named AMP Functional Module (AFM). AFMs are installed in /dev/snd and their names are in the form afmCxDy, where x is the card number, and y is the device number. The card number depends on the order in which the cards are specified in the io-audio .conf file.

Each AFM also has a symbolic name associated with it (e.g., icc, voice, asd, and csa). You can use the sym_name key in the audio configuration file to add a symbolic name (which is useful if your configuration has multiple AFMs of the same type).

Using names for AFMs (snd_afm_open_name()) is preferred to using numbers (snd_afm_open()).

Returns:

EOK on success, or a negative errno upon failure. The errno values are available in the errno.h file.

This function can also return the negative of the values that open() can assign to errno (see open() in the QNX Neutrino C Library Reference).

Errors:

-EINVAL
The filename is NULL or an empty string.
-ENOMEM
There wasn't enough memory to allocate control structures.
-SND_ERROR_INCOMPATIBLE_VERSION
The audio driver version is incompatible with the client library that the application is using.

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_afm_t) is used across multiple threads.