ado_mixer_dll()

Load the specified standard mixer DLL

Synopsis:

#include <audio_driver.h>

int32_t ado_mixer_dll( ado_card_t *card,
                       char *mixer_dll,
                       uint32_t version,
                       void *params,
                       void *callbacks,
                       ado_mixer_t **rmixer );

Arguments:

card
The card argument that io-audio passed to your Audio HW DLL's ctrl_init() function (see the Organization of a Driver chapter).
mixer_dll
The name of the standard mixer DLL.

Note: This argument is only the unique part of the mixer DLL's file name. For example, if the mixer DLL's filename is audio-mixer-ac97.so, you should specify mixer_dll as ac97.

version
The version of the mixer DLL; currently not used.
params
A pointer to configuration information and control functions that the mixer DLL needs and that your Audio HW DLL must provide (for example, to read and write the codec registers). This structure is defined in the header file for the DLL e.g. <mixer/mixer_name_dll.h>

For example, if you're loading the Audio Codec 97 (AC97), set up a structure of type ado_mixer_dll_params_ac97_t and pass a pointer to it as the params argument to this function.

callbacks
A location that ado_mixer_dll() fills in with a list of functions, provided by the mixer DLL, that your Audio HX DLL can use to control special mixer functions, such as sample rate conversion. Consult the documentation for the specific mixer DLL.

For example, if you're loading AC97, create a structure of type ado_mixer_dll_callbacks_ac97_t and pass a pointer to it as the callbacks argument to this function.

rmixer
A location where ado_mixer_dll() can store a pointer to the new mixer structure. The ado_mixer_t structure is opaque to your Audio HW DLL, but you need to pass a pointer to it to the other mixer functions. You typically save this pointer in your Audio HW DLL's hardware context.

Description:

The ado_mixer_dll() function loads the specified standard mixer_dll and returns a pointer to a newly allocated mixer structure.

Returns:

-1 if an error occurred (errno is set). Any other value indicates success.

Errors:

ENOMEM
Not enough free memory to create a new mixer.
ELIBACC
The call to dlopen() failed for the mixer DLL specified.
ELIBBAD
The call to dlsym() failed for the mixer DLL specified.
EPROGMISMATCH
The ADO_MAJOR_VERSION of the mixer DLL doesn't match with io-audio's.

Classification:

QNX Neutrino

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread No

See also:

ctrl_init() in the Organization of a Driver chapter, Writing an analog mixer in the Handling Analog Audio Data chapter, Supported Codecs appendix