sound doesn't work until I login

Oliver Grawert ogra at ubuntu.com
Wed Sep 7 09:02:20 UTC 2016


hi,
Am Mittwoch, den 07.09.2016, 08:47 +1000 schrieb Karl Auer:
> An apparently simple problem, but I can't seem to figure it out. And
> Uncle Google only has "hints and allegations".
> 
> I want sound to play when my GUI-free Ubuntu 16.04 system starts. I
> have a script that plays sound, the script starts when my system
> boots,
> each part of the script is working fine, but sound doesn't start
> happening until I log in (on a console screen - no GUI, remember).
> 
> Until I log in, every invocation of "play" (the program I use to play
> a
> sound file) produces these errors:
> 
> shm_open() failed: No such file or directory
> ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect:
> Protocol error
> /usr/bin/play FAIL formats: can't open output file `default':
> snd_pcm_open error: Connection refused
> 
> As soon as I log in, sound starts happening.

pulse gets started by the session scripts on a per-user base, not as a
system daemon. so if you are not logged in at all, there is usually no
pulseaudio daemon running. 

try changing these two options in the config like:
/etc/pulse/daemon.conf:

daemonize = yes
system-instance = yes

and make it start on system boot:

/etc/default/pulseaudio:

PULSEAUDIO_SYSTEM_START=1 

after a reboot it should start on boot as a system daemon ... 
see if that helps (else revert your changes again ;) )

ciao
	oli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20160907/46428ca6/attachment.sig>


More information about the ubuntu-users mailing list