-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Running X11 apps in Termux #3535
Comments
wow |
Fantastic! How can I install this on my mobile? |
amazing! It may works, but most software has no graphics hardware acceleration on android ( opengl vs opengles ). I hope wayland could be a direction. |
It does not work well. I did not write KeyEvent JNI wrapper and Xorg segfaults for some reason. I think it segfaults because I am no good with my hands.
It does not use graphical acceleration. It is not a Wayland port to Android. It is Xorg with modified xf86-video-dummy driver. It sends image's Ashmem region handle to the NativeActivity and outputs it to the screen using GLESv2 shader. Xorg and it's clients do not have hardware acceleration support. |
If I interpret your screenshot above correctly, you have an Xserver running inside the Termux app, with a HOME window and two widgets below. If that is not a collage, then does it work. Maybe not well but the first time - that I see! |
It works outside Termux application. It is a standalone Sparkle application with some improvements and custom layout support. NatieActivity does not support custom layout so I added it using libandroidjni.
Openbox an Pcmanfm are running inside chroot and connecting to the Xorg using sockets.
Keyboard and settings buttons? That is my attempt to add custom layout to the NativeActivity.
It does not work well.
As I said before it is unusable. For now I cloned termux-app and x11-packages. I think that using Termux build system I will fix segfaults and some other mistakes/errors/etc. |
Ok then I misinterpreted that. The spakle app, I found neither in GooglePlay nor in F-Droid and the operation of X11 packages would then be comparable to XSDL or Xvnc - right? |
I did not. But.
Sparkle does not compress image because we do not use network and do not block server while uploading an image to the screen. |
I'm still trying to understand what you did? In my words: Your screenshot above came from your Sparkle-App, which you got with Then you have launched a Xclient (your file manager) from the Termux app (with a PID), which then communicates via the Xprotocol with the Xserver of your Sparkle-App to show the Display (as in your screenshot). So far still right? If so, I would have the question of Xprotocol exchange between the two PIDs (XOpenDisplay 1st step)? (you call it X11) As a rule (not in Termux), the startx script is executed on Linux boot, after that there is a Xserver (builtin PID). In XSDL and Xvnc or on a remote computer (sshd), this is done via env |
https://github.com/twaik/android_external_xorg_server
Xprotocol = X11. Yes.
No. My app behaves just like XSDL or Xvnc (via export DISPLAY=:0). |
Looks like it works with Termux's xorg-server (x11-packages/disabled-packages for now). |
Or context menu. |
@twaik To "it works outside" above: In the Xvnc.sh a Xvnc-PID (start vcnserver) is assumed. Again, portrait/landscape rotation not is possible (but not distorted). Between Xvnc and the RealVNC-APP (outside blue) there is an other client/server dialog, which means that only part of the XEvents arrive in Termux and Is your solution Xspakle-APP (outside) and Xorg-PID in the same way or comparable? |
Sparkle works a bit different way.
If the server's Unix socket will be in Termux's folder it will be accessible for Termux's programs and we won't need TCP sockets for the apps. It will improve perfomance. May be a bit but it will. |
Sorry @twaik - I'm a bit stupid. The other three widgets are used to install (F-Droid) additional APPs and launch the two outside XServers. |
@RalfWerner Sorry, English is not my first or event second language so probably there is some misunderstaning.
Xorg can be glibc- or bionic- built. It is no difference. Sparkle's author has written it to be used with glibc container inside Linux Deploy app to not build Xorg with application with bionic. I've ported Xorg to bionic for using it inside apk (app built this way does not require external Xorg and manual driver building inside glibc container). It is much faster than Xvnc because it does not compress image or send image fragments via sockets to output image to the screen. And it does not require SDL to output image. It uses only Android and Xserver elements without any other dependencies. |
@twaik Misunderstandings can be clarified by queries - so thank you so far. I could check this only when this action is completed right? On my mobile phone I have Termux:API and Termux:Widget installed (above). Then comes Termux:Sparkle or how did you test it? Ps.: My mother tongue is either not English. In a chat with Leonid last year you specified Одеса as your home but in your profile is ירושלים |
Yes.
You can try to build it on your own.
PS: I moved to Jerusalem this year. |
@twaik Living in a holy city - nice. To: "But it segfaults*) for some reason. @xeffyr tries to handle it." Unfortunately, I have little experience with github repos / docker / travis-CI / build / bintray etc and never install APPs outside of GoolglePlay or F-Droid. *) segfaults call for solutions and take time and patience. I am a pensioner and have both. |
Some hours with building xorg-server package. |
Okay - more than I expected. |
For some reason I was building all the packages, building xorg-server and sparkle from scratch will take something about 30-45 minutes. You can post message here if you found something. |
30 to 45 minutes are better. First, I suspect I have to download the necessary sources to my phone (with |
You need only the repos I mentioned. x11-package will download sparkle sources. |
@twaik The My Termux app has 800Mb and should not overwrite, so I have the classic Installation made via GooglePlay on another phone. The app is then 620Kb and 10.6Mb after first opening. You have https://gitter.im/termux/dev ask to help with segfault-debuging. I hope you get it! Before I can contribute something I have to increase my knowledge and in the coming days I have little time. |
As I said before everything you need are x11-packages and termux-app. android_external_xorg_server is my attempt to build Xorg with AOSP.
Then you will need to create local apt repo with termux-apt-repo and add this repo to $PREFIX/etc/apt/sources.list. Then xorg-server and sparkle packages will be available to install via Termux's apt. |
Posting here prebuilt app, xorg-server and sparkle packages,
P.S. It more like demo. Any other implementations of X server have more usability. |
Thanks both of you Then I tried the cp / built* proposal of @twaik above - execute with:
and have "read me". This ERROR is understandable because of What I've to do with the two files (demo is good) from @xeffyr ( |
Android doesn't store logfiles if install failed. But you can view error message if installing with ADB, for example you can get something like:
- message shown above means that signatures between main app and addon incompatible.
No, https://github.com/its-pointless/gcc_termux is managed by @its-pointless. |
Thanks, with
what will be new now? Xorg is still from March! I've checked again your example as above described and compare with your So far you have done a fantastic job (more than in your *.mp4) and most (no plugins possible) of my wishes (above) implemented. Many Thanks. A segfault (with msg - like in your *.mp4) I could not produce so far (I keep on testing) but often I get a "black screen" (bm) e.g. when I switch by LEAVE in Termux and then try to switch back to Xorg. The processes, however, all remain last shot. KEYBOARD button is lost after first use!? Do you have the same behavior? continue bm testOnce the blackscreen mode (bm) is reached, I can not finish it without killing Termux itself! - you?
In total, |
Dear specialists, |
@JanuszChmiel Firefox is my favorite browser, and the Bluetooth keyboard has no limits. My enthusiasm for KB in Xorg referred to the option of displaying an "On-screen KB". The implementation in X-protocol does not work, just like all other external KB do not produce XEvents. Specialists are @xeffyr and @twaik and maybe you? I know a lot about X11. But much of the Android / repo / package / architecture management is still alien to me and I can do it only limited self. |
I have also testet stable dummi driver. In this case, all Xprotocol
functions are supported but keyboard and other input can not be used.
Orca screen reader have started but it did not have keyboard feetback.
Xserver XSDL works, but switching between windows from Termux or other
window to Xserver makes it unstable.
|
My research of XInput in the recommended Xserver has been described above, e.g. here and in Addendum to segfault. I do not know what is "stable dummi driver" and "Orca" does not seem to be a contributor to "X11 on phones". But I tested (check.c) again under the Bluetooth KB-aspect the Xserver: Xorg(PC), XSDL and Xvnc. In all cases, all XInputs of the KB will be correctly interpreted on the mobile/PC, if the corresponding pairing is used. Then the "on-screen KB" disappears and appears again after "decoupling". @xeffyr As next step I would like to test on a arm device (2) with |
@RalfWerner Resigned termux-app and termux-api: |
@twaik @xeffyr - You had announced soon a Termux version with lorie Xserver will ready for test. Could you please prepare a lorie |
I'm new to Termux and I recently got X11 to work. While X forwarding is working, it's kinda slow. Has anyone tried compiling Xpra to work in Termux? Just curious if this is even possible. |
Wouldn't a split screen work on mobile? I'm still learning |
You can try using this app: https://github.com/nwrkbiz/android-xserver |
Sounds interesting although i tried running XFCE within that app and got weird results, some GTK3 applications works fine (gtk3-demo), and other applications didn't |
This new X11 server is really very promising. I will also test it. I have found some old Java X11 server, but it was very little .apk and it did not supported XKB extension. I will test, if XKB extension is correctly implemented in this app. If no, I will try to kindly open some issue on Github page of this project, because it seems to Me, that programmer of this app is smart and he know what to do to make good X11 server for Android. I like it, because Pulseaudio is not included as like in Xserver XSDL, so I can use better variant of Pulseaudio sound server made for with Termux.
|
The XServer from @nwrkbiz is a fork of mattkwan. This, as well as XSDL, I have currently excluded as an alternative (3rd choice). My last checks to X11 are described here. @twaik currently serves in Israel and I hope he then works on it again. The X11 plugin is currently working as a service with notification in which preferences can be set. @wmcb-tech I recommend currently to use Emulate mouse or for VNC injured possibly also Emulate touchpad. The Direct mode (default) is currently susceptible to fault, but allows multi-touch and the other two are very stable. I often use X11 in split mode on devices that can and even better in PiP mode, which is very simplified interaction with Termux and proot-distros. |
I tried to fix the whole keyboard layout. All keys and shortcuts of the english layout are working using the "hackers keyboard" app (or external input devices). Also I tried to implement a "shared clipboard" functionality, which allows to copy texts between android and x11. A simple window manager (flwm) is also included. As already mentioned this is an fork of the darkside (mattkwan) xserver. The X11 protocol is quite complex and this app only implements an subset of features. Up to now only simple applications will work properly. (I mainly use this project to port FLTK based programs to android) |
I believe you. So do you think, that I should try to install Hackers keyboard? It is true, that when I AM using other keyboard, Talkback do not inform Me about various keys letter under my fingers. So may be, that XKB module do not work, because non supported keyboard is being used.
Or is it necessary to make some special gesture to display keyboard inside X server window?
True is, that Pluma text editor work. I will also try to run Marco window manager standalone.
Or is it necessary to click on some symbol to have keyboard wisible inside X server window?
|
Unfortunately, I use a mobile phone with Android 8 |
@sweetman135 I use for X11 (plugin) and Xvnc (2nd choice) with Android 8-11 devices and have not found any problems yet!
@nwrkbiz I have checked your XServer again but found no significant improvement to the test of 18. Apr. 2019. Your APK=13MB is larger as X11=7MB and smaller than VNC=30MB. The XClients (I use very simple once, as However, KB support now exists compared to the check two years ago and Split/PiP can be used as in X11. In parallel with Termux working is hardly possible except for PiP. Also a common use of KB for_ XServer+Termux+proot-distro is impossible. All configuration actions (but also many others) lead to the crash or a stalled mode. In this state your Java XServer would be after XSDL=91MB my 4th choice. If it is not important for you to be independent of Termux, I urgently recommend you to use one of the three better ones. |
@fornwall , @Grimler91 , @xeffyr , @its-pointless . I think it would be interesting for all of you.
Hi there! I have some thoughts about running X11 apps in Termux. Here we have Xorg server package. We can use it with Sparkle driver. For now I have sources that use Ashmem for buffers (original sparkle uses SysV SHM) and JNI calls for MotionEvents + libandroidjni. My xserver inside activity segfaults for some reason and I think it is because I am not so cool to handle it in the right way.
Details:
Sparkle needs it's own activity to work. Activity communicates with Xorg via Unix socket. It can be placed inside Termux filesystem.
libandroidjni and JNI MotionEvent wrappers are needed to use both NativeActivity and custom views in one normal activity.
Everything we need is :
As I said before I have APK that works, but I think it is unusable without comfortable user interface like XFCE/LXDE. Or we can just use lxpanel + main menu plugin for graphical menu.
Thank you for patience.
The text was updated successfully, but these errors were encountered: