termux / termux-x11

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

X11 apps severe issue on chromebooks android subsystem #643

Closed JanuszChmiel closed 4 months ago

JanuszChmiel commented 4 months ago

Dear MR Twaik, Please, could you try to find out The cause of The following issue. If I Am running Termux-x11 on My Chromebook which uses Android 11 compatible Android subsystem, app executed from Termux work like A charm including Firefox. BUt when I run some X11 apps by using Proot-distro and sharedtmp option, every X11 app freeze during its startup. No errors, no process auto termination, but process symply hangs. Proot causes this problem only while executing such Linux distribution when using Android subsystem for Chromebook. Please, do you think, if such behaviour could be solved? Proot developers do not want to even debate about it. So All Android apps are working perfectly with termux-x11 on Android subsystem of A chromebook. Termux-x11 show A nice screen, no issue at all. But If I execute some X11 app from an linux distribution which is being executed by Proot, process hang. Sure, this behaviour exist only if I Am running Android subsystem of A chromebook. Standard Android operating system do not suffer about this issue at all.

I know, that Chromebook contain officially supported viftual machine with a special Hardened Debian kernel, but it is strictly based on Somnelier Wayland module. So I can not use Desktop environment. Mate display every its panels inside A separate window. Titled Toppanel. Downpanel. Window manager can not be eexecutedat all. My favourite Marco which contain so many shortcuts support for displaiing Mate menu for example.

So I Am triing to run Linux distro by using Termux and Android subsystem of A chromebook. DO I have some chance to achieve? Or Google modules will also block my desire so Marco will also not be usable? Sure, I must specify Display 1 no 0. Thank you for your debate and for some professional advice.

twaik commented 4 months ago

Let's make some checks. Try to start something lightweight, like termux's xfce4-session + glxgears (from mesa-demos) in termux environment. When everything is started try to launch something in proot-distro. Do gears hang when you launch something in proot-distro?

JanuszChmiel commented 4 months ago

When I AM running $ termux-x11 :1 &
[1] 29904
~ $ /opt/google/containers/android/vendor/usr/share/libdrm/amdgpu.ids: No such f ile or directory

Is this severe error?

twaik commented 4 months ago

Do termux-x11 work at this point? If it works this error is not severe.

JanuszChmiel commented 4 months ago

I have tried to install Xfce desktop and I have executed xfce4-session Here is console output, I think, that Xfce work like A charm according to those outputs. $ export DISPLAY=:1
~ $ xfce4-session
gpg-agent[32330]: directory '/data/data/com.termux/files/home/.gnupg' created
gpg-agent[32330]: directory '/data/data/com.termux/files/home/.gnupg/private-key s-v1.d' created
gpg-agent[32331]: gpg-agent (GnuPG) 2.4.5 started

(xfwm4:32332): xfwm4-WARNING **: 15:13:18.323: Another compositing manager is ru nning on screen 0
xfce4-panel-Message: 15:13:20.359: Plugin "(NULL)-7" was not found and has been removed from the configuration
xfce4-panel-Message: 15:13:20.367: Plugin "pulseaudio-8" was not found and has b een removed from the configuration
xfce4-panel-Message: 15:13:20.369: Plugin "power-manager-plugin-9" was not found and has been removed from the configuration

(xfdesktop:32363): GLib-GObject-CRITICAL **: 15:13:21.346: g_object_unref: asser tion 'G_IS_OBJECT (object)' failed

(xfdesktop:32363): WARNING : 15:13:21.645: Failed to get system bus: Could not connect: No such file or directory

twaik commented 4 months ago

Start xfce desktop on empty X11 session. That means kill X-server and start it again.

JanuszChmiel commented 4 months ago

Oh dear profesionally thinking MR Twaik. I Am afraid, that I will be never able to run X11 apps on Chrome book like running those apps on Android device. Google uses their own window manager. So other window manager can not be used. As a result, Mate or Xfce which contain many useful hotkeys will be never usable for Me, because routines which are reacting on hotkeys presses are build in to The C source code of marco window manager on in to other window manager for Xfce. It is sad, because I could be able to remap hotkeys of Marco to avoid ALT usage, Google block this key so I can not use it, but I could use otherr key to recall Mate menu. But because Google uses other window manager I do not have The chance.

twaik commented 4 months ago

Google's window manager does not work under Termux or Termux:X11. Force-stop termux and termux-x11 and start from the beginning.

JanuszChmiel commented 4 months ago

~ $ export DISPLAY=:1
~ $ termux-x11 :1 &
[1] 2260
~ $ /opt/google/containers/android/vendor/usr/share/libdrm/amdgpu.ids: No such f ile or directory

~ $ xfce4-session &
[2] 2284
~ $
(xfwm4:2308): xfwm4-WARNING **: 15:37:54.099: Unsupported GL renderer (llvmpipe (LLVM 18.1.6, 256 bits)).

