Add pa-dlna setup for xps

This commit is contained in:
Sonny Bakker 2025-04-06 21:16:57 +02:00
parent 6b2c70f5da
commit 20bf21baa2
5 changed files with 115 additions and 2 deletions

View file

@ -23,6 +23,9 @@ table inet filter {
# allow ssh
tcp dport ssh accept
ip saddr 192.168.2.11 tcp dport 8080 accept comment "HTTP pa-dlna server"
ip saddr 192.168.2.11 udp dport 1900 accept comment "UPnP"
# syncthing
ip saddr 10.0.0.1 tcp dport 22000 accept
}

View file

@ -0,0 +1,26 @@
# {{ ansible_managed }}
#
# This is the built-in pa-dlna configuration written as text. It can be
# parsed by a Python Configuration parser and consists of sections, each led
# by a [section] header, followed by option/value entries separated by
# '='. See https://docs.python.org/3/library/configparser.html.
#
# The 'selection' option is written as a multi-line in which case all the
# lines after the first line start with a white space.
#
# The default value of 'selection' lists the encoders in this order:
# - mp3 encoders first as mp3 is the most common encoding
# - lossless encoders
# - then lossy encoders
# See https://trac.ffmpeg.org/wiki/Encode/HighQualityAudio.
[DEFAULT]
selection =
FFMpegFlacEncoder,
FFMpegOpusEncoder,
sample_format = s24be
rate = 96000
channels = 2
track_metadata = yes
soap_minimum_interval = 5
args = None

View file

@ -0,0 +1,40 @@
# {{ ansible_managed }}
#
# When enabled, the pa-dlna service unit is started automatically after the
# pulseaudio or pipewire service unit is started. It will also stop when the
# pulseaudio or pipewire service unit stops. However it will stop when the
# pulseaudio or pipewire service unit is restarted but it will not start.
#
# Both pa-dlna and pulseaudio service units are of 'Type=notify'. This means
# that pa-dlna will only start after pulseaudio has notified systemd that it
# is ready and pa-dlna may connect successfully to libpulse.
#
# However the pipewire service unit is of 'Type=simple'. In that case and if
# pa-dlna fails to start with the error:
# LibPulseStateError(('PA_CONTEXT_FAILED', 'Connection refused'))
# add a delay to the pa-dlna start up sequence with the directive:
# ExecStartPre=/bin/sleep 1
#
# Any pa-dlna option may be added to the 'ExecStart' directive, for example to
# restrict the allowed NICs or IP addresses (recommended) or to change the
# log level.
# The '--systemd' option is required.
#
# The 'python-systemd' package is required.
[Unit]
Description=Pa-dlna Service
Documentation=https://pa-dlna.readthedocs.io/en/stable/
After=pipewire-session-manager.service
[Service]
Type=simple
ExecStart=/opt/virtualenv/pa-dlna/bin/pa-dlna
Slice=session.slice
NoNewPrivileges=yes
UMask=0077
[Install]
WantedBy=pipewire-session-manager.service