Skip to content

tdsr fails to start speechdispatcher under termux on Android 14 #40

@grnowak

Description

@grnowak

Hello.

Thank you for creating a useful light weight multi platform screen reader.

I am running tdsr in termux https://turmux.dev on an Android 14 phone. It ran fine under Android 13.
However, when I tried running tdsr for the first time after upgrading to Android 14, I got:

~/tdsr$ ./tdsr --debug
Traceback (most recent call last):
File "/data/data/com.termux/files/home/tdsr/./tdsr", line 944, in
main()
File "/data/data/com.termux/files/home/tdsr/./tdsr", line 350, in main
synth.start()
File "/data/data/com.termux/files/home/tdsr/./tdsr", line 285, in start
self.pipe = subprocess.Popen(self.speech_server, stdin=subprocess.PIPE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 1026, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 1951, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/data/data/com.termux/files/home/tdsr/speechdispatcher'

However, the speechdispatcher script is very much present:

~/tdsr$ ls -l /data/data/com.termux/files/home/tdsr/speechdispatcher
-rwx------ 1 u0_a218 u0_a218 1146 Feb 23 23:19 /data/data/com.termux/files/home/tdsr/speechdispatcher

Separately, both the tdsr and speechdispatcher scripts do run. If I do:

~/tdsr$ ./tdsr -s cat >test

I get:

stdsr, presented by Lighthouse of San Francisco
/tdsr$ s/tdsr $
x
sexit

If I do:

~/tdsr$ echo "sHello world!" |./speechdispatcher

My phone says "hello world!"

All that tdsr.log contains is:

2024-02-23 21:17:11,668 - tdsr - DEBUG - TDSR started

I've upgraded all termux packages with pkg upgrade. I removed the tdsr directory, and $HOME/.tdsr.cfg. I cloned tdsr fresh from the repository, and ran:

pip3 install -Ur requirements.txt

with no errors, but the results stay the same as shown above.
I've made sure that the termux app has been granted all the permissions that can be granted to it.

I'm currently not as fluent in Python as I would like to be, so am not sure how else to debug this. Since I suspect this to be a problem between Android 14 and termux, I can open an issue in termux's issue tracker. I'm hoping however to be able to provide more than asking someone there familiar with termux internals and Python to install tdsr, and to figure out what's going on. I don't know if the problem is that speechdispatcher can't be opened for some reason, or that the pipe between tdsr and speechdispatcher can't be open for some reason.

Below is the output from logcat when running tdsr. My educated guess is the last line is the key to the problem, but I don't know what to do with that bit of information.
If it makes sense to someone here, great. If not, then it will be available if I link to this issue from the termux issue I would create in the future if we can't resolve it.

02-24 16:33:40.335 27410 27410 W bash : type=1400 audit(0.0:56875): avc: granted { execute } for name="tdsr" dev="dm-63" ino=101827 scontext=u:r:untrusted_app_27:s0:c218,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c218,c256,c512,c768 tclass=file app=com.termux
02-24 16:33:40.339 27410 27410 W bash : type=1400 audit(0.0:56876): avc: granted { execute } for name="coreutils" dev="dm-63" ino=66664 scontext=u:r:untrusted_app_27:s0:c218,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c218,c256,c512,c768 tclass=file app=com.termux
02-24 16:33:40.339 27410 27410 W bash : type=1400 audit(0.0:56877): avc: granted { execute_no_trans } for path="/data/data/com.termux/files/usr/bin/coreutils" dev="dm-63" ino=66664 scontext=u:r:untrusted_app_27:s0:c218,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c218,c256,c512,c768 tclass=file app=com.termux
02-24 16:33:40.339 27410 27410 W env : type=1400 audit(0.0:56878): avc: granted { execute } for path="/data/data/com.termux/files/usr/bin/coreutils" dev="dm-63" ino=66664 scontext=u:r:untrusted_app_27:s0:c218,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c218,c256,c512,c768 tclass=file app=com.termux
02-24 16:33:40.339 27410 27410 W env : type=1400 audit(0.0:56879): avc: denied { search } for name="tests" dev="dm-63" ino=106 scontext=u:r:untrusted_app_27:s0:c218,c256,c512,c768 tcontext=u:object_r:shell_test_data_file:s0 tclass=dir permissive=0 app=com.termux

I'm providing the output of termux-info below in case it proves helpful:

~/tdsr$ termux-info
Termux Variables:
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=7334
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:

sources.list

deb https://mirror.fcix.net/termux/termux-main stable main

root-repo (sources.list.d/root.list)

deb https://mirror.fcix.net/termux/termux-root root stable
Updatable packages:
All packages up to date
termux-tools version:
1.40.6
Android version:
14
Kernel build information:
Linux localhost 5.10.177-android13-4-00003-ga7208022a7ea-ab10815828 #1 SMP PREEMPT Fri Sep 15 16:40:54 UTC 2023 aarch64 Android
Device manufacturer:
Google
Device model:
Pixel 6a
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so

Any help in figuring out what's going on here, and getting to the bottom of this is much appreciated. I will be happy to run additional tests, and provide more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions