Raspberry Pi – PulseAudio daemon SystemWide at Boot

 Uncategorized  Comments Off on Raspberry Pi – PulseAudio daemon SystemWide at Boot
Feb 042017

Various findings on how to start PulseAudio at boot. has general information on running PulseAudio systemwide at boot. Those instructions, however, did not seem to actually start the daemon at boot.

sudo chmod 555 /var/run/pulse/.config/pulse/cookie
to get around cookie file/authentication errors.

Modifying /etc/pulse/ with…
load-module module-native-protocol-unix auth-anonymous=1
…seems to help. But, I have no audio when booting into the Pixel GUI.

Raspberry PI3, 503HTA Tube DAC and USB Microphone.

 Music, Projects, Raspberry PI  Comments Off on Raspberry PI3, 503HTA Tube DAC and USB Microphone.
Oct 222016

I have a Raspberry Pi 3 with a 503HTA Hybrid Tube Amp and a USB Microphone attached. I am running a HiFiBerry preconfigured SD Card image.

My intent is to run a MPD server accessible via tablet app; in this case MPD Control for Android. And also the Amazon Alexa sample application.

The only way I could get this to work was thru PulseAudio. Prior to doing any of this, make sure everything is up-to-date.

sudo apt-get update
sudo apt-get dist-upgrade
sudo rpi-update
sudo reboot

I have Raspbian Jessie configured for the Tube Amp with the following modifications:
1. In /boot/config.txt; comment out dtparam=audio=on. This disables the onboard audio. I added the following –


dtoverlay=pi3-disable-bt disables the onboard bluetooth which I believe is necessary for HiFiBerry DACs.

2. In /etc/modules; I have the following lines –

#DAC Modules

3. In /home/pi/.asoundrc; I have the following –

    type hw
    card Device
    type hw
    card sndrpihifiberry
    type hw
        type hw
        slave.pcm "external"
        type plug
        slave.pcm "usb"
    type hw
        type hw
        slave.pcm "sndrpihifiberry"
        type plug
        slave.pcm "usb"
# The following lines are constantly added at boot. I have no idea which process does
# this, but it overrides the configuration above.
pcm.!default {
	type hw
	card 1

ctl.!default {
	type hw
	card 1

I don’t believe this step is needed when using PulseAudio, however, this .asoundrc config works if you are using a USB microphone and onboard audio out. You can determine the name of your DAC with ‘aplay -l’ from the command line. Replace sndrpihifiberry with ‘ALSA’

4. Installing PulseAudio – My steps:

sudo apt-get install vlc
sudo apt-get install pulseaudio
sudo apt-get install pavucontrol

5. Installing MPD

sudo apt-get install mpd

Modify the /etc/mpd.conf with:

audio_output {
#       type            "alsa"
        type            "pulse"
        name            "MPD PulseAudio Output"
        server          ""

You will probably also need to edit this file with your custom options.

6. Modify /etc/pulse/client.conf; uncomment autospawn=yes. Delete the ‘;’ before that line.

7. Modify /etc/pulse/

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
load-module module-native-protocol-tcp auth-ip-acl=
#load-module module-zeroconf-publish

Uncomment the native-protocol entry and add ‘auth-ip-acl=’ at the end
Some instructions say to uncomment the zeroconf line, but I left it as-is.

8. Depending on which user runs MPD. These commands lets specific users to the PulseAudio groups.

sudo usermod -a -G pulse-access mpd
sudo usermod -a -G pulse mpd
sudo usermod -a -G pulse-access pi
sudo usermod -a -G pulse pi

9. Boot into your Raspbian Desktop GUI. Open a terminal and start PulseAudio.

pulseaudio -D

10. You should now be able to launch the PulseAudio Volume Control.

You should see your DAC as an Output Device and your USB Microphone as an Input Device.

11. Start your Alexa services per the instructions on their GitHub.
Note: The original errors I was getting from the ‘wakeWordAgent -e sensory’ were:

wakeWordAgent: pcm.c:694: snd_pcm_close: assertion 'pcm' failed"
wakeWordAgent: pcm.c:1046: snd_pcm_prepare: Assertion `pcm' failed.

12. Verify your MPD app.

In my experience, you must always start PulseAudio first from a terminal before Alexa or the MPD server will function properly. With these instructions, I was able to have output from MPD and also have Alexa listen and respond.