I have a shell script 'vlc.sh' 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?

  • 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.

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.