h6. [[Hardware Abstraction Layer]] h6(. » [[HAL Device API]] h6((. » [[List of HAL devices]] h6(((. » Sound I/O mixer h2. Sound I/O mixer h5. (HALDeviceAudio_Mixer) h4. Device API 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. <pre> 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 */ }; </pre> _controller_ points to the [[HALDeviceAudio_AudC|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: <pre> 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, }; </pre> 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: <pre> struct mixer_device_channel_state { bool mute: 1; int32_t gain; }; </pre> _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: <pre> 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 */ }; </pre> Throughout the API, gain values are specifed in units of 1/16th of a decibel. h4. Support in RISC OS HALDeviceAudio_Mixer is supported by the HAL branch of the [[SoundControl]] module. h4. Known implementations |_<. 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 | h6. Information sources: Kernel.Hdr.HALDevice, Audio.SoundCtrl.h.MixerDevice in CVS