Plex HTPC M1 Mac Audio Driver Fails

Server Version#: 1.27.1.5916-7000
Player Version#: 1.21.2.3158-331d3308

Just downloaded Plex HTPC on my M1 Mac Mini, and audio output fails on anything but the built-in speakers. I usually output audio over USB to an external DAC/Preamp (PS Audio Stellar Gain Cell), and occasionally straight to the TV via HDMI. Both options work using the old Plex Media Player, but the new Plex HTPC fails on each. I relevant lines from the log are listed below, seems like the interface with the audio driver is failing. Full log is also attached.

Jul 27, 2022 20:10:01.100 [0x30591f000] ERROR - [MPVEngine/mpv] ao/coreaudio_exclusive: hardware format not supported
Jul 27, 2022 20:10:01.100 [0x30591f000] ERROR - [MPVEngine/mpv] ao: Failed to initialize audio driver 'coreaudio'
Jul 27, 2022 20:10:01.101 [0x30591f000] ERROR - [MPVEngine/mpv] ao: This audio driver/device was forced with the --audio-device option.
Jul 27, 2022 20:10:01.101 [0x30591f000] ERROR - [MPVEngine/mpv] cplayer: Could not open/initialize audio device -> no sound.

Plex HTPC.4.log (880.1 KB)

I’ve used Plex HTPC on my M1 Mini quite a bit. You have such a nice DAC. I think the problem can’t be too much of a thing. So let’s start with the basics.

Play a simple wave file in Finder without Plex:

  1. Cycle power on your hardware but leave HTPC off for now.
  2. On your Mini System Prefs > Sound, set the output to the DAC.
  3. In Finder, Quick Look a 16/44.1 stereo wave file. Your DAC should play PCM 16/44.1
  4. Do the same test with a 24/96 wave file. Don’t use anything but a stereo wave file for testing. Hit the Spacebar to quick look and play the HiRes file that’s selected in Finder.
  5. If you get no sound, you have to sort out your hardware and macOS.
  6. If you get sound with a wave, you can Quick Look a stereo FLAC file. It should play as a decoded WAV and say PCM on your DAC. The Apple mixer chooses the format based on what your DAC supports and decompresses the FLAC to raw PCM bitstream on the fly.

Assuming you heard sound in Finder, let’s add in Plex HTPC.

  1. Start Plex_HTPC, navigate down to Settings > Audio > Exclusive unchecked.
  2. Then Audio Device → Autoselect device
  3. Back out of settings and use another Plex app to add those two uncompressed wave tracks as a test album to your PMS. Scan Library Files, then
  4. use HTPC to play those wave files.

Did that work?

Sending audio like this through the Apple mixer to the selected device can degrade the sound based on the Mixer limitations. People often want to send sound directly to the DAC bypassing the mixer. To do that:

  1. I set the Apple mixer to internal speakers as the output device.
  2. I set HTPC > Settings > Audio > Audio Device > to my DAC
  3. I set HTPC > Settings > Audio > Audio Device Kind > Optical or HDMI (whatever works)
  4. I leave exclusive disabled unless nothing else seems to work.

Any luck?

The problem is that your device is advertising that is supports a format and then when MPV changes it to that format it says it isn’t supported. This could be related to the fact that you have exclusive audio set; you may want to try turning that off.

nibbles, thanks for the quick and thorough response!

Interesting development: I believe the problem stems from when Plex HTPC tries to set the bitrate, whatever it’s doing is not how other apps (PlexAmp, Qobuz) work, and the bitrate it tries to set seems to either “look” OK, or will literally be “null” when viewed in the Audio MIDI Setup app. This also causes all other sound output to the selected device (USB DAC) to fail. Manually setting the bitrate (or playing audio through a different app that sets the bitrate), disabling “Exclusive Audio”, then restarting a stream on Plex HTPC seems to work.

gbooker02 – the DAC supports PCM and DSD up to 384 kHz and up to 24 bit depth. Digging through the logs, it looks like Plex HTPC is trying to use 32 bit audio. This is when trying to play a movie sourced from blu ray, which should have at most 24 bit depth.

Jul 27, 2022 20:07:43.707 [0x30591f000] DEBUG - [MPVEngine/mpv] ao/coreaudio_exclusive: Using substream 0/1.
Jul 27, 2022 20:07:43.707 [0x30591f000] DEBUG - [MPVEngine/mpv] ao/coreaudio_exclusive: our format: 48000.0Hz 32bit mcpl [9][8bpp][1fbp][8bpf][2ch] float LE U packed (float)
Jul 27, 2022 20:07:43.707 [0x30591f000] DEBUG - [MPVEngine/mpv] ao/coreaudio_exclusive: -  384000.0Hz 24bit mcpl [4][8bpp][1fbp][8bpf][2ch] int LE S (-)
(continues listing supported formats)

When playing music through Plex HTPC, it recognizes the correct bitrate & depth per the file, which is supported by my DAC, but still fails to set it (this is using Exclusive mode)

Jul 28, 2022 22:07:59.386 [0x30e96c000] DEBUG - [MPVEngine/mpv] ao/coreaudio_exclusive: virtual format 48000.0Hz 24bit mcpl [68][8bpp][1fbp][8bpf][2ch] int LE S (-)
Jul 28, 2022 22:07:59.386 [0x30e96c000] ERROR - [MPVEngine/mpv] ao/coreaudio_exclusive: hardware format not supported
Jul 28, 2022 22:07:59.386 [0x30e96c000] ERROR - [MPVEngine/mpv] ao: Failed to initialize audio driver 'coreaudio'

Using other apps like PlexAmp and Qobuz are able to interact with it no problem, so I think this is purely a Plex HTPC issue. It’s new, and the Plex team can’t test every hardware combination out there, so that’s understandable. Hopefully it can be fixed, but there is a workaround noted above that will work for now.

EDIT: I’ll also note that the supported formats the DAC is advertising to Plex HTPC in the logs matches what the DAC can actually support (also mirrored in Audio MIDI Setup), at no point does it pretend like it does 32 bit audio.

MPV on Apple with Exclusive Mode had issues: Coreaudio_exclusive only work with audio-format=s16 on a 24bit external DAC · Issue #4478 · mpv-player/mpv · GitHub

I’m not bright enough to understand if the limits of exclusive mode were corrected or how PlexAmp might behave differently. Maybe I can test with this Topping D10s I got today. I don’t know.

The more I read though, the less I understand why 24bit audio exists when computers send data in 8bit int format, or 16bit long, or 32bit floats. When is 3 bytes even used?

And with Atmos poised to take over the audio world, it seems like I need a new AVR and not a standalone DAC like I’ve been shopping for unless it’s for old music only.