termux / termux-x11

Termux X11 add-on application.
https://termux.dev
GNU General Public License v3.0
2.12k stars 313 forks source link

[Feature Request]: Add support for user-defined compositors #27

Closed suhan-paradkar closed 2 years ago

suhan-paradkar commented 3 years ago

As of now T:X11 supports it's built-in compositor only, but I plan on to add support for user-defined compositors, like Weston.. as of now, I am able to compile Weston for termux, but this feature is gonna take a lot of work.....

twaik commented 3 years ago

T:X11 has no compositor. At all. It shows a picture Xwayland sends him. Another reason it can not be implemented is missing graphical acceleration (GL/GLES). It is essential dependency for most of compositors.

suhan-paradkar commented 3 years ago

About Graphical Acceleration.. we can use libhybris?

twaik commented 3 years ago

Libhybris is not an option. Android linker restricts linking to android private libraries. But we can try to modify android-emugl. It is much better than nothing.

suhan-paradkar commented 3 years ago

Well.. we can use gl4es also?... It is now in the x11-repo...

twaik commented 3 years ago

Gl4es allows us to use desktop GL if there is GLES. It is only a command translator working on top of GLES. But in our case it is useless because GLES is unavailable.

twaik commented 3 years ago

@WMCB-Tech @suhan-paradkar what do you think about moving project to work on top of libweston? Wlroots and others require a lot of work to make them work on top of Android, libweston is almost ready. But I am afraid this project will contain all of the dependencies, not prebuilt libs.

twaik commented 3 years ago

That should fix random native crashes...

twaik commented 3 years ago

I think wlroots will be an option when Xwayland will be fixed there...

ZhymabekRoman commented 3 years ago

But we can try to modify android-emugl. It is much better than nothing.

Maybe it makes sense to try using VirGL? Eltechs by the way originally wanted it in Exagear to get hardware acceleration

twaik commented 3 years ago

It makes sence. My friend tried to do that. https://github.com/mittorn/virglrenderer-android But this solution segfaults all the time. And we did not find a way to fix it.

ZhymabekRoman commented 3 years ago

There is also such a modification, like more or less operable: https://github.com/Grima04/virgl-vtest-launcher

twaik commented 3 years ago

There is also such a modification

Things to note:

  • This app requires root.
  • You need the specific BusyBox version linked in the quick installation guide. Other BusyBox versions like the BusyBox Magisk module might not work.
  • Only Adreno GPUs are supported (unless you want to use software rendering).
  • A relatively recent Snapdragon Android device with the DRM/DRI GPU interface is needed (check if /dev/dri/card0 exists on the device).

I do not think it is applicable here...

I think wlroots will be an option when Xwayland will be fixed there...

Ok, I was wrong. It is already fixed in last versions. At least the most recent Xwayland works on top of the most recent wlroots (tinywl). I will start moving this week. This should fix #25, #40, #44, #45. And I am not sure how to write backend right... And we will have a lot of sources in our repo. Wlroots + all of it's dependencies.

Heasterian commented 3 years ago

It makes sence. My friend tried to do that. https://github.com/mittorn/virglrenderer-android But this solution segfaults all the time. And we did not find a way to fix it.

One guy upgraded this project with recent sources of virgl, but it's still crashing on Mali devices. Probably blob don't like it. It's working pretty fine with Adreno and Tegra. I also didn't try Vulkan as Venus don't like blobs (It don't work with Nvidia linux drivers for Tegra X1 atm).

twaik commented 3 years ago

Even in the case it worked I prefer to do more important stuff. For now the most important thing is core crash which I can not fix. That is a reason I am playing around wlroots now.

Heasterian commented 3 years ago

I know, I think that they are information that can be useful for you in future. I'm testing suff on Poco F1 running mobian. Also looks like some guys from China are working further on vtest for Android https://github.com/AOF-Dev/virglrenderer-android

I can't code on my own, but I'm tracking a lot of projects so I can research some usefull ones to get GPU acceleration if you want.

twaik commented 3 years ago

Maybe you know how to use Android.mk's BUILD_HOST_EXECUTABLE in Android NDK's project? My goal is to fully integrate libffi, libwayland and wlroots into Lorie projects without using prebuilt libraries, but NDK lacks "generator" feature. I can not use Android.mk to build some tools to generate the code I need. The best solution is to build libffi, libwayland, wlroots, etc. With termux-packages build system and then link Termux:X11 with these libraries. But I think it will break building app in Github Action. And building process will be much more complicated. Maybe you know someone who can help me with this stuff?

Heasterian commented 3 years ago

This it only thing I found about this: https://blog.actorsfit.com/a?ID=00750-dc14df27-348f-4ce1-af32-ee8e00b860c1

I'll ask some devs in other project if someone have idea how to do this.

DLC01 commented 2 years ago

For getting hardware accelerated graphics could mesa's Zink (opengl over Vulkan) driver be used here? It has been made working in termux (https://github.com/DLC01/mesa) and seems to work properly in GPU's which have implemented the Vulkan API, some problems may arise sometimes because of the android gpu driver missing some of Zink's base requirements but it will work without any issues for most of the times

Sorry for my messy English..