Converting to a lower quality fails with Hardware-Accelerated Streaming in Plex Web

I have already unlocked the card, but I tested it when only one stream was active anyways.

I had previously attempted what you suggest and got playback for 30 seconds then the stream drops. I’ll try and recreate when I can

When you do, please be certain to have DEBUG logging enabled and VERBOSE disabled.

After recreating, download and attach the logs ZIP file

After a couple reboots (due to an external SAS connection being funky) and staying on the old version you sent I am not seeing any of the issues I experienced on the newer version, with default transcoding. This requires that I’m at 4mpbs as the default.

I AM able to recreate the switching issue by being in any setting and changing the quality during a stream. If i am at 4mbps and change to 2mbps…it fails. As well as ANY other combination of changing the quality on-the-fly. This has not been the case in the past and I think is the issue that some of my players are having (maybe because they don’t default to their remote stream quality when initiating the playback and then they change to it? Just a guess…).

All of these tests have been done on the version you had me revert back to (1.24.5.5173)
Plex Media Server Logs_2022-05-04_08-57-36.zip (5.3 MB)

Hey @ChuckPa,

I a not sure if you can answer but I thought I’d ask.

It seems this issue was reported over a year ago. I understand how important it is to collect debug logs and to fully understand and reproduce the problems before a fix can be put in place.

However, looking at this thread I can see many debug logs shared but what’s not clear is what is next and how do we get this elevated invisibility so it can get fixed? Do we need more debugs logs? Is the problem understood/confirmed? Is a fix being worked on?

Thanks!

1 Like

@stevezau

I had written out everything I tested and what my findings were.

Summary:

When everyone who helped me test (all those who stream from me) set the playback resolution and bitrate PRIOR to starting playback –

There were no failures.

The only failures seen where those inherent in demanding the player HOLD what it was doing, dump the buffers, make PMS / transcoder delete everything, seek its way back into the file at wherever it was (transcoding as it goes), and then fill buffers on the players… timed out.

This is a systemic problem. It’s not possible to mandate everyone have a proper CPU or GPU which is guaranteed up to the task nor is it possible to mandate everyone have good internet service and, not at least, curate their media perfectly.

Remember, this “switch” must occur within a finite amount of time. That’s the problem.

There are so many variables involved and why I say systemic. All those variables which come into play the instant you change resolution mid-flight start biting.

My answer? As lame as it might sound. Set it upfront and then FORGET about it.
There is a Home Streaming and a Remote Streaming setting. Use them :slight_smile:

It still doesn’t make sense that this ONLY occurs on HW Acceleration. This is systemic in that Plex doesn’t handle HW Transcoding properly right now. This was never a problem for me until the last couple months. Nothing else has changed in my environment & if my CPU can handle it my GPU should be able to as well…

@ChuckPa I am not sure I understand.

On April 2nd you said, “The issue exists with anything above 20.04. That much is known.”.

Now I am reading you are suggesting this is a hardware/system issue that’s not up to the task?

I am confused as this was never an issue before. I have a P5000 with dual 24 core CPU’s. Which should be more than up to the task? This had worked for years and the issue we are posting about in this thread only started happening recently (relatively speaking). This issue only happens with HW acceleration as everyone else has described.

So I guess I am trying to validate. Before it seemed it was a known issue (with the latest Ubuntu versions) and Plex were looking into it… But now, Plex is saying this is NOT a bug/issue and has nothing to so with the Plex server software? Is that right? If that’s the case, are you able to help me understand why it is an issue on my machine and what is the root cause?

Thanks

I’m sorry if I confused a few things.

  1. For all processors which use HDR tone mapping (Intel QSV), above 20.04 is a problem.

  2. For all processors which are CometLake and above which use Intel Compute Runtime, those CPUs must use Intel Compute Runtime libraries ver 21.49.

  3. Ubuntu 22.04 breaks the known established Beignet-OpenCL tone mapping used by Intel QSV -7xxx, -8xxx, and -9xxx (KabyLake → CoffeeLake) because the “Beignet” package is no longer available.

My current tasking is to update the Debian/Ubuntu packaging to work correctly with the new additional variables OS Distro & Distro Version as part of the decision logic.

