Skip to content

Conversation

@madebymozart
Copy link
Collaborator

Description: Intent-based Automation and Stress-Testing for PowerPlay

Summary

This PR implements a robust command-line interface for the PowerPlay sample app via Android Intents. This enables full control of the audio engine via adb, facilitating automated power profiling, stress testing, and validation of PCM Offload behavior without manual UI interaction.

Changes

  • Intent Command Dispatcher: Added an Intent listener in MainActivity.java to trigger engine actions and configuration changes.
  • Performance Mode Management: Support for switching between none, lowlat, powersave, and offload via commands.
  • Stress Test Features: Added a toggle_offload mode to test system stability during rapid resource transitions.
  • Automation Hooks: Added duration_ms for self-terminating tests and a background flag to test system behavior during display-off/doze transitions.
  • Machine-Readable Logging: Implemented POWERPLAY_STATUS logcat outputs for easy parsing by external automation scripts.

Supported ADB Parameters

Parameter Type Description
command string Action: play, pause, stop
perf_mode string Mode: none, lowlat, powersave, offload
song_index int Track index (0-2)
volume int Volume percentage (0-100)
background bool Move app to background after starting
duration_ms int Auto-stop after N milliseconds
toggle_offload bool Enable offload/on-load stress test

How to Test

You can verify the automation by running the following command to start a timed, background offload session:

adb shell am start -n com.google.oboe.samples.powerplay/.MainActivity \
    --es command play \
    --es perf_mode offload \
    --ez background true \
    --ei duration_ms 10000

@madebymozart madebymozart requested a review from flamme January 28, 2026 23:40
@madebymozart madebymozart self-assigned this Jan 28, 2026
@flamme
Copy link
Collaborator

flamme commented Jan 29, 2026

Q: is the playback loop by default?

@madebymozart madebymozart marked this pull request as ready for review January 29, 2026 22:51
@madebymozart
Copy link
Collaborator Author

@flamme yes, we can maybe also add a loop button to the player controls to control this better.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants