EchoEum
Posts: 56
Joined: Mon Aug 01, 2016 1:01 pm

pulseaudio start on boot?

Wed Aug 03, 2016 10:58 pm

how do i get pulseaudio to start on boot?

Right now I have to execute

Code: Select all

pulseaudio -D
manualy at the start of each laumch

pcmanbob
Posts: 7080
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: pulseaudio start on boot?

Thu Aug 04, 2016 9:33 am

Hi.

A quick google search suggest this may be the required.

/etc/pulse/client.conf change "autospawn=no" to "autospawn=yes."
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

EchoEum
Posts: 56
Joined: Mon Aug 01, 2016 1:01 pm

Re: pulseaudio start on boot?

Thu Aug 04, 2016 2:27 pm

pcmanbob wrote:Hi.

A quick google search suggest this may be the required.

/etc/pulse/client.conf change "autospawn=no" to "autospawn=yes."
I found that article before I posted. I looked in that file and didn't see those options at all.

Do you think I should just add them in?

EchoEum
Posts: 56
Joined: Mon Aug 01, 2016 1:01 pm

Re: pulseaudio start on boot?

Thu Aug 04, 2016 2:31 pm

Actually I just looked again and it seems the option is there and already set to "yes"

EchoEum
Posts: 56
Joined: Mon Aug 01, 2016 1:01 pm

Re: pulseaudio start on boot?

Thu Aug 04, 2016 2:35 pm

Code: Select all

# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.

## Configuration file for PulseAudio clients. See pulse-client.conf(5) for
## more information. Default values are commented out.  Use either ; or # for
## commenting.

; default-sink =
; default-source =
; default-server =
; default-dbus-server =

 autospawn = yes
; daemon-binary = /usr/bin/pulseaudio
; extra-arguments = --log-target=syslog

; cookie-file =

; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB

; auto-connect-localhost = no
; auto-connect-display = no

pcmanbob
Posts: 7080
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: pulseaudio start on boot?

Thu Aug 04, 2016 4:05 pm

found this don't know if it will help but it talks about setting up the daemon to auto start .

In their zeal to discourage anyone from running Pulseaudio in system mode, the Pulseaudio maintainers do not ship any startup script in the distribution packages – this ensures that users who don’t know what they are doing don’t stray off the beaten path of orthodox desktop usage and end up on a forum complaining that Pulseaudio doesn’t work. But it also annoys the other users, who actually need Pulseaudio to run at system startup – but that is easily fixable thanks to another creation of Lennart’s gang: all we need is a single file called a systemd unit… I copied one from this guy who also plays with Pulseaudio network streaming (but in a different way – more on that later). This systemd unit was written for Fedora, but it works just as well for Raspbian… Copy this and paste it in /etc/systemd/system/pulseaudio.service :

[Unit]
Description=PulseAudio Daemon

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
PrivateTmp=true
ExecStart=/usr/bin/pulseaudio –system –realtime –disallow-exit –no-cpu-limit

Then ‘systemctl enable pulseaudio’ and ‘systemctl start pulseaudio’ – you now have a properly set up Pulseaudio daemon.

this is were I found it.
http://serendipity.ruwenzori.net/index. ... e-easy-way
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

EchoEum
Posts: 56
Joined: Mon Aug 01, 2016 1:01 pm

Re: pulseaudio start on boot?

Thu Aug 04, 2016 5:35 pm

hmmm... did this work for you?

I just gave it a go and had no luck.

pcmanbob
Posts: 7080
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: pulseaudio start on boot?

Fri Aug 05, 2016 9:40 am

Its been a while since I played with pulseaudio and never had it running automatically as far as I can remember, may be the answer is to just start it at boot using crontab -e and adding the line @reboot pulseaudio -D.

you may need to add the full path before the pulseaudio.

If that does not work then I am out of ideas.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
Douglas6
Posts: 4778
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: pulseaudio start on boot?

Fri Aug 05, 2016 1:58 pm

I run PulseAudio in system-wide mode and start it with a service unit. I followed the instructions here: https://github.com/davidedg/NAS-mod-con ... Audio5.txt. Remember PA will be running as root, so you need to give root pulse-access permissions.

Tac0boutit
Posts: 1
Joined: Sat Jan 12, 2019 2:15 am

Re: pulseaudio start on boot?

Sat Jan 12, 2019 2:26 am

EchoEum wrote:
Thu Aug 04, 2016 5:35 pm
hmmm... did this work for you?

I just gave it a go and had no luck.
I know this is old, but the problem still exists and there is no solution here, but I have found it. Since the service file code provided was not in a 'code' block, the double '-'s were converted to the special double hyphen character. You probably received a 'Too many arguments' error like I did. Edit your own file and convert the leading hyphens to two regular ones, or copy the pre-formatted code below:

Code: Select all

[Unit]
Description=PulseAudio Daemon

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
PrivateTmp=true
ExecStart=/usr/bin/pulseaudio --system --realtime --disallow-exit --no-cpu-limit

nopnop2002
Posts: 19
Joined: Sat Sep 28, 2013 11:40 am

Re: pulseaudio start on boot?

Sun Nov 10, 2019 10:59 pm

I tried this.
It work fine.


[autoConnect.sh]

Code: Select all

#!/bin/bash
sudo -u pi pulseaudio --start << EOF
raspberry
EOF

sudo -u pi bluetoothctl << EOF
raspberry
connect 54:14:8E:38:A8:28
EOF

[crontab -l]

Code: Select all

@reboot sleep 15 && /home/pi/autoConnect.sh

RossDv8
Posts: 148
Joined: Thu Jan 21, 2016 12:35 pm

Re: pulseaudio start on boot?

Mon Nov 11, 2019 2:51 am

Just in case anyone is still having trouble getting the pulseaudio daemon to run automatically on startup, I found the easiest was ti install pasystray (using the Raspbian software installer), or sudo apt-get install pasystray. Ypu might have to add it to the panel (as an applet) to actually see it. For some reason 'pa' or 'pulseaudio' is not listed in the name on the available applets list. It just says 'systray'.

Once you add it, you should get a second Volume control icon, and clicking it gives some pulse options - but it doesn;t work as a volume control in itself. (no slider).

However, after it was installed, and on every boot since, if I check the system monitor, pulseaudio is running, and if I open a Terminal and type pulseaudio then enter I get:

[email protected]:~ $ pulseaudio
E: [pulseaudio] pid.c: Daemon already running.
E: [pulseaudio] main.c: pa_pid_file_create() failed.
[email protected]:~ $

I use pulse a lot and this was the easiest way I found to autostart it..
Pi 4B 4GB - system on WD 240G SSD ( but /boot on Sandisk microSD)

Return to “Troubleshooting”