HDR Tone Mapping Buffering on Linux with Supported Hardware

Server Version#: 1.25.2.5319
Player Version#: 4.72 Web

I’m running Plex Media Server on Ubuntu 21.10 (Desktop) installed on a Lenovo ThinkCentre M90n-1 Nano with an Intel i5-8265U processor, 16GB RAM, and Intel UHD Graphics 620. Ubuntu is fully updated and I’ve installed the driver dependencies with the following command:
sudo apt install ocl-icd-libopencl1 beignet-opencl-icd

I’ve also referenced and read throught the HDR to SDR Tone Mapping Plex Support Article.

The video transcodes and plays fine if no tone mapping is required, but if tone mapping is used then it buffers every 10-30 seconds. Disabling tone mapping fixes the buffering, but then the color and brightness look terrible (as expected). It intersetingly also says in the Dashboard that hardware decode and transcode is being used (both lines separately), but then the CPU is clearly around 50-70% consumed and this buffering happens.

The support article says to attach a small sample file, but any HDR10 video can reproduce this. Please let me know if this is absolutely required and I’ll produce a clip if required.

Here are my logs:
com.plexapp.system.log (44.5 KB)
Plex Media Server.log (485.6 KB)
Plex Transcoder Statistics.log (66.2 KB)

Thank you in advance for helping!

You have some permissions problems with your settings.

and you seem to have forgotten to install the OpenCL drivers necessary (what the installer tells you)

Dec 30, 2021 12:26:46.274 [0x7f0b36b5bb38] DEBUG - [Transcode] Starting a transcode session 5h5982s6ievefgmxyh381ae1 at offset -1.0 (state=3)
Dec 30, 2021 12:26:46.274 [0x7f0b36b5bb38] ERROR - [Transcode] IsFileWritable: failed to create file '"/dev/shm/a755a49a-b650-4085-9c0e-e14274728440"'
Dec 30, 2021 12:26:46.274 [0x7f0b36b5bb38] WARN - [Transcode] IsDirWritable: directory '"/dev/shm"' is not writable
Dec 30, 2021 12:26:46.274 [0x7f0b36b5bb38] DEBUG - [Transcode] TPU: hardware transcoding: using hardware decode accelerator vaapi
Dec 30, 2021 12:26:46.274 [0x7f0b36b5bb38] DEBUG - [Transcode] TPU: hardware transcoding: zero-copy support present
Dec 30, 2021 12:26:46.274 [0x7f0b36b5bb38] DEBUG - [Transcode] TPU: hardware transcoding: using zero-copy transcoding
Dec 30, 2021 12:26:46.274 [0x7f0b36b5bb38] INFO - [Transcode] CodecManager: starting EAE at "/var/snap/plexmediaserver/common/tmp/pms-8ef10d8e-e93b-40e2-9ed2-9cf784c009d9/EasyAudioEncoder"
Dec 30, 2021 12:26:46.275 [0x7f0b36b5bb38] DEBUG - [Transcode/JobRunner] Job running: '/var/snap/plexmediaserver/common/Library/Application Support/Plex Media Server/Codecs/EasyAudioEncoder-1625-linux-x86_64/EasyAudioEncoder/EasyAudioEncoder'
Dec 30, 2021 12:26:46.275 [0x7f0b36b5bb38] DEBUG - [Transcode/JobRunner] Jobs: Starting child process with pid 1582
Dec 30, 2021 12:26:46.275 [0x7f0b36b5bb38] DEBUG - [Transcode] [Universal] Using local file path instead of URL: /media/synology/Plex/Compressed Versions/The Matrix (UHD HDR10 - EAC3 7.1)/The Matrix.mkv
Dec 30, 2021 12:26:46.276 [0x7f0b36b5bb38] WARN - [Transcode] [TPU] Failed to load OpenCL; falling back to software tone mapping: Error loading shared library libOpenCL.so.1: No such file or directory
Dec 30, 2021 12:26:46.276 [0x7f0b36b5bb38] DEBUG - [Transcode] Codecs: hardware transcoding: testing API vaapi
Dec 30, 2021 12:26:46.277 [0x7f0b36b5bb38] DEBUG - [Transcode] [FFMPEG] - Format 0x41524742 -> bgra.

Fwiw, I installed Plex using apt on Ubuntu so this is how it was configured out of the box.

I figured I might have permission problems because Plex also complains that I need to claim it after every reboot. Do you have any advice on how to correct those permission problems?

Also, regarding OpenCL drivers missing… is there something I need to do other than running sudo apt install ocl-icd-libopencl1 beignet-opencl-icd? Here’s the output on my Plex server:

beignet-opencl-icd is already the newest version (1.3.2-8).
ocl-icd-libopencl1 is already the newest version (2.2.14-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Thank you!

you installed from the Ubuntu store, not from Plex.tv

Sorry about not catching this with my fist post.

'/var/snap/plexmediaserver/common/

Is that a problem?

Unforunately yes if you want HDR tone mapping.

The SNAP package isn’t intended for what you’re trying to do.

There is a way to pull / save the metadata you have but unless your library is huge, it’s often easier to start over.

Please let me know what you’d like so I can then advise you further

Ok, I’ll re-install.

Is it possible that Ubuntu 21.10 is also part of the problem?
I just did some digging on Reddit and it sounds like Ubuntu 21.04 and 21.10 are known to have issues with HDR tone mapping.

Ubuntu 21.anything is problematic, We’ve seen issues. Ubuntu 20.04.3 LTS is the most stable.

I know the SNAP package (snap remove plexmediaserver --purge to clear it all out)
isn’t helping you at all.

Thanks for your help @ChuckPa

Formatting, installing Ubuntu 20.04, adding Plex repositories, installing PMS from repositories, and reconfiguring PMS from scratch did the trick.

It sounds like I made two significant errors that hopefully others can avoid…

  1. Don’t use Ubuntu 21.04 or 21.10 as Plex isn’t compatible with either.
  2. Don’t install Plex from the pop-up that appears on the screen immediately after installing Ubuntu Desktop. This will install the SNAP package which @ChuckPa advised against.

@speeddemon

Glad you’re up and running,

Ubuntu 21, just like Ubuntu 19, is their “major development year”. During these years, the OS is having a lot of new things added to it and, based on years past, not the best choice for any production (stable) environment.

When 22 comes out, I would minimally wait until the first update before considering it (Let everyone else find the bugs).

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