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: [RFC PATCH] Run PipeWire and WirePlumber in the VMs
Date: Thu, 26 Jun 2025 10:35:49 +0200	[thread overview]
Message-ID: <87sejmlx22.fsf@alyssa.is> (raw)
In-Reply-To: <2ff17d00-6603-46ae-9eb0-d4fa179db86c@gmail.com>

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

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.  Also, this
> code has seen absolutely no testing beyond "it builds", not least
> because there is no way to add a virtio-sound device to Cloud Hypervisor
> yet and I haven't tried using QEMU TCG.
>
> Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>

We indeed can't test sound works, but doat least try running the VM and
make sure that it works like it did before!  With this applied, the
application no longer starts, because the new files weren't added to the
Makefile.

Well done for figuring out s6 though. :)

> ---
>  img/app/default.nix                           |  5 ++++-
>  img/app/etc/fstab                             |  5 +++--
>  .../etc/s6-rc/app/dependencies.d/wireplumber  |  0
>  img/app/etc/s6-rc/directories/type            |  1 +
>  img/app/etc/s6-rc/directories/up              | 11 ++++++++++
>  .../s6-rc/pipewire/dependencies.d/directories |  0
>  img/app/etc/s6-rc/pipewire/notification-fd    |  1 +
>  img/app/etc/s6-rc/pipewire/run                | 20 +++++++++++++++++++
>  img/app/etc/s6-rc/pipewire/type               |  1 +
>  .../dependencies.d/directories                |  0
>  img/app/etc/s6-rc/wayland-proxy-virtwl/run    | 11 ----------
>  .../etc/s6-rc/wireplumber/dependencies.d/dbus |  0
>  .../s6-rc/wireplumber/dependencies.d/pipewire |  0
>  img/app/etc/s6-rc/wireplumber/run             | 16 +++++++++++++++
>  img/app/etc/s6-rc/wireplumber/type            |  1 +
>  15 files changed, 58 insertions(+), 14 deletions(-)
>  create mode 100644 img/app/etc/s6-rc/app/dependencies.d/wireplumber
>  create mode 100644 img/app/etc/s6-rc/directories/type
>  create mode 100644 img/app/etc/s6-rc/directories/up
>  create mode 100644 img/app/etc/s6-rc/pipewire/dependencies.d/directories
>  create mode 100644 img/app/etc/s6-rc/pipewire/notification-fd
>  create mode 100644 img/app/etc/s6-rc/pipewire/run
>  create mode 100644 img/app/etc/s6-rc/pipewire/type
>  create mode 100644 img/app/etc/s6-rc/wayland-proxy-virtwl/dependencies.d/directories
>  create mode 100644 img/app/etc/s6-rc/wireplumber/dependencies.d/dbus
>  create mode 100644 img/app/etc/s6-rc/wireplumber/dependencies.d/pipewire
>  create mode 100644 img/app/etc/s6-rc/wireplumber/run
>  create mode 100644 img/app/etc/s6-rc/wireplumber/type

Files that can't include comments need to have .license files next to
them for "reuse lint" to pass.  (This is one of the checks included if
you do a full release build by building release.nix.)

> diff --git a/img/app/default.nix b/img/app/default.nix
> index a196205..32ddb67 100644
> --- a/img/app/default.nix
> +++ b/img/app/default.nix
> @@ -8,7 +8,7 @@ pkgsStatic.callPackage (
>  { lib, stdenvNoCC, runCommand, writeClosure
>  , erofs-utils, jq, s6-rc, util-linux
>  , busybox, cacert, dejavu_fonts, execline, kmod, linux_latest, mdevd, s6
> -, s6-linux-init, xdg-desktop-portal-spectrum,
> +, s6-linux-init, xdg-desktop-portal-spectrum
>  }:
>  
>  let
> @@ -48,6 +48,9 @@ let
>        pkgs.xwayland
>        pkgs.xdg-desktop-portal
>        pkgs.xdg-desktop-portal-gtk
> +      # Depends on pulseaudio libs
> +      pkgs.pipewire
> +      pkgs.wireplumber
>      ];
>    })).fhsenv;
>  in
> diff --git a/img/app/etc/fstab b/img/app/etc/fstab
> index a95088b..40aa3bd 100644
> --- a/img/app/etc/fstab
> +++ b/img/app/etc/fstab
> @@ -1,7 +1,8 @@
>  # SPDX-License-Identifier: CC0-1.0
>  # SPDX-FileCopyrightText: 2020-2022 Alyssa Ross <hi@alyssa.is>
>  proc		/proc		proc	defaults			0	0
> -devpts		/dev/pts	devpts	defaults,gid=4,mode=620	0	0
> +devpts		/dev/pts	devpts	defaults,gid=4,mode=620		0	0
>  tmpfs		/dev/shm	tmpfs	defaults			0	0
>  sysfs		/sys		sysfs	defaults			0	0
> -tmpfs		/tmp		tmpfs	defaults			0	0
> +tmpfs		/tmp		tmpfs	defaults,mode=1755		0	0

Want to send the permissions changes from this patch separately?  We
probably need to check the permissions for all mountpoints across hosts
and guests.

> +tmpfs		/run		tmpfs	defaults			0	0

We already have /run from s6-linux-init.

> diff --git a/img/app/etc/s6-rc/pipewire/notification-fd b/img/app/etc/s6-rc/pipewire/notification-fd
> new file mode 100644
> index 0000000..7ed6ff8
> --- /dev/null
> +++ b/img/app/etc/s6-rc/pipewire/notification-fd
> @@ -0,0 +1 @@
> +5
> diff --git a/img/app/etc/s6-rc/pipewire/run b/img/app/etc/s6-rc/pipewire/run
> new file mode 100644

This needs to be executable.

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

      reply	other threads:[~2025-06-26  8:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-17 15:30 [RFC PATCH] Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-06-26  8:35 ` Alyssa Ross [this message]

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=87sejmlx22.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).