ado_pcm_sw_mix()

Provide a mechanism for an audio chip to support multiple simultaneous streams

Synopsis:

#include <audio_driver.h>

int32_t ado_pcm_sw_mix ( ado_card_t *card,
                         ado_pcm_t *pcm,
                         ado_mixer_t *mixer );

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).
pcm
The PCM device the software mixer is built on. This is a pointer to the ado_pcm_t structure created for the PCM device when you called ado_pcm_create().
mixer
The mixer in which to create the subchannel mixer groups.

Description:

The ado_pcm_sw_mix() function provides a mechanism whereby an audio chip that supports only one hardware PCM subchannel can support multiple simultaneous streams.


Note: The number of streams supported is a function of the io-audio architecture and your driver can't change it.

This function uses CPU power to mix the multiple streams together into one stream that it then sends to the PCM device.

The software mixer is implemented by creating a new PCM device attached to the card and creating the mixer controls for the new subchannel in the mixer specified.

The hardware subchannel is acquired only when the software mixer needs it, so it's possible for applications to open the hardware device directly, although this then prevents the software mixer from accepting a stream because the real hardware device is already in use.

Currently, software mixing is supported only on the playback channel of the PCM device.

Returns:

Zero on success, or -1 if an error occurred.

Classification:

QNX Neutrino

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