I need to enable sound on root user mode, I am on Ubuntu 12.04 when I login as root I can see the volume control is disabled, I searched and found that pulse audio wont work on root user mode, but I also found that System-Wide Daemon, so just applied this for root as shown below.

addgroup --system pulse
adduser --system --ingroup pulse --home /var/run/pulse pulse
addgroup --system pulse-access

# Some distributions restrict access to the sound devices to a group audio
adduser pulse audio

# Add a user to the pulse-access group
adduser root pulse-access

But while reboot still the volume control is disabled. What could be the issue, how can enable sound on root mode.

Basically what I want to do is using libao play some audio in root usermode, but when running the program I am getting the error like

ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave

1 Answer 1


I solved it by running,

pulseaudio -D as root on each start up.

  • how to do it? I'm new to ubuntu and find this a bit confusing. Do i add sudo pulseaudio -D to /etc/rc.local file?
    – node_man
    Mar 4, 2019 at 11:36
  • or do you mean when the machine start's up I have to type sudo pulseaudio -D in the terminal?
    – node_man
    Mar 4, 2019 at 11:39
  • 1
    Yes you can create a startup script put the command inside it, so every time when system boot the command will execute
    – Haris
    Mar 4, 2019 at 11:47
  • Now I get the error PulseAudio: Unable to connect: Access denied
    – Michael
    May 3, 2019 at 21:32
  • May be you have to run the command using sudo
    – Haris
    May 4, 2019 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.