From bee218efb996601fb65137ce0a139cee669d2ef9 Mon Sep 17 00:00:00 2001 From: Pig Monkey Date: Fri, 30 Dec 2016 17:20:55 -0800 Subject: [PATCH] install pulseaudio Existing users will want to remove the old udev rule for device switching, and the /etc/asound.conf file it generated. # rm /etc/udev/rules.d/00-local.rules # rm /etc/asound.conf A new /etc/asound.conf is provided by the pulseaudio-alsa package. If our old file is not removed prior to installation, the new file will be installed at /etc/asound.conf.pacnew. This will need to be moved to the proper location. --- roles/sound/tasks/main.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/roles/sound/tasks/main.yml b/roles/sound/tasks/main.yml index 0d3ea36..ca0fa32 100644 --- a/roles/sound/tasks/main.yml +++ b/roles/sound/tasks/main.yml @@ -2,8 +2,13 @@ - name: Install alsa-utils pacman: name=alsa-utils state=present -- name: Copy udev rule for USB audio device switching - copy: src=udev.rules dest=/etc/udev/rules.d/00-local.rules +- name: Install PulseAudio + pacman: name={{ item }} state=present + with_items: + - pulseaudio + - pulseaudio-alsa -- name: Push volume control script - copy: src=volume.sh dest=/usr/local/bin/volume mode=0755 +- name: Switch output to newly connected devices + lineinfile: dest=/etc/pulse/default.pa + state=present + line=load-module module-switch-on-connect