Update pipewire pulse configuration
This commit is contained in:
parent
24a13b689c
commit
75f0383ba5
8 changed files with 207 additions and 27 deletions
|
|
@ -1,23 +1,22 @@
|
||||||
# Note that pulsaudio should be removed by installing pipewire-pulse manually
|
# Note that pulsaudio should be removed by installing pipewire-pulse manually
|
||||||
|
|
||||||
- name: create pipewire-pulse override directory
|
- name: remove previous configurations
|
||||||
file:
|
file:
|
||||||
path: '{{ xdg_config_dir }}/systemd/user/pipewire-pulse.service.d/'
|
path: '{{ xdg_config_dir }}/systemd/user/pipewire-pulse.service.d/'
|
||||||
|
state: absent
|
||||||
|
loop:
|
||||||
|
- { path: '{{ xdg_config_dir }}/systemd/user/pipewire-pulse.service.d/' }
|
||||||
|
- { path: '{{ xdg_script_dir }}/pulse-script' }
|
||||||
|
|
||||||
|
- name: create pipewire configuration dir
|
||||||
|
file:
|
||||||
state: directory
|
state: directory
|
||||||
|
path: '{{ xdg_config_dir }}/pipewire'
|
||||||
|
|
||||||
# sets up an post activation script to load the module-native-protocol-tcp
|
- name: copy pipewire-pulse configuration
|
||||||
# with given parameters. This is not yet supported through pipewire-pulse's configuration,
|
|
||||||
# see https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Migrate-PulseAudio#module-native-protocol-tcp
|
|
||||||
- name: copy pipewire-pulse service override
|
|
||||||
template:
|
template:
|
||||||
src: 'templates/pipewire-pulse.j2'
|
src: 'templates/{{ platform }}/pipewire-pulse.j2'
|
||||||
dest: '{{ xdg_config_dir }}/systemd/user/pipewire-pulse.service.d/override.conf'
|
dest: '{{ xdg_config_dir }}/pipewire/pipewire-pulse.conf'
|
||||||
|
|
||||||
- name: copy pipewire-pulse script
|
|
||||||
template:
|
|
||||||
src: 'templates/{{ platform }}/pulse-script.j2'
|
|
||||||
dest: '{{ xdg_script_dir }}/pulse-script'
|
|
||||||
mode: 0755
|
|
||||||
|
|
||||||
- name: start pipewire socket
|
- name: start pipewire socket
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
||||||
95
templates/desktop/pipewire-pulse.j2
Normal file
95
templates/desktop/pipewire-pulse.j2
Normal file
|
|
@ -0,0 +1,95 @@
|
||||||
|
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||||
|
#
|
||||||
|
# PulseAudio config file for PipeWire version "0.3.48" #
|
||||||
|
#
|
||||||
|
# Copy and edit this file in /etc/pipewire for system-wide changes
|
||||||
|
# or in ~/.config/pipewire for local changes.
|
||||||
|
#
|
||||||
|
# It is also possible to place a file with an updated section in
|
||||||
|
# /etc/pipewire/pipewire-pulse.conf.d/ for system-wide changes or in
|
||||||
|
# ~/.config/pipewire/pipewire-pulse.conf.d/ for local changes.
|
||||||
|
#
|
||||||
|
|
||||||
|
context.properties = {}
|
||||||
|
|
||||||
|
context.spa-libs = {
|
||||||
|
audio.convert.* = audioconvert/libspa-audioconvert
|
||||||
|
support.* = support/libspa-support
|
||||||
|
}
|
||||||
|
|
||||||
|
context.modules = [
|
||||||
|
{ name = libpipewire-module-rt
|
||||||
|
args = {
|
||||||
|
nice.level = -11
|
||||||
|
}
|
||||||
|
flags = [ ifexists nofail ]
|
||||||
|
}
|
||||||
|
{ name = libpipewire-module-protocol-native }
|
||||||
|
{ name = libpipewire-module-client-node }
|
||||||
|
{ name = libpipewire-module-adapter }
|
||||||
|
{ name = libpipewire-module-metadata }
|
||||||
|
|
||||||
|
{ name = libpipewire-module-protocol-pulse
|
||||||
|
args = {
|
||||||
|
server.address = [
|
||||||
|
"unix:native"
|
||||||
|
{ address = "tcp:{{ vpn_ip }}:{{ pulse_port }}"
|
||||||
|
max-clients = 64
|
||||||
|
listen-backlog = 32
|
||||||
|
client.access = "allowed"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
# These overrides are only applied when running in a vm.
|
||||||
|
vm.overrides = {
|
||||||
|
pulse.min.quantum = 1024/48000 # 22ms
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{ name = libpipewire-module-access
|
||||||
|
args = {
|
||||||
|
access.allowed = [
|
||||||
|
/usr/bin/pipewire-media-session
|
||||||
|
/usr/bin/mpd
|
||||||
|
]
|
||||||
|
|
||||||
|
access.rejected = [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
# Extra modules can be loaded here. Setup in default.pa can be moved here
|
||||||
|
context.exec = [
|
||||||
|
{ path = "pactl" args = "load-module module-always-sink" }
|
||||||
|
]
|
||||||
|
|
||||||
|
stream.properties = {}
|
||||||
|
|
||||||
|
# client/stream specific properties
|
||||||
|
pulse.rules = [
|
||||||
|
{
|
||||||
|
# skype does not want to use devices that don't have an S16 sample format.
|
||||||
|
matches = [
|
||||||
|
{ application.process.binary = "teams" }
|
||||||
|
{ application.process.binary = "skypeforlinux" }
|
||||||
|
]
|
||||||
|
actions = { quirks = [ force-s16-info ] }
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# firefox marks the capture streams as don't move and then they
|
||||||
|
# can't be moved with pavucontrol or other tools.
|
||||||
|
matches = [ { application.process.binary = "firefox" } ]
|
||||||
|
actions = { quirks = [ remove-capture-dont-move ] }
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# speech dispatcher asks for too small latency and then underruns.
|
||||||
|
matches = [ { application.name = "~speech-dispatcher*" } ]
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
pulse.min.req = 1024/48000 # 21ms
|
||||||
|
pulse.min.quantum = 1024/48000 # 21ms
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
#!/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={{ vpn_ip }}
|
|
||||||
95
templates/laptop/pipewire-pulse.j2
Normal file
95
templates/laptop/pipewire-pulse.j2
Normal file
|
|
@ -0,0 +1,95 @@
|
||||||
|
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||||
|
#
|
||||||
|
# PulseAudio config file for PipeWire version "0.3.48" #
|
||||||
|
#
|
||||||
|
# Copy and edit this file in /etc/pipewire for system-wide changes
|
||||||
|
# or in ~/.config/pipewire for local changes.
|
||||||
|
#
|
||||||
|
# It is also possible to place a file with an updated section in
|
||||||
|
# /etc/pipewire/pipewire-pulse.conf.d/ for system-wide changes or in
|
||||||
|
# ~/.config/pipewire/pipewire-pulse.conf.d/ for local changes.
|
||||||
|
#
|
||||||
|
|
||||||
|
context.properties = {}
|
||||||
|
|
||||||
|
context.spa-libs = {
|
||||||
|
audio.convert.* = audioconvert/libspa-audioconvert
|
||||||
|
support.* = support/libspa-support
|
||||||
|
}
|
||||||
|
|
||||||
|
context.modules = [
|
||||||
|
{ name = libpipewire-module-rt
|
||||||
|
args = {
|
||||||
|
nice.level = -11
|
||||||
|
}
|
||||||
|
flags = [ ifexists nofail ]
|
||||||
|
}
|
||||||
|
{ name = libpipewire-module-protocol-native }
|
||||||
|
{ name = libpipewire-module-client-node }
|
||||||
|
{ name = libpipewire-module-adapter }
|
||||||
|
{ name = libpipewire-module-metadata }
|
||||||
|
|
||||||
|
{ name = libpipewire-module-protocol-pulse
|
||||||
|
args = {
|
||||||
|
server.address = [
|
||||||
|
"unix:native"
|
||||||
|
{ address = "tcp:{{ vpn_ip }}:{{ pulse_port }}"
|
||||||
|
max-clients = 64
|
||||||
|
listen-backlog = 32
|
||||||
|
client.access = "allowed"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
# These overrides are only applied when running in a vm.
|
||||||
|
vm.overrides = {
|
||||||
|
pulse.min.quantum = 1024/48000 # 22ms
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{ name = libpipewire-module-access
|
||||||
|
args = {
|
||||||
|
access.allowed = [
|
||||||
|
/usr/bin/pipewire-media-session
|
||||||
|
/usr/bin/mpd
|
||||||
|
]
|
||||||
|
|
||||||
|
access.rejected = [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
# Extra modules can be loaded here. Setup in default.pa can be moved here
|
||||||
|
context.exec = [
|
||||||
|
{ path = "pactl" args = "load-module module-always-sink" }
|
||||||
|
]
|
||||||
|
|
||||||
|
stream.properties = {}
|
||||||
|
|
||||||
|
# client/stream specific properties
|
||||||
|
pulse.rules = [
|
||||||
|
{
|
||||||
|
# skype does not want to use devices that don't have an S16 sample format.
|
||||||
|
matches = [
|
||||||
|
{ application.process.binary = "teams" }
|
||||||
|
{ application.process.binary = "skypeforlinux" }
|
||||||
|
]
|
||||||
|
actions = { quirks = [ force-s16-info ] }
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# firefox marks the capture streams as don't move and then they
|
||||||
|
# can't be moved with pavucontrol or other tools.
|
||||||
|
matches = [ { application.process.binary = "firefox" } ]
|
||||||
|
actions = { quirks = [ remove-capture-dont-move ] }
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# speech dispatcher asks for too small latency and then underruns.
|
||||||
|
matches = [ { application.name = "~speech-dispatcher*" } ]
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
pulse.min.req = 1024/48000 # 21ms
|
||||||
|
pulse.min.quantum = 1024/48000 # 21ms
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
#!/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.0.0.2
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStartPost={{ xdg_script_dir }}/pulse-script
|
|
||||||
|
|
@ -5,6 +5,7 @@ vpn_subnet: '24'
|
||||||
|
|
||||||
vpn_public_key_path: '/etc/wireguard/keys/public/desktop.pub'
|
vpn_public_key_path: '/etc/wireguard/keys/public/desktop.pub'
|
||||||
vpn_private_key_path: '/etc/wireguard/keys/private/desktop.key'
|
vpn_private_key_path: '/etc/wireguard/keys/private/desktop.key'
|
||||||
|
|
||||||
vpn_private_key: !vault |
|
vpn_private_key: !vault |
|
||||||
$ANSIBLE_VAULT;1.1;AES256
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
65386334366166306164363464633364383935313739373730373139663139373964336665636264
|
65386334366166306164363464633364383935313739373730373139663139373964336665636264
|
||||||
|
|
@ -24,3 +25,5 @@ vpn_peers:
|
||||||
preshared_key_source_path: 'files/desktop/wireguard/preshared.psk',
|
preshared_key_source_path: 'files/desktop/wireguard/preshared.psk',
|
||||||
preshared_key: !vault "$ANSIBLE_VAULT;1.1;AES256\r\n363333633336613939306632323163396239303739366135393232396134393266623939613534326238393638333137383235313039623264343932303038330a633934373638363966306533346235326234663464313963356238623064666430303030643533666536393662316237333463336462376366343335363131350a333135366239633765633136316133653535336661666461666365636233656165666635663037386666323931643265623233366133623237663734623661623661316436396465343866363266393565653237636136626536353630383263",
|
preshared_key: !vault "$ANSIBLE_VAULT;1.1;AES256\r\n363333633336613939306632323163396239303739366135393232396134393266623939613534326238393638333137383235313039623264343932303038330a633934373638363966306533346235326234663464313963356238623064666430303030643533666536393662316237333463336462376366343335363131350a333135366239633765633136316133653535336661666461666365636233656165666635663037386666323931643265623233366133623237663734623661623661316436396465343866363266393565653237636136626536353630383263",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pulse_port: 20808
|
||||||
|
|
|
||||||
|
|
@ -27,3 +27,5 @@ vpn_peers:
|
||||||
preshared_key_source_path: 'files/laptop/wireguard/preshared.psk',
|
preshared_key_source_path: 'files/laptop/wireguard/preshared.psk',
|
||||||
preshared_key: !vault "$ANSIBLE_VAULT;1.1;AES256\r\n376463366339376639373237363632363836653266353534343331333831646366373430333163383838313835613565646466653139666337626237313737300a333761383466626637336164363235643861643865653536663433373762343637303334613862373663626663616138333964386333373633643431326233370a386664366238633533356235613332373630353731306233623364623239353564313631373061393535336532393439343432373435336538666334666335633737633030386438616566376131646662316464333765636331343262663437",
|
preshared_key: !vault "$ANSIBLE_VAULT;1.1;AES256\r\n376463366339376639373237363632363836653266353534343331333831646366373430333163383838313835613565646466653139666337626237313737300a333761383466626637336164363235643861643865653536663433373762343637303334613862373663626663616138333964386333373633643431326233370a386664366238633533356235613332373630353731306233623364623239353564313631373061393535336532393439343432373435336538666334666335633737633030386438616566376131646662316464333765636331343262663437",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pulse_port: 20808
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue