termux / termux-x11

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

A bunch of issues i noticed #215

Closed Damaj301damaj-lol closed 1 year ago

Damaj301damaj-lol commented 1 year ago

I have been noticing a bunch of issues with termux-x11, particularly since the latest build (at the time of posting this issue), and i thought i would compile them up into this nice issue promt, hopefully it can help in something :P.

NOTE: i am using custom builds of mesa, vulkan headers and gallium zink, so i hope it won't affect the validity of this issue, and zink is being used in all the issues.

> termux-info output ```Termux Variables: TERMUX_API_APP__VERSION_NAME=0.50.1+2c6674f TERMUX_APP_PACKAGE_MANAGER=pacman TERMUX_APP__AM_SOCKET_SERVER_ENABLED=true TERMUX_APP__APK_PATH=/data/app/~~UJAby_aGkDnPeVl57eZftA==/com.termux-ZDG7gGDZDAIAAZCkK7M-Gw==/base.apk TERMUX_APP__APK_RELEASE=GITHUB TERMUX_APP__FILES_DIR=/data/user/0/com.termux/files TERMUX_APP__IS_DEBUGGABLE_BUILD=true TERMUX_APP__IS_INSTALLED_ON_EXTERNAL_STORAGE=false TERMUX_APP__PACKAGE_MANAGER=pacman TERMUX_APP__PACKAGE_NAME=com.termux TERMUX_APP__PACKAGE_VARIANT=apt-android-7 TERMUX_APP__PID=28296 TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c38,c258,c512,c768 TERMUX_APP__SE_INFO=default:targetSdkVersion=28:complete TERMUX_APP__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c38,c258,c512,c768 TERMUX_APP__TARGET_SDK=28 TERMUX_APP__UID=10550 TERMUX_APP__USER_ID=0 TERMUX_APP__VERSION_CODE=118 TERMUX_APP__VERSION_NAME=0.118.0+a523911 TERMUX_MAIN_PACKAGE_FORMAT=pacman TERMUX_VERSION=0.118.0+a523911 Packages CPU architecture: aarch64 Subscribed repositories: # /data/data/com.termux/files/usr/etc/pacman.conf [main] Usage = All Server = https://service.termux-pacman.dev/main/aarch64 [x11] Usage = All Server = https://service.termux-pacman.dev/x11/aarch64 [root] Usage = All Server = https://service.termux-pacman.dev/root/aarch64 [tur] Usage = All Server = https://service.termux-pacman.dev/tur/aarch64 [tur-continuous] Usage = All Server = https://service.termux-pacman.dev/tur-continuous/aarch64 [tur-multilib] Usage = All Server = https://service.termux-pacman.dev/tur-multilib/aarch64 Updatable packages: apr 1.7.0-8 -> 1.7.2-0 apr-util 1.6.1-6 -> 1.6.3-0 c-ares 1.18.1-1 -> 1.19.0-0 command-not-found 2.1.0-7 -> 2.1.0-8 dpkg 1.21.18-0 -> 1.21.19-0 fontconfig 2.14.1-1 -> 2.14.2-0 golang 3:1.19.5-0 -> 3:1.20-0 imagemagick 7.1.0.58-0 -> 7.1.0.60-0 libc++ 25.b-0 -> 25.c-0 libcairo 1.17.6-0 -> 1.17.8-0 libde265 1.0.9-0 -> 1.0.11-0 libdrm 2.4.114-0 -> 2.4.114-1 libjpeg-turbo 2.1.4-0 -> 2.1.5-0 libwayland 1.17.0-10 -> 1.21.0-0 libxxf86vm 1.1.5-0 -> 1.1.5-1 ndk-sysroot 25.b-3 -> 25.c-0 openssh 9.1.p1-0 -> 9.2.p1-0 openssh-sftp-server 9.1.p1-0 -> 9.2.p1-0 php 8.2.1-0 -> 8.2.2-0 php-fpm 8.2.1-0 -> 8.2.2-0 python-pip 22.3.1-3 -> 23.0-0 vim 9.0.0950-0 -> 9.0.1250-0 vim-runtime 9.0.0950-0 -> 9.0.1250-0 termux-tools version: 1.36.1 Android version: 11 Kernel build information: Linux localhost 4.14.190-20973144-abA715FXXU3BUB5 #1 SMP PREEMPT Thu Feb 18 21:50:20 KST 2021 aarch64 Android Device manufacturer: samsung Device model: SM-A715F ```

1: termux-x11 keeps crashing whenever an app (glxgears) tries to use display

2: termux-x11 won't close by any means unless murdered. (Solved)

3: termux-x11 keeps reloading, white screen.

I hope this issue can help in something

twaik commented 1 year ago
  1. termux-x11 never supported hardware accelerating. GLX is not supported by app. But I have a question: what environment did you use to start glxgears?
  2. I am aware about a problem, but I have no time to fix all of these. I'll take a look.
  3. Please, try to reproduce and post logcat if you can.
Damaj301damaj-lol commented 1 year ago

Hello @twaik,

  1. afaik termux-x11 does support hardware acceleration via zink and a custom version of mesa, and i am using the standard termux environment (no proot or any other layers).
  2. Try to reproduce all 3 with logcat?
twaik commented 1 year ago
  1. Hardware acceleration requires using platform libraries which is not supported. Nor in proot, nor in termux itself. You are likely use some kind of software acceleration.
  2. I would be appreciate.
twaik commented 1 year ago

I see that termux-x11 tool did not connect to main application. Sometime it happens, for some reason Unix sockets are not delivered or delivered in some broken state you should try to connect again. Later I wan to fix it but I have some higher priority issues.

twaik commented 1 year ago

Wait, it looks like glxgears is trying to connect wayland server, not Xwayland, it should not happen. Later I'll fix this behaviour.

twaik commented 1 year ago

Also it would be great to see full log of how you start both termux-x11 and glxgears, video is not very informative.

GlennX7 commented 1 year ago

1: termux-x11 keeps crashing whenever an app (glxgears) tries to use display Video:

But termux glxgears works fine for me Screenshot_2023-02-04-08-41-17-87_84d3000e3f4017145260f7618db1d683.jpg

2: termux-x11 won't close by any means unless murdered.

Yes same for me

twaik commented 1 year ago

Can you please check if it is relevant for latest build?

twaik commented 1 year ago

@Damaj301damaj-lol any updates?

Damaj301damaj-lol commented 1 year ago

@Damaj301damaj-lol any updates?

logcat is not returning useful info about termux-x11 crashing

twaik commented 1 year ago

Can you please check if it happens with latest build here?

twaik commented 1 year ago

@Damaj301damaj-lol ?

twaik commented 1 year ago

@Damaj301damaj-lol Please, make export TERMUX_X11_DEBUG=1 before invoking termux-x11 to get full log and post it here.

Heasterian commented 1 year ago

@twaik You probably could load Zink with MESA_VK_WSI_DEBUG=sw env variable. It works with Termux-X11 from new branch, Xvfb and git version of mainline Mesa. I even managed to get Turnip with KGSL working, but it's crashing a lot right now as I has to build it with both KGSL and MSM enabled. I used Debian proot, but it should work directly in Termux the same way, it's slow tho (but slowdowns can also be caused by that I'm using untested way of building Turnip).

twaik commented 1 year ago

You probably could load Zink with MESA_VK_WSI_DEBUG=sw

Android's vulkan implementation will not recognise this option, that means that you are using Turnip or software rendering.

I even managed to get Turnip with KGSL working, but it's crashing a lot right now as I has to build it with both KGSL and MSM enabled.

Check these repos. Alexvorxx built turnip + zink for exagear and it can work without DRI2 support. It works with Xvfb.

twaik commented 1 year ago

Outdated since after https://github.com/termux/termux-x11/commit/ee2224e474ce0c184de7a2c9c454c658f8afe249 there is builtin X server...