termux-packages icon indicating copy to clipboard operation
termux-packages copied to clipboard

[Bug]: Zink+Turnip+compositors black screen X11

Open joelcolina2024 opened this issue 9 months ago • 20 comments

Problem description

After updating packages on March 23, when I start Xfce session (native) through x11 app, I get a blank screen.

After further research, other users tried rolling back dbus package to 1.15.6-3. It worked normally.

But having dbus 1.16.2 installed gets the blank screen. I can't rollback myself, because 1.15.6-3 is not longer available in termux official repositories.

What steps will reproduce the bug?

Install xfce4 and x11 app. Start xfce session. Got blank screen.

What is the expected behavior?

The session starts

System information

Termux Variables:
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=16877
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.1
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main stable main
# x11-repo (sources.list.d/x11.list)
deb https://packages-cf.termux.dev/apt/termux-x11 x11 main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
Updatable packages:
All packages up to date
termux-tools version:
1.45.0
Android version:
13
Kernel build information:
Linux localhost 4.19.113-27095354 #1 SMP PREEMPT Mon Dec 30 19:35:16 KST 2024 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-N986U1
Supported ABIs:
SUPPORTED_ABIS: arm64-v8a,armeabi-v7a,armeabi
SUPPORTED_32_BIT_ABIS: armeabi-v7a,armeabi
SUPPORTED_64_BIT_ABIS: arm64-v8a
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec-ld-preload.so
Installed termux plugins:
com.termux.x11 versionCode:15

joelcolina2024 avatar Mar 26 '25 14:03 joelcolina2024

Unfortunately I can not reproduce it on my devices. Probably I miss some context. Both

termux-x11 -xstartup xfce4-session

and

termux-x11 -xstartup "dbus-launch --exit-with-session xfce4-session"

work fine. Same happens if I replace xfce4-session with startxfce4.

twaik avatar Mar 26 '25 19:03 twaik

I could reproduce it with vulkan-loader-generic + mesa-vulkan-icd-freedreno + termux-x11...

licy183 avatar Mar 26 '25 19:03 licy183

Probably logs (crashlogs?) can make situation a bit more clear, currently we have only the fact it fails to show something on some devices.

twaik avatar Mar 26 '25 20:03 twaik

try to type export LIBGL_ALWAYS_SOFTWARE=1 before starting xfce session

Creeperuuu avatar Mar 26 '25 21:03 Creeperuuu

joelcolina2024: I am the one who posted to r/termux about your inquiry asking how to roll-back to dbus 1.15.6-3. I see your architecture is also aarch64 ,just like mine. I still have the file, dbus_1.15.6-3_aarch64.deb, if you want it

imnisp avatar Mar 26 '25 23:03 imnisp

I have a similar problem which might be slightly different, it won't be known whether it is the exact same problem or not without OP testing. basically for me, something like a regression of

  • https://github.com/termux/termux-packages/issues/12139

has occurred, producing the error

EOF in dbus-launch reading address from bus daemon
14699 exited, status=1
  • Reproduction device: Samsung Galaxy S9 SM-G960U Android 10 OFW

  • Downstream bisection commit: https://github.com/termux/termux-packages/commit/007b2f9a52dea5725428e5f0fa9a8e90396373d8

  • Upstream bisection commit: https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/398

  • Workaround: https://github.com/termux/termux-packages/pull/23988

the error goes away for me, and XFCE works on Samsung Galaxy S9 SM-G960U.

export DISPLAY=:0 TERMUX_X11_XSTARTUP=xfce4-session
LIBGL_ALWAYS_SOFTWARE=1 termux-x11 &

robertkirkman avatar Mar 26 '25 23:03 robertkirkman

try to type export LIBGL_ALWAYS_SOFTWARE=1 before starting xfce session

It works when I use that command before starting session. Sorry I can't help any further because I don't know how to get logs.

joelcolina2024: This is is Doug, who posted to r/termux about your inquiry on how to roll-back to dbus 1.15.6-3. I see your architecture is also aarch64 ,just like mine. I still have the file, dbus_1.15.6-3_aarch64.deb, if you want it

Thanks for your help. I fixed it with the above command, but I don't know what changes using it.

PS: I closed this issue by mistake, I can't open it again, as the command is just a workaround.

joelcolina2024 avatar Mar 27 '25 15:03 joelcolina2024

try to type export LIBGL_ALWAYS_SOFTWARE=1 before starting xfce session

It works when I use that command before starting session. Sorry I can't help any further because I don't know how to get logs.

This means that we had slightly different problems, because, for me LIBGL_ALWAYS_SOFTWARE=1 was not sufficient, and I had to use the change in the PR to proceed

I believe that probably, if LIBGL_ALWAYS_SOFTWARE=1 helps you, then your problem is more likely to be related to the mesa package, than the dbus package

robertkirkman avatar Mar 27 '25 15:03 robertkirkman

I think this issue is not fixed yet...

licy183 avatar Mar 28 '25 02:03 licy183

@licy183 yes, it became automatically closed incorrectly, I should have marked the PR as "partially fixes" not "fixes" to avoid that.

The associated PR only solves the problem for people who experienced the error EOF in dbus-launch reading address from bus daemon and for whom export LIBGL_ALWAYS_SOFTWARE=1 had no effect. For people who have a different kind of problem, but with a similar symptom of black screen, the PR will not help.

Below I will describe my experience of the remaining problem that I can reproduce closest matching the description that OP provided, though I am unable to reproduce the exact same problem in all details that OP has described (OP describes an issue that has both begun affecting them recently, and also is affected by the use of LIBGL_ALWAYS_SOFTWARE=1, and for me no problems have appeared that fit both criteria)

On one of my devices, export TERMUX_X11_XSTARTUP=xfce4-session && termux-x11 & does not attempt to use Zink and instead it automatically defaults to LLVMpipe, so export LIBGL_ALWAYS_SOFTWARE=1 is not required for me on that device,

however, on one of my other devices (Device: Samsung Galaxy A70 SM-A705FN), I actually am able to reproduce the black screen in XFCE when mesa-vulkan-icd-freedreno is installed unless LIBGL_ALWAYS_SOFTWARE=1 is used.

Below explanations are specific to Samsung Galaxy A70 SM-A705FN

which has often exhibited significantly different graphics driver behavior in Termux compared to my other devices

On this device, the termux-x11 command attempts to launch XFCE using Zink + Turnip by default, which results in a black screen.

Image

I have been able to reproduce that on this device for a very long time actually, since approximately mid 2024 (I suspect whenever mesa began setting Zink as default for XFCE whenever mesa-vulkan-icd-freedreno is installed)

However, on this device, Zink + Turnip does actually work for me, just not with the XFCE window manager program itself.

It only works for me with regular OpenGL GLX applications (only GLX not EGL since the new fix-zink-on-egl.patch unfortunately does not actually work for me, on this device EGL only works with LLVMpipe and the freedreno opengl kgsl mesa [since the other EGL solution termux-wsi-layer-november does not work on this device]. That is to say, currently with the mesa and mesa-vulkan-icd-freedreno packages version 25.0.2-1, the program glmark2 works [since it is using GLX], but the programs glmark2-es2 and glmark2-egl both show this [since they are using EGL])

Error: eglCreateWindowSurface failed with error: 0x3003
Error: eglCreateWindowSurface failed with error: 0x3003
Error: CanvasGeneric: Invalid EGL state
Error: main: Could not initialize canvas
X connection to :0 broken (explicit kill or server shutdown).

Usually, the workaround I use to make XFCE not have a black screen, but still use GLX programs with Zink and Turnip if desired, is:

  1. Launch XFCE with LLVMpipe using the command TERMUX_X11_XSTARTUP=xfce4-session LIBGL_ALWAYS_SOFTWARE=1 termux-x11 &
  2. Once in XFCE, open a terminal window, then type unset LIBGL_ALWAYS_SOFTWARE
  3. Launch GLX programs using the shell in that terminal window

Image

robertkirkman avatar Mar 28 '25 03:03 robertkirkman

I have the same issue as OP as well, but in Arch chroot. LIBGL_ALWAYS_SOFTWARE environment variable works as a workaround. Most programs do not open, just hang. Weird thing is, everything works fine in Ubuntu chroot. Which has mesa-libgallium with version 24.2.8-1, while Arch chroot upgraded to 25.0.2-2. The issue might actually be related to mesa.

Update: Confirmed that issue is related to mesa. Built 24.3 and it works.

Image

FalconSN avatar Mar 31 '25 21:03 FalconSN

LIBGL_ALWAYS_SOFTWARE environment variable works as a workaround.

LIBGL_ALWAYS_SOFTWARE working as a workaround means it is not a dbus regression. It is mesa regression.

twaik avatar Apr 01 '25 04:04 twaik

Will setting LIBGL_DRI2_DISABLE help a lot?

licy183 avatar Apr 01 '25 04:04 licy183

Will setting LIBGL_DRI2_DISABLE help a lot?

