Mplayer remote control with ConnectBot and Android.

I love to listen to music from my stereo. I've got tons of CD with music of my favourite bands and singers. But changing CD every time you want to listen one or two songs is annoying. So I've ripped all my music to flac format and put on my HTPC. The problem is I don't have proper remote control for my HTPC. I've tested some of them (remotes and wireless keyboards) and none of them was that good to keep it. My desire is to be able to control my stereo while I'm in the kitchen or bathroom. The longest distance in my flat to HTPC is like 8 meters (about 26 ft). Only one remote I've tested worked in my whole flat (PS3 BT remote), but I've sold it with my PS3 without trying it with my HTPC. Now I know it was a mistake, I should keep it, cause remotes for PC got crazy prices and lame ranges. Some keyboards I've tested worked for like 2 meters (6-7 ft) and have to be in sight with reciever. Some was very unconfortable to type on. I've returned all I've tested. Logitech dinovo mini seems to be nice, but price in Poland is about 130$ and I've heard rumors that their 10m range is not true. So I don't want to spend additional time to get known that it's not working too.
So I decided to use my brain :). I've got Android phone with ConnectBot (which I use a lot - great piece of program). Why not use it as remote. It's easy. Of course my HTPC is linux based, so I just run mplayer with my favourite music in screen:

screen -fn -m -d -S music mplayer -loop 0 -shuffle ~/mnt/mmm/flac/thebest/*.flac

and I can reconect that screeny from any PC in my home (notebook, PC in the office or Android phone). I just need to connect with ssh to my HTPC and run screen -rd music.

But keymap of mplayer is not designed for phone with virtual keyboard. So I have to remap some key shortcuts. I's easy too. Run mplayer -input cmdlist to see all possible commands.
Then edit file ~/.mplayer/input.conf with necessary ones and you are done. I've remaped only two:
m pt_step 1
n pt_step -1

Changed "<" and ">" for previous and next in playlist to "n" and "m". And if you don't want to have that remaped keys all the time, just put input configuration to another file (like alt_input.conf), and then run mplayer with additional option -input conf=path/to/conf/file.

I'm using my Android remote control like 5 months and it's great for my needs. Another good thing is you can run ConnectBot in the background and switch to it when you need to change or mute your music.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Main menu

Article | by Dr. Radut