Regarding playing to a web browser:

  1. You’re using the dumbest player known. Why?
    – It’s not a complied client. The code is interpreted, in the browser’s API, to do the job. (Interpreted – source statements are converted → Intermediate “Pseudo-code” → “P-code” with data → the Browser → and then from the browser → your display manager to be placed on the glass.

– There are other players available which are compiled.

  • slight tangent
    Speaking EXCLUSIVELY as myself (I’ve written code with these languages - Javascript in the browser; Java for ‘host-native’ apps),
    – IMHO, they’re crap for anything other than low-volume/animated web pages or user-interactive interfaces. They’re not intended to deal with high-volumes of data like video.

Have you ever watched how much CPU your browser process uses when playing video? It’s insane. For me, Chrome uses 265% (2.65 CPU cores of the 4 cores I have on this i7-8809 just to run the browser).

Now add to how the languages are:

  1. Interpretive - Not compiled
  2. Dynamic memory allocation with high degree of waste & memory fragmentation

Not 100% related but I worked on a project once where they wanted to control an electrical power plant using Java as the main programming language.

Like all good engineers, We wrote the power plant simulation model in a traditional language (Fortran 77). We then let the Java engineers “operate” the power plant with the Java-based UI and control programming.

In every simulation, until the day management terminated the project and switched to C++, they “blew up” the power plant simulator every time they “fixed” the code. Had that been real life, it would have been an ecological disaster.

Back to using the browser and changing to lower resolution.

Because of how poor the browser is, no matter how well the code is, it’ll never be as good as a proper player. It will always fail somewhere somehow because there are limits imposed by the browser (maximum size of the code running in the browser is the biggest limit)

I gave you the instructions I did so you can reliably use it. It will always be extremely limited.

(The browser is like your family station wagon . It’ll do the job but it’s not a high performance sports car you can throw around and expect it to handle everything on demand)

With me I was using the browser as an easily replicable client for testing and getting you logs . The issues I experienced were across all other platforms with my clients (android/AppleTV/FireSticks).

Hi @ChuckPa,

Firstly, thank you for replying. I know how difficult and frustrating front-line support can be.

In my situation, I am using my P5000 GPU (not the CPU) and I am also using the plex docker container. So I assume points 1,2 and 3 do not apply to my setup or situation?

Regarding the web browser. Please don’t take this the wrong way but I kinda disagree with your assessment.

From my point of view. I have been using and supporting Plex for many many years. While travelling, the web browser is my only real option. I understand it is not the best client but it is a supported client by Plex as such I’d expect it to work correctly as it has been for many years now. It is only just recently I am experiencing the issues outlined in this thread. What I don’t agree with is saying "It will always fail somewhere somehow because there are limits imposed by the browser ". There are many other services that use the web browser for video streaming, and they all work. I understand it is hard and challenging but that’s why people use Plex, you guys take care of the complexity and make it simple for us. So, sorry but this kinda feels like an excuse if I’m being honest.

So, back to my situation. With the logs, I’ve provided and knowing my hardware setup. I still don’t understand why switching between bitrates is a problem.

The web browser works PERFECTLY when using CPU transcoding, it is ONLY an issue with using GPU/HW Transcoding enabled. This is telling me it has nothing to do with the browser client as you suggested and it is a bug within the plex code somewhere. So, I am still confused as to me it seems like a bug… I’ve supplied debug logs but not clear on what is causing it.

Thanks

I sent a message off to the teams asking for help.

Hope they have some answers.

Thanks for your continued support @ChuckPa !

I’ve gotten some feedback.

The concern is:

– If it works with software but not with hardware – Finger points to the GPU/driver

Have you tried this with any other software packages to rule out the Nvidia driver ?

I again ran this on my machine and cannot reproduce it now no matter how hard I try.

Plex/web : 100 Mbps 2160p UHD → 12 Mbps 1080p H264 tone mapped.

My current driver:

[chuck@glockner media.2006]$ nvidia-smi
Wed May 11 20:54:36 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 510.47.03    Driver Version: 510.47.03    CUDA Version: 11.6     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Quadro P2200        On   | 00000000:07:00.0 Off |                  N/A |
| 48%   37C    P8     4W /  75W |      4MiB /  5120MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
[chuck@glockner media.2007]$ 

Hi @ChuckPa. Yes, that’s what I’ve been saying. It is pointing to the GPU. However, I don’t think it is the driver as I (and most others in this thread) have tried all variants of the Nvidia driver.

This started happening after an upgrade to the plex server, I am unsure exactly what version the issue started in.

"Have you tried this with any other software packages to rule out the Nvidia driver ?
What do you mean by this?

If we look at this logically…

  • This is ONLY an issue on the plex web player, when you try to change the quality bitrate using Hardware transcoding.
  • I do NOT see the issue with h/w transcoding on clients such as the nvidia shield.
  • The issue does NOT exist in plex web if i disable HW transcoding.
  • I am in a docker container which should remove any server/host o/s package issues
  • I have tried several versions of the nvidia driver.

This seems to point to a specific issue with the plex web player when using hardware transcoding?

I understand you cannot reproduce it, but that does not mean it is not an issue.

This is why i provided logs. Do the logs not show anything?

We must discount the Nvidia Shield. We remove if from the equation because it’s a thick client. Unless the shield settings expressly call for subtitle burning, PMS will offload everything to the shield. It’s known as a ‘thick client’ because it can do all the decoding and converting itself.

The AppleTV also is a thick client. It’s not AS CAPABLE as the shield but pretty good.

Do you have a “smart tv” which you can load the Plex TV app in?

If you can, that’s a thin client. It’s a window to “display stuff in”.
It’s the closest to Plex/web we can get.

@ChuckPa Maybe i didn’t explain myself clearly.

I am not using the Nvidia shield as a thick client, in other words, to run PMS. I am using the Plex client on the shield to connect to my remote PMS server running on docker on a different system.

I also have a Roku client and LG TV client. Both have no issues swapping between bitrates w/ HW decoding.

So back to my point, all fingers are still pointing at PMS and the web client with h/w transcoding on.

Regarding your comment on thick vs thin clients. The shield, apple and what everelse can act as a thin client if connecting to your remote PMS server, this is my case here.

You are misunderstanding me a bit.

If you install the Plex player app, it’s a client. It happens to be a powerful, fully capable, “thick” client because of what it can do.

The “Plex Media Server” app, which which I see you do have installed on the Shield, is completely independent and not involved here.

Therefore, We’re only concerned with the Shield (client) player app which doesn’t cause problems.

You’ve confirmed the other players are not a problem (Roku, LG TV app) on your other “thin client” apps.

Therefore, this comes down to one thing and one thing only. “Plex/web browser app”

This is definitive. The above rules out PMS itself.

Please forgive me for going through this again but now we’re going to get the Plex/web logs and make one final pass through this so I can take the Plex/web logs back to the Plex/web team.

  1. Please make sure the Plex/web Debug logging is enabled. (hit SAVE)

  2. Make certain PMS Debug logging is also enabled.

  3. Start the playback as you have and make the rate change

  4. After it fails:
    – Settings → Plex Web - Debug - “View the logs here” – copy and save to text file.
    – Settings → Server - Troubleshooting - Download Logs.

  5. Attach both.

After completing that –

How does it work in an incognito/private browsing window when all browser extensions are disabled as well as how does it work with a different browser ?

Hi @ChuckPa i’ll get the logs for you tomorrow. Just waiting for my plex server to be quiet so i can get clean logs.

Hi @ChuckPa,

I copied this video file to my server, it is what i used during this test. https://jell.yfish.us/media/jellyfish-10-mbps-hd-hevc.mkv

I enabled debug logging in PMS and the Web Player. I then

  1. Played the video file. It started hw transcoding at 2mbps
  2. 10-15 seconds in, I changed it to 1.5mpb.
  3. Play player stopped playback but never restarted again at the lower quality.

Attached
Plex Logs.zip (24.1 KB)
are both logs.

I also tested via incognito chrome and safari, same results.

I hope this gives the team enough data to figure out what’s going on.

thanks!!

Any update on this? I haven’t run into the problem anymore, but I also haven’t really tested it again on my Browser.