Skip to content

Make the PipeWire module a driver #205

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

Merged
merged 24 commits into from
Feb 5, 2024
Merged

Conversation

DemiMarie
Copy link
Contributor

Does not work yet

Without that flag accessing the buffer memory is undefined behavior,
though it happens to work in my tests.
This will help avoid data races in the future.  No functional change
intended.
@DemiMarie DemiMarie force-pushed the pipewire-driver branch 7 times, most recently from b3d17f3 to 28e04e0 Compare December 20, 2023 01:27
@DemiMarie
Copy link
Contributor Author

PipelineRetry

@DemiMarie DemiMarie force-pushed the pipewire-driver branch 2 times, most recently from 7c03346 to 46c7f48 Compare January 4, 2024 07:00
@marmarek
Copy link
Member

marmarek commented Jan 8, 2024

It doesn't build on Debian 12:

16:05:16,336 [executor:docker:9e23a0037e] output: qubes-pw-module.c: In function 'qubes_stream_data_needed':
16:05:16,336 [executor:docker:9e23a0037e] output: qubes-pw-module.c:189:16: error: incompatible types when assigning to type 'uint32_t' {aka 'unsigned int'} from type 'struct spa_fraction'

And also on Ubuntu 22.04 or CentOS Stream 8:

16:06:28,606 [executor:docker:590da0ab17] output: qubes-pw-module.c: In function 'unload_module':
16:06:28,606 [executor:docker:590da0ab17] output: qubes-pw-module.c:256:9: error: implicit declaration of function 'pw_impl_module_schedule_destroy'; did you mean 'pw_impl_module_destroy'? [-Werror=implicit-function-declaration]
16:06:28,606 [executor:docker:590da0ab17] output:   256 |         pw_impl_module_schedule_destroy(impl->module);
16:06:28,606 [executor:docker:590da0ab17] output:       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16:06:28,607 [executor:docker:590da0ab17] output:       |         pw_impl_module_destroy
16:06:28,608 [executor:docker:590da0ab17] output: qubes-pw-module.c: In function 'remove_stream_cb':
16:06:28,608 [executor:docker:590da0ab17] output: qubes-pw-module.c:456:15: error: 'struct qubes_stream' has no member named 'timer'
16:06:28,608 [executor:docker:590da0ab17] output:   456 |     if (stream->timer != NULL)
16:06:28,608 [executor:docker:590da0ab17] output:       |               ^~
16:06:28,609 [executor:docker:590da0ab17] output: In file included from /usr/include/pipewire-0.3/pipewire/loop.h:32,
16:06:28,609 [executor:docker:590da0ab17] output:                  from /usr/include/pipewire-0.3/pipewire/data-loop.h:48,
16:06:28,609 [executor:docker:590da0ab17] output:                  from qubes-pw-module.c:77:
16:06:28,609 [executor:docker:590da0ab17] output: qubes-pw-module.c:457:53: error: 'struct impl' has no member named 'data_loop_utils'; did you mean 'loop_utils'?
16:06:28,610 [executor:docker:590da0ab17] output:   457 |         spa_loop_utils_destroy_source(stream->impl->data_loop_utils, stream->timer);
16:06:28,610 [executor:docker:590da0ab17] output:       |                                                     ^~~~~~~~~~~~~~~
16:06:28,610 [executor:docker:590da0ab17] output: /usr/include/spa-0.2/spa/support/loop.h:282:37: note: in definition of macro 'spa_loop_utils_method_v'
16:06:28,610 [executor:docker:590da0ab17] output:   282 |         struct spa_loop_utils *_o = o;                                  \
16:06:28,610 [executor:docker:590da0ab17] output:       |                                     ^
16:06:28,610 [executor:docker:590da0ab17] output: qubes-pw-module.c:457:9: note: in expansion of macro 'spa_loop_utils_destroy_source'
16:06:28,611 [executor:docker:590da0ab17] output:   457 |         spa_loop_utils_destroy_source(stream->impl->data_loop_utils, stream->timer);
16:06:28,611 [executor:docker:590da0ab17] output:       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16:06:28,611 [executor:docker:590da0ab17] output: In file included from /usr/include/spa-0.2/spa/pod/builder.h:43,
16:06:28,611 [executor:docker:590da0ab17] output:                  from qubes-pw-module.c:73:
16:06:28,611 [executor:docker:590da0ab17] output: qubes-pw-module.c:457:76: error: 'struct qubes_stream' has no member named 'timer'
16:06:28,611 [executor:docker:590da0ab17] output:   457 |         spa_loop_utils_destroy_source(stream->impl->data_loop_utils, stream->timer);
16:06:28,611 [executor:docker:590da0ab17] output:       |                                                                            ^~
16:06:28,612 [executor:docker:590da0ab17] output: /usr/include/spa-0.2/spa/utils/hook.h:181:50: note: in definition of macro 'spa_callbacks_call'
16:06:28,612 [executor:docker:590da0ab17] output:   181 |                 _f->method((callbacks)->data, ## __VA_ARGS__);                  \
16:06:28,612 [executor:docker:590da0ab17] output:       |                                                  ^~~~~~~~~~~
16:06:28,612 [executor:docker:590da0ab17] output: /usr/include/spa-0.2/spa/support/loop.h:283:9: note: in expansion of macro 'spa_interface_call'
16:06:28,612 [executor:docker:590da0ab17] output:   283 |         spa_interface_call(&_o->iface,                                  \
16:06:28,612 [executor:docker:590da0ab17] output:       |         ^~~~~~~~~~~~~~~~~~
16:06:28,612 [executor:docker:590da0ab17] output: /usr/include/spa-0.2/spa/support/loop.h:317:49: note: in expansion of macro 'spa_loop_utils_method_v'
16:06:28,613 [executor:docker:590da0ab17] output:   317 | #define spa_loop_utils_destroy_source(l,...)    spa_loop_utils_method_v(l,destroy_source,0,__VA_ARGS__)
16:06:28,613 [executor:docker:590da0ab17] output:       |                                                 ^~~~~~~~~~~~~~~~~~~~~~~
16:06:28,613 [executor:docker:590da0ab17] output: qubes-pw-module.c:457:9: note: in expansion of macro 'spa_loop_utils_destroy_source'
16:06:28,613 [executor:docker:590da0ab17] output:   457 |         spa_loop_utils_destroy_source(stream->impl->data_loop_utils, stream->timer);
16:06:28,613 [executor:docker:590da0ab17] output:       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16:06:28,613 [executor:docker:590da0ab17] output: qubes-pw-module.c:458:11: error: 'struct qubes_stream' has no member named 'timer'
16:06:28,614 [executor:docker:590da0ab17] output:   458 |     stream->timer = NULL;
16:06:28,614 [executor:docker:590da0ab17] output:       |           ^~
16:06:28,625 [executor:docker:590da0ab17] output: qubes-pw-module.c: In function 'vchan_ready':
16:06:28,625 [executor:docker:590da0ab17] output: qubes-pw-module.c:774:31: error: 'STREAM_NOT_BLOCKED' undeclared (first use in this function)
16:06:28,625 [executor:docker:590da0ab17] output:   774 |             stream->blocked = STREAM_NOT_BLOCKED;
16:06:28,625 [executor:docker:590da0ab17] output:       |                               ^~~~~~~~~~~~~~~~~~

@DemiMarie
Copy link
Contributor Author

I’m not surprised @marmarek. Right now my main priority has been fixing Fedora and working around what appear to be multiple bugs in PipeWire.

@DemiMarie DemiMarie force-pushed the pipewire-driver branch 3 times, most recently from 3229733 to 91d3b4b Compare January 9, 2024 22:40
@DemiMarie DemiMarie marked this pull request as ready for review January 9, 2024 22:44
@DemiMarie DemiMarie force-pushed the pipewire-driver branch 4 times, most recently from 645c19f to 37fc750 Compare January 10, 2024 16:29
@marmarek
Copy link
Member

PipelineRetry

@qubesos-bot
Copy link

qubesos-bot commented Jan 11, 2024

OpenQA test summary

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

New failures, excluding unstable

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

  • system_tests_pvgrub_salt_storage

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

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

  • system_tests_splitgpg

  • system_tests_network_ipv6

  • system_tests_network_updates

Failed tests

6 failures
  • system_tests_pvgrub_salt_storage

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

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

  • system_tests_splitgpg

  • system_tests_network_ipv6

  • system_tests_network_updates

Fixed failures

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

10 fixed
  • 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_41_HVMGrub_debian-12-xfce: test_000_standalone_vm (failure)
      AssertionError: Failed command: apt-get update && apt-get install -...

    • TC_41_HVMGrub_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_guivm_gui_interactive

    • guivm_startup: unnamed test (unknown)
    • guivm_startup: Failed (test died)
      # Test died: no candidate needle with tag(s) 'desktop' matched...
  • system_tests_basic_vm_qrexec_gui_zfs

    • TC_20_AudioVM_Pulse_fedora-38-xfce-pool: test_223_audio_play_hvm (failure)
      AssertionError: too short audio, expected 10s, got 9.40260770975056...

Unstable tests

  • system_tests_basic_vm_qrexec_gui

    TC_20_AudioVM_Pulse_fedora-38-xfce/test_223_audio_play_hvm (1/5 times with errors)
    • job 88812 AssertionError: too short audio, expected 10s, got 9.44596371882086...
    TC_20_AudioVM_PipeWire_fedora-38-xfce/test_226_audio_playback_pipewire (1/5 times with errors)
    • job 90153 AssertionError: Command 'pw-play --format=f32 --rate=44100 --channe...
    TC_20_NonAudio_whonix-gateway-17/test_300_bug_1028_gui_memory_pinning (1/5 times with errors)
    • job 90153 AssertionError: Dom0 window doesn't match VM window content, saved ...
  • system_tests_pvgrub_salt_storage

    TC_40_PVGrub_debian-12-xfce/test_000_standalone_vm (1/5 times with errors)
    • job 89291 AssertionError: Failed command: apt-get update && apt-get install -...
    TC_41_HVMGrub_debian-12-xfce/test_000_standalone_vm (1/5 times with errors)
    • job 89291 AssertionError: Failed command: apt-get update && apt-get install -...
    TC_42_PVHGrub_debian-12-xfce/test_000_standalone_vm (1/5 times with errors)
    • job 89291 AssertionError: Failed command: apt-get update && apt-get install -...
    TC_10_VMSalt_debian-12-xfce/test_003_update (1/5 times with errors)
    • job 89291 AssertionError: Salt command '['qubesctl', '--skip-dom0', '--show-o...
    TC_40_PVGrub_debian-12-xfce/test_010_template_based_vm (1/5 times with errors)
    • job 89291 AssertionError: Failed command: apt-get update && apt-get install -...
    TC_41_HVMGrub_debian-12-xfce/test_010_template_based_vm (2/5 times with errors)
    • job 89291 AssertionError: Failed command: apt-get update && apt-get install -...
    • job 89320 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 120 seco...
    TC_42_PVHGrub_debian-12-xfce/test_010_template_based_vm (1/5 times with errors)
    • job 89291 AssertionError: Failed command: apt-get update && apt-get install -...
  • system_tests_splitgpg

    TC_10_Thunderbird_fedora-38-xfce/test_020_send_receive_inline_with_attachment (2/5 times with errors)
    • job 88799 Exception: Failed to send message with error 'unknown'
    • job 89293 Exception: Failed to send message with error 'unknown'
  • system_tests_usbproxy

    TC_20_USBProxy_core3_fedora-38-xfce/test_070_attach_not_installed_front (1/5 times with errors)
    • job 89645 qubesusbproxy.core3ext.QubesUSBException: Device attach failed: 202...
  • system_tests_qrexec

    TC_00_Qrexec_whonix-gateway-17/test_050_qrexec_simple_eof (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_050_qrexec_simple_eof (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_whonix-gateway-17/test_051_qrexec_simple_eof_reverse (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_051_qrexec_simple_eof_reverse (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_whonix-gateway-17/test_052_qrexec_vm_service_eof (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_052_qrexec_vm_service_eof (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_whonix-gateway-17/test_053_qrexec_vm_service_eof_reverse (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_053_qrexec_vm_service_eof_reverse (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_whonix-gateway-17/test_055_qrexec_dom0_service_abort (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_055_qrexec_dom0_service_abort (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_whonix-gateway-17/test_060_qrexec_exit_code_dom0 (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_060_qrexec_exit_code_dom0 (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_whonix-gateway-17/test_065_qrexec_exit_code_vm (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_065_qrexec_exit_code_vm (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_070_qrexec_vm_simultaneous_write (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_070_qrexec_vm_simultaneous_write (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_070_qrexec_vm_simultaneous_write (1/5 times with errors)
    • job 89292 AssertionError: Timeout, probably deadlock
    TC_00_Qrexec_fedora-38-xfce/test_071_qrexec_dom0_simultaneous_write (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_071_qrexec_dom0_simultaneous_write (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_071_qrexec_dom0_simultaneous_write (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_072_qrexec_to_dom0_simultaneous_write (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_072_qrexec_to_dom0_simultaneous_write (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_072_qrexec_to_dom0_simultaneous_write (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_080_qrexec_service_argument_allow_default (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_080_qrexec_service_argument_allow_default (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_080_qrexec_service_argument_allow_default (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_081_qrexec_service_argument_allow_specific (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_081_qrexec_service_argument_allow_specific (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_081_qrexec_service_argument_allow_specific (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_082_qrexec_service_argument_deny_specific (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_082_qrexec_service_argument_deny_specific (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_082_qrexec_service_argument_deny_specific (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_083_qrexec_service_argument_specific_implementation (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_083_qrexec_service_argument_specific_implementation (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_083_qrexec_service_argument_specific_implementation (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_084_qrexec_service_argument_extra_env (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_084_qrexec_service_argument_extra_env (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_084_qrexec_service_argument_extra_env (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_090_qrexec_service_socket_dom0 (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_090_qrexec_service_socket_dom0 (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_090_qrexec_service_socket_dom0 (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_091_qrexec_service_socket_dom0_send (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_091_qrexec_service_socket_dom0_send (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_091_qrexec_service_socket_dom0_send (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_092_qrexec_service_socket_dom0_eof_reverse (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_092_qrexec_service_socket_dom0_eof_reverse (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_092_qrexec_service_socket_dom0_eof_reverse (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_093_qrexec_service_socket_dom0_eof (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_093_qrexec_service_socket_dom0_eof (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_093_qrexec_service_socket_dom0_eof (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_095_qrexec_service_socket_vm (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_095_qrexec_service_socket_vm (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_095_qrexec_service_socket_vm (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_096_qrexec_service_socket_vm_send (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_096_qrexec_service_socket_vm_send (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_096_qrexec_service_socket_vm_send (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_097_qrexec_service_socket_vm_eof_reverse (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_097_qrexec_service_socket_vm_eof_reverse (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_097_qrexec_service_socket_vm_eof_reverse (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_098_qrexec_service_socket_vm_eof (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_098_qrexec_service_socket_vm_eof (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_098_qrexec_service_socket_vm_eof (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
    TC_00_Qrexec_fedora-38-xfce/test_100_qrexec_service_force_user (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-gateway-17/test_100_qrexec_service_force_user (1/5 times with errors)
    • job 89292 libvirt.libvirtError: internal error: libxenlight failed to create ...
    TC_00_Qrexec_whonix-workstation-17/test_100_qrexec_service_force_user (1/5 times with errors)
    • job 89292 ^^^^^^^^^^^^^^^^^^^^^^... AssertionError
  • system_tests_network_updates

    TC_10_QvmTemplate_debian-12-xfce/test_000_template_list (1/5 times with errors)
    • job 90501 AssertionError: libvirt event impl drain timeout
    TC_10_QvmTemplate_debian-12-xfce/test_010_template_install (1/5 times with errors)
    • job 89290 AssertionError: libvirt event impl drain timeout
  • system_tests_whonix@hw1

    whonix_torbrowser/ (1/5 times with errors)
    whonix_torbrowser/ (1/5 times with errors)
    whonix_torbrowser/Failed (1/5 times with errors)
    • job 88577 # Test died: no candidate needle with tag(s) 'tor-browser-ipcheck-o...
  • system_tests_basic_vm_qrexec_gui_btrfs

    TC_20_AudioVM_Pulse_debian-12-xfce-pool/test_222_audio_rec_unmuted_pulseaudio (1/5 times with errors)
    • job 90170 qubes.exc.QubesVMError: Failed to attach audio input from dom0 to t...
    TC_20_NonAudio_whonix-gateway-17-pool/test_300_bug_1028_gui_memory_pinning (2/5 times with errors)
    • job 88786 AssertionError: Dom0 window doesn't match VM window content, saved ...
    • job 89654 AssertionError: Dom0 window doesn't match VM window content, saved ...
  • system_tests_basic_vm_qrexec_gui@hw1

    TC_20_AudioVM_Pulse_fedora-38-xfce/test_223_audio_play_hvm (1/5 times with errors)
    • job 88812 AssertionError: too short audio, expected 10s, got 9.44596371882086...
    TC_20_AudioVM_PipeWire_fedora-38-xfce/test_226_audio_playback_pipewire (1/5 times with errors)
    • job 90153 AssertionError: Command 'pw-play --format=f32 --rate=44100 --channe...
    TC_20_NonAudio_whonix-gateway-17/test_300_bug_1028_gui_memory_pinning (1/5 times with errors)
    • job 90153 AssertionError: Dom0 window doesn't match VM window content, saved ...
  • system_tests_basic_vm_qrexec_gui_xfs

    TC_20_AudioVM_PipeWire_debian-12-xfce-pool/test_227_audio_rec_muted_pipewire (1/5 times with errors)
    • job 89656 AttributeError: 'NoneType' object has no attribute 'read'
  • system_tests_basic_vm_qrexec_gui_zfs

    TC_00_Basic/test_120_start_standalone_with_cdrom_dom0 (1/5 times with errors)
    • job 88811 AssertionError: 1 != 0 : b'Timeout waiting for dom0:loop4 device to...
    TC_20_AudioVM_Pulse_fedora-38-xfce-pool/test_223_audio_play_hvm (1/5 times with errors)
    • job 90538 AssertionError: too short audio, expected 10s, got 9.40260770975056...
    TC_20_AudioVM_PipeWire_debian-12-xfce-pool/test_227_audio_rec_muted_pipewire (1/5 times with errors)
    • job 89319 AttributeError: 'NoneType' object has no attribute 'read'
  • system_tests_whonix

    whonix_torbrowser/ (1/5 times with errors)
    whonix_torbrowser/ (1/5 times with errors)
    whonix_torbrowser/Failed (1/5 times with errors)
    • job 88577 # Test died: no candidate needle with tag(s) 'tor-browser-ipcheck-o...

@marmarek
Copy link
Member

openQArun

3 similar comments
@marmarek
Copy link
Member

openQArun

@marmarek
Copy link
Member

openQArun

@marmarek
Copy link
Member

openQArun

Also add explicit checks for two more known but unimplemented cases.
It was always "Unknown error -1" due to misplaced parentheses.
This will cause pacat-simple-vchan to print a "Stream uncork" message to
the terminal, which can cause more xruns, creating a loop.
No functional change intended.
libvchan_write() should never be used to write to the control vchan, as
partial records are not allowed there.  Always use libvchan_send().
It's strictly better to record some samples than all zeros.
No other functional change intended.
This is needed to avoid running out of capture buffers.
This should not make a difference, modulo bugs...
This allows running any PipeWire stream out-of-process.
The PipeWire agent is more code than the PulseAudio agent, and it is not
experimental.
Ubuntu Jammy (the oldest that needs to be supported) has 0.3.48.
pw_context_get_support() is guaranteed to return a non-NULL pointer that
can be used with spa_support_find(), but does not guarantee that any
particular interface is present in the returned support objects.  The
list of interfaces has changed in the past and might change again.
Instead, use the public functions in the PipeWire API, which are
more likely to remain stable in future releases of PipeWire.
@marmarek
Copy link
Member

marmarek commented Feb 2, 2024

This still fails to build on Ubuntu jammy

@DemiMarie DemiMarie force-pushed the pipewire-driver branch 2 times, most recently from ab0fb95 to 8a13d5c Compare February 2, 2024 18:40
This avoids crashing, leaking memory, or other problems, even if the
peer detaches unexpectedly or some function called by this module fails.
In particular, this avoids a use-after-free during shutdown.

The needed changes break the build on CentOS Stream 8, so stop building
the PipeWire agent for this soon-to-be-EOL OS.
This avoids a bunch of repeated functions that merely extract the
correct stream from the impl struct and then call the callback which
does the real work.
This fixes audio quality in a Jitsi meeting using Firefox.  It uses a
delay-locked loop (DLL) to tell the resampler what rate it should use.
If the buffer is too full, it tells the resampler to resample to a lower
sample rate for playback, or to consume a higher sample rate for
capture.  If the buffer is not full enough, it tells the resampler to do
the opposite.  This ensures that buffer fill sizes are kept roughly
constant, resulting in very stable performance even over substantial
periods of time.  This also allows using very large capture buffers
(1MiB by default), which ensures that pacat-simple-vchan will not
overrun its buffer unless something is very wrong.  Without the DLL,
such large capture buffers could fill up and cause massive latency
spikes.

Because rate-matching adversely affects audio quality and increases
latency, this commit also adds support for driving the PipeWire
processing graph.  When this module is driving the graph, no
rate-matching is done.  Instead, the DLL is used to adjust the delay
between runs of the processing graph.  Since most Qubes OS VMs have no
physical audio hardware connected to them, the only other driver is
likely to be the "dummy" driver that just uses a timer.  It is strictly
preferable for this module to drive the graph instead, as this avoids
rate matching and can sometimes avoid resampling.

This was tested with PulseAudio in dom0 by me, and with both PulseAudio
and PipeWire in dom0 by Marek.  I also tested a version that does not
drive the graph to ensure that this mode works fine, which it does.
Using PipeWire in the AudioVM might provide a means of reducing overall
system latency, especially since the current code needs rather large
capture and playback buffers (8KiB by default) to smooth out uneven
sample delivery and processing in the AudioVM.  In the long term, I hope
to improve Xen’s scheduler to prioritize audio and other hard-realtime
tasks, which will allow the use of smaller buffers.

This also adds two new tunables:

- org.qubes-os.playback.target-buffer-fill (integer) sets the target
  fill level of the playback vchan.

- org.qubes-os.record.target-buffer-fill (integer) sets the target
  fill level of the recording vchan.

For consistency, org.qubes-os.record-buffer-size and
org.qubes-os.playback-buffer-size have been replaced by
org.qubes-os.record.buffer-size and org.qubes-os.playback.buffer-size,
respectively.  As it is believed that nobody but me is using these,
backwards compatibility is not provided, but it is easy to add.  The
sample configuration has been updated accordingly.
@marmarek
Copy link
Member

marmarek commented Feb 2, 2024

PipelineRetry

@marmarek marmarek merged commit 3b287d5 into QubesOS:main Feb 5, 2024
@DemiMarie DemiMarie deleted the pipewire-driver branch February 5, 2024 03:53
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.

3 participants