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

Asking for vnc support #101

Open
fish4terrisa-MSDSM opened this issue Jun 17, 2023 · 7 comments
Open

Asking for vnc support #101

fish4terrisa-MSDSM opened this issue Jun 17, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@fish4terrisa-MSDSM
Copy link
Contributor

Right now we have sdl and x11 supports, but maybe RVVM is run on a server with no screen,and both x11 and sdl is diffcult to stream through internet.And vnc support is also useful for me to add display support in archriscv-term(as I just need to add vnc module to archriscv-term).I have just tried Xvnc , but it`s too complex and has much performance cost.

@fish4terrisa-MSDSM fish4terrisa-MSDSM added the enhancement New feature or request label Jun 17, 2023
@fish4terrisa-MSDSM
Copy link
Contributor Author

Right now we have sdl and x11 supports, but maybe RVVM is run on a server with no screen,and both x11 and sdl is diffcult to stream through internet.And vnc support is also useful for me to add display support in archriscv-term(as I just need to add vnc module to archriscv-term).I have just tried Xvnc , but it`s too complex and has much performance cost.

Maybe we can use libvncserver

@LekKit
Copy link
Owner

LekKit commented Jun 19, 2023

Nice idea overall, two issues tho:

  • Pulling libvncserver will complicate loading librvvm and the build process overall. Crosscompiling it for Android will be an order of magnitude harder, certainly not as easy as just running make
  • VNC will be still noticeably slower than a native framebuffer renderer. It has to compress the image, send it over the (loopback) network, etc etc.

I will look into it, but be aware that having a native renderer for Android (via JNI or whatever) would be a lot better. I have seen examples of rendering a raw framebuffer context but didn't dig that personally yet.

@fish4terrisa-MSDSM
Copy link
Contributor Author

I have found the way to have a vnc server without libvncserver in the qemu code. They wrote a simple vnce server. The code is here. Maybe we can port that code to RVVM directly? (However, the code is a bit complex...)

@LekKit
Copy link
Owner

LekKit commented Jan 25, 2024

Is it possible to implement framebuffer rendering (from Java ByteBuffer) in android app?

@fish4terrisa-MSDSM
Copy link
Contributor Author

Is it possible to implement framebuffer rendering (from Java ByteBuffer) in android app?

I'm not much familiar with jni, may be there is , just like pelya's XSDL on android. However, Android jni and java code are just too unstable to trust (Many of the UI related codes won't work across various roms, and we have to deal with each different Android environment manually). It seems that even running an Xserver and sdl in an Android app won't cause much performance loss, so including a simple vnc server and bundle RVVM with an Android vnc viewer seems just fine. (Just as the code from qemu I mentioned above, it is possible to implement a vnc window layer for RVVM without libvncserver, and it will also benefit the users who run RVVM in docker or server)

@LekKit
Copy link
Owner

LekKit commented Jan 26, 2024

I am already working on a JNI binding for some other usecases, which might cover this usecase too (We just need to implement a GUI in java). This is why I am more interested in this approach rather than using some third-party app to share screen over network, and it will be faster, too

@LekKit
Copy link
Owner

LekKit commented Mar 16, 2024

See 3ad7e2f. I think it is possible to implement a native framebuffer GUI with this on Android.
To build JNI native lib, run make lib USE_JNI=1, then use RVVMNative.loadLib("/path/to/librvvm.so"); in Java

This is WIP but overall it captures my idea of using librvvm from Java. Any lacking feature can be added.

To render the framebuffer, call Framebuffer method getBuffer() to get a ByteBuffer. It's contents are technically shared memory between Java and RVVM display.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants