Skip to content

Commit 9d7004f

Browse files
committed
Comments on audio test addressed, back ported some of these items to existing video and display tests as well. Yaml files updated for all tests by removing || true in res line
Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
1 parent bec6a34 commit 9d7004f

7 files changed

Lines changed: 191 additions & 38 deletions

File tree

Runner/suites/Multimedia/GSTreamer/Audio/Audio_Record_Playback/Audio_Record_Playback.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ run:
2323
- cd Runner/suites/Multimedia/GSTreamer/Audio/Audio_Record_Playback/
2424
- export AUDIO_TEST_MODE AUDIO_FORMATS AUDIO_DURATION AUDIO_GST_DEBUG
2525
- ./run.sh --mode "${AUDIO_TEST_MODE}" --formats "${AUDIO_FORMATS}" --duration "${AUDIO_DURATION}" --gst-debug "${AUDIO_GST_DEBUG}" || true
26-
- $REPO_PATH/Runner/utils/send-to-lava.sh Audio_Record_Playback.res || true
26+
- $REPO_PATH/Runner/utils/send-to-lava.sh Audio_Record_Playback.res

Runner/suites/Multimedia/GSTreamer/Audio/Audio_Record_Playback/run.sh

Lines changed: 79 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ RECORDED_DIR="$OUTDIR/recorded"
5151
mkdir -p "$OUTDIR" "$DMESG_DIR" "$RECORDED_DIR" >/dev/null 2>&1 || true
5252
: >"$RES_FILE"
5353
: >"$GST_LOG"
54-
55-
SCRIPT_DIR="$(
56-
cd "$(dirname "$0")" || exit 1
57-
pwd
58-
)"
5954

6055
INIT_ENV=""
6156
SEARCH="$SCRIPT_DIR"
@@ -67,8 +62,6 @@ while [ "$SEARCH" != "/" ]; do
6762
SEARCH=$(dirname "$SEARCH")
6863
done
6964

70-
RES_FILE="$SCRIPT_DIR/${TESTNAME}.res"
71-
7265
if [ -z "${INIT_ENV:-}" ]; then
7366
echo "[ERROR] Could not find init_env (starting at $SCRIPT_DIR)" >&2
7467
echo "$TESTNAME SKIP" >"$RES_FILE" 2>/dev/null || true
@@ -217,7 +210,76 @@ while [ $# -gt 0 ]; do
217210
;;
218211

219212
-h|--help)
220-
echo "$TESTNAME SKIP" >"$RES_FILE"
213+
cat <<EOF
214+
Usage: $0 [OPTIONS]
215+
216+
Audio Record/Playback Validation using GStreamer
217+
218+
OPTIONS:
219+
--mode <all|record|playback>
220+
Test mode (default: all)
221+
- all: Run both record and playback tests
222+
- record: Run only recording tests
223+
- playback: Run only playback tests
224+
225+
--formats <format1,format2,...>
226+
Comma-separated list of audio formats to test
227+
(default: wav,flac)
228+
Supported: wav, flac
229+
230+
--duration <seconds> Duration for recording/playback in seconds
231+
(default: 10)
232+
233+
--gst-debug <level> GStreamer debug level (1-9)
234+
(default: 2)
235+
236+
--clip-url <url> URL to download test audio files (OGG/MP3)
237+
(default: GitHub release URL)
238+
239+
--clip-path <path> Local path to test audio files
240+
(overrides --clip-url if files exist)
241+
242+
-h, --help Display this help message
243+
244+
ENVIRONMENT VARIABLES:
245+
AUDIO_TEST_MODE Same as --mode
246+
AUDIO_FORMATS Same as --formats
247+
AUDIO_DURATION Same as --duration
248+
AUDIO_GST_DEBUG Same as --gst-debug
249+
AUDIO_CLIP_URL Same as --clip-url
250+
AUDIO_CLIP_PATH Same as --clip-path
251+
GST_DEBUG_LEVEL Alternative to AUDIO_GST_DEBUG
252+
RUNTIMESEC Alternative to AUDIO_DURATION
253+
254+
EXAMPLES:
255+
# Run all tests with default settings
256+
$0
257+
258+
# Run only recording tests for 5 seconds
259+
$0 --mode record --duration 5
260+
261+
# Test only WAV format
262+
$0 --formats wav
263+
264+
# Use local test files
265+
$0 --clip-path /path/to/audio/files
266+
267+
TEST SEQUENCE:
268+
ENCODE PHASE (4 tests):
269+
1. record_wav - audiotestsrc → wavenc → file
270+
2. record_flac - audiotestsrc → flacenc → file
271+
3. record_pulsesrc_wav - pulsesrc HW → wavenc → file
272+
4. record_pulsesrc_flac- pulsesrc HW → flacenc → file
273+
274+
DECODE PHASE (6 tests):
275+
5. playback_wav - file → wavparse → pulsesink
276+
6. playback_flac - file → flacparse → flacdec → pulsesink
277+
7. playback_pulsesrc_wav - file → wavparse → pulsesink
278+
8. playback_pulsesrc_flac - file → flacparse → flacdec → pulsesink
279+
9. playback_sample_ogg - file → oggdemux → vorbisdec → pulsesink
280+
10. playback_sample_mp3 - file → mpegaudioparse → mpg123audiodec → pulsesink
281+
282+
EOF
221283
exit 0
222284
;;
223285

@@ -423,8 +485,8 @@ run_playback_test() {
423485
return 1
424486
fi
425487

426-
# Check for successful completion (rc=0 or timeout rc which means it played to end)
427-
if [ "$gstRc" -eq 0 ] || [ "$gstRc" -eq 124 ] || [ "$gstRc" -eq 143 ]; then
488+
# Check for successful completion
489+
if [ "$gstRc" -eq 0 ]; then
428490
log_pass "$testname: PASS"
429491
pass_count=$((pass_count + 1))
430492
return 0
@@ -576,8 +638,8 @@ run_playback_pulsesrc_test() {
576638
return 1
577639
fi
578640

579-
# Check for successful completion (rc=0 or timeout rc which means it played to end)
580-
if [ "$gstRc" -eq 0 ] || [ "$gstRc" -eq 124 ] || [ "$gstRc" -eq 143 ]; then
641+
# Check for successful completion
642+
if [ "$gstRc" -eq 0 ]; then
581643
log_pass "$testname: PASS"
582644
pass_count=$((pass_count + 1))
583645
return 0
@@ -824,8 +886,7 @@ fi
824886
log_info "=========================================="
825887
log_info "TEST SUMMARY"
826888
log_info "=========================================="
827-
actual_total=$((pass_count + fail_count + skip_count))
828-
log_info "Total testcases: $actual_total"
889+
log_info "Total testcases: $total_tests"
829890
log_info "Passed: $pass_count"
830891
log_info "Failed: $fail_count"
831892
log_info "Skipped: $skip_count"
@@ -834,16 +895,16 @@ log_info "Skipped: $skip_count"
834895
if [ "$fail_count" -eq 0 ] && [ "$pass_count" -gt 0 ]; then
835896
result="PASS"
836897
if [ "$skip_count" -gt 0 ]; then
837-
reason="No failures (passed: $pass_count, failed: $fail_count, skipped: $skip_count, total: $actual_total)"
898+
reason="No failures (passed: $pass_count, failed: $fail_count, skipped: $skip_count, total: $total_tests)"
838899
else
839-
reason="All tests passed ($pass_count/$actual_total)"
900+
reason="All tests passed ($pass_count/$total_tests)"
840901
fi
841902
elif [ "$fail_count" -gt 0 ]; then
842903
result="FAIL"
843-
reason="Some tests failed (passed: $pass_count, failed: $fail_count, skipped: $skip_count, total: $actual_total)"
904+
reason="Some tests failed (passed: $pass_count, failed: $fail_count, skipped: $skip_count, total: $total_tests)"
844905
else
845906
result="SKIP"
846-
reason="No tests passed (skipped: $skip_count, total: $actual_total)"
907+
reason="No tests passed (skipped: $skip_count, total: $total_tests)"
847908
fi
848909

849910
case "$result" in

Runner/suites/Multimedia/GSTreamer/Display/Waylandsink_Playback/Waylandsink_Playback.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ run:
2525
- cd Runner/suites/Multimedia/GSTreamer/Display/Waylandsink_Playback/
2626
- export VIDEO_DURATION VIDEO_PATTERN VIDEO_WIDTH VIDEO_HEIGHT VIDEO_FRAMERATE VIDEO_GST_DEBUG
2727
- ./run.sh --resolution "${VIDEO_WIDTH}x${VIDEO_HEIGHT}" --pattern "${VIDEO_PATTERN}" --duration "${VIDEO_DURATION}" --framerate "${VIDEO_FRAMERATE}" --gst-debug "${VIDEO_GST_DEBUG}" || true
28-
- $REPO_PATH/Runner/utils/send-to-lava.sh Waylandsink_Playback.res || true
28+
- $REPO_PATH/Runner/utils/send-to-lava.sh Waylandsink_Playback.res

Runner/suites/Multimedia/GSTreamer/Display/Waylandsink_Playback/run.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ while [ "$SEARCH" != "/" ]; do
3838
SEARCH=$(dirname "$SEARCH")
3939
done
4040

41-
RES_FILE="$SCRIPT_DIR/${TESTNAME}.res"
42-
4341
if [ -z "${INIT_ENV:-}" ]; then
4442
echo "[ERROR] Could not find init_env (starting at $SCRIPT_DIR)" >&2
4543
echo "$TESTNAME SKIP" >"$RES_FILE" 2>/dev/null || true

Runner/suites/Multimedia/GSTreamer/Video/Video_Encode_Decode/Video_Encode_Decode.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ run:
2727
- export VIDEO_TEST_MODE VIDEO_CODECS VIDEO_RESOLUTIONS VIDEO_DURATION VIDEO_FRAMERATE
2828
- export VIDEO_STACK VIDEO_GST_DEBUG VIDEO_CLIP_URL VIDEO_CLIP_PATH
2929
- ./run.sh --mode "${VIDEO_TEST_MODE}" --codecs "${VIDEO_CODECS}" --resolutions "${VIDEO_RESOLUTIONS}" --duration "${VIDEO_DURATION}" --framerate "${VIDEO_FRAMERATE}" --stack "${VIDEO_STACK}" --gst-debug "${VIDEO_GST_DEBUG}" --clip-url "${VIDEO_CLIP_URL}" --clip-path "${VIDEO_CLIP_PATH}" || true
30-
- $REPO_PATH/Runner/utils/send-to-lava.sh Video_Encode_Decode.res || true
30+
- $REPO_PATH/Runner/utils/send-to-lava.sh Video_Encode_Decode.res

Runner/suites/Multimedia/GSTreamer/Video/Video_Encode_Decode/run.sh

Lines changed: 80 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ ENCODED_DIR="$OUTDIR/encoded"
2323
mkdir -p "$OUTDIR" "$DMESG_DIR" "$ENCODED_DIR" >/dev/null 2>&1 || true
2424
: >"$RES_FILE"
2525
: >"$GST_LOG"
26-
27-
SCRIPT_DIR="$(
28-
cd "$(dirname "$0")" || exit 1
29-
pwd
30-
)"
3126

3227
INIT_ENV=""
3328
SEARCH="$SCRIPT_DIR"
@@ -39,8 +34,6 @@ while [ "$SEARCH" != "/" ]; do
3934
SEARCH=$(dirname "$SEARCH")
4035
done
4136

42-
RES_FILE="$SCRIPT_DIR/${TESTNAME}.res"
43-
4437
if [ -z "${INIT_ENV:-}" ]; then
4538
echo "[ERROR] Could not find init_env (starting at $SCRIPT_DIR)" >&2
4639
echo "$TESTNAME SKIP" >"$RES_FILE" 2>/dev/null || true
@@ -245,7 +238,81 @@ while [ $# -gt 0 ]; do
245238
shift 2
246239
;;
247240
-h|--help)
248-
echo "$TESTNAME SKIP" >"$RES_FILE"
241+
cat <<EOF
242+
Usage: $0 [OPTIONS]
243+
244+
Video Encode/Decode Validation using GStreamer with V4L2 hardware accelerated codecs
245+
246+
OPTIONS:
247+
--mode <all|encode|decode>
248+
Test mode (default: all)
249+
- all: Run both encode and decode tests
250+
- encode: Run only encoding tests
251+
- decode: Run only decoding tests
252+
253+
--codecs <codec1,codec2,...>
254+
Comma-separated list of codecs to test
255+
(default: h264,h265,vp9)
256+
Supported: h264, h265, vp9
257+
258+
--resolutions <res1,res2,...>
259+
Comma-separated list of resolutions to test
260+
(default: 480p)
261+
Supported: 480p, 720p, 1080p, 4k
262+
263+
--duration <seconds> Duration for encoding/decoding in seconds
264+
(default: 30)
265+
266+
--framerate <fps> Framerate for video encoding
267+
(default: 30)
268+
269+
--stack <auto|upstream|downstream>
270+
Video stack to use
271+
(default: auto)
272+
273+
--gst-debug <level> GStreamer debug level (1-9)
274+
(default: 2)
275+
276+
--clip-url <url> URL to download test video files (VP9)
277+
(default: GitHub release URL)
278+
279+
--clip-path <path> Local path to test video files
280+
(overrides --clip-url if files exist)
281+
282+
-h, --help Display this help message
283+
284+
ENVIRONMENT VARIABLES:
285+
VIDEO_TEST_MODE Same as --mode
286+
VIDEO_CODECS Same as --codecs
287+
VIDEO_RESOLUTIONS Same as --resolutions
288+
VIDEO_DURATION Same as --duration
289+
VIDEO_FRAMERATE Same as --framerate
290+
VIDEO_STACK Same as --stack
291+
VIDEO_GST_DEBUG Same as --gst-debug
292+
VIDEO_CLIP_URL Same as --clip-url
293+
VIDEO_CLIP_PATH Same as --clip-path
294+
GST_DEBUG_LEVEL Alternative to VIDEO_GST_DEBUG
295+
RUNTIMESEC Alternative to VIDEO_DURATION
296+
297+
EXAMPLES:
298+
# Run all tests with default settings
299+
$0
300+
301+
# Run only encoding tests for H.264 at 720p
302+
$0 --mode encode --codecs h264 --resolutions 720p
303+
304+
# Test multiple codecs and resolutions
305+
$0 --codecs h264,h265 --resolutions 480p,720p
306+
307+
# Use upstream video stack
308+
$0 --stack upstream
309+
310+
SUPPORTED CODECS:
311+
- h264: H.264/AVC encoding and decoding (v4l2h264enc, v4l2h264dec)
312+
- h265: H.265/HEVC encoding and decoding (v4l2h265enc, v4l2h265dec)
313+
- vp9: VP9 decoding only (v4l2vp9dec) - uses pre-recorded WebM clip
314+
315+
EOF
249316
exit 0
250317
;;
251318
*)
@@ -630,9 +697,7 @@ fi
630697
log_info "=========================================="
631698
log_info "TEST SUMMARY"
632699
log_info "=========================================="
633-
# Calculate actual total for display (sum of pass/fail/skip)
634-
actual_total=$((pass_count + fail_count + skip_count))
635-
log_info "Total testcases: $actual_total"
700+
log_info "Total testcases: $total_tests"
636701
log_info "Passed: $pass_count"
637702
log_info "Failed: $fail_count"
638703
log_info "Skipped: $skip_count"
@@ -641,16 +706,16 @@ log_info "Skipped: $skip_count"
641706
if [ "$fail_count" -eq 0 ] && [ "$pass_count" -gt 0 ]; then
642707
result="PASS"
643708
if [ "$skip_count" -gt 0 ]; then
644-
reason="No failures (passed: $pass_count, failed: $fail_count, skipped: $skip_count, total: $actual_total)"
709+
reason="No failures (passed: $pass_count, failed: $fail_count, skipped: $skip_count, total: $total_tests)"
645710
else
646-
reason="All tests passed ($pass_count/$actual_total)"
711+
reason="All tests passed ($pass_count/$total_tests)"
647712
fi
648713
elif [ "$fail_count" -gt 0 ]; then
649714
result="FAIL"
650-
reason="Some tests failed (passed: $pass_count, failed: $fail_count, skipped: $skip_count, total: $actual_total)"
715+
reason="Some tests failed (passed: $pass_count, failed: $fail_count, skipped: $skip_count, total: $total_tests)"
651716
else
652717
result="SKIP"
653-
reason="No tests passed (skipped: $skip_count, total: $actual_total)"
718+
reason="No tests passed (skipped: $skip_count, total: $total_tests)"
654719
fi
655720

