RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

HALDeviceAudio_Mixer (changes)

Showing changes from revision #5 to #6: Added | Removed | Changed

Hardware Abstraction Layer
» HAL Device API
» List of HAL devices
» Sound I/O mixer

Sound I/O mixer

(HALDeviceAudio_Mixer)

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.

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.

Support in RISC OS

HALDeviceAudio_Mixer is supported by the HAL branch of the SoundCtrl?SoundControl module.

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
Information sources: Kernel.Hdr.HALDevice, Audio.SoundCtrl.h.MixerDevice in CVS
Revised on March 31, 2014 13:56:04 by Jeffrey Lee (213) (195.72.173.131)
Edit | Back in time (5 revisions) | Hide changes | History | Views: Print | Source | Linked from: HALDeviceAudio_AudC, OMAP3 HAL, List of HAL devices

Search the Wiki

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys