sound doesn't work until I login

Ralf Mardorf silver.bullet at zoho.com
Thu Sep 8 06:28:10 UTC 2016


On Thu, 08 Sep 2016 10:06:41 +1000, Karl Auer wrote:
>On Wed, 2016-09-07 at 19:38 +0200, Ralf Mardorf wrote:
>> does the script really need a sound server?  
>
>I don't know, Ralf. I've never been interested in anything except
>ordinary user sound until now.
>
>> Do you need to mix different sound sources that require resampling?  
>
>Nope.
>
>> Even for this usage ALSA provides plugins, that are likely not that
>> user-friendly as a sound server, but I doubt that user interaction is
>> required, if a script should do the work anyway.  
>
>My system just starts up and starts playing music off a USB stick,
>forever. That's it.

Ok, so IIUC when using pulseaudio, you can't kill it after startup and
restart it as user, because playing music should start when booting and
continue when starting a session.

Actually you don't need a sound server, you could use plain ALSA. OTOH
assuming you want to listen to the music after startup and get sound
from e.g. a browser at the same time the music is playing, then without
a sound server, it could be tricky.

On Thu, 08 Sep 2016 10:30:23 +1000, Karl Auer wrote:
>The only remaining issue is that I cannot control the running
>pulseaudio. Any attempt to use pacmd or pactl results in one or more
>of:
>
>Failed to create secure directory (/var/run/pulse): Permission denied
>No PulseAudio daemon running, or not running as session daemon.

Apart from the security issues mentioned by the link i posted,
https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/ ,
it also mentions:

"What is wrong with system mode?
[snip]
When in system mode, shared memory data transport is disabled for
security reasons, which means: much higher memory usage and CPU load in
system mode 
[snip]
And, most importantly: it is explicitly not designed for it, you are on
your own if you use it. The maintainer's interest in making sure system
mode is well supported is rather minimal.
[snip]"

For me this would be enough reasons not to use pulseaudio in system
mode, let alone that I never used, don't use and never ever will
use pulseaudio at all.

However, wouldn't it be the easiest way to wait until startup finished
and start playing music after the user session started? Does booting
take that long, that playing music already during startup isn't just a
ridiculous gimmick?

>I just can't change the volume

I don't know how pulseaudio interacts with ALSA, I read terrible things
mentioned by audio developers. You could try running

  $ alsamixer

or

  # alsamixer

;).

Regards,
Ralf





More information about the ubuntu-users mailing list