[PowerPlay] Integrate Audio Effect Into PowerPlay#2380
Merged
Conversation
- Introduced `EffectsController` to manage audio effects. - Refactored `Equalizer` into `EqualizerManager`. - Added `BassBoostManager`, `VirtualizerManager`, `ReverbManager`, and `LoudnessManager`. - Updated `PowerPlayAudioPlayer` to use `EffectsController`. - Replaced `EqualizerBottomSheetContent` with a new `EffectsBottomSheet` featuring tabs for Equalizer, Bass Boost, Virtualizer, Reverb, and Loudness.
This commit removes all code related to the Virtualizer audio effect from the PowerPlay sample, including: * Deletion of `VirtualizerManager.kt` * Deletion of `VirtualizerTab.kt` * Removal of Virtualizer from `EffectsBottomSheet` tabs and UI * Removal of Virtualizer initialization and management from `EffectsController`
- Remove `setEnabled` and `isEnabled` from `BassBoostManager` and `EqualizerManager`. - Rename equalizer UI elements to general effects UI in `MainActivity`. - Remove `private val` from `sessionId` in effect manager constructors.
…ay only supported audio effects
…g license headers to Kotlin source files
robertwu1
reviewed
May 14, 2026
Collaborator
Author
|
Are we good to merge this? |
flamme
reviewed
Jun 9, 2026
| ->setSessionId(oboe::SessionId::Allocate); | ||
|
|
||
| if (performanceMode == oboe::PerformanceMode::PowerSavingOffloaded) { | ||
| builder.setSharingMode(oboe::SharingMode::Shared); |
Collaborator
There was a problem hiding this comment.
Why setting sharing mode to shared for offload? MMAP PCM offload only supports exclusive.
…oving conditional logic
Collaborator
|
I have a quick talk with Robert offline. We are okay with setting the session id by default for flexibility of testing audio effects. But also note that when the app asks for allocating session id, the audio framework right now is not allowed to use mmap low latency path. In that case, it will be better to give a hint from the UI that the stream is not mmap low latency or just remove the mmap low latency option given PowerPlay more focus on testing music playback via Oboe API. |
flamme
approved these changes
Jun 10, 2026
Collaborator
Author
|
I will take that feedback and open another PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a comprehensive audio effects system to the PowerPlay sample app. It leverages Android's native audio effects (Equalizer, Bass Boost, Reverb, and Loudness Enhancer) by attaching them to the Oboe audio stream via session ID allocation. It also adds a polished UI with a bottom sheet containing tabs for each effect, allowing users to customize their audio experience in real-time.
Changes
C++ Engine (PowerPlayMultiPlayer.cpp)
SessionId::Allocate) to allow attaching Android audio effects.getSessionId()to retrieve the allocated session ID from the stream.JNI (PowerPlayJNI.cpp)
getSessionIdNativeto expose the stream's session ID to the Kotlin layer.Kotlin Audio Player (PowerPlayAudioPlayer.kt)
EffectsControllerto initialize and release audio effects when the stream is created or when the performance mode changes (which recreates the stream).Audio Effects Managers (EffectsController.kt)
EffectsControllerto query supported effects and manage instances ofEqualizerManager,BassBoostManager,ReverbManager, andLoudnessManager.AudioEffectAPIs.Jetpack Compose UI (MainActivity.kt)
EffectsBottomSheetcomposable.EqualizerTab,BassBoostTab,ReverbTab,LoudnessTab) inside the bottom sheet.Effects Support Matrix
The availability of effects depends on hardware support and is queried dynamically at runtime:
Note
If an effect is not supported by the device's hardware/HAL, it will not be initialized and its tab will not appear or will be disabled.
How to Test
Visuals