Stop PMS from sending plugins to sleep

Hi,



I’ve come up with an interesting problem:



My plugin spawns two threads which will provide video/audio data which the Plex client can display.

This works fine until you watch for extended periods of time (between 30min up to one hour).

After this period the stream suddenly stops and if I perform any action on the client it needs to reconnect to the server.



After looking at the Plex.log and Plex Media Server.log it appears to me that the server is going to some kind of sleep mode taking the plugin and it’s threads along.

I have the “always on” mode set for my plugin as well as for the servers global mode but it still happens.



Any idea how I can prevent the server from sleeping while my plugin is active?



I thought about starting a helper process to provide the stream but that would separate me from the plex api which the

streaming threads make use of (and it would need another logfile using the python system logger…)





Cheers,

Shirk

Hi Shirk,



The “AlwaysOn” value for PlexPluginMode is no longer respected by PMS, as it was present in the Info.plist files for the very first plug-ins we created (even though it didn’t do anything at the time), which were copied by most developers. As a result, a very high percentage of plug-ins have this key set in their plist file. To prevent your plug-in being put to sleep, you now need to set PlexPluginMode to “Daemon”.



Hope that helps!

  • james


I'll give it a try
-- to bad I didn't read this earlier, I have a working solution but it's "hacky" ;)

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