-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
use termux:X11 with custom chroot environment #45
Comments
What I ment is that at the moment I use an image file (ext4) bootstapped from debian repos. |
I'm not sure about new one, but old versions of Termux-X11 where working fine with Xwayland versions from main sources, backported. Try to use it first. Even if something will cause issues, you won't know untill you try. |
It is not a compositor. It is a backend for Xwayland.
Xwayland did not change. Version 1.20.5 still being used (1.20.13 is an actual version). It has a lot of patches but most of them fix pathes and disable using some capabilities that can not be used in Termux like dropping privilegies of process (setgid/setuid), glx (which can not be used directly), fbdev driver (requires root). But there is one that matter: patch fixing screen resize of Wayland compositor and making xserver use ashmem instead of SysV shared memory (link). Xwayland of chrooted environment is not pathced to use ashmem and that can be a problem. Also last versions of Lorie have special launching process so |
My question is: ashmem is needed also between Lori and Xwayland, or only between Xwayland and GUI frameworks (or applications)? Because on my devices i compiled the kernel with SysV shared memory enabled and have root access. If it's the latter then I would say that only the "patch fixing screen resize of Wayland compositor" patch would be needed. I if see correctly the hardcoded path to Xwayland in the Starter app (Starter java class) must be also changed to match the location in the chroot. |
Ashmem is needed to avoid using temporary files and MMC/NAND resource consumption. If you can activate SysV shared memory it is unneded. Termux itself uses it's own mechanism emulating SysV shared memory based on sockets. Starter app is needed to provide access to termux's directories to app with custom signature. You can put symlink/hardlink Starting Lorie from inside chroot is a bit more complicated. Some devices do not allow to use
In the case it works you can modify this source. It is created to start Lorie using termux's Sorry for my bad English... |
@zanfix did it work? |
@twaik, it works!!! This is what I had to do:
Initially it would not work. I checked if termux:x11 was creating the socket, it did, but the socket permissions were too restricted:
so i
I did not touch Xwayland, it the debian repos one unmodified
Seems good this far! |
you can chmod it right after creating socket in
Looks like it has outdated version, I'll check what I can do. |
works, i put the call to chmod right after the call to wl_display_add_socket_auto in compositor.cpp, in void LorieCompositor::start() method
Not sure what you mean... anyway xdpyinfo in reporting server version 1.20.11 (debian bullseye repo) |
I am using another approach to automate the startup.
when shutting down, once out of the chroot, before unmounting the fileystems
This approch allows:
The only problem I see is that to get Xwayland to work with termux:x11 once the chroot is already started, the socket file must be bind mounted (manually?) from outside the chroot (android side) |
@zanfix If you would want to try upstream Mesa to have better Zink speed, you can compile it from my repo with same config used for Grima's https://github.com/Heasterian/mesa In practice it's same modification, but It's changing only two lines of code. |
Does it work for you? I had to setup a debian testing chroot to be able to compile it (libdrm-dev is outdated on bullseye) but then i get some msm drm related error messages... |
I'm now running pure Mobian on my Poco F1 so I didn't tried it since some time as I don't need KGSL with mainline Linux kernel, but month ago one guy used it in Gentoo Prefix running next to Android and it was running fine. |
Is there some kind of doc on how to compile it correctly? i am using the following meson options (the same that work with Grimas's repo
|
Are sure that you pointed me to the correct repo? It's maybe this one instead? https://github.com/Heasterian/mesa-turnip-kgsl EDIT: ok wait... it's your repo... so i suppose you know that you are talking about ;-) |
@zanfix Repo is correct, but I have same issues with Debian testing now in chroot (for now with Sparkle). Use MESA_LOADER_DRIVER_OVERRIDE=zink environment variable. Looks like Bookworm is trying to load incorect DRI library and it's creating issue. |
This command should work fine. If you would want to set up multiarch, I can help you also cross-compile armhf version. |
Yes this works! Tunip gets loaded The problem now is that Xwayland fails with error "missing XDG-WM-Base protocol" EDIT: tried with sparkle and I get the same error |
Compile old Wayland from Xorg source. This git works fine with Sparkle.
And configure it using this flags.
|
I was having the same idea but did not know the flags to use... so i compiled with the flags you mentioned, all except It works! but the video performance (in general) is quite terrible! Strange because glxgears reports 300+ fps Will do more tests soon... Thank you! EDIT: sparkle is having the same issue! |
One guy that tried it recently reported that he have better result while DE is running on llvmpipe and other apps with Zink. Also, run start Xwayland on big cores (I'm using |
I'm actually running the entire chroot hierarchy in a separate cgroups for cpuset (cores 4-7) and schedtune (boost to 50) subsystems already, so I already noticed it makes a difference! So far I can say that termux:11 is better in video performance than xserver xsdl or sparkle! |
Yea, it's faster. Also, when you are using it, keep the eye on FPS when touching the screen. Performance boosts a lot while you do this and drops right after. |
oook so, I forced xfce4 to start with llvmpipe and the problem about video performance is gone Now I am getting
this is a BIG improvement!!! |
Congratulations. |
It works well and I managed to run first Portal using box86 and first Witcher game using Proton 7-0 rc6 GE1, but looks like touchpad input mode and external mouse don't work well with games using first person camera. |
Yeap, that is because of my terrible code (touchpad emulation) and Android's restrictions (capturing real mouse movements). I am planning to port libinput and use it instead of my touchpad emulator. But I stucked. |
Okay, I will try to follow everything there is to try. I will use a fresh debian stable install from linux deploy. First, mount chroot at
Delete the created
Start termux-x11 and check if the socket is created:
chmod 777 the socket:
Chroot install xorg, xwayland and i3: Try to start i3:
And now I am pissed that it actually works. Thank you everyone in this issues comment section. The symlink must have solved it. I will replicate this in my daily driver chroot. Edit: For anyone wanting to try Heasterian's mesa on debian testing, compiling xwayland is not needed. Just download a known working version of xwayland on pkgs.org. For me the 1.20.13 of ubuntu focal fossa works. |
It seems that (for me) the graphical performance, sparkle is giving me more than when using termux-x11. The performance is compared on debian testing, running on kde(llvmpipe) and gl benchmarks (both on llvmpipe and Heasterian's zink) on my (gpu) overclocked and undervolted tab s7. kde and apps take quite some time and resources to load on termux-x11, graphical benchmarks show significantly lower performance (~10% or more). Overall, it seems that the only occasion when I need to use termux-x11 is when I need to use it in as a window, not full screen like sparkle (which when I think about it, actually sounds very helpful in some situations). Kde with compositor off is very smooth (native-like smooth, which is crazy to think about when last week I was just using xfce on xsdl server and it wasn't a good experience either). |
Hello, after I followed your steps, I got these errors
I tried looking it up online but it didn't work |
I'm not familiar with arch, but can you make sure that termux-x11 is opening a socket at that port? if you symlink the socket folder to |
I was having these same error messages after compiling mesa on debian. Try to use the MESA_LOADER_DRIVER_OVERRIDE env variable to force llvmpipe. BUT i actually think that it's not working for you because you did not set the DISPLAY variable for i3:
|
|
Can I close this issue? |
I think so yes |
Such thing is so simple
sudo chmod 777 /wayland/wayland-0 XDG_RUNTIME_DIR=/wayland Xwayland & export DISPLAY=:0 xfce4-session & ` (if xfce)
|
Hi Heasterian, don't know how to ask you the question elsewhere... |
I'm not sure if after Kopper merge to Zink it will work fine, but mainline Mesa version from projects's Gitlab should now compile without mine changes (well, it's probably missing one line preventing crash in one of glmark2 tests but except this, it should work). If it will work tho, many improvements should be implemented meanwhile to both Turnip with KGSL support and Zink. |
In worst case scenario it should be possible to build mainline Turnip and older Zink version, from before Kopper merge. |
Also, I'm not sure if it applies to KGSL, but using Turnip with Zink on mainline Linux kernel you get bindless images and way more total descriptors using Zink than Freedreno and GL 4.6 instead of 4.3 so compatibility should be much better now. |
I will try it... |
i tried with 22.2.0-rc3 but it does not work...
|
Zink tries to create GLX context, but unfortunately it is not supported. You can try to use llvmpipe. |
i compiled mainline mesa for zink/kgsl but it appears broken in 22.2.0-rc3... |
Zink has now increased the vulkan requirements and will fail to work on drivers which doesn't have the basic required extensions |
i see... |
Looks like zink have issues with software displays since kopper merge. I need to open issue about it, but I'm not sure if it's not missing functionality in xorg and not Mesa itself. |
I wrote a reply on another issue that might be worth checking out for those who are still having problems with rendering a desktop environment in chroot on Termux-x11. |
Hi all,
Question: can termux:X11 app be used with a chroot environment (using official debian repos) instead of a termux environment, eventually with some tweaking here and there?
I am already able to use Xwayland with sparkle app
I have a rooted device...
Bye
The text was updated successfully, but these errors were encountered: