termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.15k stars 3.02k forks source link

Package request: Emacspeak #6504

Open tmakarios opened 3 years ago

tmakarios commented 3 years ago

You've already got Emacs and eSpeak, so the Emacspeak audio desktop could be a nice addition. It's already packaged by Debian for all architectures.

I tried following the installation instructions in the Emacspeak manual, installing Emacs, eSpeak, clang, and Tcl as required, but when I got to the stage of testing the speech server, running ./servers/espeak resulted in

can't find package Tclx
    while executing
"package require Tclx"
    (file "./servers/espeak" line 37)

My own desire to run Emacspeak is currently mainly based on curiosity, but if it was packaged and reliable, it could become a way of turning mobile phones into very small and portable general-purpose computers for blind people — the physical keyboard they would attach being by far the largest compnent.

BoniLindsley commented 2 years ago

It seems to be missing TclX. I had a go at building TclX from source on device and installing it. (My laptop is a little too old to try to package it.) That completes fine.

What fails is requiring TclX inside Tcl. This happens when running make test from TclX source. Also when testing the espeak server script the OP tried.

couldn't load file "/data/data/com.termux/files/usr/lib/tclx8.6/libtclx8.6.so": dlopen failed: cannot locate symbol "rresvport" referen
ced by "/data/data/com.termux/files/usr/lib/tclx8.6/libtclx8.6.so"...
    while executing
"load /data/data/com.termux/files/usr/lib/tclx8.6/libtclx8.6.so Tclx"
    ("package ifneeded Tclx 8.6" script)
    invoked from within
"package require Tclx"
    (file "/data/data/com.termux/files/home/.local/lib/emacspeak/servers/espeak" line 37)

I assume it has to do with symbols from /system/lib64/libc.so. I do not have enough Android knowledge to debug this.

BoniLindsley commented 2 years ago

I have added a patch to the build script. Now it builds, installs and runs... on my machine. Some caveats of the script:

Originally, there was a build warning about rresvport. And I did not see it because of the small screen space. Woops. The function reserves privleged ports which requires root. So I guess it makes sense that it is not available?

It should be relatively easy to package this? I will add to my to-do list. Would take time to learn though. Slow laptop. New to packaging in general. If anyone wants to package it instead, feel free to.

tmakarios commented 2 years ago

Thanks for working on this, @BoniLindsley!

Your TclX build script works for me, too, and gets Emacspeak running on my Pixel XL!

However, there are a few problems, some of which I also encountered when running Emacspeak on UserLAnd, piping the sound out via plain Termux: https://mail.emacspeak.org/hyperkitty/list/emacspeak@emacspeak.org/message/3U532TOWI2O2DDLMTR2MR7QVHHHE6QBS/

Problems common to Emacspeak on UserLAnd and on plain Termux:

Problems unique to Emacspeak running on plain Termux:

I've been meaning to investigate the silent tabluated lines problem by using log-espeak as the speech server, and looking at the resulting log in /tmp/espeak-*.log, but I haven't got very far.

BoniLindsley commented 2 years ago

Auditory icons that are plain tones (e.g., for blank lines) are silent.

Auditory icon problem still needs some looking into.

You can't interrupt speech [...]

To cancel speech in eSpeak NG, async support is needed. But the Termux build of eSpeak explicitly disables async. https://github.com/termux/termux-packages/blob/cf42a35c87afced7a227269db023da4ebae97470/packages/espeak/build.sh#L19-L20

How usable is Emacspeak for you without speech interrupt? This might not be worth packaging if it is essential. I do not use Emacspeak enough to determine that.

As for the packaging itself, I had intended to use a laptop with whooping 8 GB instead of the 4 GB here. But I broke its system while updating. So I will need time to fix that first.

tmakarios commented 2 years ago

How usable is Emacspeak for you without speech interrupt?

I probably wouldn't use it without that feature. It would mean I couldn't rapidly page-down through a long buffer without having to listen through all the "skipped" pages. Incremental search might be a better way to find the right spot, but I'd still have to listen to the entirety of each line that contains a match (multiple times for lines with multiple matches), until I found the line I wanted.

It might be bearable, especially if Emacspeak was modified to read only one line after each page-down, but given that I have an almost usable solution via UserLAnd, and the remaining problem there (silence on most lines of tables) is also a problem on plain Termux, I might be better off pursuing a solution to (or workaround for) that problem, so that I can use Emacspeak through UserLAnd.

Thanks for your efforts, though!

BoniLindsley commented 2 years ago

Alright. I will give up on packaging this.

I had looked into Speech Dispatcher as an alternative. It is also packaged for Termux, so it should work in theory. There is a proof-of-concept Emacspeak speech server for it at https://github.com/bartbunting/espd. Unfortunately, Speech Dispatcher itself seems to be plagued by the same threading issue as eSpeak NG did. So that idea went poof as well.

tmakarios commented 2 years ago

That's interesting about Speech Dispatcher having threading issues, too. I wonder how UserLAnd is getting around that problem, since interruption works fine there. And I think UserLAnd is based on Termux, or maybe Termux+PRoot.

Anyway, thanks again for all the thought you've put into this.

tmakarios commented 2 years ago

Aha! I've just figured out the solution to the silent lines in tables! In UserLAnd, it's as simple as

sudo apt install alsa-utils

It even means I don't have to change emacspeak-auditory-icon-function from its default value.

So I guess if anyone does one day try again to package Emacspeak for Termux, they might want to add alsa-utils as a dependency. Or an equivalent, since pkg install alsa-utils doesn't work for me in Termux. Or, I guess there might be a way to set up Emacspeak to rely on something else instead of alsa-utils.