How to have correct sound surround 5.1 over hdmi?

I try to output a video with an 5.1 audio track encoded with AAC.
For this I use an Apalis IMX6Q with an Ixora carrier board, and the linux-3.14.28 supplied by Toradex.
I use gstreamer 0.10 with this command :

gst-launch filesrc location=/media/sda1/FILE2_AAC_5-1_TestVideo.mp4 typefind=true ! aiurdemux name=demux demux. ! queue ! vpudec low-latency=true ! imxv4l2sink demux. ! queue ! beepdec ! alsasink device=plughw:2,0

But the track of the Surround Right goes on the Front Center, the track of the Front Center goes on the Surrond Left and the track of the Surround Left goes nowhere.

For this test I use the following video :

If I play the video with my computer on Ubuntu 14.04 its work well.

Anybody have a solution to get the correct output ?

Have you also tried playing the file using playbin2? I’m curious if it manages to do anything different. For example:

gst-launch playbin2 uri=/media/sda1/FILE2_AAC_5-1_TestVideo.mp4 audio_sink=”alsasink device=sysdefault:CARD=imxhdmisoc"

As Igor pointed out in the Community thread, the i.MX 6 BSP of NXP does only support stereo. We did not extend/fix that limitation, hence our BSP will likely suffer from the same limitations.
Update: Oh I see that this restrictions should actually not apply to the on-chip HDMI driver…

What might worth a try is using an upstream Linux kernel, our Apalis module recently got added (the accepted version of the patchset). You currently have to patch a 4.5 Kernel with those patches manually, or use Shawn’s for-next tree. Be aware that the hardware accelerated GStreamer plugins (imxv4l2sink) do not work with upstream kernels though.

Edited on March 23, 09:35 PST

I try this command :

gst-launch playbin2 uri=file:/media/sda1/FILE2_AAC_5-1_TestVideo.mp4 audio_sink=“alsasink device=sysdefault:CARD=imxhdmisoc”

but unfortunately only the front left and front right goes out (2 channels).

Does 5.1 Surround show up in the list when you enter: aplay -L

Can you try entering the following:

gst-launch playbin2 uri=file:/media/sda1/FILE2_AAC_5-1_TestVideo.mp4 audio_sink="alsasink device=surround51:CARD=imxhdmisoc,DEV=0"