-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion: Prevent sleep mode on Windows while streams are running #78
Comments
I think the only reasonable way would be to build that into the server itself or via a plugin. The tray app is optional and does not "know" what JF server is actually doing. That would be not the correct place in my opinion as it would also need some very tight integration apart from what its doing now. |
Thank you for the response. The opinion of the members on jellyfin/jellyfin#9043 was different (unless I misunderstood them), what would be your suggestion on how to proceed? On a related note, do you know if it is possible to bundle Jellyfin on Windows with a plugin pre-installed? Then only the Windows bundle, but not the tray app itself would need to be changed. |
i would handle it like niels said: I am but one person doing stuff here :-). System.OperatingSystem.Platform == PlatformID.Win32NT https://learn.microsoft.com/en-us/dotnet/api/system.platformid?view=net-7.0 To check before you run your code. If the feature is to be desired by an Admin he can install it. |
Ok i maybe understand what niels meant. |
Yeah I think we can make it part of the installer to automatically add a "Windows support" plugin to the server. This plugin could add stuff specific for the OS like the "prevent sleep while streaming" option. |
OK but if you want it to be installed by default, i see no functional difference of packing it into the default server install aswell and just running the code conditional. Would be 1 less step inbetween |
As the discussion seems stale, I would like to kindly inquire whether there will be a continuation / resolution at some point? If that seems unlikely, is there a chance that the current plugin (which @qwerty12 and I now consider feature complete) could, at the very least, become an official plugin despite its platform dependency? Should I be in touch on Matrix? |
I'm using this plugin. Very useful. Thank you
…On Wed, Jul 19, 2023 at 3:00 PM jonschz ***@***.***> wrote:
As the discussion seems stale, I would like to kindly inquire whether
there will be a continuation / resolution at some point?
If that seems unlikely, is there a chance that the current plugin
<https://github.com/jonschz/jellyfin-plugin-preventsleep> (which @qwerty12
<https://github.com/qwerty12> and I now consider feature complete) could,
at the very least, become an official plugin despite its platform
dependency? Should I be in touch on Matrix?
—
Reply to this email directly, view it on GitHub
<#78 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGD6KX3CSKYUJEWIL5DYDTXQ6AYNANCNFSM6AAAAAATX2U6SQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@jonschz Yes, please message/tag me and we'll get this in as a bundle for the Windows install. |
@jonschz I was looking at this again, and realized that this repo has an MIT License, so I don't know how including your GPLv3 plugin works with that. I suppose it's no issue, since it's an already compiled module that I'd be including. |
That is a good point. I would be happy to re-publish my code under MIT, and presumably @qwerty12 as well, but the problem is that the plugin template is GPL licensed (and I vaguely remember a note somewhere stating that all code linked against Jellyfin core has to be GPL as well). In any case, I agree with your assessment that distributing the binaries is not an issue (not a laywer, though). On a different note, it should also be possible to change this repo's license to GPL if that is desired, only the reverse requires consent from all contributors. |
I am going over it with the broader team. Because the plugin would be supplied as a compiled module, it should be fine. That said, our macOS wrapper is MPL v2, and we'd probably want to be consistent here. I'll work on relicensing this Repo, and then we can work on bringing in the plugin as an official project as well. |
My opinion differs. In case they are allowed to sleep it is a duty of the software to indicate when sleep is not desired, which Jellyfin currently does not do. On windows this can be by setting SetThreadExecutionState with ES_SYSTEM_REQUIRED periodically, on linux by sending the apropriate message to the dbus, and I'm sure there is a similar method for Mac. Since doing so does not harm any functionality for a dedicated high availability server there is no reason to not have this in the core. "OS specific" is not a reason to exclude something from core functionality, but rather to implement it in an OS specific way for all supported OSes if the feature is important. Carbon neutrality is important and should be the goal of any developer, including Jellyfin developers. You cannot expect users to know or care about this, so it would be good for them to see this in the server settings UI probably enabled by default with explanations on what it does and why it is important and how to use with WoL. If they don't see this they will simply turn off sleep and keep increasing carbon emissions, which I'm sure tens of thousands are already doing because they know no better. "User watches movie on TV, his computer goes to sleep during the playback and interrupts him" This is what happens. Jellyfin should try to avoid this. |
Jellyfin runs on dotnet so it would require code for all operating systems including linux flavors including mac, to be implemented and supported. Which is just outside the scope of what JF wants to do. If you configure your server to go to sleep after X time, then it should do that its mostly a feature on UI servers. If you configure your sever to go into low power, it will when there is nothing to do. Jellyfin is not responsible for management of your server, you are. The idea that was flowing around here was to make it part of the system tray app that runs on windows alone, which is a compromise. Apart from that, jf may stop the server from hibernation but could never start it back up, which in my opinion is a halve solution anyway so we should not really get too deep into it. |
Jellyfin can wake up the computer since the computer uses WakeonLan.
But you are right, Jellyfin is not responsible for managing the server. I
am, therefore, since Jellyfin does not allow me to do it as I wish, in
order to reduce my carbon footprint, I will not use it.
Simple as that.
…On Thu, Nov 23, 2023 at 6:22 PM JPVenson ***@***.***> wrote:
@msimic <https://github.com/msimic>
Jellyfin runs on dotnet so it would require code for all operating systems
including linux flavors including mac, to be implemented and supported.
Which is just outside the scope of what JF wants to do. If you configure
your server to go to sleep after X time, then it should do that its mostly
a feature on UI servers. If you configure your sever to go into low power,
it will when there is nothing to do.
Jellyfin is not responsible for management of your server, you are. The
idea that was flowing around here was to make it part of the system tray
app that runs on windows alone, which is a compromise. Apart from that, jf
may stop the server from hibernation but could never start it back up,
which in my opinion is a halve solution anyway so we should not really get
too deep into it.
—
Reply to this email directly, view it on GitHub
<#78 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABHCCKDQN2AWY4JREDRGN3YF6A4XAVCNFSM6AAAAAATX2U6SSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRUG42TGNJTGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I am curious how you would send a magic packet, via web, via the internet to a computer. There is currently a PR that aims to either create a new or improve the existing api to get knowledge of currently running streams. So utilizing that you could handling your usecase yourself by getting that info and stopping the server yourself. |
You don't need magic packets for wake on Lan.
The first ping from the jellyfin client with a default server already set
up wakes it.
It takes a bit but it works.
…On Thu, Nov 30, 2023 at 6:22 AM JPVenson ***@***.***> wrote:
I am curious how you would send a magic packet, via web, via the internet
to a computer.
There is currently a PR that aims to either create a new or improve the
existing api to get knowledge of currently running streams. So utilizing
that you could handling your usecase yourself by getting that info and
stopping the server yourself.
—
Reply to this email directly, view it on GitHub
<#78 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABHCCORMGEDTQ2JI3PRRB3YHAJ27AVCNFSM6AAAAAATX2U6SSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZTGEZDOMZTGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Wake On Lan does need a magic packet. Maybe some manufacturers have decided to allow pings, but that is not standard. We are not here to save the world nor do anything we do have the slightest impact (we do not have the user base). It's a terrible argument (following that line of thought we should remove transcoding), and it has already been shown that plugins can provide the "prevent sleep" functionality. If you want to reduce your carbon footprint, you can start by looking at eating habits, clothes and general consumerism. |
WakeOnLan requires a magic packet only if you check this checkbox in the
network interface driver properties.
Even network cards from 20 years ago have this.
…On Thu, Nov 30, 2023 at 7:21 AM Claus Vium ***@***.***> wrote:
Wake On Lan does need a magic packet. Maybe some manufacturers have
decided to allow pings, but that is not standard.
We are not here to save the world nor do anything we do have the slightest
impact. It's a terrible argument (following that line of thought we should
remove transcoding), and it has already been shown that plugins can provide
the "prevent sleep" functionality.
—
Reply to this email directly, view it on GitHub
<#78 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABHCCIXUKXUJXHKQXGJDL3YHAQVRAVCNFSM6AAAAAATX2U6SSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZTGE3TKNBYG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
the ethtool docs themselves confirm that not all options are supported on all devices, so this is not an option on linux. It's probably not a viable option on Windows either. Since they have no way of magically supporting devices that don't physically support it, in all likelihood windows just silently fails when the hardware doesn't support it. thats what they do with all their other fake/noop settings.
|
Continuing the discussion in jellyfin/jellyfin#9043 here.
As a quick recap, the underlying issue is that Jellyfin does not prevent Windows from automatically entering sleep mode after X minutes even when there are active streams. A decision was made to approach this issue in the tray app instead of the core. I have also written a proof-of-concept Jellyfin plugin here.
My question would be how to best incorporate a solution. The following ideas come to my mind:
Thanks in advance for your opinions.
The text was updated successfully, but these errors were encountered: