Plex HTPC: Not getting 5.1 (6CH) audio. Stereo (2CH) & 8CH OK

Stereo and 7.1 audio both work, but not 5.1. I have spent 2 days on this to no avail. Not seeing any relevant or similar post for audio issue. The video plays just fine.

Attached is a log for Plex HTPC while attempting to play:

Plex HTPC [Obi-Wan Kenobi_S01E06_Part 6 (2160p_10bit_HDR10&DV_WebRip_6CH_HEVC x265)].log (600.3 KB)

I have Kodi/Plex on this computer, also and it plays all formats. However, I’m trying to get away from it due to Plex Authentication BS and fact that Kodi/Plex requires authentication. Authentication does not work with Starlink (CGNAT) which I’m in process of switching to. I’m only using locally, no remote access. Using a tunnel doesn’t work very well as the Plex mothership wants to know every little thing I’m doing and so, between bandwidth and Starlink’s latency, it’s not ideal and breaks. So here I am trying to use Plex HTPC, which does not require authentication locally.

Client:
PC: Windows 10 Pro
Computer name: HTPC
Version: 21H1
OS Build: 19043.1766
GPU: Integrate Intel UHD 630 GPU in i7 8700k via HDMI
Plex HTPC: v1.19.1.3076-b24239e5
Connected via HDMI to:
AVR: Onkyo TX-RZ1100 (8CH setup. Should handle all formats Plex can throw at it)
Connected via HDMI to:
Samsung TV: 4K Q90R (Optical SPDIF & HDMI ARC not used)
Remote (Input Device): Logitech K830 Keyboard

Server:
OS: TrueNAS v12.0-U8.1
Plex Media Server: Jail; Basic (no Plex Pass) v1.27.0.5897

Would you verify that your AVR will decode AAC 6 ch please?

Looking at your log file, I can see these things occur within a few seconds of each other and some hotplug activity with respect to audio.

Can't find audio device yet
Jun 25, 2022 11:07:32.853 [6968] DEBUG - [MPVEngine/mpv] af: [in] 48000Hz 5.1 6ch floatp
Jun 25, 2022 11:07:32.853 [6968] DEBUG - [MPVEngine/mpv] af: [userspeed] 48000Hz 5.1 6ch floatp
Jun 25, 2022 11:07:32.853 [6968] DEBUG - [MPVEngine/mpv] af: [userspeed] (disabled)
Jun 25, 2022 11:07:32.853 [6968] DEBUG - [MPVEngine/mpv] af: [convert] 48000Hz 5.1 6ch floatp
Jun 25, 2022 11:07:32.853 [6968] DEBUG - [MPVEngine/mpv] ao: Trying audio driver 'wasapi'
Jun 25, 2022 11:07:32.853 [6968] DEBUG - [MPVEngine/mpv] ao/wasapi: requested format: 48000 Hz, 5.1 channels, floatp
Jun 25, 2022 11:07:32.854 [6968] ERROR - [MPVEngine/mpv] ao/wasapi: There are no playback devices available
Jun 25, 2022 11:07:32.854 [6968] ERROR - [MPVEngine/mpv] ao: Failed to initialize audio driver 'wasapi'
Jun 25, 2022 11:07:32.854 [6968] ERROR - [MPVEngine/mpv] cplayer: Could not open/initialize audio device -> no sound.
Jun 25, 2022 11:07:32.854 [6968] DEBUG - [MPVEngine/mpv] mkv: deselect track 1
Jun 25, 2022 11:07:32.855 [6968] INFO - [MPVEngine/mpv] cplayer: Audio: no audio
Success finding the receriver
Jun 25, 2022 11:07:34.880 [6968] DEBUG - [MPVEngine/mpv] ao/wasapi: OnDeviceStateChanged triggered: sending hotplug event
Jun 25, 2022 11:07:34.880 [6968] DEBUG - [MPVEngine/mpv] ao/wasapi: OnDefaultDeviceChanged triggered: sending hotplug event
Jun 25, 2022 11:07:34.883 [6968] DEBUG - [MPVEngine/mpv] ffmpeg/video: hevc: Skipping NAL unit 62
Jun 25, 2022 11:07:34.888 [2384] INFO - [Web] 05/06/2022 11:07:34:886 [null:xdw824q51uqxwyhu065lopa4] INFO [Audio] Devices: [{"description":"Autoselect device","name":"auto"},{"description":"AV Receiver (Intel(R) Display Audio)","name":"wasapi/{54c9df72-dcfb-44cb-a260-b08a322e23af}"}]
Jun 25, 2022 11:07:34.893 [2384] INFO - [Web] 05/06/2022 11:07:34:887 [null:xdw824q51uqxwyhu065lopa4] INFO [Audio] Selecting wasapi/{54c9df72-dcfb-44cb-a260-b08a322e23af} (AV Receiver (Intel(R) Display Audio))
Jun 25, 2022 11:07:34.894 [6968] DEBUG - [MPVEngine] Property 'audio-channels' set to '2.0,2.1,3.1,5.1,7.1'
Jun 25, 2022 11:07:34.894 [6968] DEBUG - [MPVEngine] Property 'audio-device' set to 'wasapi/{54c9df72-dcfb-44cb-a260-b08a322e23af}'
Jun 25, 2022 11:07:34.894 [6968] DEBUG - [MPVEngine] Property 'audio-spdif' set to 'truehd,dts,dts-hd,ac3,eac3'
Jun 25, 2022 11:07:34.894 [6968] DEBUG - [MPVEngine/mpv] cplayer: Set property: audio-channels="2.0,2.1,3.1,5.1,7.1" -> 1
Jun 25, 2022 11:07:34.894 [6968] DEBUG - [MPVEngine/mpv] cplayer: Set property: audio-device="wasapi/{54c9df72-dcfb-44cb-a260-b08a322e23af}" -> 1
Jun 25, 2022 11:07:34.894 [6968] DEBUG - [MPVEngine/mpv] cplayer: Set property: audio-spdif="truehd,dts,dts-hd,ac3,eac3" -> 1
Jun 25, 2022 11:07:34.894 [6968] WARN - [MPVEngine/mpv] cplayer: Option af-remove: item label @ac3 not found.

