Having a really hard time writing a custom profile

Server Version#: 1.23.3.4707
Player Version#: Android version 8.19.3.26473

The App has audio pass through set to HDMI. The TV is set to have audio pass through to the receiver via ARC.

The problem I am facing is that the TV is playing 5.1 AAC files directly rather than transcoding them to AC3 5.1. I think I found the issue from the verbose logging turned on. (in BOLD below)

DEBUG - Request: [192.168.1.131:57184 (Subnet)] GET /video/:/transcode/universal/decision?advancedSubtitles=text&audioBoost=100&autoAdjustQuality=0&directPlay=1&directStream=1&directStreamAudio=1&fastSeek=1&hasMDE=1&location=lan&maxVideoBitrate=200000&mediaBufferSize=74944&mediaIndex=0&partIndex=0&path=%2Flibrary%2Fmetadata%2F75681&protocol=&session=6782ab692ea2543b-com-plexapp-android&skipSubtitles=1&subtitleSize=100&videoBitrate=200000&videoQuality=100&videoResolution=3840x2160 (23 live) TLS GZIP Signed-in Token (AmpedSilence) / Accept => application/xml / Accept-Encoding => gzip / Accept-Language => en-us / Connection => Keep-Alive / Host => 192.168.1.113:32400 / User-Agent => Dalvik/2.1.0 (Linux; U; Android 10; SmartTV 4K FFM Build/QTG3.200902.001) / X-Plex-Advertising-DoNotTrack => 0 / X-Plex-Advertising-Identifier => f348dbeb-0b6f-461e-a72b-9a9b0cfa7431 / X-Plex-Client-Identifier => 6782ab692ea2543b-com-plexapp-android / X-Plex-Client-Identifier => 6782ab692ea2543b-com-plexapp-android / X-Plex-Client-Platform => Android / X-Plex-Client-Profile-Extra => add-limitation(scope=videoCodec&scopeName=h264&type=upperBound&name=video.level&value=60)+add-limitation(scope=videoCodec&scopeName=&type=upperBound&name=video.width&value=3840&replace=true)+add-limitation(scope=videoCodec&scopeName=&type=upperBound&name=video.height&value=2160&replace=true)+add-transcode-target(type=videoProfile&context=streaming&protocol=hls&container=mkv&videoCodec=h264,hevc,mpeg2video&audioCodec=aac,ac3,dca,dca,eac3,mp3&subtitleCodec=ass,pgs,subrip,dvd_subtitle,mov_text,vtt,dvb_subtitle&replace=true)+add-transcode-target-settings(type=videoProfile&context=streaming&protocol=hls&CopyMatroskaAttachments=true)+add-limitation(scope=videoAudioCodec&scopeName=aac&type=upperBound&name=audio.channels&value=8&replace=true)+add-transcode-target-audio-codec(type=videoProfile&context=streaming&protocol=hls&audioCodec=mp3)+add-transcode-target-audio-codec(type=videoProfile&context=streaming&protocol=hls&audioCodec=ac3)+add-transcode-target-audio-codec(type=videoProfile&context=streaming&protocol=hls&audioCodec=eac3)+add-transcode-target-audio-codec(type=videoProfile&context=streaming&protocol=hls&audioCodec=dca)+add-limitation(scope=videoCodec&scopeName=&type=NotMatch&name=video.anamorphic&value=999&replace=true)+add-transcode-target(type=subtitleProfile&context=streaming&protocol=http&container=mkv&subtitleCodec=srt)+append-transcode-target-codec(type=videoProfile&context=streaming&protocol=hls&videoCodec=mpeg2video)+append-transcode-target-codec(type=videoProfile&context=streaming&protocol=hls&videoCodec=hevc)+add-limitation(scope=videoCodec&scopeName=hevc&type=Match&name=video.profile&list=main|main 10)+add-limitation(scope=videoTranscodeTarget&scopeName=hevc&scopeType=videoCodec&context=streaming&protocol=hls&type=match&name=video.colorTrc&list=smpte2084|bt709|bt470m|smpte240m|smpte170m|bt470bg|bt2020-10&isRequired=false) / X-Plex-Device => SmartTV 4K FFM / X-Plex-Device => SmartTV 4K FFM / X-Plex-Device-Name => SmartTV 4K FFM / X-Plex-Device-Screen-Density => 320 / X-Plex-Device-Screen-Resolution => 1920x1080 (Android TV) / X-Plex-Device-Vendor => Hisense / X-Plex-DRM => widevine:video / X-Plex-Features => external-media,indirect-media / X-Plex-Language => en-us / X-Plex-Model => huangshan / X-Plex-Platform => Android / X-Plex-Platform => Android / X-Plex-Platform-Version => 10 / X-Plex-Platform-Version => 10 / X-Plex-Product => Plex for Android (TV) / X-Plex-Product => Plex for Android (TV) / X-Plex-Provider-Version => 3.2.0 / X-Plex-Provides => player,pubsub-player,controller / X-Plex-Token => xxxxxxxxxxxxxxxxxxxx / X-Plex-Version => 8.19.3.26473 / X-Plex-Version => 8.19.3.26473

