Setup pulse audio for remote audio
This commit is contained in:
parent
470d8053bf
commit
00b7536f5e
12 changed files with 62 additions and 147 deletions
|
|
@ -1,8 +1,9 @@
|
|||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
#
|
||||
#!/usr/bin/nft -f
|
||||
# vim:set ts=2 sw=2 et:
|
||||
|
||||
flush ruleset
|
||||
|
||||
table inet filter {
|
||||
chain input {
|
||||
type filter hook input priority 0;
|
||||
|
|
@ -26,6 +27,9 @@ table inet filter {
|
|||
# syncthing
|
||||
ip saddr 10.8.1.1 tcp dport 22000 accept
|
||||
|
||||
# allow remote pulse audio
|
||||
ip saddr 10.8.1.1 tcp dport 4713 accept
|
||||
|
||||
# allow dhcp requests for bridget connections
|
||||
iifname "vmbr0" udp dport { 53, 67 } accept
|
||||
|
||||
|
|
|
|||
5
templates/desktop/pulse-script.j2
Normal file
5
templates/desktop/pulse-script.j2
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/sh
|
||||
#
|
||||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
|
||||
/usr/bin/pactl load-module module-native-protocol-tcp auth-anonymous=1 listen=10.8.1.10
|
||||
5
templates/laptop/pulse-script.j2
Normal file
5
templates/laptop/pulse-script.j2
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/sh
|
||||
#
|
||||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
|
||||
/usr/bin/pactl load-module module-native-protocol-tcp auth-anonymous=1 listen=10.8.1.6
|
||||
8
templates/laptop/pulse.j2
Normal file
8
templates/laptop/pulse.j2
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
#
|
||||
# see /usr/share/pipewire/pipewire-pulse.conf for reference
|
||||
|
||||
context.exec = [
|
||||
{ path = "pactl" args = "module-native-protocol-tcp auth-anonymous=1 listen=10.8.1.6" }
|
||||
]
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
|
||||
music_directory "{{ mpd_music_dir }}"
|
||||
playlist_directory "{{ mpd_playlist_dir }}"
|
||||
state_file "{{ mpd_state_path }}"
|
||||
sticker_file "{{ mpd_sticker_path }}"
|
||||
log_level "secure"
|
||||
|
||||
bind_to_address "{{ mpd_listen_address }}"
|
||||
port "{{ mpd_listen_port }}"
|
||||
|
||||
auto_update "yes"
|
||||
filesystem_charset "UTF-8"
|
||||
|
||||
samplerate_converter "1"
|
||||
|
||||
database {
|
||||
plugin "proxy"
|
||||
host "{{ mpd_database_address }}"
|
||||
port "{{ mpd_database_port }}"
|
||||
}
|
||||
|
||||
audio_output {
|
||||
type "pulse"
|
||||
name "mpd"
|
||||
replay_gain_handler "software"
|
||||
mixer_type "hardware"
|
||||
format "96000:24:1"
|
||||
}
|
||||
|
||||
input {
|
||||
enabled "no"
|
||||
plugin "tidal"
|
||||
}
|
||||
|
||||
input {
|
||||
enabled "no"
|
||||
plugin "qobuz"
|
||||
}
|
||||
|
||||
decoder {
|
||||
plugin "wildmidi"
|
||||
enabled "no"
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
|
||||
sudo mount -t nfs -o vers=4,soft,async,proto=tcp,port=2049 10.8.0.1:/srv/nfs4/music {{ mpd_music_dir }}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
|
||||
[Unit]
|
||||
Description=Music Player Daemon
|
||||
Documentation=man:mpd(1) man:mpd.conf(5)
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
ExecStartPre={{ xdg_script_dir }}/music_mount
|
||||
ExecStart=/usr/bin/mpd --no-daemon {{ mpd_configuration_dir }}/mpd.conf
|
||||
ExecStopPost={{ xdg_script_dir }}/music_umount
|
||||
Restart=on-failure
|
||||
RestartSec=15s
|
||||
TimeoutStopSec=3
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/user/1000/mpd.socket
|
||||
ListenStream={{ mpd_listen_port }}
|
||||
Backlog=5
|
||||
KeepAlive=true
|
||||
PassCredentials=true
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
|
||||
pkill cantata
|
||||
sudo umount {{ mpd_music_dir }}
|
||||
[Service]
|
||||
ExecStartPost={{ xdg_script_dir }}/pulse-script
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
|
||||
sonny ALL=(ALL) NOPASSWD: /usr/bin/mount
|
||||
sonny ALL=(ALL) NOPASSWD: /usr/bin/umount
|
||||
Loading…
Add table
Add a link
Reference in a new issue