nwrkbiz / android-xserver

Maintaining the original project to make it work again with new Android versions.
MIT License
166 stars 18 forks source link

XKB extension not presented on DISPLAY 0 #27

Open JanuszChmiel opened 3 years ago

JanuszChmiel commented 3 years ago

Because I have found out, that new developer want to recode Java X11 server for Android, I would like to kindly ask you, if it would be possible to create fully functional XKB extension for this app. Or if it would require too much work from you. Pluma work, but Orca screen reader, which is very complex app and require reliable XKB extension support fails with error message, that XKB extension not present on DISPLAY 0. I Am aware, that it would require many hours to code many lines in Java to implement XKB fully. I have only kind question, if do you plan it or it is too heavy task for you for now. X11 app work very reliably and it even contain fully accessible menu and all dialogs are fully accessible with screen reader. It is advantage of code approach, which do not use native C library with Android Native activity class. If XKB extension is presented, if you would have some time and A good will, I can help you debugging to make it work even with Orca. But what should I do to give you as detailed log as possible. I Am advanced and ready to test and help you debugging. Thank you very much for yours time and for yours debate.

nwrkbiz commented 3 years ago

Thank you for your report.

What programm did you use to try, can you please upload an quick demo gif/video of the error?

What version of the app did you use? (bear in mind that the f-droid build is outdated)

JanuszChmiel commented 3 years ago

I Am using ArchLinux AArch64 architecture created by using special complex setup scripts created by Mr SD Rausty and others. I AM using latest stable Termux packages, Android 8.0. I Am running yours app available on Google Play store. I have issues with on screen recorders, but I will upload detailed textual output from my SSH console. I Am using Windows 10 and Tera term SSH client to connect to Android device. Without that configuration, I would be never able to constructively debug eerrors. Because running only Termux on Android device is very non comfort for Me. I would never ben able to collect so much text output by using buffers like Teraterm offers. I will send you a command and their textual results on The screen.

I Am only hoping, that XKB extension which will be compatible with Orca screen reader will not be too heavy programmers task for you to solve. I will do my best to help you also.

ZhymabekRoman commented 3 years ago

