Skip to content

Commit 0feb6ac

Browse files
authored
Merge pull request #238 from tmoida/fix-audiorecord-params-clean
Standardize AudioRecord to use --record-seconds parameter
2 parents 8f592b1 + 5149f32 commit 0feb6ac

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

Runner/suites/Multimedia/Audio/AudioRecord/Read_me.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ Variable Description Default
101101
AUDIO_BACKEND Selects backend: pipewire or pulseaudio auto-detect
102102
SOURCE_CHOICE Recording source: mic or null mic
103103
DURATIONS Recording durations: short, medium, long short
104-
RECORD_SECONDS Number of seconds to record (numeric or mapped) 5
104+
RECORD_SECONDS Number of seconds to record (numeric or mapped), default: 30s 30
105105
LOOPS Number of recording loops 1
106106
TIMEOUT Recording timeout per loop (e.g., 15s, 0=none) 0
107-
STRICT Enable strict mode (fail on any error) 0
107+
STRICT Strict mode (0=disabled, 1=enabled, fail on any error) 0
108108
DMESG_SCAN Scan dmesg for errors after recording 1
109109
VERBOSE Enable verbose logging 0
110110
JUNIT_OUT Path to write JUnit XML output unset
@@ -118,7 +118,7 @@ Option Description
118118
--record-seconds Number of seconds to record (numeric or mapped)
119119
--loops Number of recording loops
120120
--timeout Recording timeout per loop (e.g., 15s)
121-
--strict Enable strict mode
121+
--strict [0|1] Enable strict mode (0=disabled, 1=enabled)
122122
--no-dmesg Disable dmesg scan
123123
--junit<file.xml> Write JUnit XML output
124124
--verbose Enable verbose logging
@@ -130,7 +130,7 @@ Sample Output:
130130
sh-5.2# ./run.sh --backend pipewire
131131
[INFO] 2025-09-12 06:06:04 - ---------------- Starting AudioRecord ----------------
132132
[INFO] 2025-09-12 06:06:04 - SoC: 498
133-
[INFO] 2025-09-12 06:06:04 - Args: backend=pipewire source=mic loops=1 durations='short' rec_secs=30s timeout=0 strict=0 dmesg=1
133+
[INFO] 2025-09-12 06:06:04 - Args: backend=pipewire source=mic loops=1 durations='short' record_seconds=30s timeout=0 strict=0 dmesg=1
134134
[INFO] 2025-09-12 06:06:04 - Using backend: pipewire
135135
[INFO] 2025-09-12 06:06:04 - Routing to source: id/name=48 label='pal source handset mic' choice=mic
136136
[INFO] 2025-09-12 06:06:04 - Watchdog/timeout: 0
@@ -162,5 +162,4 @@ Results:
162162
## License
163163

164164
SPDX-License-Identifier: BSD-3-Clause-Clear
165-
(C) Qualcomm Technologies, Inc. and/or its subsidiaries.
166-
165+
(C) Qualcomm Technologies, Inc. and/or its subsidiaries.

Runner/suites/Multimedia/Audio/AudioRecord/run.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ mkdir -p "$LOGDIR"
4444
# ---------------- Defaults / CLI ----------------
4545
AUDIO_BACKEND=""
4646
SRC_CHOICE="${SRC_CHOICE:-mic}" # mic|null
47-
DURATIONS="${DURATIONS:-short}" # label set OR numeric tokens when REC_SECS=auto
48-
REC_SECS="${REC_SECS:-30s}" # DEFAULT: 30s; 'auto' maps short/med/long
47+
DURATIONS="${DURATIONS:-short}" # label set OR numeric tokens when RECORD_SECONDS=auto
48+
RECORD_SECONDS="${RECORD_SECONDS:-30s}" # DEFAULT: 30s; 'auto' maps short/med/long
4949
LOOPS="${LOOPS:-1}"
5050
TIMEOUT="${TIMEOUT:-0}" # 0 = no watchdog
5151
STRICT="${STRICT:-0}"
@@ -58,11 +58,11 @@ usage() {
5858
Usage: $0 [options]
5959
--backend {pipewire|pulseaudio}
6060
--source {mic|null}
61-
--rec-secs SECS|auto (default: 30s; 'auto' maps short=5s, medium=15s, long=30s)
62-
--durations "short [medium] [long] [10s] [35secs]" (used when --rec-secs auto)
61+
--record-seconds SECS|auto (default: 30s; 'auto' maps short=5s, medium=15s, long=30s)
62+
--durations "short [medium] [long] [10s] [35secs]" (used when --record-seconds auto)
6363
--loops N
6464
--timeout SECS
65-
--strict
65+
--strict [0|1]
6666
--no-dmesg
6767
--junit FILE.xml
6868
--verbose
@@ -84,8 +84,8 @@ while [ $# -gt 0 ]; do
8484
DURATIONS="$2"
8585
shift 2
8686
;;
87-
--rec-secs|--record-seconds)
88-
REC_SECS="$2"
87+
--record-seconds)
88+
RECORD_SECONDS="$2"
8989
shift 2
9090
;;
9191
--loops)
@@ -148,7 +148,7 @@ else
148148
log_info "Platform Details: unknown"
149149
fi
150150

151-
log_info "Args: backend=${AUDIO_BACKEND:-auto} source=$SRC_CHOICE loops=$LOOPS durations='$DURATIONS' rec_secs=$REC_SECS timeout=$TIMEOUT strict=$STRICT dmesg=$DMESG_SCAN"
151+
log_info "Args: backend=${AUDIO_BACKEND:-auto} source=$SRC_CHOICE loops=$LOOPS durations='$DURATIONS' record_seconds=$RECORD_SECONDS timeout=$TIMEOUT strict=$STRICT dmesg=$DMESG_SCAN"
152152

153153
# Resolve backend
154154
if [ -z "$AUDIO_BACKEND" ]; then
@@ -364,7 +364,7 @@ append_junit() {
364364
} >> "$JUNIT_TMP"
365365
}
366366

367-
# Auto map if REC_SECS=auto, and accept numeric tokens like 35s/35sec/35secs/35seconds
367+
# Auto map if RECORD_SECONDS=auto, and accept numeric tokens like 35s/35sec/35secs/35seconds
368368
auto_secs_for() {
369369
case "$1" in
370370
short) echo "5s" ;;
@@ -405,7 +405,7 @@ for dur in $DURATIONS; do
405405
: > "$logf"
406406
export AUDIO_LOGCTX="$logf"
407407

408-
secs="$REC_SECS"
408+
secs="$RECORD_SECONDS"
409409
if [ "$secs" = "auto" ]; then
410410
tok="$(printf '%s' "$dur" | tr '[:upper:]' '[:lower:]')"
411411
tok_secs="$(printf '%s' "$tok" | sed -n 's/^\([0-9][0-9]*\)\(s\|sec\|secs\|seconds\)$/\1s/p')"

0 commit comments

Comments
 (0)