linuxserver / docker-plex

GNU General Public License v3.0
1.19k stars 210 forks source link

HDR HW Tone Mapping broken...again #325

Closed bm77525-kr closed 1 year ago

bm77525-kr commented 2 years ago

linuxserver.io


Expected Behavior

HDR Tone Mapping should still use hardware transcode

Current Behavior

When HDR tone mapping is enabled, software transcode is used

Steps to Reproduce

1.Add the /dev/dri device to the container 2.Enable HDR tone mapping 3.Play something with HDR and force it to transcode

Environment

OS: Ubuntu 20.04.1 CPU architecture: x86_64 How docker service was installed: Official docker repo

Running Plex 1.28.1.6041 (latest tag)

4k non-HDR continues to work via hardware decode

github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

FlipABit commented 2 years ago

It works when pinning the version back to version-1.28.0.5999-97678ded3

j0nnymoe commented 2 years ago

As mentioned in previous issues regarding this, the only thing that's changed is the Plex version, please report the issue to them.

FlipABit commented 2 years ago

As mentioned in previous issues regarding this, the only thing that's changed is the Plex version, please report the issue to them.

Happy to, but looking at the most recent previous issue , that wasn't mentioned at all and was fix by a code change to this repo?

j0nnymoe commented 2 years ago

Yea that was done and one of the dependencies was pinned to a specific version. Since then the only change to the image is a Plex update.

FlipABit commented 2 years ago

Further reference for anyone stopping by here: https://forums.plex.tv/t/ubuntu-intel-n5105-qsc-hw-transcoder-not-detected/803491/5

dchawisher commented 2 years ago

It works when pinning the version back to version-1.28.0.5999-97678ded3

I can confirm that this worked for me as well (Synology DS220+ w/ celeron J4025). NOTE for idiots like me: You have to pin the version using the VERSION env variable, not by changing to an older image. If you use an old image but VERSION=latest or similar, the image will update plex as soon as it starts, and you will still have the bug.

aptalca commented 2 years ago

You can set the version var to docker and it won't do any updates during init

Ge082 commented 2 years ago

Newer public version also broke HDR Tone Mapping. The official Plex container also have this issue

VeniceNerd commented 2 years ago

Why does this keep happening? Anyone know if the Plex team is aware of the issue?

Ge082 commented 2 years ago

Why does this keep happening?

It's just Plex being Plex

Anyone know if the Plex team is aware of the issue?

They are https://forums.plex.tv/t/anyone-have-been-able-to-hw-transcode-on-an-intel-nuc-11-iris-xe/695381/524 But with Plex Team it is unknown if the transcoder team is working actively on the issue

MilesTEG1 commented 2 years ago

They are https://forums.plex.tv/t/anyone-have-been-able-to-hw-transcode-on-an-intel-nuc-11-iris-xe/695381/524 But with Plex Team it is unknown if the transcoder team is working actively on the issue

Let's just hope this is the case. I've got the issue too. Need to revert to 1.28.0.5999-97678ded3 too. For those who are thinking how to do it, juste set the VERSION environment variable to this number :

    environment:
      - VERSION=1.28.0.5999-97678ded3
            # docker : Let Docker handle the Plex Version, we keep our Dockerhub Endpoint up to date
            #          with the latest public builds.
            # latest : will update plex to the latest version available that you are entitled to.
            # public : will update plexpass users to the latest public version, useful for plexpass users
            #          that don't want to be on the bleeding edge but still want the latest public updates.
            # <specific-version>: will select a specific version (eg 0.9.12.4.1192-9a47d21) of plex to
            #                     install, note you cannot use this to access plexpass versions if you do not
            #                     have plexpass.
MilesTEG1 commented 2 years ago

Hello, Does the new Plex Media Server 1.28.2.6106 works correctly with hw transcode ? I'm not upgrading for now, I wouldn't like to know 😀

VeniceNerd commented 2 years ago

Hello, Does the new Plex Media Server 1.28.2.6106 works correctly with hw transcode ? I'm not upgrading for now, I wouldn't like to know 😀

For me it doesn’t solve the issue. Still doesn’t work.

Ge082 commented 2 years ago

1.28.2.6151-914ddd2b3 still have the issue Stay on 1.28.0.5999-97678ded3

What the fuck Plex ...

gombihu commented 2 years ago

still no joy with latest tag. sticking with 1.28.0 on Intel J4125