I think the best way around this is to just right a custom profile for this TV, but I’m having a really hard time getting the server to recognize my custom profile.

Here is the top part of the profile:

 <?xml version="1.0" encoding="utf-8"?>
 <Client name="HiSense Andriod TV">
  <!-- HiSense Andriod TV-->
  <!-- Author: AmpedSilence -->
  <!-- Version: 1.0.0.0 2021/07/05 -->
  <Identification>
    <Header name="user-agent" substring="SmartTV 4K FFM" />
  </Identification>

I took that and placed that in the C:\Users\AmpedSilence\AppData\Local\Plex Media Server\Profiles folder as it is instructed to be. Made the XML file owner “SYSTEM”

Finally, restarted the Server…

When I play the file again, its keeps coming back to this in the logs:

DEBUG - [Transcode] TranscodeUniversalRequest: using augmented profile Android

What have I done wrong? Did I miss a step somewhere?

The Android TV app does not use those profiles to determine what it can or cannot direct play. The app itself will determine that based on what your TV reports it can support.

Why do you want AC3 5.1 if AAC 5.1 will direct play? That’s just an extra conversion that you don’t need.

HDMI/ARC doesn’t support AAC 5.1 passthrough. Something has to transcode the audio.

Many TVs will decode AAC 5.1 and play it back on internal speakers, but can only output it as PCM 2.0 over HDMI/ARC.

Which is why OP wants the audio transcoded before it gets to the TV.

My Roku TVs behave this way. They can decode AAC, but they smash it to stereo.

For those devices, Plex Media Server transcodes AAC 5.1 to AC3. The TVs can do AC3 passthrough and I get 5.1 on my receiver.

OP wants the same behavior.

1 Like

Thats why passthrough was invented :wink:
*check the settings in the plex app on your device

@anon18523487, @Volts stated the problem much more clearly and directly than I did :laughing:

I am hoping that forcing the encoding to AC3 allows for audio passthrough to occur properly.

@JonSWEDEN, I have set both the TV and the Plex APP to Audio passthrough.

Below is a matrix of how the TV behaves -

When I have the Plex app set to “HDMI Passthrough” or “Disable”

Audio Codec - what PMS does - What the TV Outputs/AV Plays
2.0 CH AAC - Direct Play - 2.0 CH PCM
5.1 CH AAC - Direct Play - 2.0 CH PCM
5.1 AC3 - Direct Play - 5.1 DD
5.1 EAC3 - Direct Play - 5.1 DD+
7.1 EAC3 - Direct Play - 7.1 DD+
DTS - Direct Play - 2.0 CH PCM
6.1 DTS - Hangs forever, no playback, but does not lock up

When I have the Plex App set to “Optical Passthrough”

