Updated: May 06, 2022

Create a handle and open a connection to a specified AMP Functional Module (AFM)


#include <sys/asoundlib.h>

int snd_afm_open( snd_afm_t **handle, 
                  int card, 
                  int device );


A pointer to a location where snd_afm_open() stores a handle for the AFM
The card number.
The audio device number.


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


Note: This function can only be used if you have QNX Acoustic Management Platform 3.0 installed.

The snd_afm_open() function creates a handle and opens a connection to the Acoustics Management Platform (AMP) Functional Module (AFM) for sound card number card and audio device number device. 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.

There are no defaults; your application must specify all the arguments to this function.

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


Zero on success, or a negative error code.

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).


The card number or the device number is invalid.
There wasn't enough memory to allocate control structures.
The audio driver version is incompatible with the client library that the application is using.


QNX Neutrino

Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes


This function is not thread safe if the handle (snd_afm_t) is used across multiple threads.