Skip to content

Conversation

@arikgreen
Copy link
Contributor

  1. Fix checking state of a mixer device.
  2. Add the three new test parameters:
    • headphone device name.
    • headset mic device name.
    • waiting time for change device state.
  3. Fix skipping.
    Fix skip if no module named: usbrelay.
    Add skip if no relays hardware are detected.

Before the fix the test failed, after fixed is skipped:

2025-10-21 06:57:03 UTC [REMOTE_INFO] ktime=856 sof-test PID=11147: starting
2025-10-21 06:57:03 UTC [REMOTE_WARNING] SKIP test because:
2025-10-21 06:57:03 UTC [REMOTE_WARNING] usbrelay command not found. Please install usbrelay package.
2025-10-21 06:57:03 UTC [REMOTE_INFO] Starting func_exit_handler(2)
2025-10-21 13:15:45 UTC [INFO] ktime=2722 sof-test PID=4645: starting
/usr/bin/usbrelay
2025-10-21 13:15:45 UTC [INFO] Debug mode: Current status of all relays:
2025-10-21 13:15:45 UTC [ERROR] No relays detected. Found 0 devices. Check hardware connection.
2025-10-21 13:15:45 UTC [ERROR] The usbrelay hw module is not responding or no relays detected. Check hardware connection.
2025-10-21 13:15:45 UTC [INFO] Starting func_exit_handler(2)
2025-10-21 13:15:45 UTC [INFO] Check if pipewire is running
2025-10-21 13:15:45 UTC [INFO] Pipewire not running
2025-10-21 13:15:45 UTC [ERROR] Starting func_exit_handler(), exit status=2, FUNCNAME stack:
2025-10-21 13:15:45 UTC [ERROR]  usbrelay_switch()  @ ~/sof-test/case-lib/relay.sh
2025-10-21 13:15:45 UTC [ERROR]  main()  @ ~/sof-test/test-case/test-jack-detection-playback-capture.sh:195
2025-10-21 13:15:45 UTC [ERROR]  main()  @ ~/sof-test/test-case/test-jack-detection-playback-capture.sh:226
2025-10-21 13:15:45 UTC [INFO] pkill -TERM -f mtrace-reader.py
2025-10-21 13:15:45 UTC [INFO] ktime=2723 sof-test PID=4645: ending
2025-10-21 13:15:45 UTC [INFO] Save kernel messages since 1761052537 to ~/sof-test/logs/test-jack-detection-playback-capture/2025-10-21-13:15:45-14754/dmesg.txt
2025-10-21 13:15:45 UTC [WARNING] Empty ~/sof-test/logs/test-jack-detection-playback-capture/2025-10-21-13:15:45-14754/dmesg.txt
2025-10-21 13:15:45 UTC [INFO] Test Result: SKIP!

Copy link
Collaborator

Choose a reason for hiding this comment

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

The commit subject and message are quite vague. You could be more specific, something like: "Skip before enabling logs to avoid failure".

Also: why does the moved line fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because in this case the log is empty, and an error is raised:
[ERROR] Empty logfile

commit msg - I'll change

Copy link
Collaborator

@marc-hb marc-hb Oct 24, 2025

Choose a reason for hiding this comment

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

because in this case the log is empty, and an error is raised:
[ERROR] Empty logfile

This is still not clear; there are multiple tests that do that in the same order and they never failed like this.

git grep -e skip_test -e start_log_

test-case/volume-basic-test.sh
test-case/multiple-pause-resume.sh
test-case/test-jack-detection-playback-capture.sh
test-case/test-mic-privacy.sh

Copy link
Collaborator

Choose a reason for hiding this comment

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

So I think this commit is just hiding another, unknown issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mark this is not the same case. For example volume-basic-test.sh
Between a logger_disabled and first appearance of skip_test there are many of commands generate logs to log file.

start_test

[[ -z $tplg ]] && die "Missing tplg file needed to run"
func_pipeline_export "$tplg" "type:playback"
logger_disabled || func_lib_start_log_collect

[[ $PIPELINE_COUNT -eq 0 ]] && die "Missing playback pipeline for aplay to run"

initialize_audio_params "0"
# play into background, this will wake up DSP and IPC. Need to clean after the test
aplay_opts -D "$dev" -c "$channel" -r "$rate" -f "$fmts" /dev/zero &
sleep 1
check_alsa_tool_process
sofcard=${SOFCARD:-0}

# https://mywiki.wooledge.org/BashFAQ/024 why cant I pipe data to read?
readarray -t pgalist < <("$TOPDIR"/tools/topo_vol_kcontrols.py "$tplg")

# This (1) provides some logging (2) avoids skip_test if amixer fails
get_sof_controls "$sofcard"
dlogi "pgalist number = ${#pgalist[@]}"
[[ ${#pgalist[@]} -ne 0 ]] || skip_test "No PGA control is available"

sub(/^.*: values=/, "", $0)
print $0
found=0
}')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe this is a good opportunity to extract this to some new, separate something.awk file that would be easier to test and re-usable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to separate awk file

The test ends with FAIL status despite
the method skip_test being called next enabling logs.
Reason of a fail: "Empty logfile"

Signed-off-by: Artur Wilczak <arturx.wilczak@intel.com>
Add the three new test parameters:
1. headphone device name.
2. headset mic device name.
3. waiting time for change device state.

Fix the function for checking a device state.

Signed-off-by: Artur Wilczak <arturx.wilczak@intel.com>
Fix skip if no module named: usbrelay.
Add skip if no relays hardware are detected.

Signed-off-by: Artur Wilczak <arturx.wilczak@intel.com>
@arikgreen arikgreen force-pushed the awilczax/fix-test-jack-detection branch from ba44dda to a7c0c66 Compare October 22, 2025 10:39
@redzynix redzynix merged commit 1e34865 into thesofproject:main Oct 24, 2025
4 of 8 checks passed
@arikgreen arikgreen changed the title awilczax/fix test jack detection Fix skipping a test in test-jack-detection. Oct 24, 2025
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.

5 participants