Closed twaik closed 4 years ago
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. I am a noob but I very bump up this project.
Fantastic! How can I install this on my mobile?
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.
amazing! It may works, but most software has no graphics hardware acceleration on android ( opengl vs opengles ). I hope wayland could be a direction. I am a noob but I very bump up this project.
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! What should/could I do for it on my smartphone?
running inside the Termux app
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.
with a HOME window
Openbox an Pcmanfm are running inside chroot and connecting to the Xorg using sockets.
two widgets below
Keyboard and settings buttons? That is my attempt to add custom layout to the NativeActivity.
If that is not a collage, then does it work
It does not work well. What do not work for now (or not implemented):
What should/could I do for it on my smartphone?
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? Have you already made such a comparison?
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 git clone https://gitlab.com/mogryph/sparkle.git
and merge it with the xorg-server
sources from the package in https://github.com/termux/x11-packages/tree/master/disabled-packages from xeffyr (your links above) to your local APP and start it. So you have running a Xserver (with a PID) on the phone. As far as right?
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 DISPLAY
. How is this in your solution?
In my words: Your screenshot above came from your Sparkle-App, which you got with git clone https://gitlab.com/mogryph/sparkle.git and merge it with the xorg-server sources from the package in https://github.com/termux/x11-packages/tree/master/disabled-packages from xeffyr (your links above) to your local APP and start it.
https://github.com/twaik/android_external_xorg_server
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?
Xprotocol = X11. Yes.
If so, I would have the question of Xprotocol exchange between the two PIDs (XOpenDisplay 1st step)?
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).
@fornwall Image output needs one NativeActivity inside termux-app and one native library inside apk. And the way to start it (i.e. button in the drawer).
(i.e. button in the drawer).
Or context menu.
@twaik To "it works outside" above:
In the following picture are the APPs (widgets on my phone), which are currently necessary for an X11 client process mpv-x
with Xsdl.I have started a stand-alone Termux app (black with .bashrc
) and then manually changed the name in Navigator.
First, then the "6-second-XSDL-APP" (green) must be started (here portrait and outside). Then I started with Xsdl.sh and Xvnc.sh in Termux-Widget (are automatically entered in theNavigator but without
.bashrc
). To display the mpv-x
video, I select the XServer-APP from the APP list manually.
If the phone is rotated to landscape, the output will be distorted. The DISPLAY=:0
would be possible here, but the correct is value displayed in the XSDL start.
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 DISPLAY=:1
(5901 in the (outside APP) is required (recommended @xeffyr).
Furher issues to the same topic: https://github.com/termux/termux-app/issues/978 and https://github.com/termux/termux-api-package/issues/44
@fornwall A really big step would be the solution without outside APP by using the display of Xorg.sh directly from Termux. This would eliminate the tedious and frequent manual selection from the APP list.
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. In my picture above are several APP's on the start screen of my smartphone. The two blacks use the same APP (Termux with navigation drawer to switch between up to 8 shells)
The other three widgets are used to install (F-Droid) additional APPs and launch the two outside XServers. There's probably another Sparcle APP widget on your startup screen, right?. If so, is the reported screen then part of this Sparcle-APP or Termux?
@RalfWerner Sorry, English is not my first or event second language so probably there is some misunderstaning. Sparkle is not XSDL or Xvnc or something. Sparkle is consists of 4 parts:
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. The only two things needed to output image are place to put socket that is accessible to both Activity and Xorg and NativeActivity. I can modify Sparkle to use SurfaceView if it really needed so it can be used to provide GUI to every terminal tab (with it's own Xorg launched). But for now Xorg segfaults for some reason when it tries allocate memory. That is why Sparkle is unusable for now. @fornwall can add activity (1, 2) without launcher icon and native library to make Termux using Sparkle. Using activity with native library I wrote allows us update Sparkle or Xorg code without updating termux-app code. Activity can be launched with command or by libX11 on XOpenDisplay call.
@twaik Misunderstandings can be clarified by queries - so thank you so far.
I have understood your explanation so far: Xorg runs inside Termux (like Xvnc demon) and your two *drv.so files stored in u/lib
(for me isln -s .. / usr u
in .bashrc
) and Xorg
are in u/bin
and SparkleActivity
is used by @fornwall as part of an approved Termux APP . As far as right?
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 ירושלים
As far as right?
Yes.
I could check this only when this action is completed right?
You can try to build it on your own. https://github.com/twaik/x11-packages https://github.com/twaik/termux-app But it segfaults for some reason. @xeffyr tries to handle it.
with Leonid last year you specified Одеса as your home but in your profile is ירושלים
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."
I know! That's why he moved xorg-server
to disabled-packages in December (before I could download it with pkg install
) and marked my requests aswontfix
. But he is really very busy and I can understand that he has to prioritize.
Unfortunately, I have little experience with github repos / docker / travis-CI / build / bintray etc and never install APPs outside of GoolglePlay or F-Droid.
Based on the information in this issue - How much time would you need to create a Termux-APP with Xorg
and SparkleActivity
(e.g. with start of aterm
) on your phone?
*) 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. If you hope, I could help you with the segfaults solution contact me privately, otherwise I'll wait until @fornwall has integrated your updates above.
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. @xeffyr told me that it can be compiler bug. Or it is something wrong with xf86-video-sparklei driver.
30 to 45 minutes are better. First, I suspect I have to download the necessary sources to my phone (with git clone
) and start the build / make processes. Above I found three twaik/* repos (you see I miss some basics). I will try this tomorrow.
You need only the repos I mentioned. x11-package will download sparkle sources.
@twaik The git clone
download was successful with129Mb (8.1Mb: termux-app, 32Mb: x11-packages and 90Mb: android_external_xorg_server) the timestamp will not be applied.
https://github.com/termux/termux-app is the same repo as yours with the exception of your updates (above). So with the source a Termux app with your extensions could be generated - but how?
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. The README of the repos contains no information how to do it with this source (instead of GooglePlay) or I've not found. Could you give me a hint?
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.
and 90Mb: android_external_xorg_server
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. Classic installation will not help you, you need to build my source with Android SDK. Build instructions are available in termux/termux-app repo, but you need to clone repo recursively and copy x11-packages/packages to x11-packages/termux-packages/packages, then
cd x11-packages/termux-packages
./build-package.sh xorg-server
./build-package.sh sparkle
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,
Application: app-debug.apk.gz
AArch64 Xorg/Sparkle: xorg-sparkle-aarch64.tar.gz
ARM Xorg/Sparkle: xorg-sparkle-arm.tar.gz
P.S. It more like demo. Any other implementations of X server have more usability. Regarding segfault, I wasn't able to reproduce it on AArch64 version, but it always happens on ARM if you many times click on window's header.
Thanks both of you
I have tested the versions uname -m
of my available devices. This is: X86-64 (debian PC), i686 (moba PC), aarch64 (huawei - here I like to test Xorg) and armv81 (samsung of my wife - there I'd, installed Termux yesterday - above).
Probably my questions seem very stupid, because they are your "daily bread" - unfortunately not for me, specifically for Android I know only the user perspective.
The files you specified above (except *arm.tar
) have been saved on my huawei, analyzed with mc and clone the packages
repo_ (90 Mb).
Then I tried the cp / built* proposal of @twaik above - execute with:
[~/sd/x/x11-packages/termux-packages]$ bash build-package.sh xorg-server
ERROR: On-device builds are not supported - see README.md
and have "read me". This ERROR is understandable because of uname -o = Andriod
. in scripts/build/termux_error_exit.sh
. What does that mean for xorg generation on my phone?
What I've to do with the two files (demo is good) from @xeffyr (mv ..., tar -x...
) to use them (aterm/fluxbox on display) on my phone?
Using termux build system on-device is not supported. Termux is not selfhosting and likely never be.
Isn't statement
ERROR: On-device builds are not supported - see README.md
clear enough ? It applies to all repositories that use termux-packages build system.
What I've to do with the two files (demo is good) from @xeffyr
Dowload https://github.com/termux/termux-packages/files/2999878/app-debug.apk.gz, extract it with gzip -d
or gunzip
and install. It is APK (android package) file.
Download https://github.com/termux/termux-packages/files/2999879/xorg-sparkle-aarch64.tar.gz (only aarch64 devices) file and extract it with tar -zxf
. Enter folder "aarch64" and install *.deb files with dpkg -i
. You may need to run apt -f install
to install missing dependencies.
Open Termux and type command Xorg
or Xorg -verbose 10
.
export DISPLAY=:0
and start your X11 programs.
Click on button "back" (!!! not home) several times to exit termux.
Type on icon with label "Sparkle" which will appear if you installed modified termux application.
Sorry still unclear where the action takes place!
Clear is README.md (not selfhosting) so I've obviously misunderstood a question / answer (is phone sufficient) from you last month. The two Downloads I've already done above (The files you specified above (except *arm.tar) have been saved on my huawei) but on the wrong place?
So I need two devices (PC and mobile phone). All of the actions described above are "Linux" (I know it well and I understand it). With exchange between the devices I've also no problems. Only which files on which device has to store (excanged) where to have the modified Termux application?
Instructions from my post above (https://github.com/termux/termux-packages/issues/3535#issuecomment-475966623) is for Termux only.
APK can be installed with file manager, just make sure that it is gunzipped (i.e. no *.gz compression anymore) then click on it. If you see warning about unknown sources, go to Android settings/security and tap "allow unknown sources".
*.deb files installable with dpkg. Example dpkg -i /sdcard/mydebpackage.deb
.
So I need two devices (PC and mobile phone)
As I wrote above, all tasks with download and installiation should be done in Termux. But you can use PC to download necessary files and send them to device, but again installation should be done within Termux.
Forget to mention that before installing modified Termux application you will have to uninstall previous. Just different signature.
Am I to assume the Sparkle/Termux apk is limited to Arm/Arm64? It would not install on my x86_64 android 7.1 device? System information: Linux localhost 4.19.27-primeos #1 SMP PREEMPT Tue Mar 12 12:21:56 IST 2019 x86_64 Android Termux-packages arch: x86_64 Android version: 7.1.2 Device manufacturer: Dell Inc. Device model: Inspiron 15-3552
Very interested in Sparkle.. Been working with Xpra to output X as html5 to work around full screen only XSDL.. Do you know if Sparkle will be able to work with Android Application Window managers commonly found in Android-x86.org builds for PC? See my Desktop Screenshot.
Do you know if Sparkle will be able to work with Android Application Window managers.
No. Sparkle used to display video output from Xorg. Assume that it is similar to XSDL.
Thanks, It's a shame none of the x-server solutions other than Xrdp or Xrpa can run in a window. All others are full screen only. I would really like to know what the author of AndrOpenOffice used as well as Wine for android used for their port. I'm trying to get Android Studio for linux to behave better on Android PC platforms..
@MrJinx123 I think that AndrOpenOffice uses https://github.com/eugals/GTKAndroid . Wine for Android uses its own window system and output implementation. Exagear Desktop uses its own X11 server, but the do not want to open sources.
Hi Twaik, Leonid,
The description for installing app-debug-apk was good, but did not work on my phone (1). Here are some screenshots to clarify what I tried: from left to right:
(1: left) is what my file manager looks like with my german mobile phone. Besides that of my mother (2: Motorola arm71) and my daughter (3: Huawei aarch64). I already mentioned that to my wife above and it behaves like (2) with the same arm architecture. In all cases, the safety checks had to be switched off. Except for (3) the installation was nevertheless refused. Apparently the architecture is not suitable?
In the penultimate column you can see the two icons of Sparkle (not executable) and Termux (3:send by WhatsApp and tap on appendix - but is not my phone), below the dialogs are nevertheless ("allow unknown sources") at the end not installed. End of column are my API and Widget extensions . @xeffyr recommended above to uninstalled Termux (with the 800Mb of the last 6 months) - done without effect. Then I've uninstalled extensions too, reboot (now - Termux-free phone?), and tried again to install your app - unfortunately still without success - why or where can I found log to the broken install?
The last column (right - see also above is similar to my phone as Termux was still on it. The restore process with F-Droit and tar
took 30 minutes.
Except for (3) the installation was nevertheless refused.
If plugins installed - delete them too. Termux uses shared user id and all Termux applications (plugins) should be signed by same key. Modified Termux app obviously signed by different key.
I thought with deinstall of Termux and all extensions all plugins are removed (Termux-free above) how can I determine that perhaps hidden keys are still on the phone?
I thought with deinstall of Termux and all extensions all plugins
All Termux plugins are separate applications.
Yes but I've uninstall all (above)! Checked in APP list of setup and Startscreen and reboot, before reinstall your debug app!
Yes but I've uninstall all (above)
Then I have no idea why it is not getting installed. I was able to install it on all my devices, regardless of architecture it was installed successfully.
Checked in APP list of setup and Startscreen and reboot
btw, Termux:API is not shown on "Startscreen". Everything (termux-related) should be uninstalled from Android Settings or Google Play.
As I've understand Termux packages should use the same source Google Play or always F-Droit - as I used. your source seems to be Google Play related (do you've a F-Droit-version too?) and yes only Widget is on Startscreen, when it's placed (there was a hole after remove of Termux on my phone).
You say:"I was able to install it on all my devices, regardless of architecture it was installed successfully." So I've again tried to install your on the arm81 phone and :) today it works! So I try to install a part of my 800Mb on this device for sparkle check - need more than 30 minutes Thanks so far!
FYI i found this on xda that also uses sparkle but with wayland: https://forum.xda-developers.com/android/software/wayland-server-android-t3902720 they did not post source tough :(
Solution posted here is not original sparkle.
@mariogrip I think we can port Weston and libwailand, but I did not find anything about changing screen resolution in Weston runtime. Mogryph's wayland server uses Android Overlays. We will need to do something with panels and Task switcher if we do port Weston.
@xeffyr It's hard to install your app-debug.apk on (1) my phone. Another installation attempt on my son's phone was simply and successful but the devices of my family (with Android phones) are limited available to me for testing, maybe in between you have an idea what could I try?
The screenshot sequence above shows the state of my app list before and after uninstalling, trying to install your app and at the end the F-Droid search for "termu". For termux and both removed plugins, are "Droid" icons displayed, but not for unused plugins. Is this possibly an indication that the fdroid-key was not removed? At the end of many de/reinstallations and restarts and with restrictions, I've even installed your app on (1).
Condition for success is: Step 1: Install and Uninstall App + plugins from Play Store. Step 2: Install your app. The Plugins can not be installed either before or after step 2 from Play Store or F-Droit. Restoring the 840Mb-Termux with
sd/t.tgz
, I've learned to reduced to 2 minutes. The above described way is not loger possible by this *.apk.
Could you send me please an alternative app-debug.apk with fdroid-key like above , that I could extend by plugins - so I can test it?
In the meantime, according to your instruction, I have produced u/bin/Xorg
for aarch64 (1) and arm (2) (right in picture above). With Xorg &
and DISPLAY =: 0; xterm
you can either start by this or use shortcut/widget Xorg.sh.
I 've successfully follow the 3rd and 4th steps of your "How to use" above*). It's not optimal yet. With the QuickSupport app the mobile phone can be mirrored and controlled on the PC display and the Hackers Keyboard App contains all necessary keys (I use in _Xsdl_L and Termux). But I would prefer for control the Navigation Drawer (see #978)- is that possibly possible via an am ...
activity in a sparkle.sh?
To the 5 shots above: Full-Setup from a virgin Termux (1st) with script s on sdcard finished (2nd) in 11 minutes (several confirms needed). Close Termux and tab Sparkle (3rd) - than is control with volume-down and finger possible. Rotate phone and tab (4th)- than control with two mices (USB and TV) and Keyboard (TV) is available. The last one is from https://gitter.im/termux/dev. Maybe you remember - I'm still waiting for an update of mpv-x! A check with
t :0 m sd/ip/*4
is comparable to Xsdl.
On the sdcard the folder ip (2.5 Mb) with install sources is expected. For a setup without sdcard (symlink d=sd), ip would be expected in /storage/emulated/0/
(symlink d).
Just not includet (comment in s) is Xvnc, Termux-api but sshd to control phone from PC.
The current script s (116 loc) includes updates of all necessary packages, will used as bashrc
, manage backups (tgz) and replace (includes) the script ~/t
in #44. All 3 xservers can checked with it.
Without Xvnc the processes: Xorg, fluxbox and xterm will initialized at first time (or when not exist/killed). Below I have checked the Termux-space needed by some packages:
app->0.65Mb, open->18Mb, xorg/ssh->87Mb, xterm/fluxbox->100Mb, mpv/magicks-x->160Mb make ->316Mb and gfortran ->410Mb are required to install _localsources*).
Differences to other Xserver: first of all the process com.termux noticed, which does not exist in the normal app - what does that?. A sshd process I start .bashrc to process X11 on my PC "too". The Xorg process is also started from .bashrc as described above. How can I use Xorg from a PC-X11-client on my phone? In my network it opens with s 48 x
in Xsdl a xterm and local on phone with t :0 x
(2nd parameter indicates DISPLAY depend on Xserver) but :0 on PC is this itself.
*) Detailed test results later, when I can use my smart phone better. Without extern mouse + KB it does not going on at present. Besides the two programs check (fullscreen control - without WM = window manager - my goal of smart control) and touch (pointer/finger/device control) I also have a modified feh3.1.3 Version tested and examined the sources of Xrdp (@twaik has requested the packet from you). In which is multitouch is used, helpful for smart control and Xorg knows this unlike Xsdl also (XI2: 2.3) and also all events logged in contrast to Xvnc. Furthermore, the mobile phone rotation is supported (differend width/hight) in contrast to both alternatives. I'm hopeful! Do you've in between progress on On-Screen-KB and conf?**
References to my dropbox: ip goal of non X11 mc X11 with Xsdl
@twaik can you specify sometimes and we can not fix (condition)? I've found in sparkle so far no segfalls (except missing KB). Do you have a termux.apk
version with Xfake that I could test?
@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.