I wanted to play some mkv/avi files containing 5.1 AC3/DTS sound with mplayer through an SPDIF optical out on my Ubuntu box.
With default settings, at first I was getting:
Selected audio codec: [hwac3] afm: hwac3 (AC3 through S/PDIF)
[format] Sample format big-endian AC3 not yet supported
Error at audio filter chain pre-init!
I have the default configuration, so PulseAudio is running. I have just chosen “Alsa” as default audio device in smplayer (yes SMPlayer, a GREAT GUI for mplayer, Qt rocks get over it 😉 ).
I have tried deactivating pulseaudio temporarily to call on the alsa device directly with:
pasuspender — smplayer test.avi
but it still did not work. This suspends PulseAudio, frees all audio hardware and launches the provided command…. could come in handy another day 🙂
After some googling and testing, I finally figured out you need the following things for it to work:
- Select the correct Hardware Alsa device ! (for me it was 0.1 for the SPDIF output). If you use mplayer CLI, that is: -ao alsa:device=hw=0.1
- Disable “Enable the audio equalizer”. Activating this always gives the error.
- Enable “AC3/DTS pass-through S/PDIF”. This one is obvious…
- Disable “Use software volume control”. Activating this always gives the error.
You should get something like this:
Now you can play your favorite DVD/BR/files with full SPDIF AC3/DTS surround power, that will get decoded on your kick-ass Surround amplifier at the other end of your SPDIF cable 🙂 All this on your favorite OS. Yeah!!!
If you can’t hear anything, you need to mess with your PulseAudio settings first, and if not satisfactory then your Alsa settings.
For Pulse you need to select the “Digital Stereo Duplex (IEC958)” hardware profile.
For alsamixer, I have mostly:
- “S/PDIF Default PCM” on Mute.
- “Channel mode” at 6, although I am not sure it is needed.
- “S/PDIF” on Unmute (lol)
- Everything else on Mute, except for “PCM” and “Master” of course 🙂