-
Notifications
You must be signed in to change notification settings - Fork 27
Gstreamer Multimedia TestSuite #250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ramyathallam
wants to merge
5
commits into
qualcomm-linux:main
Choose a base branch
from
ramyathallam:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6bee547
Add files via upload
ramyathallam 6e7ca84
Revert "Gstreamer Multimedia Test Suite"
ramyathallam 2dacd06
Add files via upload
ramyathallam 42e862a
Revert "Gstreamer Multimedia Test Suite"
ramyathallam 1ca4bd7
Gstreamer Multimedia TestSuite (Video/Audio/Display/Camera)
ramyathallam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | ||
| # SPDX-License-Identifier: BSD-3-Clause-Clear | ||
|
|
||
| metadata: | ||
| format: Lava-Test Test Definition 1.0 | ||
| name: Gstreamer_Audio_Tests | ||
| description: "GStreamer Audio Pipeline Tests - Encode/Decode validation using PulseAudio" | ||
| maintainer: | ||
| - qualcomm-linux-test@quicinc.com | ||
| os: | ||
| - linux | ||
| scope: | ||
| - functional | ||
|
|
||
| params: | ||
| TIMEOUT: "120" | ||
| STRICT: "false" | ||
| DMESG_SCAN: "true" | ||
| LOGLEVEL: "INFO" | ||
|
|
||
| run: | ||
| steps: | ||
| - cd Runner/suites/Gstreamer/Audio | ||
| - ./run.sh --all | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,322 @@ | ||
| # GStreamer Audio Tests | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Standardize to one canonical location |
||
|
|
||
| ## Overview | ||
|
|
||
| This test suite validates GStreamer audio pipelines using PulseAudio for capture and playback on Qualcomm platforms. It tests audio encoding (capture to WAV) and decoding (WAV playback) functionality. | ||
|
|
||
| ## Test Cases | ||
|
|
||
| ### 1. audio-encode | ||
| **Pipeline:** | ||
| ```bash | ||
| gst-launch-1.0 pulsesrc ! audioconvert ! audioresample ! identity eos-after=2000 ! wavenc ! filesink location=./output_audio.wav | ||
| ``` | ||
|
|
||
| **Description:** | ||
| - Captures audio from PulseAudio source | ||
| - Converts and resamples audio format | ||
| - Uses identity element with eos-after=2000 (2 seconds) for controlled capture | ||
| - Encodes to WAV format | ||
| - Saves to output_audio.wav | ||
|
|
||
| **Validation:** | ||
| - Pipeline completes without errors | ||
| - Output file is created | ||
| - No ERROR/WARNING messages in GStreamer output | ||
| - No dmesg errors (if DMESG_SCAN enabled) | ||
|
|
||
| ### 2. audio-decode | ||
| **Pipeline:** | ||
| ```bash | ||
| gst-launch-1.0 filesrc location=./output_audio.wav ! wavparse ! audioconvert ! audioresample ! pulsesink | ||
| ``` | ||
|
|
||
| **Description:** | ||
| - Reads WAV file created by audio-encode test | ||
| - Parses WAV format | ||
| - Converts and resamples audio | ||
| - Plays back through PulseAudio sink | ||
|
|
||
| **Validation:** | ||
| - Pipeline completes without errors | ||
| - Audio playback successful | ||
| - No ERROR/WARNING messages in GStreamer output | ||
| - No dmesg errors (if DMESG_SCAN enabled) | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| ### Required Packages | ||
| ```bash | ||
| # GStreamer core and plugins | ||
| gstreamer1.0-tools | ||
| gstreamer1.0-plugins-base | ||
| gstreamer1.0-plugins-good | ||
|
|
||
| # PulseAudio support | ||
| pulseaudio | ||
| gstreamer1.0-pulseaudio | ||
| ``` | ||
|
|
||
| ### Audio Hardware | ||
| - Working audio capture device (microphone) | ||
| - Working audio playback device (speakers/headphones) | ||
| - PulseAudio server running | ||
|
|
||
| ### Verification | ||
| ```bash | ||
| # Check PulseAudio status | ||
| pulseaudio --check | ||
| echo $? # Should return 0 | ||
|
|
||
| # List audio sources | ||
| pactl list sources short | ||
|
|
||
| # List audio sinks | ||
| pactl list sinks short | ||
|
|
||
| # Test audio capture | ||
| gst-launch-1.0 pulsesrc ! fakesink | ||
|
|
||
| # Test audio playback | ||
| gst-launch-1.0 audiotestsrc ! pulsesink | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Run All Tests | ||
| ```bash | ||
| ./run.sh --all | ||
| ``` | ||
|
|
||
| ### Run Specific Test | ||
| ```bash | ||
| ./run.sh --test audio-encode | ||
| ./run.sh --test audio-decode | ||
| ``` | ||
|
|
||
| ### List Available Tests | ||
| ```bash | ||
| ./run.sh --list | ||
| ``` | ||
|
|
||
| ### Custom Timeout | ||
| ```bash | ||
| ./run.sh --all --timeout 180 | ||
| ``` | ||
|
|
||
| ### Enable Strict Mode | ||
| ```bash | ||
| ./run.sh --all --strict | ||
| ``` | ||
|
|
||
| ### Disable dmesg Scanning | ||
| ```bash | ||
| ./run.sh --all --no-dmesg | ||
| ``` | ||
|
|
||
| ## CLI Options | ||
|
|
||
| | Option | Description | Default | | ||
| |--------|-------------|---------| | ||
| | `--all` | Run all audio tests | - | | ||
| | `--test <name>` | Run specific test | - | | ||
| | `--list` | List available tests | - | | ||
| | `--timeout <sec>` | Timeout per test | 120 | | ||
| | `--repeat <n>` | Repeat count | 1 | | ||
| | `--repeat-policy <all\|any>` | Pass policy | all | | ||
| | `--strict` | Fail on warnings | false | | ||
| | `--no-dmesg` | Skip dmesg scan | false | | ||
| | `--help` | Show help | - | | ||
|
|
||
| ## Output Files | ||
|
|
||
| ### Result Files | ||
| - `Gstreamer_Audio_Tests.res` - Overall PASS/FAIL/SKIP status | ||
| - `logs_Gstreamer_Audio_Tests/` - Detailed logs directory | ||
| - `audio-encode.log` - Encode test output | ||
| - `audio-decode.log` - Decode test output | ||
| - `summary.txt` - Test summary | ||
| - `results.csv` - CSV format results | ||
| - `.junit_cases.xml` - JUnit XML for CI | ||
| - `dmesg_snapshot.log` - Kernel messages | ||
| - `dmesg_errors.log` - Kernel errors (if any) | ||
|
|
||
| ### Generated Files | ||
| - `output_audio.wav` - Audio file created by encode test | ||
|
|
||
| ## Validation Criteria | ||
|
|
||
| ### Pass Criteria | ||
| ✓ Pipeline executes without errors | ||
| ✓ Output files created successfully | ||
| ✓ No ERROR messages in GStreamer output | ||
| ✓ No WARNING messages (if --strict enabled) | ||
| ✓ No kernel errors in dmesg (if DMESG_SCAN enabled) | ||
| ✓ Exit code 0 from gst-launch-1.0 | ||
|
|
||
| ### Fail Criteria | ||
| ✗ Pipeline execution fails | ||
| ✗ ERROR messages in GStreamer output | ||
| ✗ WARNING messages (in strict mode) | ||
| ✗ Timeout exceeded | ||
| ✗ Output file not created | ||
| ✗ Kernel errors detected | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### PulseAudio Not Running | ||
| ```bash | ||
| # Start PulseAudio | ||
| pulseaudio --start | ||
|
|
||
| # Check status | ||
| pulseaudio --check | ||
| ``` | ||
|
|
||
| ### No Audio Devices | ||
| ```bash | ||
| # List available sources | ||
| pactl list sources short | ||
|
|
||
| # List available sinks | ||
| pactl list sinks short | ||
|
|
||
| # Set default source/sink | ||
| pactl set-default-source <source-name> | ||
| pactl set-default-sink <sink-name> | ||
| ``` | ||
|
|
||
| ### Permission Issues | ||
| ```bash | ||
| # Add user to audio group | ||
| sudo usermod -a -G audio $USER | ||
|
|
||
| # Verify group membership | ||
| groups $USER | ||
| ``` | ||
|
|
||
| ### Audio Capture Fails | ||
| ```bash | ||
| # Test with audiotestsrc instead | ||
| gst-launch-1.0 audiotestsrc ! audioconvert ! audioresample ! wavenc ! filesink location=test.wav | ||
|
|
||
| # Check microphone permissions | ||
| ls -la /dev/snd/ | ||
|
|
||
| # Test with arecord | ||
| arecord -d 2 -f cd test.wav | ||
| ``` | ||
|
|
||
| ### Audio Playback Fails | ||
| ```bash | ||
| # Test with speaker-test | ||
| speaker-test -t sine -f 440 -c 2 | ||
|
|
||
| # Test with aplay | ||
| aplay test.wav | ||
|
|
||
| # Check volume levels | ||
| pactl list sinks | grep -i volume | ||
| ``` | ||
|
|
||
| ### Pipeline Negotiation Errors | ||
| ```bash | ||
| # Enable debug output | ||
| GST_DEBUG=3 gst-launch-1.0 pulsesrc ! audioconvert ! audioresample ! wavenc ! filesink location=test.wav | ||
|
|
||
| # Check supported formats | ||
| gst-inspect-1.0 pulsesrc | ||
| gst-inspect-1.0 wavenc | ||
| ``` | ||
|
|
||
| ### Common Error Messages | ||
|
|
||
| **"Could not open audio device for recording"** | ||
| - PulseAudio not running or no capture device available | ||
| - Check: `pactl list sources short` | ||
|
|
||
| **"Could not open audio device for playback"** | ||
| - PulseAudio not running or no playback device available | ||
| - Check: `pactl list sinks short` | ||
|
|
||
| **"Failed to connect stream"** | ||
| - PulseAudio server connection issue | ||
| - Restart: `pulseaudio --kill && pulseaudio --start` | ||
|
|
||
| **"No space left on device"** | ||
| - Insufficient disk space for output file | ||
| - Check: `df -h .` | ||
|
|
||
| ## Environment Variables | ||
|
|
||
| ```bash | ||
| # GStreamer debug level (0-9) | ||
| export GST_DEBUG=3 | ||
|
|
||
| # PulseAudio server | ||
| export PULSE_SERVER=unix:/run/user/1000/pulse/native | ||
|
|
||
| # Audio buffer size | ||
| export PULSE_LATENCY_MSEC=50 | ||
| ``` | ||
|
|
||
| ## CI/CD Integration | ||
|
|
||
| ### LAVA Integration | ||
| ```yaml | ||
| - test: | ||
| definitions: | ||
| - repository: https://git.codelinaro.org/clo/le/le-test-automation/qcom-linux-testkit | ||
| from: git | ||
| path: Runner/suites/Gstreamer/Audio/Gstreamer_Audio_Tests.yaml | ||
| name: gstreamer-audio-tests | ||
| parameters: | ||
| TIMEOUT: "120" | ||
| STRICT: "false" | ||
| DMESG_SCAN: "true" | ||
| ``` | ||
|
|
||
| ### Standalone Execution | ||
| ```bash | ||
| # Basic run | ||
| cd /path/to/qcom-linux-testkit/Runner/suites/Gstreamer/Audio | ||
| ./run.sh --all | ||
|
|
||
| # With custom parameters | ||
| TIMEOUT=180 STRICT=true ./run.sh --all | ||
| ``` | ||
|
|
||
| ## Platform Support | ||
|
|
||
| | Platform | Status | Notes | | ||
| |----------|--------|-------| | ||
| | QCS6490 | ✓ Supported | Full audio support | | ||
| | QCS8550 | ✓ Supported | Full audio support | | ||
| | QCS8650 | ✓ Supported | Full audio support | | ||
| | SA8775P | ✓ Supported | Full audio support | | ||
| | SA8650P | ✓ Supported | Full audio support | | ||
| | SA8255P | ✓ Supported | Full audio support | | ||
|
|
||
| ## Known Issues | ||
|
|
||
| 1. **PulseAudio Latency**: Some platforms may experience audio latency | ||
| - Workaround: Adjust `PULSE_LATENCY_MSEC` environment variable | ||
|
|
||
| 2. **Device Busy**: Audio device may be in use by another application | ||
| - Workaround: Stop other audio applications or use `fuser -k /dev/snd/*` | ||
|
|
||
| 3. **Sample Rate Mismatch**: Some devices may not support default sample rates | ||
| - Workaround: Explicitly set sample rate in pipeline with `audio/x-raw,rate=48000` | ||
|
|
||
| ## Additional Resources | ||
|
|
||
| - [GStreamer Documentation](https://gstreamer.freedesktop.org/documentation/) | ||
| - [PulseAudio Documentation](https://www.freedesktop.org/wiki/Software/PulseAudio/) | ||
| - [GStreamer PulseAudio Plugin](https://gstreamer.freedesktop.org/documentation/pulseaudio/) | ||
| - [Audio Debugging Guide](https://wiki.archlinux.org/title/PulseAudio/Troubleshooting) | ||
|
|
||
| ## License | ||
|
|
||
| ``` | ||
| Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | ||
| SPDX-License-Identifier: BSD-3-Clause-Clear | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After you move suites under Runner/suites/Multimedia/Gstreamer/..., update YAML to:
cd Runner/suites/Multimedia/Gstreamer/Audio