[MPlayer-users] Starting mplayer from inittab breaks slave mode
Roguedr
roguedr at gmail.com
Thu Mar 29 07:53:27 CEST 2012
Not sure if this is a mplayer issue or some misunderstanding about how
linux works.
I intend to have a media player set up that starts mplayer on boot and
is controlled to slave mode.
I created a fifo file and stored all the configuration in the
/etc/mplayer/mplayer.conf file. Then I tested mplayer from the command
line and everything works well.
Next step was to put mplayer in inittab using something like:
mp:2345:respawn:/usr/bin/mplayer -idle
This works well, i.e. mplayer starts (tested this with a video file
and it plays). However mplayer does not attach to the fifo pipe.
I tested this with 'lsof' and mplayer simply does not attach to the
pipe. Even with aggressive logging I was unable to identify any error
messages.
Going further I tries to start mplayer as a service, using this wrapper script:
----
#!/bin/bash
case $1 in
start)
echo $$ > /var/run/mplayer.pid;
exec 2>&1 /usr/bin/mplayer -idle
;;
stop)
kill `cat /var/run/mplayer.pid` ;;
*)
echo "usage: mplayer {start|stop}" ;;
esac
exit 0
-----
Than I set the service to run at start up. Same results: mplayer works
but does not attach to the pipe.
Next I set up autologin for a user and put mplayer in the login
script. This works, mplayer plays and is attached to the pipe for
slave mode.
Question is, why does mplayer attach to the pipe only in case of an
interactive login? Is this expected behaviour?
I'm using a fairly up to date Arch Linux (Linux myhost 3.2.8-1-ARCH #1
SMP PREEMPT Mon Feb 27 21:51:46 CET 2012 x86_64 AMD Athlon(tm) II X2
235e Processor AuthenticAMD GNU/Linux)
Mplayer is SVN-r34799-4.6.3
Conf file is:
---
vo=fbdev2
fs=yes
zoom=yes
cache = 8192
fixed-vo=yes
osdlevel=0
nolirc=yes
slave=yes
input=file=/player/commandpipe
loop=0
nosound=yes
----
Thanks,
Rogue
More information about the MPlayer-users
mailing list