patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: Demi Marie Obenour <demiobenour@gmail.com>
Cc: Spectrum OS Development <devel@spectrum-os.org>
Subject: Re: [PATCH v3] Run PipeWire and WirePlumber in the VMs
Date: Fri, 18 Jul 2025 12:19:33 +0200	[thread overview]
Message-ID: <87qzydsswa.fsf@alyssa.is> (raw)
In-Reply-To: <87tt39stoz.fsf@alyssa.is>

[-- Attachment #1: Type: text/plain, Size: 6286 bytes --]

Alyssa Ross <hi@alyssa.is> writes:

> Demi Marie Obenour <demiobenour@gmail.com> writes:
>
>> On 7/14/25 10:54, Alyssa Ross wrote:
>>> Demi Marie Obenour <demiobenour@gmail.com> writes:
>>> 
>>>> WirePlumber is completely overkill as a session manager here, and
>>>> ideally a trivial session manager would be used instead.  I did build a
>>>> Spectrum OS image and found that PipeWire and WirePlumber both
>>>> successfully started.  PipeWire is configured to listen on the
>>>> PulseAudio socket, so PulseAudio compatibility works.  This does inject
>>>> a large number of completely unnecessary files into the VM, notably for
>>>> libcamera and Bluetooth support.
>>> 
>>> Yeah, I saw this in the log:
>>> 
>>> N 14:27:54.810067 wp-internal-comp-l ../lib/wp/private/internal-comp-loader.c:588:on_component_loaded: <WpCore:0x28d95d30> optional component 'support.logind [module: libwireplumber-module-logind]' failed to load: failed to start systemd logind monitor: -2 (No such file or directory)
>>> N 14:27:54.811299 wp-internal-comp-l ../lib/wp/private/internal-comp-loader.c:640:wp_component_array_load_task_execute_step: <WpCore:0x28d95d30> skipping component 'monitor.bluez.seat-monitoring [virtual]' because some of its dependencies were not loaded
>>> E 14:27:54.851210           spa.dbus ../spa/plugins/support/dbus.c:333:impl_connection_get: Failed to connect to system bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
>>> E 14:27:54.852143         spa.bluez5 ../spa/plugins/bluez5/bluez5-dbus.c:6632:impl_init: failed to get dbus connection
>>> N 14:27:54.855904          wp-device ../lib/wp/device.c:710:wp_spa_device_new_from_spa_factory: SPA handle 'api.bluez5.enum.dbus' could not be loaded; is it installed?
>>> N 14:27:54.856657         s-monitors bluez.lua:411:createMonitor: PipeWire's BlueZ SPA plugin is missing or broken. Bluetooth devices will not be supported.
>>> E 14:27:54.859091    spa.bluez5.midi ../spa/plugins/bluez5/midi-enum.c:805:impl_init: Creating GDBus connection failed: Could not connect: No such file or directory
>>> N 14:27:54.859810          wp-device ../lib/wp/device.c:710:wp_spa_device_new_from_spa_factory: SPA handle 'api.bluez5.midi.enum' could not be loaded; is it installed?
>>> N 14:27:54.860524         s-monitors bluez-midi.lua:95:createMonitor: PipeWire's BlueZ MIDI SPA missing or broken. Bluetooth not supported.
>>> E 14:27:54.861346 spa.bluez5.midi.no ../spa/plugins/bluez5/midi-node.c:1989:impl_init: failed to get dbus connection: Could not connect: No such file or directory
>>> E 14:27:54.862435        pw.resource ../src/pipewire/resource.c:255:pw_resource_errorf_id: can't create node: Input/output error
>>> W 14:27:54.863275            wp-node ../lib/wp/node.c:913:wp_impl_node_new_from_pw_factory: failed to create node from factory 'spa-node-factory'
>>> N 14:27:54.863965         s-monitors bluez-midi.lua:130:createServers: Failed to create BLE MIDI server.
>>> [0:00:01.314658075] [123]  INFO IPAManager ipa_manager.cpp:137 libcamera is not installed. Adding '/nix/store/src/ipa' to the IPA search path
>>> [0:00:01.321611889] [123]  INFO Camera camera_manager.cpp:326 libcamera v0.5.0
>>> 
>>> Can we set something in a config file or something to disable this extra
>>> stuff?
>>
>> I started work on a v4 patch, but before sending it I decided to test
>> that not only did PipeWire and WirePlumber start, but also that I
>> could actually play sound to a virtio-sound device I had attached
>> to the VM.  This failed rather miserably, and I finally figured out
>> the culprit: PipeWire relies on udev for device discovery, and without
>> udev it doesn't detect any devices.
>>
>> It appears possible to create devices in PipeWire via the PipeWire CLI
>> or via the configuration file.  The former would allow them to be
>> created by mdevd, while the latter would be appropriate if the devices
>> were known to be ready before PipeWire started.
>>
>> I strongly recommend using either systemd-udevd (with systemd) or eudev
>> (without systemd) in the host and in any VM that will have real hardware
>> attached to it.  udev rules are where all the upstream work on uevent
>> processing is happening, so it fits with Spectrum's "upstream first"
>> mindset.  Something simpler like mdevd might be appropriate for VMs that
>> will only ever see virtual hardware with known behavior and do not need
>> to deal with the quirks of real hardware.
>
> No real objection to udev in VMs.  On the host I'm less sure, because
> ideally the host shouldn't really be interacting with hardware very
> much, so it comes down to whether there are things in scope for the host
> where the kernel doesn't do the right thing by default.
>
>> For the host, I think systemd is probably the right solution.  It's
>> complicated, but that is because it solves a complicated problem.
>> Without systemd, Spectrum will wind up needing to reimplement a lot of
>> configuration that has already been written for systemd.  Also, systemd
>> has fantastic TPM support.
>
> systemd is very modular.  I'm not sure you need much of the rest of
> systemd to use the TPM stuff, for example.  The value I'd see in systemd
> would be all the sandboxing stuff for services.  It's annoying because
> none of that has to be part of a single unified service manager either —
> it could largely easily be done by modular chainloaders — but given
> nobody is implementing it outside of systemd there might not be a
> reasonable other choice.  So I'm not really opposed to this either, and
> I guess it probably means we need udev on the host anyway.  I don't know
> when I'd be able to prioritise making the switch, though…

Although at that point we're introducing lots of sockets and global
buses and things that we've so far been very keen to avoid on the host.
I'm really not sure all that additional surface is actually a good
tradeoff compared to doing what defense in depth sandboxing measures we
can easily do ourselves.  The set of software that has to run on the
code is very tightly constrained, so it's a very different situation to
what we'd find in VMs, where we need to be compatible with arbitrary
stuff…

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

  reply	other threads:[~2025-07-18 10:20 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-11  2:44 [PATCH v3] Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-07-14 14:54 ` Alyssa Ross
2025-07-15 20:22   ` Demi Marie Obenour
2025-07-16 10:26     ` Alyssa Ross
2025-07-16 21:16   ` Demi Marie Obenour
2025-07-16 21:27     ` Demi Marie Obenour
2025-07-18 12:16       ` Alyssa Ross
2025-07-17  5:53   ` Demi Marie Obenour
2025-07-18 10:02     ` Alyssa Ross
2025-07-18 10:19       ` Alyssa Ross [this message]
2025-07-18  2:07 ` [PATCH v4 0/3] Sound support in Spectrum VMs Demi Marie Obenour
2025-07-18  2:13   ` [PATCH v4 1/3] Rebuild the root filesystem when the makefile changes Demi Marie Obenour
2025-07-18 11:14     ` Alyssa Ross
2025-07-18  2:13   ` [PATCH v4 2/3] Fix permissions on /tmp Demi Marie Obenour
2025-07-18 11:51     ` Alyssa Ross
2025-07-18 11:51     ` Alyssa Ross
2025-07-18 11:53     ` Alyssa Ross
2025-07-18  2:14   ` [PATCH v4 3/3] Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-07-18 11:27     ` Alyssa Ross
2025-07-18 17:59       ` Demi Marie Obenour
2025-07-19  9:22         ` Alyssa Ross
2025-07-19 20:05           ` Demi Marie Obenour
2025-07-19  8:06     ` Alyssa Ross
2025-07-19 20:03       ` Demi Marie Obenour
2025-07-19 20:07         ` Demi Marie Obenour
2025-07-20  7:50           ` Alyssa Ross
2025-07-20 17:58   ` [PATCH v5 0/8] Sound support in Spectrum VMs Demi Marie Obenour
2025-07-20 18:02     ` [PATCH v5 1/8] Revert "img/app: fix permissions on /tmp" Demi Marie Obenour
2025-07-21  9:34       ` Alyssa Ross
2025-07-20 18:03     ` [PATCH v5 2/8] img/app: Use separate service to create directories Demi Marie Obenour
2025-07-21  9:21       ` Alyssa Ross
2025-07-22 23:48         ` Demi Marie Obenour
2025-07-20 18:04     ` [PATCH v5 3/8] img/app: Fix permissions of /tmp/.X11-unix Demi Marie Obenour
2025-07-20 18:05     ` [PATCH v5 4/8] img/app: Create other X11 directories Demi Marie Obenour
2025-07-21  9:23       ` Alyssa Ross
2025-07-21 19:03         ` Demi Marie Obenour
2025-07-20 18:06     ` [PATCH v5 5/8] img/app: Be explicit about directory modes Demi Marie Obenour
2025-07-20 18:08     ` [PATCH v5 6/8] img/app: create /run/user and /run/wait very early in boot Demi Marie Obenour
2025-07-21  9:23       ` Alyssa Ross
2025-07-20 18:10     ` [PATCH v5 7/8] host/rootfs: " Demi Marie Obenour
2025-07-20 18:11     ` [PATCH v5 8/8] img/app: Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-07-21  9:42       ` Alyssa Ross
2025-07-21 19:09         ` Demi Marie Obenour
2025-07-26 10:11           ` Alyssa Ross
2025-07-21 19:10         ` Demi Marie Obenour
2025-07-24 22:15     ` [PATCH v6 0/5] Sound support in Spectrum VMs Demi Marie Obenour
2025-07-24 22:30       ` [PATCH v6 1/5] host/rootfs: Create /run/user and /run/wait via run-image Demi Marie Obenour
2025-07-26 10:46         ` Alyssa Ross
2025-07-24 22:32       ` [PATCH v6 2/5] img/app: " Demi Marie Obenour
2025-07-24 22:33       ` [PATCH v6 3/5] img/app: tell mount(8) to create directories Demi Marie Obenour
2025-07-26 11:20         ` Alyssa Ross
2025-07-26 11:26         ` Alyssa Ross
2025-07-24 22:35       ` [PATCH v6 4/5] img/app: Create needed directories in early boot Demi Marie Obenour
2025-07-26 10:24         ` Alyssa Ross
2025-07-27 20:13           ` Demi Marie Obenour
2025-07-24 22:36       ` [PATCH v6 5/5] img/app: Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-07-26 11:29         ` Alyssa Ross
2025-07-26 10:57       ` [PATCH v6 0/5] Sound support in Spectrum VMs Alyssa Ross
2025-07-28  5:57       ` [PATCH v7 0/2] " Demi Marie Obenour
2025-07-28  6:01         ` [PATCH v7 1/2] img/app: Create needed directories in early boot Demi Marie Obenour
2025-07-28  6:03         ` [PATCH v7 2/2] img/app: Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-07-28  6:18           ` Demi Marie Obenour
2025-07-28 23:13         ` [PATCH v8 0/2] Sound support in Spectrum VMs Demi Marie Obenour
2025-07-29  0:32           ` [PATCH v9 " Demi Marie Obenour
2025-07-29  0:33             ` [PATCH v9 1/2] img/app: Create needed directories in early boot Demi Marie Obenour
2025-07-29 12:44               ` Alyssa Ross
2025-07-29  0:33             ` [PATCH v9 2/2] img/app: Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-07-29 13:08               ` Alyssa Ross
2025-07-29 21:17                 ` Demi Marie Obenour
2025-07-30  8:10                   ` Alyssa Ross
2025-07-30  9:59             ` [PATCH v10] " Demi Marie Obenour
2025-07-31  9:12               ` Alyssa Ross
2025-07-31  9:40               ` Alyssa Ross
2025-07-31 17:06               ` [PATCH v11] " Demi Marie Obenour
2025-08-01 17:53                 ` Alyssa Ross
2025-08-02  7:54                 ` Alyssa Ross
2025-07-28 23:13         ` [PATCH v8 1/2] img/app: Create needed directories in early boot Demi Marie Obenour
2025-07-28 23:19           ` Demi Marie Obenour
2025-07-28 23:13         ` [PATCH v8 2/2] img/app: Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-07-29 12:41         ` [PATCH v7 0/2] Sound support in Spectrum VMs Alyssa Ross
2025-07-24 22:23     ` [PATCH v6 1/5] host/rootfs: Create /run/user and /run/wait via run-image Demi Marie Obenour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87qzydsswa.fsf@alyssa.is \
    --to=hi@alyssa.is \
    --cc=demiobenour@gmail.com \
    --cc=devel@spectrum-os.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).