Coder Social home page Coder Social logo

chrys87 / fenrir Goto Github PK

View Code? Open in Web Editor NEW
44.0 13.0 13.0 7.77 MB

An TTY screenreader for Linux.

License: GNU Lesser General Public License v3.0

Python 87.24% Shell 3.63% Roff 9.13%
accessibility screen-reader braille python-3 a11y console tty

fenrir's Introduction

Fenrir

A modern, modular, flexible and fast console screenreader. It should run on any operating system. If you want to help, or write drivers to make it work on other systems, just let me know. This software is licensed under the LGPL v3.

OS Requirements

  • Linux (ptyDriver, vcsaDriver, evdevDriver)
  • macOS (ptyDriver)
  • BSD (ptyDriver)
  • Windows (ptyDriver)

Core Requirements

  • python3 >= 3.3
  • screen, input, speech, sound or braille drivers dependencies see "Features, Drivers, Extras".

Features, Drivers, Extras, Dependencies

Input Drivers:

  1. "evdevDriver" input driver for linux evdev
  • python-evdev >=0.6.3 (This is commonly referred to as python3-evdev by your distribution)
  • python-pyudev
  • loaded uinput kernel module
  • ReadWrite permission
    • /dev/input
    • /dev/uinput
  1. "ptyDriver" terminal emulation input driver
  • python-pyte

Screen Drivers:

  1. "vcsaDriver" screen driver for linux VCSA devices
  • python-dbus
  • Read permission to the following files and services:
    • /sys/devices/virtual/tty/tty0/active
    • /dev/tty[1-64]
    • /dev/vcsa[1-64]
    • read logind DBUS
  1. "ptyDriver" terminal emulation driver
  • python-pyte

Speech Drivers:

  1. "genericDriver" (default) speech driver for sound as subprocess:
  • espeak or espeak-ng
  1. "espeakDriver" speech driver for Espeak or Espeak-NG:
  • python-espeak
  1. "speechdDriver" speech driver for Speech-dispatcher:
  • Speech-dispatcher
  • python-speechd
  1. "emacspeakDriver" speech driver for emacspeak
  • emacspeak

Braille Drivers:

  1. "BrlttyDriver" braille driver (WIP):
  • brltty (configured and running)
  • python-brlapi

Sound Drivers:

  1. "genericDriver" (default) sound driver for sound as subprocess:
  • Sox
  1. "gstreamerDriver" sound driver for gstreamer
  • gstreamer >=1.0
  • GLib

Extras:

  1. spellchecker
  • python-pyenchant
  • aspell-YourLanguageCode (example aspell-en for us English)
  1. Unix daemon (also needed for Systemd):
  • python-daemonize
  1. Modify system volume:
  • pyalsaaudio (needs libasound2's headers).

installation

If there is a package for your distrobution of choice, please let us know so we can add it here.

  • Archlinux: PKGBUILD in AUR (fenrir-git recommended)

  • PIP: sudo pip install fenrir-screenreader

  • Manual:

  • install "espeak" and "sox" with your package manager

  • sudo pip install -r requirements.txt

  • run install.sh or uninstall.sh as root

  • you also can just run it from Git without installing: You can just run the following as root: if you are in Fenrir Git rootfolder:

    cd src/fenrir/ sudo ./fenrir

Same thing, but use the daemon so the terminal is not blocked:

cd src/fenrir/
sudo ./fenrir-daemon

Settings "settings.conf" is located in the "config" directory or after installation in /etc/fenrir/settings. Take care to use drivers from the config matching your installed drivers. By default it uses:

  • sound driver: genericDriver (via sox, could configured in settings.conf)
  • speech driver: genericDriver (via espeak or espeak-ng, could configured in settings.conf)
  • braille driver: brlttyDriver (WIP)
  • input driver: evdevDriver

Configure pulseaudio

Pulseaudio by default only plays sound for the user its currently running for. As fenrir is running as root, your local user does not hear the sound and speech produced by fenrir. for this fenrir provides a script to configure pulseaudio to stream the sound played as root to your local user. This is not a issue of fenrir but this is how pulseaudio works.

just run the configuration script twice (once as user, once as root):

/usr/share/fenrirscreenreader/tools/configure_pulse.sh
sudo /usr/share/fenrirscreenreader/tools/configure_pulse.sh

The script is also located in the tools directory in git

Configure pipewire

Pipewire by default only plays sound for the user its currently running for. As fenrir is running as root, your local user does not hear the sound and speech produced by fenrir. for this fenrir provides a script to configure pipewire to stream the sound played as root to your local user. This is not a issue of fenrir but this is how pipewire works.

just run the configuration script twice (once as user, once as root):

/usr/share/fenrirscreenreader/tools/configure_pipewire.sh
sudo /usr/share/fenrirscreenreader/tools/configure_pipewire.sh

The script is also located in the tools directory in git

localization

copy fenrir.mo translations file from fenrir/locale/your_language/LC_MESSAGES/fenrir.mo to /usr/share/locale/your_language/LC_MESSAGES/fenrir.mo

Documentation

Here is the Fenrir Wiki. It is currently being updated, so keep checking back. Feel free to help with documentation.

fenrir's People

Contributors

adamlincoln avatar chrys87 avatar cmb avatar fudge333 avatar jticket1024 avatar lilmike avatar manuelcortez avatar nunonunowicz avatar rybinden avatar schulle4u avatar stormdragon2976 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fenrir's Issues

fenrir and fenrir-pty causing major CPU and memory usage

Fenrir-daemon and fenrir-pty, when running together, can cause major CPU and memory usage in the daemon when things like headphones are muted when using mumble or similar. Reproduced with linphone+fenrir-daemon+fenrir-pty+muting. Log is attached.
Best guess is that they are fighting for devices with one another/linphone/something else.
fenrir.log

Fenrir in Raspbian

Hi, I have been trying to use Fenrir in Raspbian.

I have changed in src/fenrir/fenrir:
#!/bin/env
for
#!/usr/bin/env
But when I try to run the application, I get the following:

...
ANY INFO 2017-01-25 19:31:02.972524: Punctuation: EMOTICONDICT.;) :twinker
ANY INFO 2017-01-25 19:31:02.972795: Punctuation: EMOTICONDICT.XD :loool
ANY INFO 2017-01-25 19:31:02.973071: Punctuation: EMOTICONDICT.:D :lought
ERROR 2017-01-25 19:31:02.973758: Loading inputDriver Driver : 'module' object has no attribute 'module_from_spec'
Traceback (most recent call last):
File "./fenrir", line 21, in
main()
File "./fenrir", line 16, in main
app = fenrir.fenrir()
File "/home/pi/code/fenrir/src/fenrir/fenrir.py", line 19, in init
self.environment = settingsManager.settingsManager().initFenrirConfig()
File "/home/pi/code/fenrir/src/fenrir/core/settingsManager.py", line 260, in initFenrirConfig
environment['runtime']['inputManager'].initialize(environment)
File "/home/pi/code/fenrir/src/fenrir/core/inputManager.py", line 19, in initialize
self.env['input']['newNumLock'] = self.env['runtime']['inputDriver'].getLedState()
AttributeError: 'NoneType' object has no attribute 'getLedState'

Do you have any idea about why this is happening?

daemonization failure

Get the following error when running as root after installation:

Traceback (most recent call last):
  File "/usr/bin/fenrir", line 26, in <module>
    daemon = Daemonize(app="fenrir-daemon", pid=pidFile, action=main, chdir=os.path.dirname(os.path.realpath(__main__.__file__)))
TypeError: __init__() got an unexpected keyword argument 'chdir'

Unicode /dev/vcsu* support for linux screen driver

Linux screen driver makes some use of /dev/vcs* pseudo devices to obtain screen text. The down side of this is that /dev/vcs* devices only contain ansi representation of the screen content, user has to configure correct code page for the screen driver in order to read non-ascii characters. Even if this is configured correctly fenrir can only read limited number of characters from the screen.
Since linux 4.19, there are /dev/vcsu* devices complementing /dev/vcs* devices allowing reading of unicode data from the screen.
This is something brltty is making use out of in its upcoming 6.0 release.
Would it be possible to implement this into fenrir as well?
Patches related to the kernel implementation are at: https://lore.kernel.org/patchwork/patch/956334/

Greetings

Peter

Log failed accesses to /dev/vcsa so they appear by default

I attempted to launch Fenrir and it didn't work, nor did it output anything to the console. When I ran it with -dp to display debug logs, I saw a failed attempt to access /dev/vcsa6.

This is easy to resolve, but it seems like Fenrir should loudly log the failure rather than just not work. It may also make sense to just exit, since at that point it doesn't make sense to keep running.

Thanks a bunch.

Phonetic reading is broken

Fenrir's phonetic reading is apparently broken. when I press for example fenrir_key+shift+2 to read the character phonetically, the review cursor jumps somewhere, usually to the next line. I've already made sure I'm using the correct keyboard layout, desktop.

Using the latest git version in Gentoo, on a pure console.

question: fenrir and curses

Hello,

thank You very much for this program. I just wonder whether is there any support for fenrir and curses library. I have got several programs using curses programming library and it seems like fenrir starts to read from the top but while I press the insert key and Shift and letter K while having defined fenrirKey in the file:
/etc/fenrirscreenreader/settings/settings.conf
fenrirKeys=KEY_INSERT
the screen is not read but instead it redraws and puts the cursor in the top left corner.

Any hint would be appreciated. Thank You very much.

Attachment:
My system id Debian 11 and Python 3.10
Fenrir is installed from master branch.

Syntax error on startup

Hello,

While configuring fenrir, the package would tell me:

File "/usr/lib/python3/dist-packages/fenrirscreenreader/inputDriver/atspiDriver.py", line 52
global _availableError
^
SyntaxError: name '_availableError' is used prior to global declaration

The attached patch.txt fixes it

not working under macOS

Hi.
some people told me that this will work under macOS, but installation fails, because the script is trying to install it in a location that is locked, due to security.

Using copy/paste functions doesn't keep line breaks

When I mark a text, then copy and paste somewhere, Fenrir doesn't keep line breaks, but paste all of the text as a single line. this occurs when copying from the bash terminal as well as nano editor. It appears Fenrir is somehow erasing the line break character, or the like.

Add a configuration location in $HOME

It'd be nice if settings.conf could be located somewhere in $HOME but outside the source directory. I install most non-packaged software into my home directory so a restore gets me back to a comfortable system configuration. As things stand, it looks like I either have to run Fenrir from source, or keep my personal configuration in /etc.

Might be nice if ~/.config/fenrir/settings.conf could also be checked. Then maybe ~/.config/fenrir could be used for other things like user scripts.

Thanks!

Sync LEDs on Grab/ Ungrab

Sync LEDs on Grab/ Ungrab to not change the state on switch between that contexts.
example Wifi disables on start fenrir.

What is the "correct" way to change the fenrir voice while it's running?

I have to frequently switch the speaking language while using fenrir but there doesn't seem to be an easy way to do that. The best I've found is:

  1. Switching away from what I was doing
  2. editing settings.conf and changing the voice field
  3. Pressing fenrir+q
  4. Getting back to what I was doing
  5. Repeating all that when I want to switch back

The documentation mentions some languages field, which isn't present in the configuration and neither is the script that supposedly uses it.

I'm using the latest version of fenrir from the aur. Thanks in advance.

No text reading in NE

Fenrir doesn't read any text content in the NE text editor. It rather reads the status bar content, e.g. line and column, whenever I move with any arrow key. Enabling highlight tracking doesn't help. Speakup reads the text content correctly.

Using Gentoo and Fenrir at a pure console.

cataclysm-dda

hello. i started to play cataclysm-dda
i tryed to use fenrir instead speakup, but it have sum strange quirks.

reproduce

  1. install cataclysm ~ pacman -S cataclysm-dda
  2. set tty size ~ stty columns 80 rows 43
  3. start the game
  4. start new game. new, [Play Now! (Fixed Scenario)]
  5. press "x" to enter look mode
  6. move cursor around

the panel with tile info isn't read by fenrir. however speakup and brltty see it.

System freezes after login

