Skip to content

Add test script to validate USB UAC#266

Open
achauras-qcom wants to merge 3 commits intoqualcomm-linux:mainfrom
achauras-qcom:feature/usb-uac
Open

Add test script to validate USB UAC#266
achauras-qcom wants to merge 3 commits intoqualcomm-linux:mainfrom
achauras-qcom:feature/usb-uac

Conversation

@achauras-qcom
Copy link
Contributor

The shell script verifies the enumeration of USB Audio Devices connected to DUT.

@achauras-qcom achauras-qcom force-pushed the feature/usb-uac branch 2 times, most recently from 6877bdd to 9f1040f Compare February 17, 2026 11:41
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.

Commit ordering / path inconsistency (important for clean history)

Create files directly in Runner/suites/Kernel/Baseport/USB/usb_uac/ from patch 1 onward, and drop patch 4/4 entirely.
Alternative:
Move patch 4/4 earlier (as 1/4), then add script/README/YAML into the final location.

The shell script verifies the enumeration of USB Audio Class devices.

Signed-off-by: Aanchal Chaurasia <achauras@qti.qualcomm.com>
Added setup information and basic requirements.
This informs the tester of the hardware setup requirement before
starting test.

Signed-off-by: Aanchal Chaurasia <achauras@qti.qualcomm.com>
Individual test definition is meant to be used for debugging the test
script running in LAVA.

Signed-off-by: Aanchal Chaurasia <achauras@qti.qualcomm.com>
audio_device_count=$(
for f in /sys/bus/usb/devices/*/bInterfaceClass; do
[ -r "$f" ] || continue
if grep -qx '01' "$f"; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Validate more than bInterfaceClass == 01

# Count uniques devices with bInterfaceClass = 01 (UAC) under /sys/bus/usb/devices
audio_device_count=0
log_info "=== USB Audio device Detection ==="
audio_device_count=$(
Copy link
Contributor

Choose a reason for hiding this comment

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

Add ALSA/device-node checks (/dev/snd, /proc/asound/cards, aplay -l, arecord -l where available)
Print detected UAC device details (VID:PID, product, device path)

log_info "=== Test Initialization ==="

# Check if grep is installed, else skip test
deps_list="grep sed sort wc"
Copy link
Contributor

Choose a reason for hiding this comment

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

Add missing dependency tr

done 2>/dev/null | sed 's/:.*$//' | sort -u | wc -l | tr -d '[:space:]'
)

log_info "Number of USB audio devices found: $audio_device_count"
Copy link
Contributor

Choose a reason for hiding this comment

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

Distinguish playback-only vs capture-only devices and also log bound driver info from sysfs


- Connect USB Audio peripheral(s) to USB port(s) on DUT.
- Only applicable for USB ports that support Host Mode functionality.
- USB Audio peripherals examples: USB headset, microphone, sound card, etc.
Copy link
Contributor

Choose a reason for hiding this comment

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

Improve README to clarify exact validation scope

echo "$TESTNAME PASS" > "$RES_FILE"
exit 0
else
log_fail "$TESTNAME : Test Failed - No 'USB Audio Device' found"
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider whether “no UAC device attached” should be FAIL or SKIP

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