sn0opy commented 2 years ago

HW tone mapping is going to be fixed in 1.28.3. There's no ETA for a (beta) release yet though. Check the link in https://github.com/linuxserver/docker-plex/issues/325#issuecomment-1220913055

No need to check if it's fixed if the main Plex version is below that.

andywong36 commented 2 years ago

I was able to get HW transcoding and tone-mapping working with 4K HDR -> 1080p SDR on an i5-7200u / HD620.

The fix requires a new Dockerfile (for now). I discovered that beignet-opencl-icd wasn't available from apt-list. This requirement is listed in https://support.plex.tv/articles/hdr-to-sdr-tone-mapping/#Dependencies

FROM lscr.io/linuxserver/plex:latest

RUN apt-get update && apt-get install -y beignet-opencl-icd

Followed by the suitable modification of your docker-compose to build this.

j0nnymoe commented 2 years ago

I was able to get HW transcoding and tone-mapping working with 4K HDR -> 1080p SDR on an i5-7200u / HD620.

The fix requires a new Dockerfile (for now). I discovered that beignet-opencl-icd wasn't available from apt-list. This requirement is listed in support.plex.tv/articles/hdr-to-sdr-tone-mapping/#Dependencies

FROM lscr.io/linuxserver/plex:latest

RUN apt-get update && apt-get install -y beignet-opencl-icd

Followed by the suitable modification of your docker-compose to build this.

This is a long winded way of adding a package to our container when you can just use a custom script https://www.linuxserver.io/blog/2019-09-14-customizing-our-containers

andywong36 commented 2 years ago

Cool, thanks for sharing!

Since this may fix some problems others are having, I'll open a PR as well.

nopoz commented 2 years ago

Can anyone confirm if this is fixed in the latest version? version-1.29.0.6244-819d3678c

sn0opy commented 2 years ago

Can anyone confirm if this is fixed in the latest version? version-1.29.0.6244-819d3678c

Works for me without the need of installing any further packages. Just stock container image with latest Plex version on Unraid 6.11 and an i3-12100T.

nopoz commented 2 years ago

I just tested version-1.29.0.6244-819d3678c and it does transcode standard hdr content but it doesn't hardware transcode dolby vision hdr content.

Like previously, rolling back to version-1.28.0.5999-97678ded3 - hardware transcoding works as expected for all hdr formats.

FlipABit commented 2 years ago

1.29.1.6241 beta dropped today and finally fixes hardware HDR transcoding. The Intel libraries are also now bundled with Plex for Linux systems.

JDIacobbo commented 2 years ago

Using the latest tag with an i7-9700k.

I'm noticing that I'm only getting HW transcoding on 1 stream. Any subsequent stream uses CPU transcoding. Is any one else experiencing this?

Rolling back to 1.28.0.5999-97678ded3 fixes it.

erikburman commented 2 years ago

Relevant thread on plex forums https://forums.plex.tv/t/pms-1-29-1-hw-tonemapping-testing-questions-and-answers/812785

puijken commented 2 years ago
**apt-get update && apt-get install -y beignet-opencl-icd**

Currently running: 1.29.0.6244-819d3678c-ls134

After starting the container I ran this command in the console -> HDR tonemapping HW transcoding working again. Easy 10 second temp solution.

Will be gone of course on the next container image update but let's hope it's fixed by then.

sn0opy commented 2 years ago

Will be gone of course on the next container image update but let's hope it's fixed by then.

@puijken Just use the package-install docker mod https://github.com/linuxserver/docker-mods/tree/universal-package-install

gombihu commented 2 years ago

Still no joy for me on 1.29.0.6244 hw transcode is not working with 4k and hdr tone mapping on J4125 CPU :( Going back again to 1.28.0

sn0opy commented 2 years ago

Still no joy for me on 1.29.0.6244

that’s because the fix is included in 1.29.1. Not in 1.29.0

Rainzzzzzz commented 2 years ago

Hello can someone confirm if it is fixed? Im still on 1.28…

NeussConsulting commented 2 years ago

Hello can someone confirm if it is fixed?

Im still on 1.28…

For me it is fixed since last update.

MadWalnut commented 2 years ago

Hello can someone confirm if it is fixed? Im still on 1.28…

Not for me. 1.29.1 still goes back to SW transcoding because of the HDR tone mapping, which makes every transcoded stream extremely laggy.

james-d-elliott commented 2 years ago

Hello can someone confirm if it is fixed? Im still on 1.28…

Not for me. 1.29.1 still goes back to SW transcoding because of the HDR tone mapping, which makes every transcoded stream extremely laggy.

How much of the plex official 1.29.1 tone mapping issue thread have you read and tried?

MadWalnut commented 2 years ago

@james-d-elliott You mean this thread?

There isn't really that much to try is there? I am using a tested & verified CPU (J4125 in a Synology Box) with the ls.io plex image (PMS 1.29.1.6316). I enabled HDR tone mapping and hw acceleration. There was no need to remove old packages (like beignet) because prior to 1.29.1 I never attempted to get HDR tone mapping to work.

So now when I transcode 4K HEVC HDR10, it doesn't give me hw transcoding and the stream buffers every 2 seconds. Transcoding 1080p works with hw acceleration.

Is there anything I've missed?

james-d-elliott commented 2 years ago

Looking at the thread, you probably want to check the /config/Library/Application Support/Plex Media Server/Drivers/ directory exists and contains the appropriate driver. If it doesn't then maybe it's not writable? If it does then it most likely indicates there is still an issue on the PMS side.

MadWalnut commented 2 years ago

Yes, I had a folder in that directory with these files:

$ ls icr-9-linux-x86_64

libiga64.so
libiga64.so.1
libiga64.so.1.0.1
libigc.so
libigc.so.1
libigc.so.1.0.1
libigdfcl.so
libigdfcl.so.1
libigdfcl.so.1.0.1
libigdrcl.so
libocloc.so
libopencl-clang.so.11

However, for testing I deleted that folder, did a docker pull and restarted the Docker container and now... It's working! I have no idea why, clearly the permissions where also fine before because otherwise the files would not have been there... Maybe something with the new ls.io image release 22h ago? Anyhow, maybe this helps someone else. Thanks for the pointer @james-d-elliott!

james-d-elliott commented 2 years ago

The files are downloaded by PMS. So I'm guessing they may have either fixed something, they may not update them every start, or they were corrupted somehow and PMS thought they were fine.

Rainzzzzzz commented 2 years ago

Updated to the lastest release and it finaly work TY ALL

nopoz commented 2 years ago

Tested version-1.29.1.6316-f4cdfea9c - Intel hardware transcoding worked on HDR10, Dolby Vision, and standard HD content.

puijken commented 2 years ago

Same here .. with latest tag updated today to 1.29.1.6316 and all is working as it should :).

m04ndj5xc2u3pn4eow commented 2 years ago

I can't seem to get version-1.29.1.6316-f4cdfea9c to work for me. Any media that needs transcoding doesn't play at all. version-1.28.0.5999-97678ded3 is the last version that works.

I checked if it was a perms issue, but I see this in the logs when starting/restarting the server:

**** Server already claimed ****
**** permissions for /dev/dri/renderD128 are good ****
**** permissions for /dev/dri/card0 are good ****
Docker is used for versioning skip update check
[custom-init] No custom files found, skipping...
Starting Plex Media Server. . . (you can ignore the libusb_init error)
[ls.io-init] done.
Critical: libusb_init failed
Dolby, Dolby Digital, Dolby Digital Plus, Dolby TrueHD and the double D symbol are trademarks of Dolby Laboratories.

I also doubled-checked /dev/dri/ directory:

total 0 
crw-rw---- 1 root root      226,   0 Nov  1 16:47 card0 
crw-rw---- 1 root videoqxsq 226, 128 Nov  1 16:47 renderD128

I tried what @MadWalnut mentioned, but no luck. I'm also running on a Synology NAS with J4125 CPU.

@Rainzzzzzz @nopoz @puijken, are you guys running on an intel Synology NAS as well?

e: If anyone else runs into this issue, this is what solved it for me (particularly the 2nd option)

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

gombihu commented 1 year ago

On Plex Media Server v1.30.2.6563-3d4dc0cce still not working on Celeron J4125:

Jan 10, 2023 23:37:26.731 [0x148455b96b38] INFO - [Req#68d/Transcode] Preparing driver icr for GPU 
Jan 10, 2023 23:37:27.058 [0x148456111b38] ERROR - [Req#6a9/Transcode/rcxl1lr7nxbalv7l6vx3wmcr/e02f1d26-c360-4569-bba7-0019f64a2536] [AVHWDeviceContext @ 0x14f3920c8580] No matching devices found.
Jan 10, 2023 23:37:27.688 [0x148456111b38] ERROR - [Req#6ae/Transcode/rcxl1lr7nxbalv7l6vx3wmcr/e02f1d26-c360-4569-bba7-0019f64a2536] [Parsed_tonemap_opencl_3 @ 0x14f396351c80] Failed to finish command queue: -5.
Jan 10, 2023 23:37:28.194 [0x148456111b38] ERROR - [Req#6af/Transcode/rcxl1lr7nxbalv7l6vx3wmcr/e02f1d26-c360-4569-bba7-0019f64a2536] Error while filtering: I/O error
Jan 10, 2023 23:37:28.194 [0x148456111b38] ERROR - [Req#6b0/Transcode/rcxl1lr7nxbalv7l6vx3wmcr/e02f1d26-c360-4569-bba7-0019f64a2536] Failed to inject frame into filter network: I/O error
Jan 10, 2023 23:37:28.194 [0x148456111b38] ERROR - [Req#6b1/Transcode/rcxl1lr7nxbalv7l6vx3wmcr/e02f1d26-c360-4569-bba7-0019f64a2536] Error while processing the decoded data for stream #0:0
Variant id="e02f1d26-c360-4569-bba7-0019f64a2536" targetBitrate="15717" context="streaming" sourceVideoCodec="hevc" sourceAudioCodec="ac3" videoDecision="transcode" audioDecision="transcode" protocol="dash" container="mp4" videoCodec="h264" audioCodec="aac" audioChannels="2" transcodeHwRequested="1" transcodeHwDecoding="vaapi" transcodeHwEncoding="vaapi" transcodeHwDecodingTitle="Intel (VA API)" transcodeHwEncodingTitle="Intel (VA API)" transcodeHwFullPipeline="1">
<Media id="1637" videoProfile="main 10" audioChannels="2" audioCodec="aac" bitrate="14968" container="mp4" duration="6268160" height="1280" optimizedForStreaming="1" protocol="dash" videoCodec="h264" videoFrameRate="24p" videoResolution="1080p" width="3072" selected="1">
<Part hasThumbnail="1" id="1637" videoProfile="main 10" bitrate="14968" container="mp4" duration="6268160" height="1280" optimizedForStreaming="1" protocol="dash" width="3072" decision="transcode" selected="1">
<Stream bitrate="14854" codec="h264" default="1" displayTitle="4K HDR10 (HEVC Main 10)" extendedDisplayTitle="4K HDR10 (HEVC Main 10)" frameRate="23.975999832153320" height="1280" id="700" streamType="1" width="3072" decision="transcode" location="segments-video" />
<Stream bitrate="114" bitrateMode="cbr" channels="2" codec="aac" default="1" displayTitle="English (AC3 5.1)" extendedDisplayTitle="English (5.1) (Dolby Digital) (AC3)" id="702" language="English" languageCode="eng" languageTag="en" selected="1" streamType="2" decision="transcode" location="segments-audio"

Seems I have to go back to safe 1.28.0 version where this HDR HW t.mapping works (tried 1.28.1, 1.28.2, only .0 works..) or at least does not crash the movie and uses hw transcode

mattalat1 commented 1 year ago

On Plex M

Can confirm that it also doesn't work on J5005 processor using latest docker image.

gobigdave commented 1 year ago

Confirmed it still doesn’t work with Docker 1.30.2 and an Intel i3. Does work on 1.28.0.

puijken commented 1 year ago

Seesms to work fine here? i3 8100 on version 1.30.1.6562.

Just played a 4k HDR10 (HEVC Main 10) movie which is transcoded to 720p (H264) on a non-HDR screen - all looking good and using hw transcoding.

nopoz commented 1 year ago

Tested with latest version version-1.30.1.6562-915986d62 and it works for me. Tried various different 4K HDR10 and Dolby Vision content and all hardware transcoded as expected. Plex Server is running on an Intel 8600 processor.

gombihu commented 1 year ago

image 1.30.1.6562 Celeron J4125 no joy

j0nnymoe commented 1 year ago

These issues need to be reported upstream, we've already done what we can with pinning the intel driver inside the container to a specific version.

As you can see there is constant issues with other platforms here https://forums.plex.tv/t/pms-1-29-1-hw-tonemapping-testing-questions-and-answers/812785

Closing this issue.