From 84fc4622d59823ba544fa7d5fa585e7b54feeaf9 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Mon, 6 Nov 2017 17:37:11 +0100 Subject: [PATCH] [pulseaudio] Adjustments to user mode instructions --- README_PULSE.md | 115 ++++++++++++++++++++++--------------------- forked-daapd.conf.in | 7 +-- 2 files changed, 63 insertions(+), 59 deletions(-) diff --git a/README_PULSE.md b/README_PULSE.md index c6f3363f..c613ec50 100644 --- a/README_PULSE.md +++ b/README_PULSE.md @@ -1,66 +1,28 @@ # forked-daapd and Pulseaudio + +You have the choice of runnning Pulseaudio either in system mode or user mode. +For headless servers, i.e. systems without desktop users, system mode is +recommended. + +If there is a desktop user logged in most of the time, a setup with network +access via localhost only for daemons is a more appropriate solution, since the +normal user administration (with, e.g., `pulseaudio -k`) works as advertised. +Also, the user specific configuration for pulseaudio is preserved across +sessions as expected. + +- [System mode](#system-mode-with-bluetooth-support) +- [User mode](#user-mode-with-network-access) + + +## System Mode with Bluetooth support + Credit: [Rob Pope](http://robpope.co.uk/blog/post/setting-up-forked-daapd-with-bluetooth) -System mode is generally only recommended for headless servers, i.e., -systems without desktop users. - - -## User Mode with Network Access - -If there is a desktop user logged in most of the time, a setup with -[network access via localhost -only](http://billauer.co.il/blog/2014/01/pa-multiple-users/) -for daemons is a more appropriate solution, since the normal user -administration (with, e.g., `pulseaudio -k`) works as -advertised. Also, the user specific configuration for pulseaudio is -preserved across sessions as expected. - -Quoting from the above blog, the necessary setup (per user) boils down -to: - - -### Step1: Copy system pulseaudio configuration to the users home directory - -``` -mkdir -p ~/.pulse -cp /etc/pulse/default.pa ~/.pulse/ -``` - - -### Step 2: Enable TCP access from localhost only - -Edit the file `~/.pulse/default.pa` , adding the following line at the end: - -``` -load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 -``` - - -### Step 3: Restart the pulseaudio deamon - -``` -pulseaudio -k -# OR -pulseaudio -D -``` - - -### Step 4: - -In the `audio` section of `/etc/forked-daapd.conf`, set `server` to `localhost`: - -``` -server = "localhost" -``` - - -## System Mode - This guide was written based on headless Debian Jessie platforms. Most of the instructions will require that you are root. -### Step 1: Setting up Pulseaudio in system mode with Bluetooth support +### Step 1: Setting up Pulseaudio If you see a "Connection refused" error when starting forked-daapd, then you will probably need to setup Pulseaudio to run in system mode [1]. This means @@ -140,6 +102,47 @@ connect [MAC address] Now the speaker should appear in forked-daapd. You can also verify that Pulseaudio has detected the speaker with `pactl list sinks short`. + + +## User Mode with Network Access + +Credit: wolfmanx and [this blog](http://billauer.co.il/blog/2014/01/pa-multiple-users/) + + +### Step 1: Copy system pulseaudio configuration to the users home directory + +``` +mkdir -p ~/.pulse +cp /etc/pulse/default.pa ~/.pulse/ +``` + + +### Step 2: Enable TCP access from localhost only + +Edit the file `~/.pulse/default.pa` , adding the following line at the end: + +``` +load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 +``` + + +### Step 3: Restart the pulseaudio deamon + +``` +pulseaudio -k +# OR +pulseaudio -D +``` + + +### Step 4: Adjust configuration file + +In the `audio` section of `/etc/forked-daapd.conf`, set `server` to `localhost`: + +``` +server = "localhost" +``` + --- [1] Note that Pulseaudio will warn against system mode. However, in this use diff --git a/forked-daapd.conf.in b/forked-daapd.conf.in index 91606d26..41562ff2 100644 --- a/forked-daapd.conf.in +++ b/forked-daapd.conf.in @@ -177,9 +177,10 @@ audio { # Type of the output (alsa, pulseaudio, dummy or disabled) # type = "alsa" - # For pulseaudio output, an optional server can be specified. - # If not set, connection is made via local socket. -# server = "" + # For pulseaudio output, an optional server hostname or IP can be + # specified (e.g. "localhost"). If not set, connection is made via local + # socket. +# server = "" # Audio PCM device name for local audio output - ALSA only # card = "default"