Skip to content
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

[Feature Request] Hibernate #57

Open
m1k1o opened this issue May 7, 2021 · 13 comments
Open

[Feature Request] Hibernate #57

m1k1o opened this issue May 7, 2021 · 13 comments
Labels
discussion Discussion topic enhancement New feature or request

Comments

@m1k1o
Copy link
Owner

m1k1o commented May 7, 2021

Considering, if it would be interensting, to have some kind of hibernate feature. It has already been discussed, that browser does not need to be running always, when neko is idle. It could "sleep" or just be hibernating. Meaning, Go serwer would run but all the pipelines (maybe xorg & pulseaudio) and browser would be shut down.

There would be a button (only for admins) that can "wake it up". Others could connect to neko, but they would be notified about it is "sleeping".

This would introduce much refactoring on the connectionl logic on client / server. Considering, if it is worth it.

@m1k1o m1k1o added the discussion Discussion topic label May 7, 2021
@mbattista
Copy link
Contributor

If I understand correctly you just want a possibility to stop/start the gstreamer pipeline on command?

@m1k1o
Copy link
Owner Author

m1k1o commented May 7, 2021

Not only gstreamer pipeline but also browser and WebRTC server.

@mbattista
Copy link
Contributor

Why also browser and WebRTC?

Stopping the pipeline would leave neko in the starting state, before anyone has joined and could save some cpu cores.
But the browser and the WebRTC server do not need that many resources?

If you e.g. stop an youtube video to watch later and hypernate kills the browser, you have to remember how far along the video you were.

@m1k1o
Copy link
Owner Author

m1k1o commented May 7, 2021

My motivation is to be able to disconnect users mainly from streaming video from my server, while being connected to chat. So you are right, no need to turn off browser.

If I have my deployment and I have some people, they are constantly pulling video from my server. Unless I turn off neko, they disconnect or I kick them. I thought about having some lobby, so people can be connected and chat while not receiving video data from server unless admin allows.

Another level of this would be to have this split between users and admins. So allow only admins to stream (logging in to accounts, typing some sensitive information) while users would wait in the lobby and after they will be let in.

@mbattista
Copy link
Contributor

Simple Solution: Stop the pipeline. All users stay connected and can chat, bandwidth and cpu-cyclen are saved. People see a black "placeholder" where the video should be.
Advantages: Quickly implemented, Sufficient for most cases

Complex Solution: Video does not autoplay. Instead there is an overlay which has to be clicked to join the WebRTC session. If no gstreamer pipeline is run, an different overlay gets put over the video until a video is streamed.
Advantages: Users have clean input, User initiate WebRTC session.

@m1k1o
Copy link
Owner Author

m1k1o commented May 7, 2021

I like the first solution, and I think, it could be indeed sufficient. That would create a new usecase: Truning only video pipeline off, so if you are just listening to music, you don't need to receive video stream.

@mbattista
Copy link
Contributor

This feature took longer then I expected and is still not finished.

It will still need a lot of re-code since it will now need to save all the peerconnections and corresponding websockets to reanounce SDPs after each change of track (removed audio / video). I will try to tackle #48 while I am at it.

@m1k1o
Copy link
Owner Author

m1k1o commented May 25, 2021

You can open a draft pull request and I can help with some tasks, if you want.

@m1k1o m1k1o changed the title [Feature] Hibernate [Feature Request] Hibernate Jul 23, 2021
@m1k1o m1k1o added the enhancement New feature or request label Jul 23, 2021
@Kinuseka
Copy link

I wonder if this is still being worked on? Its a very helpful feature.

@m1k1o
Copy link
Owner Author

m1k1o commented Oct 16, 2023

I don't think this is being worked on. It can be acheived by stopping docker exec neko supervisorctl stop google-chrome and starting docker exec neko supervisorctl start google-chrome. You could wrap it to a simple service and create custom button for that.

@Kinuseka
Copy link

Kinuseka commented Oct 16, 2023

I was hoping for an automatic hibernation when there are no more users on the room.

@m1k1o
Copy link
Owner Author

m1k1o commented Oct 16, 2023

That info can be received using /stats?pwd=<admin> endpoint. But yeah, it would be nicer if it would be part of neko itself. But the project is getting bigger and bigger, maybe it would be a good time to think about some plugins/addons. Where such logic could be easily added to neko externally.

@yesBad
Copy link
Contributor

yesBad commented Oct 16, 2023

I could write you a simple modified image that checks like each minute if a user is connected and based on that it will stop/start the browser, if you are interested @Kinuseka

m1k1o added a commit that referenced this issue Jun 23, 2024
* implement additional modifiers to xorg.

* xorg modifiers to API.

* update modifiers api & add ws.

* scroll pos rename to delta and add ctrl key.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion topic enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants