PMS Transcoding Audio Unnecessarily

I used RasPlex 6-8 months ago, and I’ve come back to it on my Raspberry Pi 3B as a bedroom client. I have updated to 1.7.1.

My library is primarily HEVC but PMS is running from my Nvidia Shield so that’s not an issue - I expect it to transcode to H.264.

For audio, my library is 99% either DTS-HD MA or Dolby TrueHD - which shouldn’t be an issue. I tried allowing passthrough, and the DTS-HD / TrueHD lights on my receiver wouldn’t illumunate. Then I tried turning off passthrough and essentially letting Ffmpeg handle the audio Decoding.

When I checked Plex, I discovered that no matter what, these formats are being transcoded to AAC.

I must be missing something really silly here.

@alexsisk said:
I used RasPlex 6-8 months ago, and I’ve come back to it on my Raspberry Pi 3B as a bedroom client. I have updated to 1.7.1.

My library is primarily HEVC but PMS is running from my Nvidia Shield so that’s not an issue - I expect it to transcode to H.264.

For audio, my library is 99% either DTS-HD MA or Dolby TrueHD - which shouldn’t be an issue. I tried allowing passthrough, and the DTS-HD / TrueHD lights on my receiver wouldn’t illumunate. Then I tried turning off passthrough and essentially letting Ffmpeg handle the audio Decoding.

When I checked Plex, I discovered that no matter what, these formats are being transcoded to AAC.

I must be missing something really silly here.

This is because the rPi 2/3 hardware does not support DTS-HD MA or Dolby TrueHD passthrough. It only supports 7.1 audio via AAC.

After that post, I actually tried one of the few H.264 / TrueHD movies I have - and Plex was 100% DirectPlay. And my receiver said PCM. That means the TrueHD file must have been decoded by FFmpeg on the Pi.

That being said, why couldn’t it transcode an H.265 video and Direct Stream the uncompressed audio?

FFmpeg is part of OpenPHT, and you can see on FFmpeg’s website that it has decoders for DTS-HD MA and TrueHD.

Also, I’ve always wondered why it says “Support 8-channel DTS-HD Decoding” in the audio settings (which would indicate that RasPlex can decode client side) but doesn’t mention TrueHD, when they’re both part of FFmpeg.

Quite confused. RasPlex certainly wouldn’t use the extra processing power needed to encode to AAC client-side if it can decode to PCM client-side.

@alexsisk said:
After that post, I actually tried one of the few H.264 / TrueHD movies I have - and Plex was 100% DirectPlay. And my receiver said PCM. That means the TrueHD file must have been decoded by FFmpeg on the Pi.

Correct, the rPi will transcode to PCM.

That being said, why couldn’t it transcode an H.265 video and Direct Stream the uncompressed audio?

FFmpeg is part of OpenPHT, and you can see on FFmpeg’s website that it has decoders for DTS-HD MA and TrueHD.

There may be an issue here. I’ve seen it but I don’t have that much 7.1 sound to test with.

Also, I’ve always wondered why it says “Support 8-channel DTS-HD Decoding” in the audio settings (which would indicate that RasPlex can decode client side) but doesn’t mention TrueHD, when they’re both part of FFmpeg.

Quite confused. RasPlex certainly wouldn’t use the extra processing power needed to encode to AAC client-side if it can decode to PCM client-side.

Kodi Raspberry Pi documentation

1.8 How about multichannel audio support?
By default audio is downmixed to stereo.
If your receiver/TV supports DTS or AC3 passthrough then enable these in audio settings and you will get 6 channel audio.
Multichannel PCM audio is supported over HDMI. Note: not all receivers support this and toslink/optical will not.
Enable by setting the speaker configuration to suitable value (e.g. 5.1 or 7.1).
If your recevier does not support multichannel PCM, then leave this at 2.0. You can still get multichannel audio through passthrough.

Dom, Raspberry Pi Engineer

The HD audio passthrough issue is only related to HDMI output.
It depends where the content comes from. Blu-Ray mandates that non-HD audio is present. DTS-HD contains a 5.1 channel DTS core which can be passed through by the Pi (through HDMI).
Alternatively if the HD audio is TrueHD, then there must be a 5.1 channel AC3 track with the same content, which the Pi can pass through.

If passthrough is not available, then DTS or AC3 can be decoded by the Pi, and either output as 6 channel PCM (through HDMI), or downmixed to stereo (for analogue audio or HDMI if TV doesn’t support multichannel PCM).

With the new libdcadec library, we can now decode 8 channel DTS-HD. TrueHD was already supported, and can produce 8 channel audio. These 8 channel formats can be output as 8 channel PCM, or downmixed.

If you are planning to use a USB audio device for HD audio output, I’d suggest doing some research. Linux driver support for USB audio cards is not guaranteed. Passthough support is an obstacle. HD passthrough is a further obstacle.
The data rates required by HD audio may be problematic. Honestly, I can’t recall a case of anyone even trying this (succeeding or failing).

Thank you for the research. Okay, so the takeaway is:

  1. Encoded HD audio isn’t going to make it through
  2. the ever-present DTS core may pass through
  3. Of course since TrueHD doesn’t have the nested core like DTS, it won’t pass through, but a separate AC3 track would.

!!!****This is really the million dollar question -----> If FFmpeg is doing its job behind the scenes multichannel PCM output is fine - no passthrough necessary. I just wonder why Plex Media Server insists on transcoding to AAC when the Pi is perfectly capable of decoding DTS-HD MA and TrueHD. <-------!!!

And that one thing that bothers me still (and it was the same in Kodi until Krypton) is WHY they give you the option to enable/disable DTS-HD, but not the same with TrueHD - if nothing else, it serves as a way to tell the user browsing settings “I got your HD audio covered!”

Kodi chose to entirely remove that DTS-HD toggle in Krypton. Which is why I looked further into it and found that FFmpeg covers both HD audio formats.

@benjaminwolf said:
There may be an issue here. I’ve seen it but I don’t have that much 7.1 sound to test with.

It doesn’t have to be 7.1 - a majority of my DTS-HD MA tracks are actually 5.1.

Could be an issue with the H265 portion of the device profiles. I believe these are stored in PMS. I’ll look into it when I have a little more time.

@benjaminwolf said:
Could be an issue with the H265 portion of the device profiles. I believe these are stored in PMS. I’ll look into it when I have a little more time.

Thank you! I appreciate the assistance more than you know.