termux / termux-x11

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

got 'X Error of failed request: BadShmSeg (invalid shared segment parameter)' #234

Closed xxfree86 closed 1 year ago

xxfree86 commented 1 year ago

most x applications works fine with termux-x11 + proot-distro but when i try to run glxgears, ffplay, blender got error like this.

X Error of failed request: BadShmSeg (invalid shared segment parameter) Major opcode of failed request: 130 (MIT-SHM) Minor opcode of failed request: 3 (X_ShmPutImage) Segment id in failed request: 0x1400010 Serial number of failed request: 269 Current serial number in output stream: 270

These applications works in vncviewer but slow. :-/

any suggestion?

LG v50 sd855, android 12, proot-distro : ubuntu

Suletta-Majo commented 1 year ago

had same error me too. i am it posted reddit r/termux 'kivy' section reason i don't know i can't fix it too

i searched this MIT-SIM errors similer example >Major opcode of failed request: 130 (MIT-SHM) famous error and deep spaghetti reason. so i retire search :(

my error number 131. flet and kivy can't complete run simple samples yes errors include 'ffplay'

twaik commented 1 year ago
  1. Are you using termux's Xwayland with proot apps? Proot's sysvipc implementation is incompatible with terrmux, I've got something like that while tried to use termux's x11vnc with prooted Xvfb.
  2. Termux:X11 itself does not support any kind of GL, GLX, GLES, etc. But some users reported swrast and llvmpipe backends of mesa work (software rendering).
xxfree86 commented 1 year ago
  1. Are you using termux's Xwayland with proot apps? Proot's sysvipc implementation is incompatible with terrmux, I've got something like that while tried to use termux's x11vnc with prooted Xvfb.

I've try it according to the article in this link: https://udroid-rc.gitbook.io/udroid-wiki/udroid-landing/setting-up-gui/termux-x11

twaik commented 1 year ago

Try to install Xwayland inside proot and start termux-x11 from inside. I am not sure if udroid can start termux apps but proot-distro can.

kde-yyds commented 1 year ago

It seems that the Xwayland package is not built with glx support. After building and installing Xwayland with glx support, opengl programs will work (software renderer, of course).

xxfree86 commented 1 year ago

installed mesa-demos package in termux with pkg install command and it's glxgears runs without error. avg 300fps.

xxfree86 commented 1 year ago

Try to install Xwayland inside proot and start termux-x11 from inside. I am not sure if udroid can start termux apps but proot-distro can.

tried start termux-x11 inside proot but not working.

termux-x11 ended with 'killed.' message to console.

twaik commented 1 year ago

Killed message means there is a reason in logcat.

twaik commented 1 year ago

It should not find something because app_process is linked to bionic. Proot-distro allows to start programs outside a container.

twaik commented 1 year ago

termux-x11 ended with 'killed.' message to console.

Fixed.

IntinteDAO commented 1 year ago

installed mesa-demos package in termux with pkg install command and it's glxgears runs without error. avg 300fps.

You can always use mesa-zink (from TUR repository) to have hardware acceleration

twaik commented 1 year ago

Real hardware acceleration is not possible without using private APIs.

IntinteDAO commented 1 year ago

Real hardware acceleration is not possible without using private APIs.

Well - I'm talking about using a graphics card. With (relative) Vulkan support, you can use OpenGL on Vulkan - Zink.

Maybe the use of Turnip will improve Zink performance, we'll see.

twaik commented 1 year ago

Well - I'm talking about using a graphics card

I am talking about this too. Android restricts access to graphics card and does not have public API to access them directly. Even if Vulkan library has can work with real graphics card Vulka library on Android has no X11 support.

Suletta-Majo commented 1 year ago

https://www.reddit.com/r/termux/comments/uikny1/opengl_support_on_termux_x11/ mesa wayland with glx compile is this? hard mission for me :\ but wait. i feel user:itsfreepizza posted maybe very nice way for me. he meanings tigervnc-xorg-extension ? tigervnc-xorg-session can't find apt and internet web :/

xxfree86 commented 1 year ago

--no-sysvipc option of the proot-distro script seems to bypass the BadShmSeg error.

IntinteDAO commented 1 year ago

mesa wayland with glx compile is this? hard mission for me :

@Suletta-Majo You have packages mesa-zink in TUR repository

Suletta-Majo commented 1 year ago

TURリポジトリにmesa-zinkパッケージがあります thank you i'll get

ThatMG393 commented 1 year ago

@Suletta-Majo Check this out: https://github.com/ThatMG393/gpu_accel_termux

Only tested on Mali GPU's

Suletta-Majo commented 1 year ago

thanx info. out of topic little bit but this script looked include qualcomm SoC. nice :) myphone aquos wish2 > Snapdragon 690 5G Adreno 619L

many Variety of GPU accel is work qualcomm chip https://www.reddit.com/r/termux/comments/10hu1x7/termux_prefix_with_preinstalled_ubuntu_2204_proot/ this comments says 'Virgl works well on Adreno 650 (Snapdragon 865)' maybe mine too :-)

xxfree86 commented 1 year ago

most x applications works fine with termux-x11 + proot-distro but when i try to run glxgears, ffplay, blender got error like this.

X Error of failed request: BadShmSeg (invalid shared segment parameter) Major opcode of failed request: 130 (MIT-SHM) Minor opcode of failed request: 3 (X_ShmPutImage) Segment id in failed request: 0x1400010 Serial number of failed request: 269 Current serial number in output stream: 270

These applications works in vncviewer but slow. :-/

any suggestion?

LG v50 sd855, android 12, proot-distro : ubuntu

git cloned mesa-22.0.5 src, built and installed to /usr/local/lib in proot-distro and glxgear, ffplay, blender, glmark2 runs without error.

i don't know whats going on this but annoying error is gone.

twaik commented 1 year ago

So I can close this?

xxfree86 commented 1 year ago

So I can close this?

of course. ;-)