gujjwal00 / avnc

VNC Client for Android
GNU General Public License v3.0
660 stars 59 forks source link

Feature request: Turn off video completely, only keyboard/remote control mode as a server option. #154

Open barkoder opened 1 year ago

barkoder commented 1 year ago

Basically the Image quality slider going all the way down to No Image

I'm a bit further away from the monitor, but it's still in front of me, and I want to be able to control the media player running on my PC via AVNC.
But I don't want to tax the CPU of my phone with AVNC displaying and processing the video that's being played.
I just want a black screen with a keyboard, so just the inputs get forwarded.

Thanks!

gujjwal00 commented 1 year ago

The situation is much more complicated here.

Easiest option is to stop rendering the frame, but it won't help with CPU/Network usage as all that work still needs to be done in background. If we stop framebuffer updates entirely, it breaks a bunch of other stuff (e.g. cursor updates, frame resize, extended key events etc) because these are implemented as "pseudo-encodings" in RFB protocol.

Even if that was acceptable, a simple black screen is not going to be ideal experience for remote control. You will need touch feedback, probably more virtual keys, special handling of zoom etc.

IMHO, you should try apps dedicated to this particular task (e.g. some apps can act as a Bluetooth keyboard/touchpad).

barkoder commented 1 year ago

The bluetooth driver for my linux laptop doesn't work. It's never worked. And Bluetooth dongles don't work either.

VNC over WiFi, does.

So VNC is what I use to control it.

You mentioned a few things that implementing this would break?

I'm curious, is there a reason for why a cursor might need to update on a black screen, because I wouldn't even need to see the cursor?

I would've thought that it would be okay if this breaks?

Frame resize - Do you mean the pinch to zoom and unzoom? Or do you mean the resizing that happens when AVNC downscales/upscales the frame to fit a given Android screen?

As a potential solution, and please pardon me if I sound stupid proposing the following sentence as a solution but, is it possible, during this hypothetical "remote control" mode, for AVNC to create like a resizable black dummy frame that's generated on device instead of passing through frames from the server, to stop "frame resizing" from breaking?

Extended key events - I presume this means Ctrl, Alt, Shift, Insert etc.?

If so, yes, this is important to me. This cannot break.

Even if that was acceptable, a simple black screen is not going to be ideal experience for remote control.

It doesn't have to be ideal, I only need wifi keyboard(using VNC or some other open protocol) to type into a terminal that I'm in front of. To use and control mpv and any other media player, without draining my phone battery.

Instead of the slider going all the way down to blank, that I proposed in the OP, you could even have it as a separate button in the server options as "Remote Control Mode (Experimental)", with an (?) beside it, stating precisely what the trade-offs of this mode might entail for those who choose to use it?

If I want to switch to regular mode, I'll create a new server profile, with screen pass through(regular non-remote control mode).

IMHO, you should try apps dedicated to this particular task (e.g. some apps can act as a Bluetooth keyboard/touchpad).

I've looked, but I've found none.

Not even closed source ones, let alone FOSS.

The few that exist ask me to install some non-VNC proprietary service that's always incompatible on my Linux Desktop.

The solution that comes closest to what I need is Weylus' "Energy Saving mode (no video, black screen)".

But there's no keyboard Input. Only Mouse, Stylus and Touch.

Unfortunately the Weylus project has had no new release since 31st Oct 2021. No commits since 6th Aug 2022.

If you or anyone else reading this finds a better solution that works over WiFi(ideally FOSS), please do let me know, I'd appreciate it.

Thanks!

gujjwal00 commented 1 year ago

I'm curious, is there a reason for why a cursor might need to update on a black screen, because I wouldn't even need to see the cursor? I would've thought that it would be okay if this breaks?

It can also affect the cursor position, but you are right, this probably won't be a big issue.

Frame resize - Do you mean the pinch to zoom and unzoom? Or do you mean the resizing that happens when AVNC downscales/upscales the frame to fit a given Android screen?

As a potential solution, and please pardon me if I sound stupid proposing the following sentence as a solution but, is it possible, during this hypothetical "remote control" mode, for AVNC to create like a resizable black dummy frame that's generated on device instead of passing through frames from the server, to stop "frame resizing" from breaking?

Together with zooming in client, it also concerns screen resize on server.

Extended key events - I presume this means Ctrl, Alt, Shift, Insert etc.?

If so, yes, this is important to me. This cannot break.

It likely won't break, but some key/shortcuts may not work with some servers.

It doesn't have to be ideal, I only need wifi keyboard(using VNC or some other open protocol) to type into a terminal that I'm in front of. To use and control mpv and any other media player, without draining my phone battery.

Instead of the slider going all the way down to blank, that I proposed in the OP, you could even have it as a separate button in the server options as "Remote Control Mode (Experimental)", with an (?) beside it, stating precisely what the trade-offs of this mode might entail for those who choose to use it?

If you are willing to accept tradeoffs, I can add an experimental option. But please note that this mode opens up many new features/extensions which I am not willing to implement.

If you or anyone else reading this finds a better solution that works over WiFi(ideally FOSS), please do let me know, I'd appreciate it.

MultiVNC has a very nice Touchpad mode. It does exactly what you are asking here.

barkoder commented 1 year ago

I had already tried MultiVNC. But after your recommendation I tried it once more. It doesn't have this feature.

Setting Quality Level to 0 or None doesn't stop frames from being passed through.

I don't see any option for a blank black screen?

Maybe I'll open a ticket on on MultiVNC's issues page.

If you are willing to accept tradeoffs, I can add an experimental option. But please note that this mode opens up many new features/extensions which I am not willing to implement.

Yes please! I understand. Thank you!

gujjwal00 commented 1 year ago

I don't see any option for a blank black screen?

  1. Connect to a server
  2. Tap on green hamburger menu (≡)
  3. Tap on 'Toggle View'
userw2891 commented 1 year ago
userw2891 commented 1 year ago

And not the last this is a VNC client not a terminal for commands to server... so video should be always enabled.

This issue shold be closed, as user request is totaly unresonable, try to ask for a feature so he can use an app that is not intended to be used in that way.

nahuhh commented 1 year ago

This issue shold be closed, as user request is totaly unresonable, try to ask for a feature so he can use an app that is not intended to be used in that way.

I 100% disagree. Blank/black screen saves a LOT of battery power and (i assume) bandwidth. i very, very often use vnc as a wireless mouse and keyboard.

i use KDECONNECT for certain use cases, but avnc's mouse is superior to any other ive used.

+1 to adding an feature that lets you set the screen quality to blank.

PureIncompetence commented 1 year ago

IMHO, you should try apps dedicated to this particular task (e.g. some apps can act as a Bluetooth keyboard/touchpad).

I've looked, but I've found none.

Not even closed source ones, let alone FOSS.

If you or anyone else reading this finds a better solution that works over WiFi(ideally FOSS), please do let me know, I'd appreciate it.

Thanks!

@barkoder KDEConnect, which @nahuhh already mentioned, contains exactly what you were describing with its "Remote Control" option. Remotely contolling mouse and keyboard works perfectly fine. I'm using it for exactly the usecase you described. Its completely FOSS (client and server). If you're using gnome on your linux box there is GSConnect, which implements the kdeconnect protocol for gnome (didn't use that yet though).

gujjwal00 commented 1 year ago

Here is my opinion so far:

Thanks.

barkoder commented 1 year ago

Thank you @nahuhh and @pureincompetence for the suggestions! I will check them out.

Thank you for the help with MultiVNC @gujjwal00 . Yes, that works as intended. But no option to set that permanently as a "profile". I'll see about raising an issue over in the MultiVNC issues page.

Yes, as you will simply be able to push AVNC in background when not needed to conserve battery. If this is enough for you, please let me know.

While this would still be more clicks than I'd personally like, I think this should be good enough my phone's battery.

However, at least currently(v2.2.1), the keyboard gets auto-hidden whenever I push AVNC to the background and come back again. In this hypothetical experimental "remote control" mode, it would be rather tedious to have to bring up the sidebar every time and pull up the keyboard, just to hit a couple of buttons.

Basically, could you make it so that if keyboard was open when AVNC got pushed into the background, then the keyboard should automatically show up if AVNC is brought back into the foreground. I also think that this should be the case even in normal mode.

Thanks again!