Ubuntu

How do I make my headless server act as a PulseAudio server on startup?

Asked by Endolith on 2009-02-21

If I login, it creates a PulseAudio server, but when I log out the server shuts down. How do I get it to act as a server without anyone logged in?

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu pulseaudio Edit question
Assignee:
No assignee Edit question
Last query:
2009-06-03
Last reply:
2009-06-19
Simone Cianfriglia (crimer) said : #1

Open terminal the type:
    sudo editor /etc/default/pulseaudio

Then you have to edit the line
    PULSEAUDIO_SYSTEM_START=0
to
    PULSEAUDIO_SYSTEM_START=1

Save and exit editor.

Now there are two options:
1) Reboot
2) sudo service pulseaudio start

Endolith (endolith) said : #2

# Start the PulseAudio sound server in system mode.
# (enables the pulseaudio init script)
# System mode is not the recommended way to run PulseAudio as it has some
# limitations (such as no shared memory access) and could potentially allow
# users to disconnect or redirect each others audio streams. The
# recommend way to run PulseAudio is as a per-session daemon. For GNOME
# sessions you can install pulseaudio-esound-compat and GNOME will
# automatically start PulseAudio on login (if ESD is enabled in
# System->Preferences->Sound). For other sessions, you can simply start
# PulseAudio with "pulseaudio --daemonize".

Simone Cianfriglia (crimer) said : #3

Endolith, I can't figure your new question.....

Endolith (endolith) said : #4

PULSEAUDIO_SYSTEM_START=1 does not work

I don't care about users redirecting audio streams, but what's the downside of no shared memory access?

Simone Cianfriglia (crimer) said : #5

If pulseaudio is executed as a per-user process, it uses shared memory to communicate; if it's started as a system daemon, it operates only by local sockets.
Obviously shared memory is faster than sockets, but unix local sockets are managed by the kernel in memory so they're not so slow as it seems.

To start pulseaudio as a daemon you have to:
1) Edit /etc/default/pulseaudio as written before
2) killall pulseaudio
3) sudo service pulseaudio restart

Or try to substitute passages 2 and 3 with "reboot" or "sudo reboot"

If there are other problems write here :)

Endolith (endolith) said : #6

Yes, I did that. It still doesn't create a pulseaudio server until I log in to the remote machine.

l3iggs (l3iggs) said : #7

i've been smashing my head into this problem for the past few hours and i think i've got it figured out now. what a mess these stupid pulse config files are. try following these steps on a fresh pulseaudio install:

edit your /etc/default/pulseaudio file so that:
PULSEAUDIO_SYSTEM_START=1
DISALLOW_MODULE_LOADING=0

now put the following three lines in the bottom of your /etc/pulse/system.pa file:
load-module module-esound-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/16
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/16
load-module module-zeroconf-publish

you can remove the auth... junk from the first two lines there if you want, they just prevent any IP other than a local one from connecting to your server (although it might be cool for a few minutes if someone else started playing music on your speakers)

make sure you've got the pulseaudio-module-zeroconf package installed

now you can sudo etc/init.d/pulseaudio start and you should be up and running, and that should run on bootup

good luck

hopefully the time i've spent on this benefits someone other than just me

Endolith (endolith) said : #8

According to the file /etc/pulse/default.pa these are supposed to be configured using the GUI:

### 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
#load-module module-zeroconf-publish

Endolith (endolith) said : #9

Even after this is all set up, how do I direct the sound devices? It's not at all intuitive. Whenever I start a server remotely, my local computer connects to it automatically and starts playing all sound through it. How do I route sounds to the local speakers by default and choose to move streams to the remote computer only when I want to?

Launchpad Janitor (janitor) said : #10

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Endolith (endolith) said : #11

Any ideas?

Launchpad Janitor (janitor) said : #12

This question was expired because it remained in the 'Open' state without activity for the last 15 days.