[Linux] MPlayer 5.1 AAC to AC3 encode on the fly

Mplayer is arguably the most powerful media player for Linux, but unlike VLC, it lacks an intuitive and powerful configuration GUI (though SMPlayer is amazing).

Thus, in order to set it up correctly, you'll need to fiddle both with the GUI and some old-school text file configuration.

First, install it as (for Ubuntu/Debian):

sudo apt-get install mplayer2 smplayer

Then check you have some output like this:

lavcac3enc     : runtime encode to ac3 using libavcodec

when you run this command:

 mplayer -af help | grep lavcac3enc

Now, to have it encode a 5.1 AAC audio track to AC3 on the fly, you'll need to:

configure via GUI (SMPlayer):

- disable the audio equalizer under Preferences->General->Audio
- enable AC3/DTS pass-through S/PDIF under the same section
- add this parameter:


under Advanced->Options for MPlayer->Audio filters

configure via text file by editing ~/.mplayer/config:


I'm using pulse since alsa gives me nearly 2 seconds of audio delay, but if you wish you can use it by setting instead:



[Ubuntu] Enable hibernation

Ubuntu by default has the hibernation option disabled, even if the system is installed with enough swap space.

Before enabling it, first check if it works without issues by running this command:

sudo pm-hibernate

If the system hibernates correctly and you don't see any errors, edit the /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla file:

gksu gedit /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla

Then look for these two sections:

[Disable hibernate by default in upower]
[Disable hibernate by default in logind]

And change the ResultActive value to yes

Save, reboot and you'll have the option to hibernate the system now.

[Ubuntu] Fix volume reset after reboot

A small but annoying bug in Ubuntu causes the sound volume to be unmuted and reset to 100% after a reboot or logout.

This can be fixed by editing the /etc/pulse/default.pa configuration file for PulseAudio:

gksu gedit /etc/pulse/default.pa

Then look for these lines:

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

and comment out the first one:

### Automatically restore the volume of streams and devices
#load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

Save, logout or reboot and you're set.