Loading mplayer from thunar with access to multiple audio streams

This is about the non-gui version of mplayer. I like the keyboard interface and in the past I've had lots of problems with versions of gmplayer (the one in Slackware 13 seems well behaved however).

I use the file manager Thunar quite often, and like to be able to start music and movies with mplayer from it. There are three options to do that if mplayer is not configured yet. One I don't know about: thunar must have a MIME application list somewhere - I don't know where. Two and three are: "open with other application" (right-click-menu) and "Configure custom actions" (under Edit). Both need a command line to execute ([path] %F).

"Open with other application" is most practical (more space on the right-click-menu) but if you use something like xterm -e mplayer %F the app gets the name "xterm". That is a minor inconvenience, but can (if need be) resolved with a start-up script: put xterm -e mplayer "$@" in a bash script, give that a safe name and use that as app. However, my problem was that in Slackware 12.1 mplayer could not open multiple streams by default, even though Alsa has improved on this point. The solution is apparently to use mplayer -ao alsa:device=dmix. Extra problem: when I used that directly in Thunar ("custom command") it didn't work (no idea why not). The easy solution (which I thought of only days later) is to add this option to your mplayer config file (mine lives in ~/.mplayer/config).

# Write your default config options here!

Obviously you only need ao=alsa:device=dmix, but the other two I happen to like as well (vf=screenshot,eq,hue allows for taking a screenshot with s and adjusting contrast, color, hue and saturation with 1-8.

Sun Mar 8 14:45:03 CET 2009

Update: whether mplayer -ao alsa:device=dmix works depends on your hardware! Depending on your hardware (and version of Alsa?) you may not need it even; Also, look at an option like 'use software volume control' (xmms) in the relevant applications (to be able to adjust volume independently from other apps). Its softvol=1 in config of mplayer and/or 'enable software mixer' in gmplayer's preferences.

Sun Dec 26 07:51:02 CET 2010