Request for audio-related snap declarations for pipewire snap

We are migrating the Core Desktop architecture into a more flexible one, which requires pipewire to run in its own snap. So we want to request the following for pipewire snap:

  1. allow D-Bus slots claiming the names org.pulseaudio.Server and org.freedesktop.ReserveDevice1 on the session bus.

  2. we’re adding audio-playback, audio-record, and pulseaudio slots. I realise that the pulseaudio interface is deprecated in favor of the first two, but without it old snaps still using it as a plug won’t have anything to connect to.

These requirements are basically the same used by the ubuntu-desktop-session snap, inside which pipewire runs in the current Core Desktop architecture.

I think that the snap declaration changes would look similar to these:

      -
        slot-attributes:
          name: org.pulseaudio.Server
      -
        slot-attributes:
          name: org.freedesktop.ReserveDevice1
      # plus all the other cases already in the declaration...
    deny-auto-connection: true
  audio-playback:
    allow-installation: true
    allow-connection:
      on-classic: false
    allow-auto-connection:
      on-classic: false
  audio-record:
    allow-installation: true
    allow-connection:
      on-classic: false
    allow-auto-connection: false
  pulseaudio:
    allow-installation: true
    allow-connection:
      on-classic: false
    allow-auto-connection: false

Note that allow-auto-connection for audio-record and pulseaudio should be more restrictive than audio-playback, as it is in the base declaration. I think it’d be useful to follow the pattern we used for the desktop/wayland/x11 slots, and only make it a connection candidate on Ubuntu Core systems.

1 Like

@review-team is there any chance we could get some movement on this? We want this as part of a reorganisation of some code in Ubuntu Core Desktop: essentially we’re moving some user services that ran as part of the ubuntu-desktop-session snap to its own snap. The goal being to allow different desktop sessions to share the same implementation rather than each providing their own.

The rationale for granting this snap declaration would be the same as when we asked for these permissions on the ubuntu-desktop-session snap:

Hey @SergioCostas @jamesh

Sorry for the delay. +1 from me for allowing pipewire snap to slot the requested DBus names and audio-playback, audio-record and pulseaudio. I agree that pipewire should slot (note it is a slot not a plug) pulseaudio for compatibility reasons.

If those slots are only required and expected to be used in Core system I agree it will be good if we can reflect it in the snap-declaration :slight_smile:

2 Likes

+1 from me too - apologies for the delay on reviewing this request, not sure how it slipped through the cracks.

Regarding using this only on core systems, I wonder if there might be a case where the pipewire snap is used similarly to fwupd on classic systems?

2 Likes

2+ for, 0 against. This is now live.

I’ve mirrored the configuration of ubuntu-desktop-session for the requested interfaces. so that they should only be connectable on core systems. If you think that we should also make those available on classic systems we can update the declaration afterwards.

Please let me know if everything works as expected

2 Likes

We don’t have any immediate plans to do so, and the on-classic: false guards should reduce the chance of people breaking their system if they happen to install the snap.

At the moment, if both system:audio-playback and pipewire:audio-playback are valid connection candidates then snapd will connect application snaps to neither. I’d prefer the snap to seemingly be non-functional than to break audio for all newly installed snaps.

Thanks! The snap that was pending for manual review has been accepted, so yes, it seems everything is fine. I’ll put it in edge.