I'm looking for a replacement for mplayer. mplayer is a audio player for the console. It works just fine when I use it like so:

 mplayer /path/to/audio.mp3

But when I start it in the background I get this error message:

 :~$ mplayer /home/.alarm-sounds/alien1.wav &
 [3] 15451
 :~$ MPlayer svn r34540 (Ubuntu), built with gcc-4.7 (C) 2000-2012 MPlayer Team
 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.

I'm trying to write a little alarm script because I want to practice some modified version of pomodoro.


From the manual:

Q: How can I run MPlayer in the background?
A: Use: mplayer options filename < /dev/null &

The redirect (note it's an input from /dev/null) is critical. mplayer is expecting input.

So in my case, the following works:

mplayer -nolirc ~/Music/Aqua/Aquarium/Aqua\ -\ 03\ -\ Barbie\ Girl.mp3 < /dev/null &

This is a shorter variation:

cat 0 | mplayer ~/Music/Aqua/Aquarium/Aqua\ -\ 03\ -\ Barbie\ Girl.mp3 &
  • That doesn't work either. I've tried it. Same LIRC error.
    – Seth
    Sep 4 '13 at 14:40
  • @Seth The LIRC notice is not a terminal error and passing in -nolirc will stop it from showing.
    – Oli
    Sep 4 '13 at 14:56
  • works just fine.
    – schlingel
    Sep 4 '13 at 15:32
  • @Oli That's odd because it DID NOT work for me...
    – Seth
    Sep 4 '13 at 18:43
  • @Seth Try mplayer [file] </dev/null >/dev/null 2>&1 & Feb 22 '15 at 1:22

If you're just dealing with wavs, you can use paplay.

For mpeg playback you'll need something else. You could mess around manually decoding it and piping that back around into paplay but one alternative to mplayer is mpeg321:

mpg321 ~/Music/Aqua/Aquarium/Aqua\ -\ 03\ -\ Barbie\ Girl.mp3 &

And now that's playing. Great. I need to pick a better example when I do this stuff.


You can use cvlc, the commandline version of vlc.

cvlc ~/Music/pathToSomeAlbum/someSong.mp3 &

If you want to hide all of the output as well as run it in the background use this neat trick:

cvlc ~/Music/pathToSomeAlbum/someSong.mp3 2>&1 > /dev/null &

That will route all the output into /dev/null.


The lirc message can be avoided completely by adding the following to $HOME/.mplayer/config:


Unless of course you actually use a remote control...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.