Skip to content

feat(ffv)!: rename PowerMode → ListeningMode + terminology/HFP fixes (stacked on #177) - #529

Open
Ulrond wants to merge 1 commit into
feature/23-task-far-field-voice-halfrom
ffv-177-review-edits
Open

feat(ffv)!: rename PowerMode → ListeningMode + terminology/HFP fixes (stacked on #177)#529
Ulrond wants to merge 1 commit into
feature/23-task-far-field-voice-halfrom
ffv-177-review-edits

Conversation

@Ulrond

@Ulrond Ulrond commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Stacked review-feedback PR targeting #177's branch — applies the mechanical changes from my proposal comment. Merge into your branch (feature/23-task-far-field-voice-hal) if it looks right; reject items individually if not.

@lucienkennedylamb

What's in this PR

RenamesPowerModeListeningMode, with values renamed to listening-capability vocabulary that doesn't overlap with system power state names:

  • FULL_POWERACTIVE_LISTEN
  • STANDBYKEYWORD_ALERT
  • DEEP_SLEEPPOWERED_OFF
  • NONE kept as-is
  • PowerMode.aidlListeningMode.aidl (git-mv preserves history)
  • All callers updated: IFarFieldVoiceController.setPowerMode()setListeningMode(), IFarFieldVoiceEventListener.onEnteredPowerMode()onEnteredListeningMode(), Status.powerModeStatus.listeningMode, CMakeLists.txt source list updated.

Terminology consistency — every reference to a channel uses the "Audio" suffix so it's unambiguous:

  • "Keyword channel" → "Keyword Audio channel"
  • "Continual channel" → "Continual Audio channel"
  • "Microphones channel" → "Microphones Audio channel"

Endian order pinned — replaced "host processor's native endian order" with "16-bit signed little-endian PCM" throughout the channel docs so consumers don't need per-platform byte-swap logic. (Pick a different value if 16-bit LE is wrong for the platform — the point is to define one, not to specifically pick LE.)

Capabilities extended — added ListeningMode[] supportedListeningModes so platforms that only support a subset (e.g. KEYWORD_ALERT + POWERED_OFF, no ACTIVE_LISTEN) can advertise that.

Callback docstrings rewrittenonKeywordDetected() and onEndOfCommand() got clearer descriptions including what zero offset means.

HFP YAML reworkedhfp-ffv.yaml:

  • camelCase keys mirroring the AIDL field names exactly (microphoneChannelCount, not microphone_channel_count)
  • dropped fields that are runtime status, not static caps: power_state, privacy_mode, hardware_failure, noise_reduction, beamforming, beamforming_type, noise_reduction_type — these belong in Status / IFarFieldVoiceEventListener callbacks, not in HFP
  • added supportedListeningModes and the canonical channelTypes enumeration
  • restructured under a capabilities: block that maps 1:1 with the Capabilities parcelable

What's NOT in this PR (deliberately left for you)

These items from my proposal needed FFV-team judgement and I didn't want to guess:

  • Fields with no clear consumer / vendor-defined units — items 16, 17 from the proposal. Several fields described as "vendor-defined units" need concrete HAL units (dB, 0..100, 0.0..1.0) or removal — needs domain knowledge of how they're consumed.
  • Module overview docdocs/halif/ffv/current/far_field_voice.md per the interface template — not done.
  • State.aidl simplification — file is already module-local, but mirrors the common State pattern verbatim (9 values). If FFV genuinely doesn't need FLUSHING / STARTING / STOPPING, you can trim. I didn't touch it.
  • KeywordDetectInfo parcelable — this didn't exist in the current branch (already removed?), so the related comments in my proposal are moot. If it's coming back later, the unit/zero-meaning concerns from items 13-17 still apply.

Test plan

  • AIDL compiler accepts the renamed types and imports
  • No external callers depend on the old PowerMode / setPowerMode / onEnteredPowerMode names (pre-1.0, but worth a grep across consumer repos)
  • HFP validator (if any) accepts the new key shape



Acts on the review feedback in PR #177:
- Rename PowerMode → ListeningMode (ACTIVE_LISTEN / KEYWORD_ALERT / POWERED_OFF)
  to drop overlap with system power state vocabulary and describe the module's
  externally-observable listening behaviour instead.
- Consistent terminology: "Keyword channel" → "Keyword Audio channel"
  (same for Continual Audio / Microphones Audio).
- Pin a HAL-wide endian order on audio data — 16-bit signed little-endian PCM —
  so consumers no longer need per-platform byte-swap logic.
- Surface supportedListeningModes in Capabilities so platforms can advertise
  which subset of modes they support.
- Rewrite onKeywordDetected() and onEndOfCommand() docstrings.
- Rework hfp-ffv.yaml: camelCase keys mirroring the AIDL field names, drop
  runtime-status fields (power_state, privacy_mode, hardware_failure) which
  belong in Status, not in HFP. Add supportedListeningModes + channelTypes.

Mechanical changes only. Items from the review that need author judgement
(removing fields with no consumer, defining HAL units for things currently
described as vendor-defined, scoping the module's overview doc) are
intentionally left for the author.
Copilot AI review requested due to automatic review settings May 27, 2026 09:02
@github-project-automation github-project-automation Bot moved this to Architecture Review Required in halif_aidl May 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the FFV (Far Field Voice) HAL surface to use clearer “listening mode” terminology (renaming PowerModeListeningMode and related APIs), aligns channel terminology (“Keyword/Continual/Microphones Audio channel”), pins the documented PCM endianness, and refactors the FFV HFP YAML to mirror the Capabilities parcelable (including adding supportedListeningModes).

Changes:

  • Rename PowerMode enum/file/fields/methods/callbacks to ListeningMode across FFV AIDL and build wiring.
  • Extend Capabilities with ListeningMode[] supportedListeningModes and update HFP YAML shape/keys to match Capabilities.
  • Documentation/terminology updates for channel naming and PCM encoding/endian wording.

Reviewed changes

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

Show a summary per file
File Description
ffv/current/hfp-ffv.yaml Restructures FFV HFP to a capabilities: block mirroring Capabilities and adds supportedListeningModes / canonical channel types.
ffv/current/com/rdk/hal/farfieldvoice/Status.aidl Renames powerMode field to listeningMode and updates related docs/imports.
ffv/current/com/rdk/hal/farfieldvoice/PowerMode.aidl Removes the old PowerMode enum definition (replaced by ListeningMode).
ffv/current/com/rdk/hal/farfieldvoice/ListeningMode.aidl Adds the new ListeningMode enum with updated terminology and mapping notes.
ffv/current/com/rdk/hal/farfieldvoice/IFarFieldVoiceEventListener.aidl Renames callback to onEnteredListeningMode and updates parameter/docs.
ffv/current/com/rdk/hal/farfieldvoice/IFarFieldVoiceControllerListener.aidl Clarifies wake-word / end-of-command callback docstrings and parameter descriptions.
ffv/current/com/rdk/hal/farfieldvoice/IFarFieldVoiceController.aidl Renames setPowerModesetListeningMode and updates channel docs (including endian/PCM wording).
ffv/current/com/rdk/hal/farfieldvoice/IFarFieldVoice.aidl Updates top-level interface documentation to use Audio-channel terminology consistently.
ffv/current/com/rdk/hal/farfieldvoice/Capabilities.aidl Adds supportedListeningModes and updates channel-type documentation language.
ffv/current/CMakeLists.txt Updates the FFV AIDL source list to build ListeningMode.aidl instead of PowerMode.aidl.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ffv/current/hfp-ffv.yaml
# (see ffv/current/com/rdk/hal/farfieldvoice/Capabilities.aidl) so a single
# grep finds both the API surface and the per-platform value.
#
# This is a reference HFP — SOC vendors derive platform-specific variants
Comment on lines +60 to 64
* If channelType specifies a Continual Audio channel or Microphones Audio channel
*
* Audio data is written to the channel's pipe at the vendor/product specific sampling rate. The audio data
* format is vendor/product specific. The endian order of each sample value is that of the host processor's
* native endian order.
* Audio data is written to the channel's pipe at the channel's native sampling rate using the
* same 16-bit signed little-endian PCM encoding as the Keyword Audio channel.
*
@Ulrond Ulrond added component:ffv OEM component: ffv team:AV_Architecture AV Architecture review required Breaking Change RETIRED (#712): alias of Major Change during transition — do not apply to new PRs and removed team:AV_Architecture AV Architecture review required labels May 27, 2026
@Ulrond Ulrond changed the title ffv: rename PowerMode → ListeningMode + terminology/HFP fixes (stacked on #177) feat(ffv)!: rename PowerMode → ListeningMode + terminology/HFP fixes (stacked on #177) May 27, 2026
@Ulrond Ulrond added this to the 0.21.0 milestone Jun 3, 2026
@Ulrond Ulrond moved this from Architecture Review Required to Review Requested in halif_aidl Jun 23, 2026
@Ulrond Ulrond self-assigned this Jun 23, 2026
@Ulrond
Ulrond requested a review from a team June 23, 2026 10:07
@Ulrond Ulrond removed the Breaking Change RETIRED (#712): alias of Major Change during transition — do not apply to new PRs label Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:ffv OEM component: ffv

Projects

Status: Review Requested

Development

Successfully merging this pull request may close these issues.

3 participants