Skip to content

feat: add per-input volume control and fader level to audiomixer (#396)#399

Open
Ulrond wants to merge 1 commit intodevelopfrom
feature/396-audiomixer-per-input-volume
Open

feat: add per-input volume control and fader level to audiomixer (#396)#399
Ulrond wants to merge 1 commit intodevelopfrom
feature/396-audiomixer-per-input-volume

Conversation

@Ulrond
Copy link
Copy Markdown
Collaborator

@Ulrond Ulrond commented Apr 7, 2026

Summary

Adds two mechanisms for per-input audio level control on the AudioMixer, addressing gaps identified from the dsAudio.h gap analysis (raised by @BatthalaH).

Per-input volume methods (IAudioMixerController)

  • setInputVolume(int inputIndex, int volume) — set volume (0-100) for a specific mixer input
  • getInputVolume(int inputIndex) — query current volume for an input

Covers: TTS attenuation, system sound levels, audio description level adjustment.

Fader property (Property.aidl)

  • Property.FADER_LEVEL = 5 — main/associated audio balance (0=main only, 50=equal, 100=assoc only)

Platform-dependent — must be declared in hfp-audiomixer.yaml. Reference HFP updated for mixer instance 0.

Files changed

  • IAudioMixerController.aidl — added setInputVolume() and getInputVolume() methods
  • Property.aidl — added FADER_LEVEL property
  • hfp-audiomixer.yaml — added FADER_LEVEL to mixer 0 supported properties

Closes #396

See also: discussion #398 (output port lifecycle rationale)

@github-project-automation github-project-automation bot moved this to Architecture Review Required in halif_aidl Apr 7, 2026
Copilot AI review requested due to automatic review settings April 7, 2026 22:14
@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: 39de011
Report detail: https://gist.github.com/rdkcmf-jenkins/272d0c42a9f472af17e76bac1982e698'

@Ulrond Ulrond requested review from a team and abmpatel and removed request for a team April 7, 2026 22:17
@Ulrond Ulrond self-assigned this Apr 7, 2026
@Ulrond Ulrond added the component:audiomixer SOC component: audiomixer label Apr 7, 2026
@Ulrond Ulrond added this to the 0.15.0 milestone Apr 7, 2026
@Ulrond Ulrond moved this from Architecture Review Required to Review Requested in halif_aidl Apr 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds missing per-input audio level controls to the AudioMixer HAL AIDL surface (per dsAudio.h gap analysis), plus a new mixer-level fader property intended for main/associated balance (e.g., audio description).

Changes:

  • Added setInputVolume() / getInputVolume() to IAudioMixerController for per-input volume (0–100).
  • Added Property.FADER_LEVEL (0–100) to represent main vs associated balance.
  • Updated hfp-audiomixer.yaml reference profile to declare FADER_LEVEL support for mixer resource id: 0.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
audiomixer/current/com/rdk/hal/audiomixer/IAudioMixerController.aidl Adds per-input volume setter/getter methods with AIDL doc/comments.
audiomixer/current/com/rdk/hal/audiomixer/Property.aidl Introduces new FADER_LEVEL mixer property with documentation.
audiomixer/current/hfp-audiomixer.yaml Declares FADER_LEVEL in mixer 0 supported properties list.

Comment on lines +106 to +107
* in the HAL Feature Profile (hfp-audiomixer.yaml). Middleware must
* query capabilities before using this property.
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc says “Middleware must query capabilities before using this property”, but IAudioMixer.getCapabilities() returns Capabilities which currently doesn’t include any field that advertises supported mixer-level Property keys. This makes the guidance ambiguous/misleading for API consumers. Please clarify the wording (e.g., refer explicitly to the HFP supportedProperties list) or expose supported mixer properties via the AIDL capabilities so clients can actually query them at runtime.

Suggested change
* in the HAL Feature Profile (hfp-audiomixer.yaml). Middleware must
* query capabilities before using this property.
* in the HAL Feature Profile (hfp-audiomixer.yaml), for example via the
* HFP supportedProperties list. Middleware must verify that this property
* is declared there before using it, as mixer property support is not
* currently advertised through the AIDL Capabilities object.

Copilot uses AI. Check for mistakes.
Comment on lines +122 to +125
* @brief Sets the volume level for a specific mixer input.
* @details Allows per-input attenuation for use cases such as TTS overlay,
* system sound mixing, or audio description level adjustment.
*
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New documentation adds an @details tag. Per the project’s AIDL/Doxygen conventions, @details should be avoided (detailed text should follow @brief without a tag). Please remove @details here and keep the detailed description as plain comment text under @brief.

Copilot uses AI. Check for mistakes.
* @param[in] inputIndex Mixer input index (0-based, matching Capabilities.inputs).
* @param[in] volume Volume level in range 0..100 (0 = silent, 100 = full).
*
* @returns true if the volume was set, false if the input index is invalid.
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For boolean-returning methods, other comments in this file use @returns + @retval entries to document each outcome (e.g., setInputRouting). Consider switching this block to that pattern so the success/failure semantics are unambiguous and consistent.

Suggested change
* @returns true if the volume was set, false if the input index is invalid.
* @returns Success status.
* @retval true The volume was successfully set for the specified input.
* @retval false The input index is invalid.

Copilot uses AI. Check for mistakes.
@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

b'## WARNING: A Copyright scan failure has been waived

A prior failure has been upvoted

  • Upvote reason: ok

  • Commit: 39de011
    '

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:audiomixer SOC component: audiomixer

Projects

Status: Review Requested

Development

Successfully merging this pull request may close these issues.

Task: audiomixer — add per-input volume/attenuation and fader control

3 participants