656721
case "$result" in

Runner/utils/lib_gstreamer.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,35 @@ gstreamer_build_audio_record_pipeline() {
525525
return 0
526526
}
527527

528+
529+
# -------------------- Playback pipeline builder (backend-aware) --------------------
530+
# gstreamer_build_playback_pipeline <backend> <format> <file> <capsStrOrEmpty> <alsadev>
531+
gstreamer_build_playback_pipeline() {
532+
backend="$1"
533+
format="$2"
534+
file="$3"
535+
capsStr="$4"
536+
alsadev="$5"
537+
538+
[ -n "$alsadev" ] || alsadev="default"
539+
540+
dec="$(gstreamer_pick_decode_chain "$format")"
541+
sinkElem="$(gstreamer_pick_sink_element "$backend" "$alsadev")"
542+
if [ -z "$sinkElem" ]; then
543+
printf '%s\n' ""
544+
return 0
545+
fi
546+
547+
if [ -n "$capsStr" ]; then
548+
printf '%s\n' "filesrc location=${file} ! ${dec} ! audioconvert ! audioresample ! ${capsStr} ! ${sinkElem}"
549+
return 0
550+
fi
551+
552+
printf '%s\n' "filesrc location=${file} ! ${dec} ! audioconvert ! audioresample ! ${sinkElem}"
553+
return 0
554+
}
555+
556+
528557
# gstreamer_build_audio_playback_pipeline <format> <input_file>
529558
# Builds audio playback pipeline using pulsesink
530559
# Supports: wav, flac, ogg, mp3 formats

0 commit comments

Comments
 (0)