Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

#!/bin/bash
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
add comment

1 Answer 1

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"
audio:x:63:videouser,root
pulse:x:474:videouser,root
pulse-access:x:473:videouser,root

after editing from:

# cat /etc/group|egrep -i "audio|pulse"
audio:x:63:
pulse:x:474:
pulse-access:x:473:

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

share|improve this answer
add comment

Your Answer

 
discard

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.