Quoting mplayer.conf:
" Configuration files are read system-wide from /etc/mplayer/mplayer.conf
and per user from ~/.mplayer/config, where per-user settings override
system-wide settings, all of which are overrriden by the command line."
However, changing the order of audio codec so that 'alsa' is first in user config file does not appear to work.
My preference is to leave the /etc/mplayer/mplayer.conf file as is and make changes to the mplayer.conf file in ~/.mplayer/config
Using the following line: 'ao=alsa,pulse,sdl:aalib' only works in the /etc/mplayer conf file and therefore don't appear to be overridden by the 'per-user' settings.
Also, I would prefer not to start mplayer with the '-ao alsa' option either...
Any thoughts on if this is a 'bug' or 'feature request' or have I missed something?
Edit - adding that playing an mp3, the following warning is returned: "AO: [pulse] Init failed: Connection refused Failed to initialize audio driver 'pulse' AO: [alsa] 44100Hz 1ch floatle (4 bytes per sample) Video: no video Starting playback..."
FIXED
MPlayer looks for the environment variable 'HOME' to determine where to look for the users mplayer config file.
Apps such as lighttpd used to run scripts that in turn run mplayer do not by default set the 'HOME' environment variable.
One could argue and say there is a limitation with MPlayer only looking for an environment value 'HOME' rather than a more robust mechanism to determine a users 'home' directory....
Running MPlayer with 'env HOME=/var/www' will help MPlayer locate the users config file without having to edit /etc/mplayer/mplayer.conf. This also fixes the need to run MPlayer with sudo:
As an example, the following instruction works in a python script called from a remote browser connecting to lightpd web server on a raspberry pi: playing_mplayer=subprocess.Popen(['env', 'HOME=/var/www', 'mplayer', '-slave', '-nocache', '-quiet', '-volume', '60', '-key-fifo-size', '2', '-input', 'file=/run/shm/mpcontrol', '-playlist', 'http://tx.whatson.com/icecast.php?i=magic1054.mp3.m3u' ], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)