mardi 27 janvier 2015

No sound with process owned by www-data

I am building a webapp to play youtube videos on a headless webserver (for Raspberry Pi). The webapp takes a youtube video url and uploads the url through a http post request to a php script, that will execute mps-youtube to play the audio from the youtube video.


When mps-youtube is executed by my own user the sound works.


I have a develop environment on my desktop running ubuntu 14.04. I added the www-data user to the audio and video group. This was working for a brief moment, but it stopped working, and I have no clue why.


The output from the php exec('mpsyt playurl "'.$url.'" 2>&1') call shows that mps-youtube is executed, there is just no sound output. The error log from apache does not show anything either. I am looking for ideas how to troubleshoot this.


Update: I tried playing a mp3 file with mpg123 from the php script to exclude the possibility the problem is caused by mpsyt. Still no audio, however the process was running; output of ps aux | grep mpg123:



www-data 9884 0.0 0.0 4444 656 ? S 00:43 0:00 sh -c mpg123 "/var/www/440Hz-5sec.mp3" 2>&1
www-data 9885 6.0 0.0 235688 3956 ? Sl 00:43 0:00 mpg123 /var/www/440Hz-5sec.mp3

Aucun commentaire:

Enregistrer un commentaire