Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch qdb entry being set and modified on start or while playing #211

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

fepitre
Copy link
Member

@fepitre fepitre commented Mar 26, 2024

@fepitre
Copy link
Member Author

fepitre commented Mar 26, 2024

It might deserves more logging messages but this is a first draft approach. In order to have a smooth switching experience, it requires that (see QubesOS/qubes-gui-daemon#141) pacat-simple-vchan remains open for welcoming any qube. For example, in my setup, I have both dom0 and sys-usb having it running for my test qube. In that case, playing VLC switches perfectly fine between both when changing audiovm.

@marmarek
Copy link
Member

@DemiMarie

Copy link
Contributor

@DemiMarie DemiMarie left a comment

Choose a reason for hiding this comment

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

Looks mostly good so far, but I’ll want to check tomorrow before I formally approve this change.

pipewire/qubes-pw-module.c Outdated Show resolved Hide resolved
pipewire/qubes-pw-module.c Outdated Show resolved Hide resolved
pipewire/qubes-pw-module.c Show resolved Hide resolved
@fepitre fepitre marked this pull request as ready for review April 2, 2024 09:28
Copy link
Contributor

@DemiMarie DemiMarie left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I hope I was not too harsh reviewing.

Comment on lines 1784 to 1786
do {
res = spa_loop_invoke(impl->main_loop, add_qdb_cb, 0, NULL, 0, true, impl);
} while (res == -EPIPE);
Copy link
Contributor

Choose a reason for hiding this comment

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

This code is already running on the main thread. Just call add_qdb_cb directly.


qdb_watch(impl->qdb, QUBES_AUDIOVM_QUBESDB_ENTRY);
qdb_fd = qdb_watch_fd(impl->qdb);
spa_assert_se(qdb_fd != -EPIPE);
Copy link
Contributor

Choose a reason for hiding this comment

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

Whta does -EPIPE mean here?

Copy link
Member Author

@fepitre fepitre Apr 6, 2024

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

That will cause a core dump. Is that really the intended behavior? I think the code should instead gracefully handle the case where the connection to qubesdb is lost.

struct impl *impl = user_data;
int qdb_fd;

qdb_watch(impl->qdb, QUBES_AUDIOVM_QUBESDB_ENTRY);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check the return value.

pipewire/qubes-pw-module.c Show resolved Hide resolved
pipewire/qubes-pw-module.c Outdated Show resolved Hide resolved
pipewire/qubes-pw-module.c Outdated Show resolved Hide resolved
pipewire/qubes-pw-module.c Show resolved Hide resolved
pipewire/qubes-pw-module.c Show resolved Hide resolved
pipewire/qubes-pw-module.c Outdated Show resolved Hide resolved
@qubesos-bot
Copy link

qubesos-bot commented Apr 4, 2024

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.2&build=2024042610-4.2&flavor=pull-requests

New failures, excluding unstable

Compared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.2&build=2024041501-4.2&flavor=update

  • system_tests_pvgrub_salt_storage

    • TC_40_PVGrub_debian-12-xfce: test_000_standalone_vm (failure)
      AssertionError: Failed command: apt-get update && apt-get install -...

    • TC_40_PVGrub_debian-12-xfce: test_010_template_based_vm (failure)
      AssertionError: Failed command: apt-get update && apt-get install -...

    • TC_42_PVHGrub_debian-12-xfce: test_000_standalone_vm (failure)
      AssertionError: Failed command: apt-get update && apt-get install -...

    • TC_42_PVHGrub_debian-12-xfce: test_010_template_based_vm (failure)
      AssertionError: Failed command: apt-get update && apt-get install -...

    • TC_10_VMSalt_debian-12-xfce: test_003_update (failure)
      AssertionError: Salt command '['qubesctl', '--skip-dom0', '--show-o...

  • system_tests_usbproxy

  • system_tests_network_updates

    • VmUpdates_debian-12-xfce: test_000_simple_update (failure)
      AssertionError: 1 not found in [0] : set -o pipefail; apt-get updat...
  • system_tests_basic_vm_qrexec_gui_zfs

  • system_tests_basic_vm_qrexec_gui_btrfs

Failed tests

20 failures
  • system_tests_pvgrub_salt_storage

    • TC_40_PVGrub_debian-12-xfce: test_000_standalone_vm (failure)
      AssertionError: Failed command: apt-get update && apt-get install -...

    • TC_40_PVGrub_debian-12-xfce: test_010_template_based_vm (failure)
      AssertionError: Failed command: apt-get update && apt-get install -...

    • [unstable] TC_41_HVMGrub_debian-12-xfce: test_000_standalone_vm (failure)
      AssertionError: Failed command: apt-get update && apt-get install -...

    • [unstable] TC_41_HVMGrub_debian-12-xfce: test_010_template_based_vm (failure)
      AssertionError: Failed command: apt-get update && apt-get install -...

    • TC_41_HVMGrub_fedora-39-xfce: test_000_standalone_vm (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_41_HVMGrub_fedora-39-xfce: test_010_template_based_vm (error)
      qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...

    • TC_42_PVHGrub_debian-12-xfce: test_000_standalone_vm (failure)
      AssertionError: Failed command: apt-get update && apt-get install -...

    • TC_42_PVHGrub_debian-12-xfce: test_010_template_based_vm (failure)
      AssertionError: Failed command: apt-get update && apt-get install -...

    • TC_10_VMSalt_debian-12-xfce: test_003_update (failure)
      AssertionError: Salt command '['qubesctl', '--skip-dom0', '--show-o...

  • system_tests_splitgpg

  • system_tests_usbproxy

  • system_tests_network_updates

    • VmUpdates_debian-12-xfce: test_000_simple_update (failure)
      AssertionError: 1 not found in [0] : set -o pipefail; apt-get updat...
  • system_tests_dispvm

    • [unstable] TC_20_DispVM_fedora-39-xfce: test_100_open_in_dispvm (failure)
      AssertionError: Timeout waiting for editor window
  • system_tests_basic_vm_qrexec_gui_zfs

  • system_tests_basic_vm_qrexec_gui_btrfs

Fixed failures

Compared to: https://openqa.qubes-os.org/tests/97064#dependencies

20 fixed

Unstable tests

  • system_tests_basic_vm_qrexec_gui

    TC_20_AudioVM_Pulse_debian-12-xfce/test_220_audio_play_pulseaudio (2/5 times with errors)
    • job 94385 AssertionError: too short audio, expected 10s, got 8.26902494331065...
    • job 95164 AssertionError: too short audio, expected 10s, got 9.06335600907029...
    TC_20_AudioVM_Pulse_fedora-39-xfce/test_220_audio_play_pulseaudio (1/5 times with errors)
    • job 94385 AssertionError: too short audio, expected 10s, got 8.97528344671201...
    TC_20_AudioVM_Pulse_whonix-workstation-17/test_220_audio_play_pulseaudio (5/5 times with errors)
    • job 94385 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95164 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 96347 AssertionError: only silence detected, no useful audio data
    • job 97080 AssertionError: only silence detected, no useful audio data
    • job 97185 AssertionError: only silence detected, no useful audio data
    TC_20_AudioVM_Pulse_whonix-workstation-17/test_221_audio_rec_muted_pulseaudio (2/5 times with errors)
    • job 94385 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95164 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17/test_222_audio_rec_unmuted_pulseaudio (5/5 times with errors)
    • job 94385 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95164 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 96347 AssertionError: only silence detected, no useful audio data
    • job 97080 AssertionError: only silence detected, no useful audio data
    • job 97185 AssertionError: only silence detected, no useful audio data
    TC_20_AudioVM_Pulse_whonix-workstation-17/test_223_audio_play_hvm (2/5 times with errors)
    • job 94385 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95164 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17/test_224_audio_rec_muted_hvm (2/5 times with errors)
    • job 94385 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95164 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17/test_225_audio_rec_unmuted_hvm (2/5 times with errors)
    • job 94385 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95164 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_PipeWire_debian-12-xfce/test_226_audio_playback_pipewire (2/5 times with errors)
    • job 94385 AssertionError: too short audio, expected 10s, got 9.34784580498866...
    • job 95164 AssertionError: too short audio, expected 10s, got 9.49097505668934...
  • system_tests_pvgrub_salt_storage

    TC_41_HVMGrub_debian-12-xfce/test_000_standalone_vm (3/5 times with errors)
    • job 96359 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
    • job 97092 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
    • job 97197 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
    TC_41_HVMGrub_debian-12-xfce/test_010_template_based_vm (3/5 times with errors)
    • job 96359 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
    • job 97092 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
    • job 97197 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
  • system_tests_extra

    TC_00_QVCTest_debian-12-xfce/test_010_screenshare (1/5 times with errors)
    • job 94380 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_QVCTest_fedora-39-xfce/test_010_screenshare (1/5 times with errors)
    • job 94380 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_QVCTest_whonix-gateway-17/test_010_screenshare (1/5 times with errors)
    • job 94380 AssertionError: 'qubes-video-companion screenshare' exited early (1...
    TC_00_QVCTest_whonix-workstation-17/test_010_screenshare (1/5 times with errors)
    • job 94380 AssertionError: 'qubes-video-companion screenshare' exited early (1...
    TC_00_QVCTest_debian-12-xfce/test_020_webcam (1/5 times with errors)
    • job 94380 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_QVCTest_fedora-39-xfce/test_020_webcam (1/5 times with errors)
    • job 94380 ~~~~^~~~~~~~~~... ZeroDivisionError: division by zero
    TC_00_QVCTest_whonix-gateway-17/test_020_webcam (1/5 times with errors)
    • job 94380 self.assertIsNone(p.returncode)... AssertionError: 1 is not None
    TC_00_QVCTest_whonix-workstation-17/test_020_webcam (1/5 times with errors)
    • job 94380 self.assertIsNone(p.returncode)... AssertionError: 1 is not None
    TC_00_Appmenus/test_121_create_appvm_with_whitelist (1/5 times with errors)
    • job 94380 '/tmp/tmpb0w885he/test-inst-app/apps/org.qubes-os.qubes-vm-setting...
  • system_tests_usbproxy

    TC_20_USBProxy_core3_debian-12-xfce/test_030_detach (1/5 times with errors)
    • job 95187 AssertionError: 0 == 0 : Device disconnection failed
    TC_20_USBProxy_core3_whonix-gateway-17/test_070_attach_not_installed_front (1/5 times with errors)
    • job 97173 qubesusbproxy.core3ext.QubesUSBException: Device attach failed: 202...
    TC_20_USBProxy_core3_debian-12-xfce/test_090_attach_stubdom (1/5 times with errors)
    • job 97608 AssertionError: 1 != 0 : Device connection failed
    TC_20_USBProxy_core3_fedora-39-xfce/test_090_attach_stubdom (1/5 times with errors)
    • job 97608 AssertionError: 1 != 0 : Device connection failed
  • system_tests_network_ipv6

    VmIPv6Networking_debian-12-xfce/test_031_firewall_dynamic_block (1/5 times with errors)
    • job 97090 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    VmIPv6Networking_fedora-39-xfce/test_031_firewall_dynamic_block (2/5 times with errors)
    • job 96357 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    • job 97090 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... AssertionError
  • system_tests_network_updates

    TC_10_QvmTemplate_whonix-gateway-17/test_010_template_install (1/5 times with errors)
    • job 97201 AssertionError: libvirt event impl drain timeout
    TC_11_QvmTemplateMgmtVM_fedora-39-xfce/test_010_template_install (1/5 times with errors)
    • job 96358 AssertionError: libvirt event impl drain timeout
  • system_tests_dispvm

    TC_20_DispVM_fedora-39-xfce/test_100_open_in_dispvm (1/5 times with errors)
    • job 94390 AssertionError: './open-file test.txt' failed with ./open-file test...
  • system_tests_devices

    TC_00_List_debian-12-xfce/test_001_list_loop_mounted (1/5 times with errors)
    • job 96351 AssertionError: Device test-inst-vm:loop0 (/tmp/test.img) should no...
  • system_tests_basic_vm_qrexec_gui_zfs

    TC_00_Basic/test_120_start_standalone_with_cdrom_dom0 (1/5 times with errors)
    • job 95180 AssertionError: 1 != 0 : b'Timeout waiting for dom0:loop4 device to...
    TC_20_AudioVM_Pulse_debian-12-xfce-pool/test_220_audio_play_pulseaudio (2/5 times with errors)
    • job 94379 AssertionError: Command 'paplay --format=float32le --rate=44100 --c...
    • job 95180 AssertionError: too short audio, expected 10s, got 8.96707482993197...
    TC_20_AudioVM_Pulse_fedora-39-xfce-pool/test_220_audio_play_pulseaudio (1/5 times with errors)
    • job 95180 AssertionError: too short audio, expected 10s, got 8.61614512471655...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_220_audio_play_pulseaudio (5/5 times with errors)
    • job 94379 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95180 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 96337 AssertionError: only silence detected, no useful audio data
    • job 97096 AssertionError: only silence detected, no useful audio data
    • job 97175 AssertionError: only silence detected, no useful audio data
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_221_audio_rec_muted_pulseaudio (2/5 times with errors)
    • job 94379 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95180 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_222_audio_rec_unmuted_pulseaudio (5/5 times with errors)
    • job 94379 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95180 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 96337 AssertionError: only silence detected, no useful audio data
    • job 97096 AssertionError: only silence detected, no useful audio data
    • job 97175 AssertionError: only silence detected, no useful audio data
    TC_20_AudioVM_Pulse_fedora-39-xfce-pool/test_223_audio_play_hvm (1/5 times with errors)
    • job 95180 AssertionError: frequency 3517.990148595454 not in specified range,...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_223_audio_play_hvm (2/5 times with errors)
    • job 94379 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95180 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_224_audio_rec_muted_hvm (2/5 times with errors)
    • job 94379 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95180 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_225_audio_rec_unmuted_hvm (2/5 times with errors)
    • job 94379 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95180 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
  • system_tests_basic_vm_qrexec_gui_btrfs

    TC_20_AudioVM_Pulse_debian-12-xfce-pool/test_220_audio_play_pulseaudio (2/5 times with errors)
    • job 94386 AssertionError: too short audio, expected 10s, got 9.32555555555555...
    • job 95165 AssertionError: too short audio, expected 10s, got 8.28539682539682...
    TC_20_AudioVM_Pulse_fedora-39-xfce-pool/test_220_audio_play_pulseaudio (2/5 times with errors)
    • job 94386 AssertionError: too short audio, expected 10s, got 9.21634920634920...
    • job 95165 AssertionError: too short audio, expected 10s, got 9.25759637188208...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_220_audio_play_pulseaudio (5/5 times with errors)
    • job 94386 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95165 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 96348 AssertionError: only silence detected, no useful audio data
    • job 97081 AssertionError: only silence detected, no useful audio data
    • job 97186 AssertionError: only silence detected, no useful audio data
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_221_audio_rec_muted_pulseaudio (2/5 times with errors)
    • job 94386 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95165 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_222_audio_rec_unmuted_pulseaudio (5/5 times with errors)
    • job 94386 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95165 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 96348 AssertionError: only silence detected, no useful audio data
    • job 97081 AssertionError: only silence detected, no useful audio data
    • job 97186 AssertionError: only silence detected, no useful audio data
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_223_audio_play_hvm (2/5 times with errors)
    • job 94386 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95165 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_224_audio_rec_muted_hvm (2/5 times with errors)
    • job 94386 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95165 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_225_audio_rec_unmuted_hvm (2/5 times with errors)
    • job 94386 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95165 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_PipeWire_fedora-39-xfce-pool/test_226_audio_playback_pipewire (1/5 times with errors)
    • job 94386 AssertionError: too short audio, expected 10s, got 7.64335600907029...
  • system_tests_basic_vm_qrexec_gui_ext4

    TC_20_AudioVM_Pulse_debian-12-xfce-pool/test_220_audio_play_pulseaudio (2/5 times with errors)
    • job 94268 AssertionError: too short audio, expected 10s, got 8.77791383219954...
    • job 95166 AssertionError: too short audio, expected 10s, got 9.13657596371882...
    TC_20_AudioVM_Pulse_fedora-39-xfce-pool/test_220_audio_play_pulseaudio (1/5 times with errors)
    • job 95166 AssertionError: too short audio, expected 10s, got 9.01439909297052...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_220_audio_play_pulseaudio (5/5 times with errors)
    • job 94268 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95166 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 96349 AssertionError: only silence detected, no useful audio data
    • job 97082 AssertionError: only silence detected, no useful audio data
    • job 97187 AssertionError: only silence detected, no useful audio data
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_221_audio_rec_muted_pulseaudio (2/5 times with errors)
    • job 94268 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95166 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_222_audio_rec_unmuted_pulseaudio (5/5 times with errors)
    • job 94268 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95166 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 96349 AssertionError: only silence detected, no useful audio data
    • job 97082 AssertionError: only silence detected, no useful audio data
    • job 97187 AssertionError: only silence detected, no useful audio data
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_223_audio_play_hvm (2/5 times with errors)
    • job 94268 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95166 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_224_audio_rec_muted_hvm (2/5 times with errors)
    • job 94268 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95166 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_225_audio_rec_unmuted_hvm (2/5 times with errors)
    • job 94268 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95166 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_PipeWire_fedora-39-xfce-pool/test_226_audio_playback_pipewire (2/5 times with errors)
    • job 94268 AssertionError: too short audio, expected 10s, got 9.14578231292517...
    • job 95166 AssertionError: too short audio, expected 10s, got 9.48775510204081...
  • system_tests_basic_vm_qrexec_gui_xfs

    TC_20_AudioVM_Pulse_debian-12-xfce-pool/test_220_audio_play_pulseaudio (3/5 times with errors)
    • job 94192 AssertionError: too short audio, expected 10s, got 9.48453514739229...
    • job 94388 AssertionError: too short audio, expected 10s, got 9.32911564625850...
    • job 95167 AssertionError: too short audio, expected 10s, got 8.98888888888888...
    TC_20_AudioVM_Pulse_fedora-39-xfce-pool/test_220_audio_play_pulseaudio (2/5 times with errors)
    • job 94192 AssertionError: too short audio, expected 10s, got 9.49594104308390...
    • job 94388 AssertionError: too short audio, expected 10s, got 8.73632653061224...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_220_audio_play_pulseaudio (5/5 times with errors)
    • job 94192 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 94388 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95167 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 97083 AssertionError: only silence detected, no useful audio data
    • job 97188 AssertionError: only silence detected, no useful audio data
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_221_audio_rec_muted_pulseaudio (3/5 times with errors)
    • job 94192 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 94388 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95167 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_debian-12-xfce-pool/test_222_audio_rec_unmuted_pulseaudio (2/5 times with errors)
    • job 94388 AssertionError: only silence detected, no useful audio data
    • job 97083 AssertionError: only silence detected, no useful audio data
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_222_audio_rec_unmuted_pulseaudio (5/5 times with errors)
    • job 94192 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 94388 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95167 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 97083 AssertionError: only silence detected, no useful audio data
    • job 97188 AssertionError: only silence detected, no useful audio data
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_223_audio_play_hvm (3/5 times with errors)
    • job 94192 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 94388 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95167 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_224_audio_rec_muted_hvm (3/5 times with errors)
    • job 94192 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 94388 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95167 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17-pool/test_225_audio_rec_unmuted_hvm (3/5 times with errors)
    • job 94192 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 94388 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95167 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_PipeWire_debian-12-xfce-pool/test_226_audio_playback_pipewire (1/5 times with errors)
    • job 95167 AssertionError: too short audio, expected 10s, got 9.48408163265306...
    TC_20_AudioVM_PipeWire_fedora-39-xfce-pool/test_226_audio_playback_pipewire (2/5 times with errors)
    • job 94388 AssertionError: too short audio, expected 10s, got 9.47580498866213...
    • job 95167 AssertionError: too short audio, expected 10s, got 9.47213151927437...
  • system_tests_basic_vm_qrexec_gui@hw1

    TC_20_AudioVM_Pulse_debian-12-xfce/test_220_audio_play_pulseaudio (2/5 times with errors)
    • job 94385 AssertionError: too short audio, expected 10s, got 8.26902494331065...
    • job 95164 AssertionError: too short audio, expected 10s, got 9.06335600907029...
    TC_20_AudioVM_Pulse_fedora-39-xfce/test_220_audio_play_pulseaudio (1/5 times with errors)
    • job 94385 AssertionError: too short audio, expected 10s, got 8.97528344671201...
    TC_20_AudioVM_Pulse_whonix-workstation-17/test_220_audio_play_pulseaudio (5/5 times with errors)
    • job 94385 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95164 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 96347 AssertionError: only silence detected, no useful audio data
    • job 97080 AssertionError: only silence detected, no useful audio data
    • job 97185 AssertionError: only silence detected, no useful audio data
    TC_20_AudioVM_Pulse_whonix-workstation-17/test_221_audio_rec_muted_pulseaudio (2/5 times with errors)
    • job 94385 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95164 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17/test_222_audio_rec_unmuted_pulseaudio (5/5 times with errors)
    • job 94385 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95164 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 96347 AssertionError: only silence detected, no useful audio data
    • job 97080 AssertionError: only silence detected, no useful audio data
    • job 97185 AssertionError: only silence detected, no useful audio data
    TC_20_AudioVM_Pulse_whonix-workstation-17/test_223_audio_play_hvm (2/5 times with errors)
    • job 94385 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95164 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17/test_224_audio_rec_muted_hvm (2/5 times with errors)
    • job 94385 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95164 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_Pulse_whonix-workstation-17/test_225_audio_rec_unmuted_hvm (2/5 times with errors)
    • job 94385 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    • job 95164 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
    TC_20_AudioVM_PipeWire_debian-12-xfce/test_226_audio_playback_pipewire (2/5 times with errors)
    • job 94385 AssertionError: too short audio, expected 10s, got 9.34784580498866...
    • job 95164 AssertionError: too short audio, expected 10s, got 9.49097505668934...


qdb_watch(impl->qdb, QUBES_AUDIOVM_QUBESDB_ENTRY);
qdb_fd = qdb_watch_fd(impl->qdb);
spa_assert_se(qdb_fd != -EPIPE);
Copy link
Contributor

Choose a reason for hiding this comment

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

That will cause a core dump. Is that really the intended behavior? I think the code should instead gracefully handle the case where the connection to qubesdb is lost.

Copy link
Contributor

@DemiMarie DemiMarie left a comment

Choose a reason for hiding this comment

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

yes, error handling in C is terrible

pipewire/qubes-pw-module.c Outdated Show resolved Hide resolved
Copy link
Member

@marmarek marmarek left a comment

Choose a reason for hiding this comment

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

If audiovm isn't set initially, or not running yet, then pipewire fails to start at all, with mod.qubes-audio: no /qubes-audio-domain-xid entry in QubesDB, so it doesn't see it set later (when audiovm is set or started).

pipewire/qubes-pw-module.c Show resolved Hide resolved
pipewire/qubes-pw-module.c Outdated Show resolved Hide resolved
pipewire/qubes-pw-module.c Outdated Show resolved Hide resolved
pipewire/qubes-pw-module.c Outdated Show resolved Hide resolved
pipewire/qubes-pw-module.c Outdated Show resolved Hide resolved
pipewire/qubes-pw-module.c Outdated Show resolved Hide resolved
Copy link
Contributor

@DemiMarie DemiMarie left a comment

Choose a reason for hiding this comment

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

There are probably some nits, but at this point I think the code is good to ship.

pw_log_error("Could not open QubesDB");
goto error;
}
impl->qdb = qdb;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: this should be cleaned up when the module is destroyed. Nit because right now that only happens at process exit anyway.

@marmarek
Copy link
Member

Relevant audiovm tests have passed :)

@fepitre
Copy link
Member Author

fepitre commented Apr 23, 2024

@DemiMarie @marmarek Are we good for this PR?

@DemiMarie
Copy link
Contributor

@fepitre good from my side

Copy link
Member

@marmarek marmarek left a comment

Choose a reason for hiding this comment

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

Besides some minor comments, please squash those commits together.

pw_log_info("AudioVM unset, disconnecting from %d", impl->domid);
else {
errno = -domid;
pw_log_error("Cannot obtain new peer domain ID: %m");
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it keep old impl->domid in this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is going to be either a negative value or an acceptable value. It will change in all the case on new audiovm so I don't think it matters.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, so you interpret failing to read as "no audiovm". I'm fine with this, but please adjust the message to be clear about it.

impl->domid = domid;
for (int i = 0; i < 2; ++i) {
if (impl->stream[i].source.fd != -1)
pw_log_error("Closing %d", impl->stream[i].source.fd);
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's an error, more like info?. And also, why only log message is under this "if", is that intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because this message is not pertinent if there is no fd, we don't close -1 as this is the value saying there is no fd.

goto error;
}
impl->qdb = qdb;
impl->domid = get_domid_from_qdb(impl->qdb);
Copy link
Member

Choose a reason for hiding this comment

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

Getting domid should be done just after setting up the watch, otherwise you'll miss modification between those two calls.

@fepitre fepitre force-pushed the devel20240324 branch 2 times, most recently from a0aa211 to 4ff04a6 Compare April 26, 2024 14:10
@marmarek marmarek merged commit 9becd06 into QubesOS:main Apr 26, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants