-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Adding GLES/EGL support to Termux apps #2107
Comments
Termux apps are apps built for Termux, like cmus or termux-wake-lock. Firefox is X11 app, it means it is hardware acceleration-enabled if running Xorg supports GLX. Termux have no Xorg support yet but I will write xorg-video-android driver when libcw(*1) will be tested and improved. I have already ported Xorg(*2) to android, but it is unusable without video output library. libgui supports video output but it is sdk-dependent and can not be used in non-Java userspace apps without hacks or AOSP-prebuilt binary blobs. So I will just improve libcw, then I will write xorg driver. And this Xorg will be usable inside chroot with DISPLAY=:0 environment variable. It will behave like XServer XSDL but it will be much faster. And only then I will add GLX support to that server. Something like this. |
@fornwall I need you to implement window listener in Java side. I can create JNI-bindings to make this lib openable by Java or you can write something like JNI-dlopener for the app. |
X11 server is Xorg. Xorg running in chroot or LXC uses glibc and it can not use Android libraries such as Android libEGL.so or Android libGLESv2.so.
Look at sparkle driver. It renders image to the tmpfs and Android app draws it to the screen. It can not draw to the screen without Android app and can not use hardware acceleration. My solution will use the hardware acceleration without any bindings.
It would be much slower than software acceleration.
And than I found a way to not use Android app... |
It needs libGLESv2 and libEGL in chroot or LXC container too. The same problem as with Xorg. And XWayland + Wayland will be much slower in this case. |
I have updated the lib git. |
Looks like this lib can solve this issue. |
@fornwall I think it is ready to be integrated. I need only the activity/GLSurfaceView to be integrated into Termux code and I will be able to improve it. For now the only things needed to be adapted are JNI functio names to match JNI expectations (Java_com_example_SanAngeles_DemoRenderer_onSurfaceCreated -> Java_com_termux_libcwRenderer(?)_onSurfaceCreated) |
any news on this? |
What about libhybris |
No news. Libhybris is just android libc + library loader + some android library wrappers. We do not need to use external bionic and loader because termux uses device's bionic implementation. The only things we can use are wrappers but without universal API for hardware buffers or native windows they are completely useless. So we can not use GLES for rendering separate windows, only the whole screen. That is the reason we can not use EGL/GLES for X11/Wayland apps. |
Moin @twaik |
@RalfWerner the app should be signed with the same key as Termux::App is. |
@twaik I think signing is not the problem, because otherwise I would not be able to install the app, but it worked in the real and emulated device in the termux environment. Only in ubuntu not!
Then |
@RalfWerner how did you install Ubuntu? Using proot? The server creates server socket only in Termux's environment, not Ubuntu's one. |
yes! What would be an alternative? Are you interested in install script? |
@RalfWerner even if it will be available to be used from Ubuntu you still wont be able to use Ubuntu's EGL/GLES implementation. Android has different graphical subsystem structure. |
But if you start Xwayland in Termux you will be able to use it from Ubuntu. Using "export DISPLAY=..." |
That was my first unsuccessful attempt here again:
|
I don't see where
Make |
aterm is the XClient from termux. It won't get any better if I finish it. env is in ubuntu the same as above. I try
But with your change suggestion in |
@RalfWerner you did not export DISPLAY |
For now I am spending all the time at work and don't have a time for development. In a month I am joining IDF, so I won't have a free time. |
@seisdr let's be respectful |
@twaik Good for Israel but bad for termux - how sad! I read 3 years are common. I wish you success as well as God's support and protection for the time. You are apparently still young and very busy, while I'm old and have too much time - deal with A-Studio :) Can you or @xeffyr give me a tip on how to fix this? |
Uninstall all addons & previous Termux app before installing a new one. You are using a different signature key. |
How can it be? I've installed both APKs one after the other with Studio today and previously uninstalled all termux APKs from the R11 emulation - should I repeat? |
termux-x11 does not use our shared development key. As result, termux-x11 will have a key different from which is used by termux-app and other addons. See https://github.com/termux/termux-app/blob/master/app/build.gradle#L34 for more information. |
Thanks @xeffyr for the tip. Both apps use targetSdkVersion 28 (see shot above) In addition to x11, I also use the plugins Widget - already contained the
Compared to my previous checks with
Addendum to the PID3 start: In the meantime I became successful (five shots below). |
Crash log is needed.
Termux:API is not normal app and don't have default activity.
I have added keystore and config recently, so do |
As described in Addendum to the PID3 start X11 in api28 works satisfactorily for a Studio emulation. I would repeat that if
As described above, I test real devices (shot1: Termux:API 5.18 MB =api28) and emulations in Studio (>=api29). Because of Error in shot4 I can not do this here - what to do?
Your patch I've done in same way. My question was whether only one instead of four |
You need to install Termux:API but not run it. Its a plug-in package and not app. Regarding key - it is one for all APKs. Just added in per-repository mode. |
Hello there. As I mentioned here I found a way to share Android Native Window between processes. The library is here.
Some details of the implementation (the most important):
ANativeWindowBuffer
s with a set of some methods manipulating them.About integration: for now the output program uses libgui to draw image to Surfaceflinger directly. It draws the shared window on top of other windows. That is a problem. The integration into Termux apk is necessary. I think the app should scan some folder for new UNIX-sockets and open windows the termux apps can bind to (like the button "New session" and bash).
The text was updated successfully, but these errors were encountered: