You are not logged in.
I tried to achieve that by editing ~/.bash_profile as below, but I still get the same error. However when I run the same command in terminal everything works fine. It looks like system haven't yet fully started when the mplayer is started, but I don't know hot to handle it.
~bash_profile
#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
mplayer -slave -playlist /home/$USER/er.m3u 1&>/home/$USER/mplayer.log &
Result
MPlayer SVN-r36285-4.7.2 (C) 2000-2013 MPlayer Team
205 audio & 424 video codecs
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing http://stream.radioer.pl:8000/Radio_eR.
Resolving stream.radioer.pl for AF_INET...
Couldn't resolve name for AF_INET: stream.radioer.pl
STREAM_ASF, URL: http://stream.radioer.pl:8000/Radio_eR
Resolving stream.radioer.pl for AF_INET...
Couldn't resolve name for AF_INET: stream.radioer.pl
Failed, exiting.
Resolving stream.radioer.pl for AF_INET...
Couldn't resolve name for AF_INET: stream.radioer.pl
No stream found to handle url http://stream.radioer.pl:8000/Radio_eR
Playing 1.
File not found: '1'
Failed to open 1.
Exiting... (End of file)
Does anyone know how to fix that or run mplayer after boot some other way?
Last edited by kisawk (2013-07-12 00:49:42)
Offline
What exactly are you trying to accomplish? You can't start mplayer after boot because there's no X session running. Are you trying to start it after login?
"Whoever has ears, let him hear"
Offline
OP doesn't need X as it's a radio playlist.
Offline
This looks pretty much like a network error, you could try to write a systemd service that depends on dhcpcd being fully started or hack you bashrc by putting a condition like ping your radio server. I guess there is a simple way to know if you have a fully functionnal network connection but I don't know it.
Offline
Mplayer can work without X server. Generally speaking I want to run slideshow with music in the background. I need whole thing to run automatically after reboot in case of blackout and I thought it would be easier to accomplish without X server.
Going back to the topic - I delayed executing mplayer by 10 seconds and it works properly.
#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
sleep 10
mplayer -slave -playlist /home/$USER/er.m3u 1&>/home/$USER/mplayer.log &
Still, I don't want to leave it this way. Any ideas what is causing the problem?
Offline
kisawk, are you sure your network is up when you log in?
Offline
As I said earlier everything must start without user participation, so I use autologin. Is there any way to check if network is up (and wait until it will be) before running mplayer?
Offline
As (kinda) already advised, use a while loop that pings that radio server.
Offline
It took me two hours, but it works! Thank you very much.
~/.bash_profile
#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
while :
do
if ping.sh stream.radioer.pl
then
break
fi
done
mplayer -slave -playlist /home/$USER/er.m3u 1&>/home/$USER/mplayer.log &
and ping.sh
#!/bin/sh
ping -c 1 "$1" > /dev/null
There is one more thing. Although I redirected output from ping to /dev/null, I still get this error each time ping.sh is executed.
ping: unknown host stream.radioer.pl
Can I get rid of it somehow?
Offline
Change '> /dev/null' to '2> /dev/null':
$ ping -c1 foobar >/dev/null
ping: unknown host foobar
$ ping -c1 foobar 2>/dev/null
$
to redirect the errors.
Offline
Works great. Thanks again.
Offline
It works the same ways as '1&>/home/$USER/mplayer.log' you have in your script.
http://en.wikipedia.org/wiki/Redirectio … le_handles
'0' is standard input, '1' is standard output and '2' is standard error.
Offline
@karol: Thanks. Have always wondered but never found out.
Offline