in reply to Sharing Sound card / Remote Media PC.

Your sound card's device node under /dev will be owned by a group called audio (or similar).

Add your web-server's user (eg: www-data, or nobody) to that group.

-David

Replies are listed 'Best First'.
Re^2: Sharing Sound card / Remote Media PC.
by SkipHuffman (Monk) on Nov 15, 2007 at 16:41 UTC

    Thank you, that sounds right. But...

    I have added the "nobody" id and the "apache" id to the group "audio" which owns /dev/audio (which is a link to /dev/sound/audio, which is owned by root.) But it seems to make no difference.

    I can play my script from the command line, either locally or through ssh, but not through a web form. (useless web form below).

    mplayer is running, I can see the feedback on the web browser, but no sound.

    <html> <head> <title> Test file </title> </head> <body> <h1>Test file</h1> <p>test data <form action="/cgi-bin/PlayPod.pl"> <input type="submit" value="play pod"> </form> </body> </html>

    Skip
      Two things:

      Are you sure the webserver is running as nobody?

      Does PlayPod.pl know how to start the music and give control back to the initiating terminal (in this case the web-server via fork) ?

      -David

        Figured it out. I needed to restart the web server(rebooted actually) before it recognized the new group assignments.

        I am expecting use of "system" should allow control to be retained by the web server. It does play the sound file to completion, or if I hit the back button, the file is interrupted.

        I think the web server actually runs as "apache", but I think it may run cgi as "nobody".

        Skip