Showing changes from revision #5 to #6:
Added | Removed | Changed
This documentation is for versions of the API with a major version number of 0. Currently, 0 is the only major version number which has been 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); void (*GetMixLimits)(struct mixer_device *, uint32_t channel, struct mixer_device_channel_limits *); /* API 0.1 extension */ };
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; /* True if the settings cannot be changed */ bool mono: 1; /* True if mono, false if stereo */ bool default_mute: 1; /* True if the channel should be muted by default */ 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, };
It is valid for multiple channels to belong to the same category. However the mixer must order the channels so that any channels which belong to the same category are numbered consecutively.
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; };
GetMixLimits was introduced in API version 0.1. Any device with version number 0.1 or above is required to implement it. It allows the device to return information about the gain limits of each mixer channel, via the mixer_device_channel_limits structure:
struct mixer_device_channel_limits { int32_t mingain; /* Minimum supported gain */ int32_t maxgain; /* Maximum supported gain */ int32_t step; /* Smallest step/granularity of setting */ };
Throughout the API, gain values are specifed in units of 1/16th of a decibel.
HALDeviceAudio_Mixer is supported by the HAL branch of the SoundCtrl?SoundControl module.
Device ID | Description | Implemented in |
---|---|---|
HALDeviceID_Mixer_STAC9750 | SigmaTel STAC9750 audio codec | HAL.Tungsten.s.Audio |
HALDeviceID_Mixer_TPS65950 | TPS65950-compatible audio mixer | HAL.OMAP3.s.Audio |
HALDeviceID_Mixer_TWL6040 | TWL6040-compatible audio mixer | HAL.OMAP4.s.Audio |
HALDeviceID_Mixer_VCHIQ | VCHIQ audio service mixer | HWSupport.Sound.BCMSound.s.Module |