Asking for vnc support
fish4terrisa-MSDSM opened this issue · 7 comments
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.
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
Nice idea overall, two issues tho:
- Pulling
libvncserver
will complicate loadinglibrvvm
and the build process overall. Crosscompiling it for Android will be an order of magnitude harder, certainly not as easy as just runningmake
- 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.
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...)
Is it possible to implement framebuffer rendering (from Java ByteBuffer) in android app?
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)
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
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.