Skip to content

Conversation

@tmoida
Copy link
Contributor

@tmoida tmoida commented Dec 17, 2025

Resolves #229

Problem:
AudioPlayback test was forcing network connections even when audio files were already present locally, causing tests to fail in offline environments.

Solution:

  • Add --enable-network-download flag (opt-in, default: disabled)
  • Add audio_check_clips_available() to check files before network ops
  • Implement smart network gating: only connect if files missing AND flag enabled
  • Auto-enable network download when WiFi credentials provided via CLI

@tmoida tmoida force-pushed the main branch 2 times, most recently from 5edc97f to 7fbc036 Compare December 19, 2025 11:17
@tmoida
Copy link
Contributor Author

tmoida commented Dec 22, 2025

Hi @smuppand,

I've made the changes as requested. Here's what I did:

Changes Made

I removed the SSID and PASSWORD from the YAML file since we don't want WiFi credentials hardcoded there. Instead, I added support for CI to provide a custom location for the audio clips.

Files modified:

  • AudioPlayback.yaml - removed SSID/PASSWORD params, added AUDIO_CLIPS_BASE_DIR
  • run.sh - added --audio-clips-path flag
  • audio_common.sh - updated resolve_clip() to check for custom path
  • Read_me.md - documented the new options

Please review and let me know if any other changes are required.

@tmoida tmoida force-pushed the main branch 2 times, most recently from 9b78678 to bbe9d8c Compare December 23, 2025 11:36
@tmoida
Copy link
Contributor Author

tmoida commented Dec 23, 2025

Hi @smuppand ,

I've addressed all the feedback you provided. Here's what was fixed:

Changes made:

  1. Fixed network operation order - clips are now checked FIRST before any network operations
  2. Removed duplicate asset fetch logic from per-test loop
  3. Changed file check from -f to -s to handle empty files correctly
  4. Simplified per-test logic - if clip exists → use it; if missing → SKIP with helpful message

Please review and let me know if any other changes are required.

@smuppand smuppand requested a review from mwasilew December 23, 2025 17:02
if [ -n "${AUDIO_CLIPS_BASE_DIR}" ]; then
./run.sh --backend "${AUDIO_BACKEND}" --sink "${SINK_CHOICE}" --formats "${FORMATS}" --durations "${DURATIONS}" --loops "${LOOPS}" --timeout "${TIMEOUT}" --audio-clips-path "${AUDIO_CLIPS_BASE_DIR}" || true
else
./run.sh --backend "${AUDIO_BACKEND}" --sink "${SINK_CHOICE}" --formats "${FORMATS}" --durations "${DURATIONS}" --loops "${LOOPS}" --timeout "${TIMEOUT}" || true
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep only one invocation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaned up the YAML as requested - no more duplicate run.sh calls. The script already checks if AUDIO_CLIPS_BASE_DIR is set, so we can always pass --audio-clips-path and let it handle the logic internally.

Copy link
Contributor

@mwasilew mwasilew left a comment

Choose a reason for hiding this comment

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

Please make the commit title more descriptive. The resolves part should not be in the title.

EXTRACT_AUDIO_ASSETS: true # Download/extract audio assets if missing, default: true
SSID: "" # Wi-Fi SSID for network connection, default: unset
PASSWORD: "" # Wi-Fi password for network connection, default: unset
ENABLE_NETWORK_DOWNLOAD: false # Enable network download of missing audio files, default: false
Copy link
Contributor

Choose a reason for hiding this comment

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

you still need SSID and PASSWORD if the network is enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @mwasilew,

Thanks for the feedback. Fixed both issues:

  1. Made the commit title more descriptive
  2. SSID/PASSWORD: Added them back to the YAML params and run command - definitely needed for network download scenarios

Please review and let me know if any other changes are required.

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks good!

- Add --enable-network-download flag (default: disabled) for offline-first operation
- Implement smart network gating: only connect when clips missing AND download enabled
- Add audio_check_clips_available() to validate clips before any network operations
- Remove duplicate asset fetch logic from per-test loop (single download at startup)
- Add --audio-clips-path flag for CI workflows with pre-staged clips
- Add SSID/PASSWORD parameters for network authentication when download enabled

This allows tests to run offline when clips are present, while providing
network download capability when explicitly enabled with proper credentials.

Resolves qualcomm-linux#229

Signed-off-by: Teja Swaroop Moida <tmoida@qti.qualcomm.com>
Copy link
Contributor

@smuppand smuppand left a comment

Choose a reason for hiding this comment

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

LGTM

@smuppand smuppand merged commit ea73304 into qualcomm-linux:main Dec 26, 2025
8 checks passed
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.

AudioPlayback requires networking

3 participants