For me that does not make any difference on Galaxy A70 or Galaxy S9, ~~but on Galaxy S9, LLVMpipe is already active by default, I guess there is something automatically setting that somewhere for Galaxy S9 which is probably appropriate because, if I use MESA_LOADER_DRIVER_OVERRIDE=zink with or without LIBGL_DRI2_DISABLE=1, Galaxy S9 shows this for all programs~~

glx: failed to create drisw screen
failed to load driver: zink
glx: failed to create drisw screen
failed to load driver: zink
glx: failed to create drisw screen
failed to load driver: zink
glx: failed to create drisw screen
failed to load driver: zink

~~so zink currently does not work on Galaxy S9, but, that problem does not affect Galaxy A70.~~

Also, the black screen affecting Galaxy A70 when zink is used on the XFCE window manager only (not affecting other programs) is possibly a different problem from what others here experience, because it did not start recently but appeared a relatively long time ago.

robertkirkman avatar Apr 01 '25 04:04 robertkirkman

Actually never mind, about the failed to load driver: zink, on the Galaxy S9 there was the test package vulkan-wrapper-android

  • https://github.com/termux/termux-packages/pull/22500

installed, and I had forgotten to remove it. After removing it, now for me Galaxy S9 is back to behaving exactly the same as Galaxy A70 for the purposes of zink and XFCE,

that is to say, now, Galaxy A70 and Galaxy S9 both have working zink for all programs that are not XFCE window manager itself, but XFCE must be launched with LIBGL_ALWAYS_SOFTWARE=1 on both of them, otherwise Termux:X11 shows only black instead of XFCE. but zink can be used for programs within that XFCE after it is launched by using unset LIBGL_ALWAYS_SOFTWARE, as described above regarding the Galaxy A70.

But this is exactly how Galaxy A70 and Galaxy S9 have both been behaving since approximately mid 2024, so this is possibly a different problem from what others here experience, and LIBGL_DRI2_DISABLE has no effect on them. Only LIBGL_ALWAYS_SOFTWARE=1 prevents the black screen in XFCE window manager (or pkg remove mesa-vulkan-icd-freedreno which also works, but that is how to completely disable vulkan and prevent using it in any programs on Adreno devices).

robertkirkman avatar Apr 01 '25 05:04 robertkirkman

Will setting LIBGL_DRI2_DISABLE help a lot?

Doesn't for me. Also, a way for OP to test whether he/she has the same issue as me is; seeing if i3 works or not. i3, feh and weston (this also prints gpu info correctly) works for me but not browsers, thunar, xfce, viewnior, glmark2 and mesa-utils programs.

Update: Built mesa from git main branch and it still works... Flags used: -Dplatforms=x11 -Dgallium-drivers=virgl,llvmpipe -Degl-native-platform=x11 -Dvulkan-drivers=[] glmark2 prints correct gpu name (adreno 610), so it doesn't seem to default to software rendering. Maybe it's fixed already but not rolled out yet.

FalconSN avatar Apr 01 '25 05:04 FalconSN

No. It is because that mesa is built with -Dlegacy-x11=dri2.

licy183 avatar Apr 01 '25 08:04 licy183

Status update of things I mentioned here in the large messages:

  • I have realized now that https://github.com/termux/termux-packages/pull/24017 has now fixed the problem of EGL not working with Zink for me so now EGL apps are working with Zink Turnip on Samsung Galaxy A70 SM-A705FN
  • however that PR has not had any effect on the other problem of the xfce4-session/termux-x11 -xtartup xfce4-session command (not other programs, only the desktop environment) requiring LIBGL_ALWAYS_SOFTWARE=1 whenever Zink and Turnip are both installed otherwise black screen, so that problem is still present

robertkirkman avatar Apr 19 '25 21:04 robertkirkman

In my opinion, all problems that any user described in this issue that are not yet fixed do not technically have any actual connection with dbus at all, and the only dbus problem was fixed a long time ago, therefore the title of the issue should be changed to "Zink+Turnip+compositors black screen X11" in order to be more accurate. However others might disagree or believe something different from me.

robertkirkman avatar Aug 26 '25 11:08 robertkirkman

I could reproduce it with vulkan-loader-generic + mesa-vulkan-icd-freedreno + termux-x11...

When you tested and said you reproduced it on march 26th, licy183, did LIBGL_ALWAYS_SOFTWARE=1 prevent the problem for you - and is it still reproducible? Or were you unable to reproduce that problem and what you originally reproduced was the other problem?

robertkirkman avatar Aug 26 '25 11:08 robertkirkman