PmsService icon indicating copy to clipboard operation
PmsService copied to clipboard

Hardware Acceleration

Open daeks opened this issue 6 years ago • 26 comments

As we all may know the sesson 0 does not allow access to hardware drivers. Is there a way in your program to start as interactive session? Interactive session should allow access to them also on a session 0.

  • Enable interactive services reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows" /v "NoInteractiveServices" /t REG_DWORD /d "0" /f

  • Create service with type "interact" sc create whatever binpath= "whatever_command" type= own type= interact >NUL

Might be something worth to be tried?

daeks avatar Jul 06 '18 05:07 daeks

you can try it yourself.

in the registry, go to HKLM\SYSTEM\CurrentControlSet\Services\PlexService

modify the Type value and set the 9th bit to 1.

enable interactive services as per the registry key in your post. (remember to restart windows after you make that change).

I'm not convinced it will work, and it's not something I'll be doing in my installer by default.

cjmurph avatar Jul 06 '18 07:07 cjmurph

I have enabled UI0Detect service to see its status but it does not react-

Just to be sure, registry value is set correctly:

image

daeks avatar Jul 06 '18 12:07 daeks

Doesn't look right, the ninth bit isn't set. What was the value of type before you modified it?

cjmurph avatar Jul 06 '18 12:07 cjmurph

0x00000010

daeks avatar Jul 06 '18 19:07 daeks

Setting the ninth but makes it 0x00000110 (decimal 272)

The binary representation of 0x110 is 100010000

cjmurph avatar Jul 06 '18 22:07 cjmurph

Hello,

Did you get this working @daeks ?

I'm experiencing an issue where plex crashes when I attempt to play a file which requires encoding. If I disable hardware acceleration or run plex from the app instead of the service, it transcodes fine. It appears a lot of people have this issue when running plex as a service.

Any assistance or steps to resolve would be appreciated. Thank You.

irishj avatar Dec 19 '18 19:12 irishj

Yeah, the same thing is happening to me. Only hardware accelerated transcoding is affected, and only while running as a service. When I started Plex on the same account via RDP, the hw transcoding was working fine.

TheMNSTR avatar Dec 25 '18 11:12 TheMNSTR

This is a known issue and not something I can remedy. The resources required for hw decoding are not available in session 0. Unless Microsoft/nvidia/amd/Intel do something about it, we're stuck.

cjmurph avatar Dec 25 '18 12:12 cjmurph

Damn, that sucks. I even tried using an EDID emulator to see if that would help. No dice.

TheMNSTR avatar Dec 26 '18 21:12 TheMNSTR

I starting using 'AlwaysUp" and run the plex media server via that tool and hardware acceleration works fine now.

irishj avatar Dec 26 '18 21:12 irishj

Alwaysup?

On December 26, 2018 16:45:28 irishj [email protected] wrote:

I starting using 'AlwaysUp" and run the plex media server via that tool and hardware acceleration works fine now. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

nylimited avatar Dec 26 '18 22:12 nylimited

https://www.coretechnologies.com/products/AlwaysUp/

irishj avatar Dec 26 '18 22:12 irishj

If alwaysup works then there is something I can do.

cjmurph avatar Dec 26 '18 23:12 cjmurph

TY!

On December 26, 2018 17:54:39 irishj [email protected] wrote:

https://www.coretechnologies.com/products/AlwaysUp/ — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

nylimited avatar Dec 26 '18 23:12 nylimited

I can verify that using AlwaysUp with Plex in Session 1 allows both hardware decoding and encoding. Starting in session 0 allows only encoding but not decoding.

JesterEE avatar Jan 18 '19 07:01 JesterEE

Can you advise how you set Plex to run in Session 1 ? I have mine in session 0, which as you said, only provides encoding. Thanks !

irishj avatar Jan 18 '19 18:01 irishj

Just updated to 1.1.7.0 to try this running as both Local System Account and Local User - and both times decoding fails to work. If i disable the service and run PMS then decoding works.

andyburton avatar Jan 31 '19 19:01 andyburton

@irishj Just to clarify, AlwaysUp is working for you without having to specify Session 1? @JesterEE Can you advise how to use Session 1. AlwaysUp authors say nothing about this in the documentation for configuring Plex. @cjmurph Just to clarify, do you mean if AlwaysUp has figured out a solution, you should be able to implement the same once it is understood?

I guess I'm asking, does this work flawlessly already with AlwaysUp? Or will any solution like this project and AlwaysUp be a little rough (Updating Plex etc.) because these use cases are not first class citizens in the Windows OS?

gravidThoughts avatar Jul 17 '19 00:07 gravidThoughts

It's my understanding that hardware acceleration won't work in session 0. I'm not sure exactly why, this may change with future versions of windows.

Always up allow a user session to be created (session 1..n). I don't see the point, you might as well auto login and start Plex with a scheduled task.

The point of this wrapper is to have Plex running as a service so no user session is required.

cjmurph avatar Jul 17 '19 00:07 cjmurph

@cjmurph Thanks for the quick reply.

Scheduled task? I think you just have to autologin with the account you used to install the Plex server, and have the server configure to automatically start at login. Am I misunderstanding something?

gravidThoughts avatar Jul 17 '19 00:07 gravidThoughts

No, you could do that. You can configure a scheduled task to restart if it stops though.

cjmurph avatar Jul 17 '19 00:07 cjmurph

It seems like, in 2021 with Windows 11, this is no longer an issue:

image

d8ahazard avatar Dec 07 '21 22:12 d8ahazard

It seems like, in 2021 with Windows 11, this is no longer an issue:

Could you provide some information? Is it the same PMS version that didn't work with 2019 and below? Note that the problem wasn't/isn't that HW Accel doesn't work at all but not when you run PMS as a service AND your're not logged in in Windows.

qpirsel avatar Dec 21 '21 14:12 qpirsel

It seems like, in 2021 with Windows 11, this is no longer an issue:

Could you provide some information? Is it the same PMS version that didn't work with 2019 and below? Note that the problem wasn't/isn't that HW Accel doesn't work at all but not when you run PMS as a service AND your're not logged in in Windows.

Sure. :D

So, all I did to test is the following:

Log out from the Windows 11 box as all users (reboot). Open the plex web player from Plex.tv. Pick some 4K content, under settings, ensure it's transcoding down to 1080p. Check the PMS dashboard in a separate browser tab - it shows HW transcoding as pictured above.

FWIW, the user I am running Plex under is an Administrator on the computer.

Tested from Windows 11 with an RTX2070 GPU.

image

d8ahazard avatar Dec 21 '21 14:12 d8ahazard

Thank's for the fast response. I will give it a try and report my results.

qpirsel avatar Dec 21 '21 17:12 qpirsel

Ok, after some testing I guess I can confirm it. At first I had issues with hw transcoding because I always selected predefined setting which doesn't work on my test server. But I think that is related to the older i3 Haswell CPU (QSV) I'm using for the test. When I select automatic conversion the Dashboard switches to Transcode/hw.

Of course, I was not logged in (2019, clean reboot) and it is not necessary that the plex user is a member of the administration group. That's important for me because the system is running some other services and holds some (for me) sensitive data.

qpirsel avatar Dec 27 '21 09:12 qpirsel