Make Pulse role more modular

This commit is contained in:
Salt 2021-01-25 19:38:55 -06:00
parent 7851fb89aa
commit 46eb6a73d7
3 changed files with 47 additions and 13 deletions

View File

@ -0,0 +1,11 @@
# 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.

View File

@ -0,0 +1,24 @@
# 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: 48000
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

View File

@ -1,23 +1,22 @@
# Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
# more information. Default values are commented out. Use either ; or # for
# commenting.
# See pulse-daemon.conf(5) for more info
# This file managed via Ansible
# Bugfixes for my desktop's audio card
realtime-scheduling = no # Fixes a weird stutter issue
# Sanity
flat-volumes = no
flat-volumes = {{ pulse_flat_volumes }}
# Audio Quality
default-sample-format = s32le # Pulse does 16bit sampling by default for some reason
default-sample-rate = 48000 # Higher sample rate than default
alternate-sample-rate = 44100
resample-method = speex-float-5 # Increase resampling quality
avoid-resampling = true
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 = 5 # Pulse, why are you so friggin latent by default?
default-fragment-size-msec = 10
default-fragments = {{ pulse_latency_fragments }} # Pulse, why are you so friggin latent by default?
default-fragment-size-msec = {{ pulse_latency_fragment_size }}
high-priority = yes
nice-level = -19
high-priority = {{ pulse_high_priority }}
nice-level = {{ pulse_nice_level }}