@JanuszChmiel, Hello, could you say exactly after the launch of which program in Termux (or rather inside the proot'ed Arch Linux distribution) is sent error message about the absence of XCB? I want to personally check and provide more information

JanuszChmiel commented 3 years ago

To be able to use speech synthesizers because I do not see at all, I Am using The following configuration from Termux session.

apt install pulseaudio sox
pulseaudio --start --exit-idle-time=-1
pactl load-module module-native-protocol-unix socket=/data/data/com.termux/files/home/arch/tmp/pulse.sock auth-anonymous=1

I Am running ArchLinux special scripts which can be downloaded from here:

https://raw.githubusercontent.com/TermuxArch/TermuxArch/master/setupTermuxArch.bash

After I finish ArchLinux installation by using The script, I modify /etc/profile Bash script to add Pulseaudio support

export PULSE_SERVER=unix:/tmp/pulse.sock

Then I add my non root user account

addauser janusz

After this procedure, i simply type

su
pacman -S mate mate-extra pulseaudio-alsa espeak-ng orca

After that, and when all packages will be installed, I must type

export DISPLAY=:0

then I run yours X11 server from my Android desktop. I let GUI as it is and I Am controlling SSH session of running ArchLinux in Termux by using Windows computer.

[janusz@localhost root]$ dbus-run-session marco &
[1] 8329
[janusz@localhost root]$ dbus-daemon[8330]: [session uid=1002 pid=8330] Activating service name='org.a11y.Bus' requested by ':1.0' (uid=1002 pid=8331 comm="marco " label="u:r:untrusted_app:s0:c512,c768")
dbus-daemon[8330]: [session uid=1002 pid=8330] Successfully activated service 'org.a11y.Bus'
Window manager warning: Log level 128: unsetenv() is not thread-safe and should not be used after threads are created
Window manager warning: Log level 32: could not find XKB extension.
dbus-daemon[8330]: [session uid=1002 pid=8330] Activating service name='org.gtk.vfs.Daemon' requested by ':1.2' (uid=1002 pid=8331 comm="marco " label="u:r:untrusted_app:s0:c512,c768")
dbus-daemon[8330]: [session uid=1002 pid=8330] Successfully activated service 'org.gtk.vfs.Daemon'
fuse: failed to open /dev/fuse: Permission denied

There is also error missing composition function

Activating service name='org.a11y.atspi.Registry' requested by ':1.0' (uid=1002 pid=8331 comm="marco " label="u:r:untrusted_app:s0:c512,c768")
dbus-daemon[8437]: Successfully activated service 'org.a11y.atspi.Registry'
SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
Window manager warning: Broken client! Window 0x100001 (marco (jak) changed client leader window or SM client ID

[janusz@localhost root]$

So XKB extension can not be even detected not only by using rca. BUt also while using Marco window manager.

JanuszChmiel commented 3 years ago

It will be some complex issue. I can only hope, that it is really not because I do not use Hackers keyboard. Because this keyboard is totally inaccessible for screen readers I must always use some accessible Android keyboards. But I do not thing, that Java code of Xserver is made so only this type of keyboard can be used. Mate-session produce severe crash, because Marco window manager can not use XKB and compositor too.

JanuszChmiel commented 3 years ago

I Am ready to test debu .apk packages no problem. But it will be not very easy to solve XKB and composition issues.

nwrkbiz commented 3 years ago

I am very sorry but the XKB extension as defined and described by https://www.x.org/releases/current/doc/kbproto/xkbproto.html is not implemented yet. This is something that needs to be done.

But maybe this is not the problem, the lack of XKB only prompts a warning.

nwrkbiz commented 3 years ago

Ok, @JanuszChmiel I just reformatted your report, it seems to me like the "macro" window manager is the one complaining and causing troubles. As a workaround you could try to use the window manager shipped directly with the XServer app (or do you depend on macro because of some speech synthesis features?) .

JanuszChmiel commented 3 years ago

No problém. I will be patiently waiting. I Am also aware, that implementing this extension would require many hours of intensive programming from yours team. If you will decide not go through this complex programmers task, I will respect it. For now, I AM using Tigervnc, Pulseaudio integrated in Termux and my loving BVNC Pro. It has some important advantages such as. I can hear Espeak speaking if Orca screen reader will automatically send some text from notification area and I do not have to have phone screen turned on. Because one very kind C programmer have even implemented some shared memory function directly to Proot source code, I can also use some applications which are using shared memory. And C language expert who have implemented this feature hsas implemented it so well, that it do not cause Android kernel instability or other Android parts such as surface flinger, Zigote, ETC. So I can safely use Android apps such as Skype, Google Look out and I can safely run mate desktop environment in background. Some times C expert may be are not very like, that I Am bothering them with my desires about using screen readers on A phone, but I also do my best to help them constructively and I Am doing my best to bring useful remarks for them. Thank you very much for yours kind access to my plea.

JanuszChmiel commented 3 years ago

But how to use this build in window manager? When I turn it on from The X server menu. What would I had to do to run it really? Do I have to type some command from X11 server window on keyboard? Because when I simply activated yours build in window manager, Orca still reported XKB extension not present on display 0.

nwrkbiz commented 3 years ago

But how to use this build in window manager? When I turn it on from The X server menu. What would I had to do to run it really? Do I have to type some command from X11 server window on keyboard? Because when I simply activated yours build in window manager, Orca still reported XKB extension not present on display 0.

Do not run following command: "dbus-run-session marco &", instead perform following 3 steps:

1.) After starting the app please try to open up the X server menu and then click the "Window Manager (off)" menu.

2.) You can verify if its running by checking the X server menu text. It will change to "Window Manager (on)" (take care to not click again).

3.) Start Orca via: "dbus-run-session orca &"

If possible please share resulting logfiles (maybe we are lucky and can work out some way to start orca without the need of the XKB extension).

nwrkbiz commented 3 years ago

I may have a nasty hack, which may allow you to start up orca:

You can try to comment out line 366 within "/usr/lib/python3.9/site-packages/orca/orca.py".

Line 366 will read out:

" _originalXmodmap = subprocess.check_output(['xkbcomp', os.environ['DISPLAY'], '-'])"

Simply add a hash to the beginning to make it read out:

"# _originalXmodmap = subprocess.check_output(['xkbcomp', os.environ['DISPLAY'], '-'])"

Maybe this helps to use this application for speech synthesis.

BR, Giri

JanuszChmiel commented 3 years ago

Thank you very much for yours advice, I will try to edit .py script of Orca tomorrow. If other error will not happen. It will be a little adventure.