(xfdesktop:2336): WARNING : 15:37:56.053: Failed to get system bus: Could n ot connect: No such file or directory

JanuszChmiel commented 4 months ago

1140 frames in 5.0 seconds = 227.825 FPS
1145 frames in 5.0 seconds = 228.971 FPS
1194 frames in 5.0 seconds = 238.784 FPS
1219 frames in 5.0 seconds = 243.771 FPS
1019 frames in 5.0 seconds = 203.790 FPS
1129 frames in 5.0 seconds = 225.647 FPS
1168 frames in 5.0 seconds = 233.564 FPS
1206 frames in 5.0 seconds = 241.076 FPS
1128 frames in 5.0 seconds = 225.421 FPS

JanuszChmiel commented 4 months ago

MR Twaik, I Am vvery very sorry. Really, after I have restarted my chromebook, Xfce build in window manager really work. There was some pieces of Marco in RAm when I have tried to run mate-session from Ubuntu Jammi. So there is some chance. Gears generate some numbers of frame rates. But When I execute something in Proot-distro, it really hangs up.

JanuszChmiel commented 4 months ago

Gears still send some frame rates values on A terminal even I am triing to run

proot-distro login --user janusz ubuntu-oldlts --shared-tmp

export DISPLAY=:1 mate-session &

But no output on Ubuntu terminal screen

JanuszChmiel commented 4 months ago

It is very probably some Proot issue. Unfortunately, even if I have tried to use Xvnc it did not help. The same problem exists. Thank you for your time.

JanuszChmiel commented 4 months ago

When I have tried to install Opensuse distro. And when I have tried to run Seamonkey without desktop environment and without window manager.

Terminal contain many error lines with The following content. warn] epoll_wait: Function not implemented Do you think, that this not implemented function can cause The fact, that mate-session and other X11 apps do not run on Termux and Proot? Is it possible to implement such function from The Proot source code? Or unfortunately not?

twaik commented 4 months ago

I'll ask my question again and it will be better to answer only this question to not confuse me. Do glxgears report framerate AFTER you launch something heavy in proot-distro?

JanuszChmiel commented 4 months ago

Yes. It report frame rate.

twaik commented 4 months ago

So everything hangs and glxgears keeps reporting framerate. Weird. What happens in the case if you start one more glxgears after screen hangs? Does it report framerate too?

JanuszChmiel commented 4 months ago

Yes. Even if I execute
glxgears after screen hang it still produces

150 frames in 5.0 seconds = 29.941 FPS

twaik commented 4 months ago

It is weird. Unfortunately I have no ideas what I can do in this case. I should see it with my own eyes. Are you available tomorrow at 6:00 am UTC? I can connect your device remotely to see what's wrong.

JanuszChmiel commented 4 months ago

I Am afraid, that it is really thanks to non implemented kernel system call warn] epoll_wait System call is documented here for example. https://man7.org/linux/man-pages/man2/epoll_wait.2.html

Because all Termux x11 based apps are really working. So it is very probably thanks to some kernel difference between standard Android kernel and modified Android kernel which run on virtual machine on Chrome OS.

Unfortunately, i do not have time on this time, but I can activate ssh client which you will recommend to Me and I will be following your instructions so you can connect to my chromebook remotely. Unfortunately, I do not have my own static IP address, but Tmate support even my non static IP, MR Bednarski have debugged one Proot issue on my phone remotely without issue thanks to Tmate.

twaik commented 4 months ago

Tell me when you will be ready for connections.

twaik commented 4 months ago

I am afraid ssh will not be enough for this, I need to see when the image stops updating.

twaik commented 4 months ago

Probably you will need to check if Chrome Remote Desktop works on your device. You can check it by installing Chrome Remote Desktop app from Play Store (on your Android device) and from Chrome Web Store (on your chromebook). After this you should try to share screen on your chromebook, then connect your device from your phone. In the case if it works tell me when I can connect you (after 6:00 am UTC)..

twaik commented 4 months ago

You still did not respond. I am not sure if opening issue termux/proot#297 is really effective since termux widely uses epoll_wait under the hood (because some packages we port use it). And some android subsystems like Looper/ALooper use it too.

JanuszChmiel commented 4 months ago

I have created detailed bug report related to Proot instead, because this error which I have reported here in this issue is not strictly specific for Termux-x11 addon app. Which work very very professionally and reliably across various Android versions. It even work normally and perfectly when user run app by using Termux, not by using Proot. So I AM pointing elite C programmers like you are dear MR Twaik to The following issue, which contain detailed Proot verbose at The highest possible detailed level level 9.

https://github.com/termux/proot/issues/297 Please I Am very kindly ask The most elite C language developers if Chromebook issue can be solved. If no, I will never intrude because of it again. MR Twaik, MR Michael Bednarski and othere and may be that even new programmers can very probably try to find The solution. Thank you for your time dear MR Twaik. And thank you again for your very professionally developed Termux-x11 application.