Pulseaudio updates for argus that seems to work well
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
# Role: scanner_pulseaudio
|
||||
# Role: argus_pulseaudio
|
||||
# Install and configure PulseAudio for network audio streaming
|
||||
#
|
||||
# This role:
|
||||
# - Installs PulseAudio and required packages
|
||||
# - Configures network audio (TCP + zeroconf/Avahi)
|
||||
# - Creates systemd service to run PulseAudio as busnet user
|
||||
# - Creates systemd service to run PulseAudio as argus user
|
||||
#
|
||||
|
||||
- name: Install PulseAudio and network audio packages
|
||||
@@ -19,27 +19,19 @@
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Ensure busnet user is in audio groups
|
||||
- name: Ensure argus user is in audio groups
|
||||
ansible.builtin.user:
|
||||
name: busnet
|
||||
name: argus
|
||||
groups: "{{ item }}"
|
||||
append: yes
|
||||
with_items:
|
||||
- pulse-access
|
||||
- audio
|
||||
|
||||
- name: Create PulseAudio configuration directory
|
||||
ansible.builtin.file:
|
||||
path: /etc/pulse/default.pa.d
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
|
||||
- name: Deploy PulseAudio network audio configuration
|
||||
ansible.builtin.template:
|
||||
src: templates/network-audio.pa.j2
|
||||
dest: /etc/pulse/default.pa.d/network-audio.pa
|
||||
src: templates/default.pa.j2
|
||||
dest: /etc/pulse/default.pa
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
37
ansible/roles/argus_pulseaudio/templates/default.pa.j2
Normal file
37
ansible/roles/argus_pulseaudio/templates/default.pa.j2
Normal file
@@ -0,0 +1,37 @@
|
||||
# This file is managed by Ansible.
|
||||
#
|
||||
# PulseAudio network audio configuration
|
||||
#
|
||||
# This is so we can plug radios into this computer and then offer the radio sound card on the network
|
||||
# so other computers can run software and use the sound card on the radio as long as they are plugged
|
||||
# into the network.
|
||||
#
|
||||
|
||||
# This will automatically handle devices being plugged in, or unplugged from, the USB bus.
|
||||
load-module module-udev-detect
|
||||
|
||||
# NOT USED
|
||||
# This is how you reference a specific sound card
|
||||
#load-module module-alsa-sink device=hw:CARD=ft991a sink_name=ft991a_tx
|
||||
#load-module module-alsa-source device=hw:CARD=ft991a source_name=ft991a_rx
|
||||
|
||||
# NOT USED
|
||||
# Set up custom sink and source values. To get the values for master, you must first load pulseaudio
|
||||
# with only the module-udev-detect and let it detect the sound cards. Then you run:
|
||||
# pactl list sinks short
|
||||
# pactl list sources short
|
||||
# Custom sink and source names for the Digirig C-Media sound card
|
||||
#load-module module-remap-sink sink_name=digirig_tx master=alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo remix=no
|
||||
#load-module module-remap-source source_name=digirig_rx master=alsa_input.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.mono-fallback remix=no
|
||||
# Custom sink and source names for the FT-991a sound card
|
||||
#load-module module-remap-sink sink_name=ft991a_tx master=alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo remix=no
|
||||
#load-module module-remap-source source_name=ft991a_rx master=alsa_input.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo remix=no
|
||||
|
||||
# Load native protocol for UNIX socket for pactl
|
||||
load-module module-native-protocol-unix
|
||||
|
||||
# Enable TCP network protocol so any TCP client can use the sound devices
|
||||
load-module module-native-protocol-tcp auth-anonymous=1 auth-ip-acl=0.0.0.0/0
|
||||
|
||||
# Enable zeroconf/Avahi discovery
|
||||
load-module module-zeroconf-publish
|
||||
@@ -1,21 +0,0 @@
|
||||
# This file is managed by BusNet Ansible.
|
||||
#
|
||||
# PulseAudio network audio configuration
|
||||
#
|
||||
# This is so we can plug radios into this computer and then offer the radio sound card on the network
|
||||
# so other computers can run software and use the sound card on the radio as long as they are plugged
|
||||
# into the network.
|
||||
#
|
||||
|
||||
# Enable TCP network protocol for remote clients
|
||||
# auth-anonymous=1 allows connections without authentication
|
||||
# auth-ip-acl=0.0.0.0/0 allows connections from any IP address
|
||||
load-module module-native-protocol-tcp auth-anonymous=1 auth-ip-acl=0.0.0.0/0
|
||||
|
||||
# Enable zeroconf/Avahi discovery so clients can auto-find the server on the network. In reality I find
|
||||
# this doesn't work so well, but it's here....
|
||||
load-module module-zeroconf-publish
|
||||
|
||||
# Disable suspend on idle to keep audio devices active
|
||||
# This ensures the audio devices don't go to sleep when not in use
|
||||
unload-module module-suspend-on-idle
|
||||
@@ -15,8 +15,8 @@ Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
# Run as busnet user
|
||||
User=busnet
|
||||
Group=busnet
|
||||
User=argus
|
||||
Group=argus
|
||||
|
||||
# Allow real-time priority for better audio performance
|
||||
LimitRTPRIO=9
|
||||
|
||||
Reference in New Issue
Block a user