Audio Codec - what PMS does - What the TV Outputs/AV Plays
2.0 CH AAC - Direct Play - 2.0 CH PCM
5.1 CH AAC - Transcode - 5.1 DD
5.1 AC3 - Direct Play - 5.1 DD
5.1 EAC3 - Direct Play - 5.1 DD
7.1 EAC3 - Direct Play - 5.1 DD
5.1 DTS - Direct Play - 5.1 DTS
6.1 DTS - Transcode - 5.1 DD

The TV is obviously capable of doing AC3 pass through, just not with 5.1 AAC audio. I have nice 7.1 EAC3 tracks I would not like to lose during playback, but would also want to the full 5.1 Surround Sound when available. I figured that a custom profile would be able to accomplish it, but it appears that since the App is sending its profile with the GET command, I don’t think I will be able to over ride it.

Any other options that I can try to get this to work? I have no other problems with any other Apps (i.e. Netflix, Disney+, Hulu, Amazon Prime… etc.), its just Plex that is causing this issue.

1 Like

Can you get me the Android logs after starting up the app? Have the passthrough setting on hdmi.
The app will log what codecs are supported by your TV and what it detects through the hdmi connection.

Here you are sir!

07-06 20:21:15.140  i: [AppEventMonitor]        ApplicationCreated
07-06 20:21:15.270  i: ------------------------------
07-06 20:21:15.271  i: Hello, Plex for Android world (debug: false)!
07-06 20:21:15.272  i: App version: 8.19.3.26473 (825652880)
07-06 20:21:15.272  i: Nano server version: null
07-06 20:21:15.273  i: Manufacturer: Hisense  Device: huangshan  Model: SmartTV 4K FFM  Product: huangshan  Version: 10
07-06 20:21:15.277  i: Screen size: Large Screen density: XHigh Resolution: 1920x1080 DPI: 320 Touchscreen: false  Marketplace: com.android.vending  Architecture: armeabi-v7a
07-06 20:21:15.316  i: [BootBehaviour][Background] Install Referrer behaviour took 10ms to execute on the background thread.
07-06 20:21:15.317  i: [BootBehaviour][Background] Network behaviour took 26ms to execute on the background thread.
07-06 20:21:15.323  i: [MetricsSender] Metrics host is not available so we need to fetch the privacy map.
07-06 20:21:15.328  i: [BootBehaviour][Background] Metrics behaviour took 10ms to execute on the background thread.
07-06 20:21:15.421  i: [VideoUtils] MediaCodec found (OMX.MTK.AUDIO.DECODER.DSPAC3) for audio/ac3
07-06 20:21:15.422  i: [VideoUtils] MediaCodec found (OMX.MTK.AUDIO.DECODER.DSPEAC3) for audio/eac3
07-06 20:21:15.423  i: [VideoUtils] MediaCodec found (OMX.MTK.AUDIO.DECODER.DSPDTS) for audio/vnd.dts
07-06 20:21:15.431  i: [BootBehaviour][Background] Sentry behaviour took 142ms to execute on the background thread.
07-06 20:21:15.433  i: [VideoUtilities] Recommended H264 profile determined as Level6 / ConstrainedHigh.
07-06 20:21:15.434  i: [BootBehaviour][Background] Preferences behaviour took 146ms to execute on the background thread.
07-06 20:21:15.471  i: [ApplicationBehaviourManager] Version code is 825652880.
07-06 20:21:15.472  i: [ApplicationBehaviourManager] Previous version was -1.
07-06 20:21:15.473  i: [ApplicationBehaviourManager] Fresh install detected.
07-06 20:21:15.616  i: [BootBehaviour][Background] Application behaviour took 182ms to execute on the background thread.
07-06 20:21:15.619  i: [EventSource (PlexTV)] No current user.
07-06 20:21:15.696  i: [ReferrerUtils] Referrer: utm_source=google-play&utm_medium=organic
07-06 20:21:15.713  i: [BootBehaviour][Foreground] Sentry behaviour took 0ms to execute on the foreground thread.
07-06 20:21:15.714  i: [BootBehaviour][Foreground] Network behaviour took 0ms to execute on the foreground thread.
07-06 20:21:15.718  i: [BootBehaviour][Foreground] Metrics behaviour took 0ms to execute on the foreground thread.
07-06 20:21:15.719  i: [BootBehaviour][Foreground] Install Referrer behaviour took 0ms to execute on the foreground thread.
07-06 20:21:15.721  i: [BootBehaviour][Foreground] Preferences behaviour took 0ms to execute on the foreground thread.
07-06 20:21:15.723  i: [BootBehaviour][Foreground] Application behaviour took 0ms to execute on the foreground thread.
07-06 20:21:15.769  i: [BootManager] Took 483ms to complete all 6 boot tasks.

