I learnt a lot of things, here is a full feedback, describing concepts, problems AND SOLUTION.
Let me remind you my hardware :
NAS Storage with mkv movies <== Ethernet ==> Raspberry PI <== HDMI ==> SONY 55ex720 TV <== SPDIF Optical ==> Logitech 5.1 Z-5500
First you have to know that DTS or AC3 are digital encoded audio streams. That means you can't send it directly to an audio speaker. There must be an audio decoder between DTS sender ans audio speaker.
The question is which device have to do that ?
Actually, HDMI is not a simple cable with data going from raspberry to the TV. It has a real communication with the TV, a lot of data is exchanged. For example, the TV tells the PI which resolution/framerate it is able to show. And another information is if the TV is able to decode DTS !!! if it is not (which is my case with my Sony 55ex720), the default configuration asks the raspberry to decode DTS !
Raspberry is amazing for video !
Indeed, it has a hardware 1080p video decoding system. That means it doesn't use the CPU power to decode the video, it uses a specific hardware chip. This is mandatory as the raspberry CPU isn't power enough to decode such streams. So there is no problem with the video decoding. Raspberry is not amazing for audio !
Indeed it doesn't have a hardware audio decoding system. So the CPU is used to do that in order to send a decoded sound to the HDMI Device. As DTS is a very heavy stream (because of its quality), decoding it requires a lot of CPU Power. :idea:That's why the video is sluttering, the CPU struggles to decode the audio stream.
So what to do ???
The solution is not really simple (sometimes it works fine but it didn't for me and I had a lot of steps) First Step : Passthrough
You have force the raspberry to send the DTS stream without decoding it. This is called Passthrough because the stream is read from the mkv file and directly pass it to the HDMI device.
That's possible using a raspberry special boot instruction. To do that you have to edit the file config.txt. This file is located in /boot/config.txt. You can edit it with command line but your /boot has to be mounted (I had a boot error telling me the boot device mounting failed, if you have this error, check this thread)
The line to add to config.txt is the following (documentation of all available options is here
Another problem I had is that this options didn't work at the beginning. I'm sorry to say that but it seems my PI was suddently updated during boot and the option worked after this update. I don't know how this update was triggered though.
Once this option works, you can test it : When you read a DTS movie, you can't change the volume. A message is shown at the top of the screen, telling you in red font "Audio passthrough in progress". Second Step : Double Passthrough
Unfortunatly, my TV was telling the truth to my raspberry : It is not able to decode DTS :@ !!
So my PI doesnt decode DTS, I activated a passthrough to send DTS to my TV.
My TV doesn't decode DTS, I would just have to passthrough to my Audio system !!
There is the problem, my f.....g SONY TV doesn't have this feature !!!
It cannot just send the DTS signal to my audio Logitech Z-5500 : There is no more sound for DTS mkv
The reason is that a TV is not a media center, it is normally used only to show video and when you are rich (~1000$) you buy a Home cinema which has an amplifier where you plug the HDMI from raspberry. It sends video to the TV and decodes DTS and send it to your speakers. Third Step : There is always a solution : HDMI Splitter
The fact is we have a raspberry ! We are not rich and we want a solution.
As we can't send DTS to our TV because it is Sony and it want us to buy a Sony home cinema, we have to find a trick.
The only way is to act like an amplifier but without 1000$.
You have to split video and audio, only a hardware switch can do that and you have to buy it.
I found three options :
This is definitely a misleading title. The thread title contains no mention of the hardware required therefore many people will see the title and think the post contains a generic solution, which is does not.
Fortunately a generic solution is just around the corner, with your help!