So I’m not sure why audio-spdif is getting set, nor why another round of decision making failed to occur after the Hotplug event was triggered and the AVR was found. It’s like it stuck with it’s decision of no device no sound, even though a device was just found.

Perhaps if you upload an HTPC log showing a successful playback of AAC 7.1 audio, the devs can look for something. Also a Plex Media Server.log file in debug mode could be useful, one that’s shows you demonstrating success and failure of 7.1 and 5.1 AAC.

If I had receiver capable of decoding AAC, I would test it on HTPC here, but I don’t sorry.

@Nibbles: Thanks for looking at this.

Regarding 6CH AAC with AVR: I’m not really sure how one would actually verify this without contaminating the results with the particular video player used affecting the result??

First, a look at the AVR manual states the following:

Supported Audio Formats
For server playback and playback from a USB storage:
device, this unit supports the following music file formats.
Note that sound files that are protected by copyright cannot be played on this unit. It then listed numerous formats including this:

AAC (.aac/.m4a/.mp4/.3gp/.3g2/.AAC/.M4A/.MP4/.3GP/.3G2):
• Supported formats: MPEG-2/MPEG-4 Audio
• Supported sampling rates: 44.1 kHz, 48 kHz, 88.2 kHz, 96 kHz
• Supported bitrates: Between 8 kbps and 320 kbps.
Incompatible files cannot be played.

Secondly, my existing Kodi+Plex Addon setup, on same computer, will play 5.1 AAC files just fine. In Kodi/Settings/System/Audio there is a setting for specifying the sound engine/physical interface. My Kodi+Plex Addon setup is set to Wasapi (AV Receiver (Intel(R) Display Audio). The AVR shows the stream as PCM and with Direct play selected I get audio out of the appropriate speakers.

I wondered whether MediaMonkey app, which is running (but not necessarily playing) most of time was somehow blocking audio. Mediamonkey is set to exclusive mode using Wasapi. So to be sure, I closed the Mediamonkey and tried to play video again with no luck.

Noticed in log, Plex is using 24 bit @ 48 kHz so I temporarily changed the properties for the AV Receiver (Intel(R) Display Audio under Advanced tab to use that rather than 24 bit@ 44.100 kHz which is ideal for my MP3 player. This had no affect so I changed it back to 24 bit @ 44.1 kHz.

After messing around I discovered there are some other video files with 5.1 audio that DO play. Attached is log and audio properties for a WORKING file. This one is NOT in 4K and does NOT have HDR or Dolby Vision. So it may be a better (more basic) file to use for comparison than the file used in my original post. [Edit: Attaching file kept changing the name to “test.log” from “Plex HTPC [ForAllMankind_S03E01_Polaris (1080p_10bit_WebRip_6CH_HEVC x265)_Working]].log”]

test.log (611.8 KB)

Audio Properties:
Format : AAC LC SBR
Format/Info : Advanced Audio Codec Low Complexity with Spectral Band Replication
Commercial name : HE-AAC
Format settings : Explicit
Codec ID : A_AAC-2

As requested here is debug log and audio properties for a WORKING video with 7.1 audio:
Plex HTPC [Transformers; The Last Knight (2017) [1080p_10bit_BluRay_8CH_HEVC x265_Eng_Working]].log (712.7 KB)

Audio Properties:
Format : AAC LC SBR
Format/Info : Advanced Audio Codec Low Complexity with Spectral Band Replication
Commercial name : HE-AAC
Format settings : Explicit
Codec ID : A_AAC-2

As for Plex Media Server logs, they are in a TrueNAS (FreeNAS) jail and that will be somewhat difficult, at least for me as I’m an idiot with CLI. Also, not convinced the server is the root cause as it will play the these same files using Kodi+Plex Addon.

In case someone is wondering what the audio properties are for the file associated with the original log “Plex HTPC [Obi-Wan Kenobi_S01E06_Part 6 (2160p_10bit_HDR10&DV_WebRip_6CH_HEVC x265)].log” attached in my previous post, here they are:

Audio Properties:
Format : AAC LC SBR
Format/Info : Advanced Audio Codec Low Complexity with Spectral Band Replication
Commercial name : HE-AAC
Format settings : Explicit
Codec ID : A_AAC-2

Would appreciate any help.

You have your system set to refresh rate match the video to the content. When this happens, the audio device for your AVR is disappearing from the system. This is due to your AVR re-negotiating with the change in refresh rate and in the process Windows is reporting that the audio device has disappeared. Then playback starts.

Typically this is resolved by setting/increasing the Refresh Rate Switching Delay setting to give the AVR time to reappear as an audio device to the computer before playback begins.

1 Like

@booker02
That solved it. Now I know why that setting is in Plex. Thanks.

The detailed note associated with that setting makes no mention of possible reasons why one would change the setting. If you already know, you know, but if you don’t it’s not going really help. Had it mentioned that AVR’s may need this, maybe I would have figured it out. IMHO it might help if there was a little more info there in the note.

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