HW Transcoding with HDR Tone mapping not working (hw works without tone mapping enabled)

J4125 machine arrived

Fresh Unraid 6.12.4 installed.

Confirming HW transcoding does not work using 6.1.49 kernel

Wiped the broken-*** Windows 11 install which came with the box and installed Ubuntu 22.04 LTS HWE

root@jemini:/lib/systemd/system# uname -a
Linux jemini 6.2.0-36-generic #37~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct  9 15:34:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
root@jemini:/lib/systemd/system# 

I can confirm, and will now forward to the Unraid folks, this does work in the 6.2 Ubuntu kernel.

I’m sure that will help them sort out the problem.

Screenshot from 2023-11-13 22-21-14

@ChuckPa
I am a bit confused. You confirmed that HW HDR tone mapping does not work with gemini lake and unraid 6.12.4 (kernerl 6.1.49) but regular HW SDR transcoding does. Am I right?

Can you confirm that hw hdr tone mapping works with kernel 6.2 and gemini lake? You posted a screenshot with SDR HW transcoding (not HDR content).

Thank you

Hi @ChuckPa, I don’t think it’s a problem that must be forwarded to Unraid teams or any other team different from the Plex one. I say that because of the following reasons:

  • it also doesn’t work for me, and I have Debian 12, nothing to do with Unraid
  • on my system old version of Plex woks correctly, newer ones doesn’t
  • On my system I also have installed Jellifin, a media server similar to Plex, it did work on past and it continues to work now

I think this is something that clearly is a bug in Plex media server. Nothing else.

Please make a test on your brand new device using Debian 12 and tell us the result.

Regards,
Andrea

@ChuckPa mentioned that HW HDR tone mapping works in a different way than the Jellyfin implementation.

Once again… HDR HW tone mapping works only with Unraid 6.10.3 (kernel 5.15) but does not with 6.11.5 (kernel 5.19.17) and 6.12.4 (kernel 6.1.49). Normal SDR transcoding works with all mentioned version of Unraid.

Debian 12 has kernel 6.1.x.

In the case of Jellyfin, hw hdr tone mapping works with all versions of Unraid above.

Let me say this again all laid out. – This is where I’m at with it.
I am extremely limited (insufficient knowledge) with unraid kernel changes.

J4125 CPU , Ubuntu Server 22.04.3 LTS -

  1. Ubuntu 5.15 kernel - HW transcode :white_check_mark: , HW tonemap :white_check_mark:
  2. Ubuntu 6.2.0 kernel (HWE) - HW transcode :white_check_mark: , HW tone map :white_check_mark:

J4125 CPU, Unraid -

  1. Unraid 6.11.5 - 5.15 Kernel - HW transcode :white_check_mark: , HW tone map :white_check_mark:
  2. Unraid 6.12.4 - 6.1.49 Kernel - HW transcode :x: , HW tonemap :x:

I’ll reset this thing and start over with the 6.11.5 I got fresh if need be

I would very much like to try a 6.2.0 kernel with Unraid 6.12.4 but do not have the knowledge to accomplish this.

Note: The KabyLake NUC is being set off to the side even though Gemini Lake is a KabyLake refresh (extremely close)

I’ll load Debian 12 and let you know how it works out.
(I just got Ubuntu 22.04 all settled. :stuck_out_tongue: lol )

Unraid 6.10.3 comes with kernel 5.15 and 6.11.5 has kernel 5.19.17.

I think Unraid 6.13 should include kernel 6.2+.

Thanks for that info.

I’m currently finishing the installation of Debian 12

chuck@jemini:~$ uname -a
Linux jemini 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64 GNU/Linux
chuck@jemini:~$

Based on the pattern we’re seeing, I expect it to fail.

If that happens, the challenge for me will be to determine why.

I think I found it.

