From d79d442303f9da44f17efd11d46759561a95d603 Mon Sep 17 00:00:00 2001 From: Jacob Babor Date: Tue, 23 Apr 2024 18:03:52 -0500 Subject: [PATCH] Remove pulseaudio role, since everything uses pipewire these days --- roles/pulseaudio/README.md | 11 --- roles/pulseaudio/defaults/main.yml | 24 ------ roles/pulseaudio/tasks/main.yml | 21 ----- roles/pulseaudio/templates/pulse-client.conf | 3 - roles/pulseaudio/templates/pulse-daemon.conf | 22 ------ roles/pulseaudio/templates/pulse-default.pa | 77 ------------------- roles/pulseaudio/templates/pulseaudio.service | 24 ------ 7 files changed, 182 deletions(-) delete mode 100644 roles/pulseaudio/README.md delete mode 100644 roles/pulseaudio/defaults/main.yml delete mode 100644 roles/pulseaudio/tasks/main.yml delete mode 100644 roles/pulseaudio/templates/pulse-client.conf delete mode 100644 roles/pulseaudio/templates/pulse-daemon.conf delete mode 100644 roles/pulseaudio/templates/pulse-default.pa delete mode 100644 roles/pulseaudio/templates/pulseaudio.service diff --git a/roles/pulseaudio/README.md b/roles/pulseaudio/README.md deleted file mode 100644 index 7240975..0000000 --- a/roles/pulseaudio/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# pulseaudio - -Role to configure Pulseaudio as a system-wide daemon *without* using Pulse in system mode. - -## What? - -Pulseaudio runs as its own server with control over the audio hardware in `pulseaudio.service`. It listens on a socket in `/tmp/pulse-server` responding to members of the `audio` group. - -## Why? - -It allows for clean, efficient multi-user setups. diff --git a/roles/pulseaudio/defaults/main.yml b/roles/pulseaudio/defaults/main.yml deleted file mode 100644 index ee69285..0000000 --- a/roles/pulseaudio/defaults/main.yml +++ /dev/null @@ -1,24 +0,0 @@ -# vim:ft=ansible: -# Flat volumes are the behavior where Pulse uses one global audio slider -# instead of allowing for per-application, per-sink control. -pulse_flat_volumes: "no" -# Sample rate; pretty self-explanatory -# Consider setting to 96000 if you have high-quality headphones -pulse_sample_rate: 96000 -pulse_sample_rate_alternate: 44100 -# For some reason, Pulse does 16-bit sampling by default. This fixes that -pulse_sample_format: s32le -# Sometimes Pulse has to resample; speex-float-5 is pretty solid -pulse_resample_method: speex-float-5 -pulse_resample_avoid: "true" -# Latency settings; increase if you get stuttering -# "Size" is in milliseconds -pulse_latency_fragments: 5 -pulse_latency_fragment_size: 10 - -## You shouldn't have to mess with these settings - -# Should the process be marked as high-priority? -pulse_high_priority: "yes" -# What level should Pulse renice itself to on startup? -pulse_nice_level: -19 diff --git a/roles/pulseaudio/tasks/main.yml b/roles/pulseaudio/tasks/main.yml deleted file mode 100644 index 2427c1b..0000000 --- a/roles/pulseaudio/tasks/main.yml +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env ansible-playbook -# vim:ft=ansible: -- name: assure pulse package - ansible.builtin.apt: name=pulseaudio - when: ansible_os_family == 'Debian' -- name: remove user pulseaudio services - ansible.builtin.file: state=absent path={{ item }} - loop: - - /etc/systemd/user/default.target.wants/pulseaudio.service - - /etc/systemd/user/sockets.target.wants/pulseaudio.socket -- name: template out configs - ansible.builtin.template: src={{ item.src }} dest={{ item.dest }} mode=0644 - loop: - - { src: "pulse-client.conf", dest: "/etc/pulse/client.conf" } - - { src: "pulse-daemon.conf", dest: "/etc/pulse/daemon.conf" } - - { src: "pulse-default.pa", dest: "/etc/pulse/default.pa" } - - { src: "pulseaudio.service", dest: "/etc/systemd/system/pulseaudio.service" } -- name: assure pulse user - ansible.builtin.user: name=pulseaudio password="!" system=yes home=/var/lib/pulse groups=audio -- name: enable pulse service - ansible.builtin.systemd: name=pulseaudio enabled=yes state=started daemon_reload=yes diff --git a/roles/pulseaudio/templates/pulse-client.conf b/roles/pulseaudio/templates/pulse-client.conf deleted file mode 100644 index 0b2e703..0000000 --- a/roles/pulseaudio/templates/pulse-client.conf +++ /dev/null @@ -1,3 +0,0 @@ -# {{ ansible_managed }} -autospawn = no -default-server = unix:/tmp/pulse-server diff --git a/roles/pulseaudio/templates/pulse-daemon.conf b/roles/pulseaudio/templates/pulse-daemon.conf deleted file mode 100644 index f91b3f6..0000000 --- a/roles/pulseaudio/templates/pulse-daemon.conf +++ /dev/null @@ -1,22 +0,0 @@ -# See pulse-daemon.conf(5) for more info -# {{ ansible_managed }} - -# Bugfixes for my desktop's audio card -realtime-scheduling = no # Fixes a weird stutter issue - -# Sanity -flat-volumes = {{ pulse_flat_volumes }} - -# Audio Quality -default-sample-format = {{ pulse_sample_format }} # Pulse does 16bit sampling by default for some reason -default-sample-rate = {{ pulse_sample_rate }} -alternate-sample-rate = {{ pulse_sample_rate_alternate }} -resample-method = {{ pulse_resample_method }} # Increase resampling quality -avoid-resampling = {{ pulse_resample_avoid }} - -default-fragments = {{ pulse_latency_fragments }} # Pulse, why are you so friggin latent by default? -default-fragment-size-msec = {{ pulse_latency_fragment_size }} - -high-priority = {{ pulse_high_priority }} -nice-level = {{ pulse_nice_level }} - diff --git a/roles/pulseaudio/templates/pulse-default.pa b/roles/pulseaudio/templates/pulse-default.pa deleted file mode 100644 index 464f143..0000000 --- a/roles/pulseaudio/templates/pulse-default.pa +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/pulseaudio -nF -#!/usr/bin/pulseaudio -nF -# -.fail - -load-module module-device-restore -load-module module-stream-restore -load-module module-card-restore -load-module module-augment-properties -### Should be after module-*-restore but before module-*-detect -load-module module-switch-on-port-available -### Use hot-plugged devices like Bluetooth or USB automatically (LP: #1702794) -.ifexists module-switch-on-connect.so -load-module module-switch-on-connect -.endif - -# Device detection -.ifexists module-udev-detect.so -load-module module-udev-detect -.else -load-module module-detect -.endif - -# Bluetooth -.ifexists module-bluetooth-policy.so -load-module module-bluetooth-policy -.endif -.ifexists module-bluetooth-discover.so -load-module module-bluetooth-discover -.endif - -# Protocols -.ifexists module-esound-protocol-unix.so -load-module module-esound-protocol-unix -.endif -load-module module-native-protocol-unix auth-group=audio socket=/tmp/pulse-server - -# Load GSettings/paprefs modules -.ifexists module-gsettings.so -.nofail -load-module module-gsettings -.fail -.endif - -load-module module-default-device-restore -load-module module-always-sink -load-module module-intended-roles -load-module module-suspend-on-idle - -### If autoexit on idle is enabled we want to make sure we only quit -### when no local session needs us anymore. -.ifexists module-console-kit.so -load-module module-console-kit -.endif -.ifexists module-systemd-login.so -load-module module-systemd-login -.endif - -# Enable positioned event sounds -load-module module-position-event-sounds -# Cork music/video streams when a phone stream is active -load-module module-role-cork -# Block audio recording for snap confined packages -.ifexists module-snap-policy.so -load-module module-snap-policy -.endif - -load-module module-filter-heuristics -load-module module-filter-apply - -## Gets around a weird audio skipping bug on my desktop -.ifexists module-udev-detect.so -load-module module-udev-detect tsched=0 - -## My laptop gets sink suspension popping when using headphones -unload-module module-suspend-on-idle - diff --git a/roles/pulseaudio/templates/pulseaudio.service b/roles/pulseaudio/templates/pulseaudio.service deleted file mode 100644 index 367c352..0000000 --- a/roles/pulseaudio/templates/pulseaudio.service +++ /dev/null @@ -1,24 +0,0 @@ -# vim:ft=systemd -# NOTE: This service is ONLY useful IF you have the following: -# * client.conf is set to not autospawn and listen to a socket instead -# * default.pa is configured to start such a socket -# Using this unit file and complaining to me that it doesn't work without -# the other configs in place will result in me not giving a shit - -## THIS UNIT DOES NOT START PULSE IN SYSTEM MODE -## THIS UNIT DOES NOT START PULSE IN SYSTEM MODE -## THIS UNIT DOES NOT START PULSE IN SYSTEM MODE -## THIS UNIT DOES NOT START PULSE IN SYSTEM MODE -## THIS UNIT DOES NOT START PULSE IN SYSTEM MODE -[Unit] -Description=Pulseaudio sound server - -[Service] -User=pulseaudio -Group=pulseaudio -ExecStart=/usr/bin/pulseaudio --disallow-exit -ExecReload=/bin/kill -HUP $MAINPID -Restart=always - -[Install] -WantedBy=multi-user.target