Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

126.5. brltty-6.9.1

Braille display and console speech — the screen reader

Version 6.9.1, release 1
Shelf accessibility — Screen readers, speech, braille and alternative input
Phase 41_system (System), 53 of 1047 in build order
Licence LGPL-2.1-or-later
Homepage https://brltty.app/
Build time 1.0 SBU
Installed size 9.0 MiB in 955 files
Recipe ports/core/accessibility/brltty/kpkgbuild

About

BRLTTY is the screen reader of the text console: it drives a refreshable braille display, speaks through a speech synthesiser, or both. It reads the Linux console through /dev/vcsa, so what it covers is the login prompt, a shell on another virtual terminal and the installer. It does not read the graphical session. There the reader is Orca, which reads the native applications and reaches a braille display through BRLTTY’s API, BrlAPI, and its Python module. What is and is not read, how to turn it on and how its speech reaches the sound card are in Braille and speech at a text console.

The package installs the brltty daemon, with its three screen drivers and the eSpeak NG speech driver built in; its braille drivers and its other speech drivers as loadable modules under /usr/lib/brltty; libbrlapi with its Python module; the polkit action and rule that admit a BrlAPI client; and a service script, 65_brltty.

Why it is in KDOS

The comment above it in script/phases/41_system/packages.d/accessibility.txt:

BRLTTY reads /dev/vcsa, so what it covers is the text consoles: the tty1 login prompt before the desktop starts, tty2 and the installer — grids of cells it takes verbatim, with none of the guessing a toolkit tree needs. Once the desktop runs on tty1, that console gives it nothing. It does not read the graphical session: its AtSpi2 screen driver is not built, and the session's reader is Orca, which reaches a braille display through BrlAPI. The statement of record is docs/kdos/02-user-guide/accessibility.md.

Sources

Dependencies

Depends on: autoconf, automake, libtool, pkgconf, ncurses, alsa-lib, eudev, espeak-ng, coreutils, doxygen, speech-dispatcher, bluez, dbus, polkit, icu, libcap, pcre2, expat, gettext, tmux, liblouis, python3, python3-cython, python3-setuptools.

Required by: no port names it.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install brltty'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/accessibility/brltty.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/accessibility/brltty
echo 'cf4619ce1471690e4ecc5544ee6289cef6c5bdf5855a1ac8dcc63f5beedf108d  brltty-6.9.1.tar.xz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/brltty
SRC=$SRC_ROOT/brltty-6.9.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf brltty-6.9.1.tar.xz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

./configure \
	--prefix=/usr \
	--sysconfdir=/etc \
	--libdir=/usr/lib \
	--localstatedir=/var \
	--disable-x \
	--disable-java-bindings \
	--disable-ocaml-bindings \
	--disable-tcl-bindings \
	--enable-python-bindings \
	--disable-lua-bindings \
	--disable-emacs-bindings \
	--disable-lisp-bindings \
	--enable-liblouis \
	--disable-gpm \
	--enable-i18n \
	--enable-icu \
	--enable-polkit \
	--enable-expat \
	--with-curses=ncurses \
	--with-rgx-package=libpcre2-32 \
	--with-pcm-package=alsa \
	--with-midi-package=alsa \
	--with-service-package=no \
	--without-libbraille \
	--without-espeak \
	--without-flite \
	--without-mikropuhe \
	--without-swift \
	--without-theta \
	ac_cv_header_eci_h=no \
	ac_cv_lib_intl_main=no \
	--with-screen-driver=lx,em,tx,-all \
	--with-speech-driver=eSpeak-NG
make
make install INSTALL_ROOT=$PKG CONFLIBDIR=:
compgen -G "$PKG/usr/lib/python3*/site-packages/brlapi*.so" >/dev/null || {
	echo 'brltty: the Python brlapi module was not built; Orca would have no braille' >&2
	exit 1
}

make install-polkit INSTALL_ROOT=$PKG

install -d "$PKG/etc/init.d"
cat > "$PKG/etc/init.d/65_brltty.sh" <<'KDOS_SH'
#!/bin/bash
. /etc/init.d/service_helper

NAME="brltty"
DAEMON="/usr/bin/brltty"

case "$1" in
    start)
        [ ! -x "$DAEMON" ] && { echo "[SKIP] $NAME: $DAEMON not found"; exit 0; }
        # The configuration is the only opt-in. An attached serial or USB
        # device is no sign of a braille display — most are something else —
        # and nothing installs /etc/brltty.conf: a machine starts BRLTTY once
        # somebody writes one naming the display driver or speech path.
        if [ ! -s /etc/brltty.conf ]; then
            echo "[SKIP] $NAME: no /etc/brltty.conf"
            exit 0
        fi
        echo "[KDOS] Starting $NAME..."
        # Speech plays through ALSA `default`, which is the session's
        # PipeWire, and init starts no PipeWire: without this the voice is
        # "Host is down" and silence. kdos_card is the card itself and is
        # exclusive, and eSpeak NG holds it only while an utterance plays:
        # while a desktop session's PipeWire holds the card this cannot
        # speak, and while this speaks PipeWire cannot play.
        export KDOS_ALSA_DEFAULT=kdos_card
        supervise "$NAME" "$DAEMON" -n
        ;;
    stop)   stop_service "$NAME" ;;
    status) check_status "$NAME" ;;
    *)      echo "Usage: $0 {start|stop|status}"; exit 1 ;;
esac
KDOS_SH
chmod 755 "$PKG/etc/init.d/65_brltty.sh"

The switches, and why each is set:

The braille driver list is left at its default, which builds every driver configure registered as a loadable module under /usr/lib/brltty; almost all of them speak to the display through BRLTTY’s own serial, USB, HID and Bluetooth code and need no library.

The common switches of each build system are explained in the Flag glossary.

postinstall.sh runs on the installed system after the package is adopted:

# Everything is written under PKG_ROOT, the root kpkgadd is installing into:
# --root and an A/B update install into a tree that is not the running one.
#
# BrlAPI admits a client through polkit's org.a11y.brlapi.write-display, and
# the rule build.sh installs grants that action to the brlapi group and to
# nobody else: without the group every BrlAPI client — brltty-clip included —
# is refused by the running daemon. The desktop account joins it only when the
# group is first made, so a user who later leaves it stays out across
# reinstalls. The guard reads PKG_ROOT's files, because getent answers for the
# running root and not the tree being installed.
root="${PKG_ROOT:-/}"
if ! grep -q '^brlapi:' "$root/etc/group" 2>/dev/null; then
	groupadd -R "$root" -r brlapi
	grep -q '^kdos:' "$root/etc/passwd" 2>/dev/null && \
		usermod -R "$root" -a -G brlapi kdos
fi

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/brltty, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf brltty-6.9.1-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/brltty, and runs the triggers its paths call for.

Contents

Installed programs: brltty, brltty-atb, brltty-cldr, brltty-clip, brltty-cmdref, brltty-config.sh, brltty-ctb, brltty-genkey, brltty-hid, brltty-ktb, brltty-lsinc, brltty-mkuser, brltty-morse, brltty-prologue.bash, brltty-prologue.lua, brltty-prologue.sh, brltty-prologue.tcl, brltty-setcaps, brltty-term, brltty-tmux, brltty-trtxt, brltty-ttb, brltty-ttysize, brltty-tune, eutp, vstp.

Installed libraries: libbrlapi.a, libbrlapi.so.

Installed directories: /etc/brltty, /usr/include/brltty, /usr/lib/brltty, /usr/lib/python3.14/site-packages/Brlapi-0.8.8-py3.14.egg-info, /usr/libexec/brltty, /usr/share/licenses/brltty, /var/lib/BrlAPI.

Short descriptions

brltty refreshable braille display driver for Linux/Unix
eutp EuroBraille file transferring
vstp VisioBraille file transferring
brltty.pc Braille Device Daemon

Notes

The source is the release archive from brltty.app, not the tag archive from GitHub. The release carries upstream’s generated configure; the tag archive has none and needs ./autogen, which would generate it with this tree’s autoconf and run Tools/gendeps, a Tcl script that opens every source file to follow its includes. Upstream’s configure calls expr length, a GNU extension that POSIX expr does not have, so coreutils is in depends.

BrlAPI admits a client only when it may: its default is a key file plus polkit, and make install writes neither half. The key file would be one secret copied into every image, so the port installs only the polkit half, with make install-polkit: the action org.a11y.brlapi.write-display and upstream’s rule, which grants it to members of the brlapi group and tests no session. postinstall.sh creates that group the first time the package is installed and adds the desktop account, kdos, to it; a user later removed from the group stays out across reinstalls. Without the group every BrlAPI client is refused, Orca and brltty-clip included (see Programs that talk to BRLTTY).

The service script, /etc/init.d/65_brltty.sh, starts nothing until /etc/brltty.conf exists and is not empty, and nothing installs that file: an attached serial or USB device is no sign of a braille display. It runs the daemon as root, because /dev/vcsa belongs to root and the tty group, and sets KDOS_ALSA_DEFAULT=kdos_card, so speech goes straight to the sound card when no session’s PipeWire is running. The eSpeak NG driver links espeak-ng, which opens the card for each utterance and closes it once the utterance has played, so BRLTTY holds the card only while it speaks (see Turning BRLTTY on and Speech and the sound card).