Appendix: Supported Codecs

This appendix contains the list of supported codecs for the QNX Audio Architecture. A supported codec in these terms is a codec for which QNX Software Systems has produced a Dynamic Linked Library (DLL) to control it.

The currently supported codecs include:

We support a codec only if it's a standardized part with a detailed specification, and it's used in audio platforms of use to us and our customers.

As well as providing analog audio mixer functions, a codec may also provide other callback functions of use to the audio driver, such as Sample Rate Conversion (SRC) or S/PDIF. Handling PCM Audio Data chapter.

To use one of these codecs, call ado_mixer_dll() in your Audio HW DLL's ctrl_init() function. For more information, see Using a standard mixer DLL in the Handling Analog Audio Data chapter.

The sections below indicate what arguments you need to pass to ado_mixer_dll().

Audio Codec 97 (AC97)

DLL name
Pass "ac97" as the mixer_dll argument to ado_mixer_dll().
Header file
<mixer/ac97_dll.h>
Parameter structure
This structure holds pointers to the callback functions that you need to provide for the mixer DLL to call:
typedef
struct  ado_mixer_dll_params_ac97
{
  HW_CONTEXT_T  *hw_context;
  uint16_t      (*read) (HW_CONTEXT_T *hw_context,
                         uint16_t reg);
  void          (*write) (HW_CONTEXT_T *hw_context,
                          uint16_t reg, uint16_t val);
  int32_t       (*init) (HW_CONTEXT_T *hw_context);
  void          (*destroy) (HW_CONTEXT_T *hw_context);
} ado_mixer_dll_params_ac97_t;

The members include:

hw_context
A pointer to a structure that you can use for any context-sensitive data that your driver needs. It's used only as an argument for the function calls.
read()
Read the given ac97 register.
write()
Write the given value into the given ac97 register.
init()
The upper layer of the driver calls this function after the codec has been initialized. Use this callback to make any last-minute adjustments.
destroy()
The upper layer of the driver calls this function just before the DLL terminates. In general, you should use it to undo anything init() did.

Pass a pointer to a ado_mixer_dll_params_ac97_t structure as the params argument to ado_mixer_dll().

Supported device controls
This structure holds pointers to the callback functions, provided by the mixer DLL, that your Audio HW DLL can call to control the device:
enum ac97_SRC
{
  AC97_FRONT_DAC_SRC,
  AC97_SURR_DAC_SRC,
  AC97_LFE_DAC_SRC,
  AC97_LR_ADC_SRC,
};

typedef
struct  ado_mixer_dll_callbacks_ac97
{
  MIXER_CONTEXT_T  *mix_context;
  int32_t          (*SRC_test) (MIXER_CONTEXT_T * mix_context,
                                enum ac97_SRC src,
                                ado_pcm_cap_t * caps);
  int32_t          (*SRC_set) (MIXER_CONTEXT_T * mix_context,
                               enum ac97_SRC src,
                               uint32_t * rate);
}
ado_mixer_dll_callbacks_ac97_t;

The members include:

mix_context
A pointer to a structure that the codec uses for any context-sensitive data that it needs. Use it only as an argument for the function calls defined in this structure.
SRC_test
Checks which sample rates are supported for the src sample rate converter and updates the information in the given ado_pcm_cap_t structure.
SRC_set
Sets the sample rate for the src sample rate converter.

Pass a pointer to a ado_mixer_dll_callbacks_ac97_t structure as the callbacks argument to ado_mixer_dll().

References

AK4531

DLL name
Pass "ak4531" as the mixer_dll argument to ado_mixer_dll() function call.
Header file
<mixer/ak4531_dll.h>
Parameter structure
This structure holds pointers to the callback functions that you need to provide for the mixer DLL to call:
typedef
struct  ado_mixer_dll_params_ak4531
{
  HW_CONTEXT_T  *hw_context;
  void          (*write) (HW_CONTEXT_T *hw_context,
                          uint16_t reg, uint16_t val);
  void          (*destroy) (HW_CONTEXT_T *hw_context);
} ado_mixer_dll_params_ak4531_t;

The members include:

hw_context
A pointer to a structure that you can use for any context-sensitive data that your driver needs. It's used only as an argument for the function calls.
write()
Write the given value into the given ak4531 register.
destroy()
The upper layer of the driver calls this function just before the DLL terminates.

Pass a pointer to a ado_mixer_dll_params_ak4531_t structure as the params argument to ado_mixer_dll().

Supported device controls
None; pass a NULL pointer as the callbacks argument to ado_mixer_dll().
Reference
http://www.akm.com/ProductPages/ak4531.html