Nov 14, 2023 16:02:42.732 [140706181929784] DEBUG - [Req#ea/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (GeminiLake [UHD Graphics 600])
Nov 14, 2023 16:02:42.740 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x32315659 -> yuv420p.
Nov 14, 2023 16:02:42.740 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x30323449 -> yuv420p.
Nov 14, 2023 16:02:42.740 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x3231564e -> nv12.
Nov 14, 2023 16:02:42.740 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x32595559 -> yuyv422.
Nov 14, 2023 16:02:42.740 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x59565955 -> uyvy422.
Nov 14, 2023 16:02:42.740 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x48323234 -> yuv422p.
Nov 14, 2023 16:02:42.740 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x58424752 -> rgb0.
Nov 14, 2023 16:02:42.740 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x58524742 -> bgr0.
Nov 14, 2023 16:02:42.740 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x30313050 -> p010le.
Nov 14, 2023 16:02:42.740 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Created surface 0x4000000.
Nov 14, 2023 16:02:42.740 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Direct mapping possible.
Nov 14, 2023 16:02:42.745 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Driver supports RC modes CQP, CBR, VBR.
Nov 14, 2023 16:02:42.745 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Driver does not support ICQ RC mode.
Nov 14, 2023 16:02:42.745 [140706181929784] WARN - [Req#ea/Transcode] [FFMPEG] - No quality level set; using default (20).
Nov 14, 2023 16:02:42.746 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Using nv12 as format of reconstructed frames.
Nov 14, 2023 16:02:42.746 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Created surface 0x4000001.
Nov 14, 2023 16:02:42.746 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Direct mapping possible.
Nov 14, 2023 16:02:42.752 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Using fixed QP = 20 / 20 / 24 for IDR- / P- / B-frames.
Nov 14, 2023 16:02:42.753 [140706181929784] DEBUG - [Req#ea/Transcode] Codecs: testing hevc (decoder) with hwdevice vaapi
Nov 14, 2023 16:02:42.753 [140706181929784] DEBUG - [Req#ea/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (GeminiLake [UHD Graphics 600])
Nov 14, 2023 16:02:42.755 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x32315659 -> yuv420p.
Nov 14, 2023 16:02:42.755 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x30323449 -> yuv420p.
Nov 14, 2023 16:02:42.755 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x3231564e -> nv12.
Nov 14, 2023 16:02:42.755 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x32595559 -> yuyv422.
Nov 14, 2023 16:02:42.755 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x59565955 -> uyvy422.
Nov 14, 2023 16:02:42.755 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x48323234 -> yuv422p.
Nov 14, 2023 16:02:42.755 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x58424752 -> rgb0.
Nov 14, 2023 16:02:42.755 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x58524742 -> bgr0.
Nov 14, 2023 16:02:42.755 [140706181929784] DEBUG - [Req#ea/Transcode] [FFMPEG] - Format 0x30313050 -> p010le.
Nov 14, 2023 16:02:42.755 [140706181929784] DEBUG - [Req#ea/Transcode] Codecs: Testing with profile 'Main 10'

Debian 12.2 , kernel 6.1 (just like it is with Unraid)

Tone mapping OFF = :white_check_mark:
Tone mapping ON = :x:

With Tone mapping OFF, PMS pushes the HDR through to the player and lets the player render it. Not 100% viable in all cases but maybe it’ll get us through until after the holidays (my team member is on PTO until Nov 30)

I’m going to continue checking all the platforms and possible i915 configurations to refine where the drm issue is.

I’ve done a full sweep and have this nailed down to OpenCL.

I’ve taken it as far as I can.

I’ve written the ticket and labeled Priority 1 (Fix next).

2 Likes

Keep us updated! Thank you

any news?

It’s Thanksgiving weekend here. Nothing to report until team gets back on Nov 30

Hopefully we get a fix as soon as possible! This is not a tiny issue :frowning:

Does PMS v1.40 solve this?

Any update on this? I still get the same behavior with 1.40.

I’m seeing this behavior on version 1.32.8.7639 with an Intel Arc GPU. Everything works fine unless tone mapping is enabled. No HW Accel on files being tone mapped.

This is disappointing as everything works fine in Jellyfin.

@IamSpartacus

Are you using a 6.x Linux kernel?

@ChuckPa

Yes, kernel 6.5 on both the host (Debian) and plex container (confirmed via uname -r). Conatiner shows 6.5.0-0.deb12.4-amd64. The Arc works fine (other than tone mapping) for hw accel in Plex and it also works in some other apps I’m using (tdarr). In Jellyfin it works for everything, including tone mapping.

Thanks for confirming the kernel and your results.

Containers will always show the host’s kernel info.
(Containers are mapped onto the host kernel)