Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a shell script '' that plays a video using vlc:

vlc /home/sparky/sample.mp4

When I run this script from my login, I get audio + video.

When I call this script from the Apache user (via php), I get only video. The Apache error log complains about audio:

[0x96053ec] pulse audio output error: cannot connect to server: Connection refused
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_card_driver returned error: 
No such file or directory
oss audio output error: cannot open audio device (/dev/dsp)

I've tried adding the apache user to the audio, pulse, pulse-access, and admin groups. But I've have had no luck. I'm running xubuntu 11.10. What should I try next?

share|improve this question
Looks like there is quite a bit more to this than just setting up permissions. I found this: link --Looks like a good guide to solving this problem: – Sparky1 Nov 15 '11 at 23:18
If you have solved your problem, consider adding it as an answer and marking it, or if inappropriate, closing/deleting? – Lewis Goddard Feb 24 '12 at 20:40

The answer was provided from a link mentioned by the OP in a comment. The following is an excerpt from it:

Turns out that I needed to edit the /etc/group file and add videouser user to the audio user group of users who are allowed to have audio while the root login is in session. The line should like like this:

# cat /etc/group|egrep -i "audio|pulse"

after editing from:

# cat /etc/group|egrep -i "audio|pulse"

and sure enough, there was sound. However, the pulseaudio still showed the error. Appears a reboot is in order.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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