Hello, I'm new here and am posting this because I can't find anything relevant in a search of the forums.
I have a suite of perl scripts that plays selections from my music collection. A kind of personalised version of iTunes. I use an apache server on my LAN to handle the user interface, backed up by a MySQL database, and I use VLC to play the tracks and control the play through VLC's html interface. It's been running fine under Windows for a good few years.
Since Windows 10 is an abomination, I am finally taking the plunge to move everything to Linux and I'm running Ubuntu 16.04 with apache, with a MySQL database backend.
On Ubuntu the interface and database parts work fine, but my script doesn't seem able to invoke vlc to play the music. I've tried various things and after banging my head against it for a while I decided to seek help.
The command string generated by the script is of the form:
/usr/bin/vlc --http-password="xxxxx" --intf="http" --one-instance --play-and-exit --playlist-enqueue /path_to_music/test.mp3
Run from the command line, this plays the track and I can control it through the http interface in a webpage (port 8080). It exits normally at the end.
However, when I execute the same command through a perl system call (forked process) in my script, the call returns error code 256 and no music is heard . The apache error log says:
Home directory not accessible: Permission denied
[00000000020c3ec8] pulse audio output error: PulseAudio server connection failure: Connection refused
Home directory not accessible: Permission denied
[00000000020cb7d8] core interface error: no suitable interface module
[0000000001ff6178] core libvlc error: interface "globalhotkeys,none" initialization failed
[00000000020cb7d8] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[00000000020cb7d8] core interface error: no suitable interface module
[0000000001ff6178] core libvlc error: interface "dbus,none" initialization failed
[00000000020cb7d8] core interface error: no suitable interface module
[0000000001ff6178] core libvlc error: interface "default" initialization failed
My best guess is that it's a permissions issue and the cgi environment is not able to invoke the vlc application correctly. Is that right? Is this an example of Linux' superior security isolating the web server from other applications?
And if so, what is the workaround?
Any help will be appreciated.
Philip
Bookmarks