Plex HTPC Optical AC3/DTS Passthrough

Well the HTPC app on an Intel Mac is staggeringly good, better than the ATV4K app [ducks under a desk emoji], but I’m seeing the same issue with the Optical/SPDIF choice not working.


tl;dr

my guess

when trying to passthrough DTS audio to Optical/SPDIF device
HTPC log says TranscodeToAC3Enabled is being passed
so right after spdif_dts is loaded by MPV ( yes! )
it then tries to load lavcac3enc and fails ( no! )

partial Plex_HTPC.log
Jun 21, 2022 12:54:36.517 [0x7000039f7000] DEBUG - [MPVEngine/mpv] ad: Codec list:
Jun 21, 2022 12:54:36.517 [0x7000039f7000] DEBUG - [MPVEngine/mpv] ad:     spdif_dts (dts) - libavformat/spdifenc audio pass-through decoder
Jun 21, 2022 12:54:36.517 [0x7000039f7000] DEBUG - [MPVEngine/mpv] ad: Opening decoder spdif_dts
Jun 21, 2022 12:54:36.518 [0x7000039f7000] DEBUG - [MPVEngine/mpv] ad: Selected codec: spdif_dts (libavformat/spdifenc audio pass-through decoder)
Jun 21, 2022 12:54:36.518 [0x7000039f7000] ERROR - [MPVEngine/mpv] lavcac3enc: Couldn't find encoder ac3.
Jun 21, 2022 12:54:36.518 [0x7000039f7000] ERROR - [MPVEngine/mpv] user_filter_wrapper: Creating filter 'lavcac3enc' failed.
Jun 21, 2022 12:54:36.518 [0x7000039f7000] ERROR - [MPVEngine/mpv] cplayer: Audio filter initialized failed!
Jun 21, 2022 12:54:36.518 [0x7000039f7000] DEBUG - [MPVEngine/mpv] mkv: deselect track 1
Jun 21, 2022 12:54:36.518 [0x7000039f7000] INFO - [MPVEngine/mpv] cplayer: Audio: no audio

My Configuration

  • Plex HTPC-1.19.1.3076 on an Macbook Pro 16 (2019) macOS 12.4 Monterey
  • Cal-Digit TS3 Thunderbolt Dock w/ Toslink Output
  • Logitech 5.1 speaker system w/ DTS & AC3 DAC has Toslink Input
  • PMS- 1.27.0.5897 on QNAP TS-451+ x86_64 - QTS 4.5.4.2012 en-US
  • One subnet LAN, a few switches, 4K external HP Monitor

What I Did

  • My PMS is set for Direct Play Direct Stream
  • Set the Mac system sound output device to the Macbook speakers to keep HTPC away from the SPDIF interface during setup.
  • Started HTPC > Settings > Audio >
  • Exclusive Audio - ON
  • Audio Device - CalDigit Thunderbolt 3 Audio
  • Audio Device Kind - OPTICAL/SPDIF
  • Audio Channels - 2.0 (Stereo)
  • Dolby Digital AC3 - checked
  • DTS - Checked
  • Tried to play a film with only DTS audio.
  • Tried to play a film with only AC3 audio.
  • Tried to play a TV show with AAC 2.0 audio

What Happened

  • Silence, no indication of any signal reaching the DAC on all three media.
  • The Plex HTPC.log file shows SPDIF output is accepted and that a decoder is loaded by the MPV engine, but right after that it tries to load an AC3 encoder into the filter tree and it fails there, resulting in
    INFO - [MPVEngine/mpv] cplayer: Audio: no audio

What I expected

  • I should have heard sound from the two films in DTS and AC3
  • The Decode LED on my DAC should have lit up indicating DTS or AC3 audio on those two.
  • I know this hardware chain plays DTS and AC3, as it works with Plex Media Player.
  • I should have got silence from the AAC video like I did. This was correct and expected that encoded AAC can’t be decoded by my DAC when sent directly to the DAC bypassing the Apple mixer via the “Exclusive Audio” checkbox.

A Workaround

  • It works great if I just choose HDMI like the OP stated.

An Unexpected Joy

  • Plex-HTPC took a film with a single DTS-HD MA track and stripped out the MA part, sending my DAC a pure DTS track to play. That caused a ■■■■ eating grin for about an hour until I realized that Plex Media Player has been doing it for years.

Plex HTPC.log.zip (32.7 KB)

<3