pulse: add a small pulseaudio daemon

Add a small application that loads the pulse server and makes it
listen on the pulseaudio socket.
Add some systemd activation files to start the service.
This commit is contained in:
Wim Taymans 2020-11-12 16:53:55 +01:00
parent 10207456f0
commit 798bcc10b1
5 changed files with 181 additions and 1 deletions

View file

@ -1,11 +1,19 @@
systemd_user_services_dir = systemd.get_pkgconfig_variable('systemduserunitdir', define_variable : [ 'prefix', prefix])
install_data(sources : 'pipewire.socket', install_dir : systemd_user_services_dir)
install_data(
sources : ['pipewire.socket', 'pipewire-pulse.socket'],
install_dir : systemd_user_services_dir)
systemd_config = configuration_data()
systemd_config.set('PW_BINARY', join_paths(pipewire_bindir, 'pipewire'))
systemd_config.set('PW_PULSE_BINARY', join_paths(pipewire_bindir, 'pipewire-pulse'))
configure_file(input : 'pipewire.service.in',
output : 'pipewire.service',
configuration : systemd_config,
install_dir : systemd_user_services_dir)
configure_file(input : 'pipewire-pulse.service.in',
output : 'pipewire-pulse.service',
configuration : systemd_config,
install_dir : systemd_user_services_dir)

View file

@ -0,0 +1,25 @@
[Unit]
Description=PipeWire PulseAudio
# We require pipewire-pulse.socket to be active before starting the daemon, because
# while it is possible to use the service without the socket, it is not clear
# why it would be desirable.
#
# A user installing pipewire and doing `systemctl --user start pipewire-pulse`
# will not get the socket started, which might be confusing and problematic if
# the server is to be restarted later on, as the client autospawn feature
# might kick in. Also, a start of the socket unit will fail, adding to the
# confusion.
#
# After=pipewire-pulse.socket is not needed, as it is already implicit in the
# socket-service relationship, see systemd.socket(5).
Requires=pipewire-pulse.socket
[Service]
Type=simple
ExecStart=@PW_PULSE_BINARY@
Restart=on-failure
[Install]
Also=pipewire-pulse.socket
WantedBy=default.target

View file

@ -0,0 +1,10 @@
[Unit]
Description=PipeWire PulseAudio
[Socket]
Priority=6
Backlog=5
ListenStream=%t/pulse/native
[Install]
WantedBy=sockets.target