I’m seeing similar behavior and been trying to figure this out for some time. I have a Mibox and discovered that over HDMI, it will only output AC3 (maybe DTS? haven’t tried), and PCM 2.0. If the video file I’m trying to play is encoded with AAC 5.1, it will send it to the receiver as PCM 2.0. I’m also using the audio passthrough over HDMI.

Kodi does the same thing as well when I tested it out. The thing Kodi does differently is that they have an “Enable Dolby Digital (AC3) Transcoding”. When this is selected, the receiver picks up that video as AC3 5.1 instead of PCM 2.0.

Is there an equivalent option in Plex to do this? It may fix both of our issues if there is.

Sorry, lost track of this thread. Can you get me the entire log (attach the entire file, do not cut/paste) after the app has been on for a few minutes. There is other info that gets logged later.

@MovieFan.Plex
I am having the EXACT same problem as @AmpedSilence. I’m attaching (probably too much) log of playing an AAC5.1 movie.
Here’s a picture of what’ I’m playing – Plex thinks it’s outputting AAC 5.1 but the receiver is only getting PCM 2.0
logging.txt (4.7 MB)

What equipment is involved? Almost no devices do passthrough for AAC. I’m not actually aware of any receivers that support AAC 5.1.

Many TVs downmix AAC 5.1 to PCM 2.0.

This happens with both my Onn Android TV and Chromecast with Google TV Android TV, plugged directly into a Yamaha RX-V485. The manual for the RX-V485 says it supports the following audio formats over HDMI:
• Dolby TrueHD
• Dolby Digital Plus
• Dolby Digital
• DTS-HD Master Audio
• DTS-HD High Resolution Audio
• DTS Express
• DTS
• DSD 2-ch to 6-ch (2.8 MHz)
• PCM 2-ch to 8-ch (Max. 192 kHz/24-bit)

If the receiver is reporting that it doesn’t support AAC 5.1, I’d expect Plex would attempt to transcode it into something it supports (in 5.1), rather than 2ch PCM, correct?

It’s the CCwGTV and Android TV that are reporting capabilities to Plex, and they definitely do support receiving and decoding AAC 5.1, semi-independently of what they can output to the next hop.

Do they only output stereo? (Roku does this)
Can they convert to AC3 themselves? (Apple TV can do this)

I don’t know as much about those devices though.

I know that Roku TVs have a similar issue, and it’s limited to 2-channel AAC for that reason. Looking at the Android and Chromecast profiles, they appear to have the same UpperBound name="audio.channels" value="2" for AAC.

But profiles aren’t the full story; devices can report additional capabilities.

You could share Plex + Device logs, that might give some additional clues.

Or maybe somebody who knows better will come along. :slight_smile:

Your logs are from the Android TV. It does report that it detected something connected via HDMI (arc) and it supports AAC and PCM upto 8-channels. The Plex sees the audio is 5.1 AAC and is direct paying it. Which means the app is giving the device 5.1 AAC. It is then up to the device to send the audio through HDMI. If the receiver shows it is only getting 2 channels, then the issue is with the TV not sending all 5.1 channels. Check your TV’s audio settings to see if there is something that is limiting the output.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.