Hello,
I recently installed fenrir-git from the AUR. After login, the system freezes when Fenrir is first loaded when the system is set to use SpeechDispatcher as my output module of choice.

Here is what I did before installation:

  • Grant ReadWrite permission to /dev/input and /dev/uinput
  • Grant Read permission to /sys/devices/virtual/tty/tty0/active, /dev/tty1, and /dev/vcsa1
  • Install sox for sound output
  • SpeechDispatcher is working as expected with voxin output module.

After installation, I ran the configure_pipewire script as both root and as my regular user. Pipewire and pipewire-pulse are set to start at boot, and my regular user is also added to the "audio" group.

When rebooting the system and logging in with my username and password, the system locks up and freezes after a few seconds. Sometimes, I do hear the Fenrir startup sound, but other times, I don't.

Is there anything I'm doing wrong, or is there a step I'm missing?

Thanks.

Fenrir+F4 does not flush buffer

Pressing Fenrir+F4 does not immediately stop speech if buffer contains more to speak. For example if Fenrir+F4 is pressed after launching Emacspeak, Fenrir continues to gabble lisp loads. Should stop immediately IMHO

Brailledisplay 8 dot

Hi
I would like to know if
I can change settings for braille display | and $ seems to be wrong and Dot 4 5 for $ as I recalled( < >). And the numbers are also one Step down.
How can I change the braille display settings for the fenrir?
It is just a little bit confusing, because brltty did by default also used this braille Types.
I won't to test if I can develop on linux better on nano or vim.

Do not use sketchy path determination

Fenrir currently hard-codes its path and makes various hard assumptions about the Linux system it runs on. It assumes, for example, that the configuration directory is either /etc/fenrirscreenreader or fenrir_binary_location/../../config. This doesn't work on distributions like NixOS, where it is (not) best practice to store configuration under /etc (as that is used for global system configuration, and package-based configuration usually resides in the nix store to be manipulated with configuration options within configuration.nix). It is therefore highly advisable to provide a command-line option to override this determination and to specify the settings root.

fenrir and archiso with anarchy problem when booting up

I am working with anarchy developers to add accessibility to theyr installer.
At first i used espeakup, but when i would want to install a desktop it would conflict with orca.
I downloaded the aur fenrir package, edited a pkgbuild a little to provide some optional depends as required, made python-espeak from aur too, and created an arch repository with these packages at
https://stas-prze.github.io/arch/repo
I edited the customize-airootfs.sh to start fenrir as a system service, and it worked perfectly.
The problem is when i start the iso.
I cant tell you what exactly fenrir says because of the startup sound beeing a little to loud, but i hear that it starts with that 8bitty dingdong, and then i hear something is not installed, something is a name of some package or something like that, i thing something related to speech.
I also switched my repo out for the jenux repo, and tested with that and the jenux fenrir config, but it didn't work, even no startup sound and no speech, unless speech dispatcher didn't installwhitch it should have cause i didn't hear any error of sord failed to enable speech-dispatcherd.service.
If you want i can send over my archiso config

Complete pty/pty2 keyboard layouts

Hi,
I am using pty mode because tried to run fenrir on termux/android.
I cannot do it directly, but it works well on proot/archlinux and likely other distros, however the only mode I can use there is pty mode.
The problem is the keyboard layout is incomplete.
It would be nice if it were completed for other people like me who have to use full pty mode without evdev.

Can't input after starting Fenrir

Hi, I'mn attempting to install Fenrir. I've gone through an installed dependencies, run the pulseaudio script as normal user and root, and run the install script. When I check dependenceis using the script, I get these:

python3-brlapi: FAIL
python3-speechd: FAIL
python3-espeak: FAIL

I'm on Ubuntu and python3-speechd is version 0.9.1-4. python3-espeak is 0.5-2. I'm not using braille.

When I start fenrir, I get the starting sound, but then can enter no input and hear nothing until cancelling the process with Control-c, when I get the exit sound. When I disable sound effects, I get a "start fenrir" and "quit fenrir" message. I'm using gnome-terminal on Ubuntu 20 LTS. Any guidance from here on getting fenrir working would be appreciated .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.