Currently, only API version 0 is defined.
struct mixer_device { struct device device; struct device *controller; uint32_t nchannels; struct mixer_device_channel_features (*GetFeatures)(struct mixer_device *, uint32_t channel); void (*SetMix)(struct mixer_device *, uint32_t channel, struct mixer_device_channel_state state); __value_in_regs struct mixer_device_channel_state (*GetMix)(struct mixer_device *, uint32_t channel); };
controller points to the audio device associated with this mixer. nchannels contains the number of audio channels supported by the mixer.
The GetFeatures entry point is used to read the features of the indicated channel:
struct mixer_device_channel_features { bool fixed: 1; bool mono: 1; bool default_mute: 1; unsigned : 13; signed category: 16; }; enum { mixer_CATEGORY_SPEAKER = -1, mixer_CATEGORY_HEADPHONES = -2, mixer_CATEGORY_LINE_OUT = -3, mixer_CATEGORY_AUX_OUT = -4, mixer_CATEGORY_SYSTEM = 0, mixer_CATEGORY_MIC = 1, mixer_CATEGORY_LINE_IN = 2, mixer_CATEGORY_AUX_IN = 3, };
SetMix and GetMix are used to update the state of each channel, using the _mixer_device_channel_state structure:
struct mixer_device_channel_state { bool mute: 1; int32_t gain; };
HALDeviceAudio_Mixer is supported by the HAL branch of the SoundCtrl module.
Device ID | Description | Implemented in |
---|---|---|
HALDevice_Mixer_STAC9750 | SigmaTel STAC9750 audio codec | HAL.Tungsten.s.Audio |