Skip to content

Detect dummy/virtual sinks with checkbox-support-pipewire-utils (New)#2317

Open
tomli380576 wants to merge 29 commits intomainfrom
detect-dummy-sinks
Open

Detect dummy/virtual sinks with checkbox-support-pipewire-utils (New)#2317
tomli380576 wants to merge 29 commits intomainfrom
detect-dummy-sinks

Conversation

@tomli380576
Copy link
Contributor

@tomli380576 tomli380576 commented Feb 4, 2026

Description

This PR adds a new subcommand to checkbox-support-pipewire-utils that checks whether the default audio/video device is a real device.

usage: Pipewire validator default_device_is_real [-h] -d {audio-source,audio-sink,video-source}

options:
  -h, --help            show this help message and exit
  -d, --device {audio-source,audio-sink,video-source}
                        Device type, audio source/sink or video source.

Example:

# Real device

$ checkbox-support-pipewire-utils default_device_is_real -d audio-sink
OK! 'Lunar Lake-M HD Audio Controller Speaker' (id=62) is a real device

$ echo $?
0

# dummy output 

$ checkbox-support-pipewire-utils default_device_is_real -d audio-sink
Default audio sink 'Dummy Output' (id=33) is a virtual device

$ echo $?
250

# virtual node from applications

$ checkbox-support-pipewire-utils default_device_is_real -d audio-sink
Default audio sink 'Easy Effects Sink' (id=91) is a virtual device

$ echo $?
250

Running this command before the record/playback step can prevent manual test cases from passing when the sources/sinks aren't real devices like dummy sink or a pipewire node created by another application.

Resolved issues

The current audio/alsa_record_playback_internal, audio/playback_headphones, bluetooth/audio-a2dp, bluetooth/audio_record_playback (and many others) are allowed to pass by default when the output device is a Dummy Sink or a virtual pipewire node as long as pipewire reports the device as a source/sink. This check can prevent these tests from passing when the device is not real.

Documentation

The basic idea is we ask wpctl for the ID of the current default device, then feed that ID into pw-dump. Inside the json returned by pw-dump there's an optional field called node.virtual. If it's explicitly set to true, then this node is definitely associated with a virtual/dummy device thus shouldn't be tested. Otherwise the device is likely real (or at least pipewire thinks it's real).

Some caveats:

  1. The term "default" is a bit misleading. Technically we are checking if the "currently selected" device is real, but "default" is pipewire's terminology.
  2. V4L2 loopback devices are considered real
  3. "Dummy Output" devices will appear both as sinks and sources
  4. There is no video-sink

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 90.90909% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.27%. Comparing base (1040ed4) to head (9a1583e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...support/checkbox_support/scripts/pipewire_utils.py 90.90% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2317      +/-   ##
==========================================
+ Coverage   55.24%   55.27%   +0.02%     
==========================================
  Files         413      413              
  Lines       44448    44481      +33     
  Branches     8194     8202       +8     
==========================================
+ Hits        24556    24587      +31     
- Misses      19032    19033       +1     
- Partials      860      861       +1     
Flag Coverage Δ
checkbox-ng 71.69% <ø> (ø)
checkbox-support 71.00% <90.90%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tomli380576 tomli380576 requested a review from Copilot February 5, 2026 02:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new default_device_is_real subcommand to checkbox-support-pipewire-utils that validates whether the default audio/video device is a physical device rather than a virtual or dummy device (e.g., "Dummy Output"). This prevents manual audio test cases from incorrectly passing when no real audio hardware is being tested.

Changes:

  • Added default_device_is_real method to detect virtual/dummy audio devices
  • Integrated device validation checks into audio test jobs with set -e for proper error handling
  • Added test coverage for both real and dummy device scenarios

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
providers/base/units/bluetooth/jobs.pxu Added device validation checks to Bluetooth audio tests with proper error handling
providers/base/units/audio/jobs.pxu Added device validation checks to audio playback and recording tests with proper error handling
checkbox-support/checkbox_support/scripts/tests/test_pipewire_utils.py Added unit tests and test data for device validation functionality
checkbox-support/checkbox_support/scripts/tests/test_data/wpctl_happy_path.txt Test data for real HDMI audio device scenario
checkbox-support/checkbox_support/scripts/tests/test_data/wpctl_dummy.txt Test data for dummy/virtual audio device scenario
checkbox-support/checkbox_support/scripts/tests/test_data/pw_dump_happy_path.txt JSON output for real device validation test
checkbox-support/checkbox_support/scripts/tests/test_data/pw_dump_dummy.txt JSON output for dummy device validation test
checkbox-support/checkbox_support/scripts/pipewire_utils.py Implemented default_device_is_real method with CLI argument parser

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tomli380576 tomli380576 changed the title Detect dummy sinks with checkbox-support-pipewire-utils (New) Detect dummy/virtual sinks with checkbox-support-pipewire-utils (New) Feb 5, 2026
@tomli380576 tomli380576 requested a review from Copilot February 5, 2026 07:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tomli380576 tomli380576 marked this pull request as ready for review February 9, 2026 04:07
@tomli380576
Copy link
Contributor Author

Job related changes are removed for now to not make this pr too big

@tomli380576 tomli380576 requested a review from Copilot February 9, 2026 05:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tomli380576 tomli380576 marked this pull request as draft February 9, 2026 05:10
@tomli380576 tomli380576 marked this pull request as ready for review February 9, 2026 06:06
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.

1 participant