I recently got a raspberry pi 4 and wanted to access its gui because I wanted to use the pi like a note taking device. I wanted a spreadsheet, a browser with quick key navigation and a familiar interface. Yes, I could have used emacs with emacspeak which is something I am exploring but I am familiar with the Linux gui and it is an easier interface to use when coming from Microsoft Windows. As of this writing, I have been unable to get the default lxde desktop to work with Orca. I hear “screen reader on” and can indeed access some desktop elements. I suspect that the accessibility infrastructure in the lxde desktop that is bundled with the raspberry pi is incomplete but cannot be sure of this because I have not tried looking at the events that fire when I navigate screen elements.
Things are different when I use the mate desktop. Orca comes up talking and I can easily navigate screen elements.
Here are the steps I took to get orca with the mate desktop working on the raspberry pi 4. . You must have the following prerequisites in place.
- The pi should be connected to the internet. Use a wired connection else you can also use a wireless connection though that will need you to create a text file on the sd card
- A physical keyboard must be connected to the pi. You will need this keyboard to issue commands on the pi.
- An external USB sound card to avoid the crackling with the 3.5mm jack. This is not necessary any more but is good to have.
- A pair of headphones or speakers to hear speech output once you have launched Orca
I started with raspbian lite because I wanted a clean gui system to start with. However, you can as easily start with the full version of raspbian. Once I had flashed it to a sd card, placed a blank file called “ssh” without the quotes in the boot partition to enable the ssh server of the pi upon boot up, and had booted my pi, I was ready to begin the actual work of installation.
The first thing I had to do was to switch to an external sound card. This is because when I tried using the raspberry pi 4’s native 3.5mm jack for sound output, I got too much crackling. The speech was unintelligible. Please note, in the latest version of raspbian, an external soundcard is no longer necessary.
How can I use an external USB sound-card and set it as default?
Once you have implemented the steps in the above post, you are ready to move to installing the mate desktop.
The following post told me how to install the mate desktop. I have however not moved it to an external drive. Everything is on a sd card which seems to work just fine in my limited testing.
Install Mate Desktop on the Raspberry Pi using an External Hard Drive
I am going to paraphrase the above post.
You will need to run the following commands on the pi. Use ssh from your machine to do so.
Update everything
sudo apt update
sudo apt upgrade -y
sudo apt dist-upgrade -y
Install the mate desktop
Many of the commands have been taken from the below post.
Steps for Configuring Mate Desktop on 4GB Raspberry Pi 4B – (Rev.7)
sudo apt install mate-desktop --no-install-recommends -y
sudo apt install mate-desktop-environment-core -y
sudo apt install mate-themes -y
sudo apt install mate-session-manager -y
sudo apt install xinit -y
sudo apt install mate-terminal -y
sudo apt install mate-applets -y
sudo apt install software-properties-gtk -y
sudo apt install xserver-xorg -y
sudo apt install lightdm -y
sudo apt install xserver-xorg-video-dummy
Setting to boot to mate
Please run the following step to select the mate desktop.
sudo update-alternatives --config x-session-manager
The above command will show you a list of desktops. You will be able to select the mate desktop from the list by using the up and down arrow keys.
Add a text editor
sudo apt install gedit
It is time to install the orca screen reader
The version of orca that comes with the package manager on Raspbian buster is very old. In addition, orca is updated almost every alternate day especially when bugs are found and enhancements are implemented.. Therefore, we will do an installation from source.
Enable any commented out sources
You need to install orca’s dependencies first. However, on my installation of raspbian buster, I had to remove the “#” from a sources line in the following file. This may change from update to update therefore check this before installing dependencies.
/etc/apt/sources.list
Install git
Install the git client by using the following command.
sudo apt-get install git
Install orca build dependencies
sudo apt-get build-dep gnome-orca
Get the orca source code
Ensure you are in your home directory or where ever else you want the source code to be. You do not need to create a separate directory for the source code because the git command will do so.
Run the following command.
git clone https://gitlab.gnome.org/GNOME/orca.git
Build and install orca
Run the below commands. Check the output of each command to ensure that there are no errors.
cd orca
PYTHON=/usr/bin/python3 ./autogen.sh
make
sudo make install
This completes the installation of Orca.
Configuring the dummy display driver
We need to configure mate to run the dummy display driver. If we do not do this, the GUI will exit with an error message stating that no screens were found. A physical display is needed. We use the ddummy display driver to get around this.
You need to edit the following file.
/etc/X11/xorg.conf
If the file is not there, then create a fresh file.
The file must contain the following contents.
Section "Monitor"
Identifier "Monitor0"
HorizSync 28.0-80.0
VertRefresh 48.0-75.0
# https://arachnoid.com/modelines/
# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
EndSection
Section "Device"
Identifier "Card0"
Driver "dummy"
VideoRam 256000
EndSection
Section "Screen"
DefaultDepth 24
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Depth 24
Modes "1920x1080_60.00"
EndSubSection
EndSection
Getting orca running
Launch raspi-config and set the pi to login into the text console automatically.
Reboot the pi by using the following command.
sudo reboot
Give a minute to the pi to boot.
At this point, you should be at the shell prompt. type the following to launch the gui.
startx
Wait for about a minute and you will hear “screen reader on”. At this point, you can begin navigating the mate desktop and setting up Orca the way you want too.
If orca does not start, then hit the left windows + alt + s keys. If that still fails, hit alt+f2, type orca and press enter.
Enabling accessibility on chromium
One of the things you would probably like to have on your pi is an accessible web browser. As of this writing, raspbian comes with the chromium web browser. You need to add a flag when launching chromium to enable accessibility. The best way to do this is to add the flag to the chromium shortcut on the pi. Take the following steps to do this.
- Navigate to the following path.
/usr/share/applications
- You will see many files here. Most of them are desktop shortcuts. Edit the following file.
chromium-browser.desktop
- For every line that starts with the word “exec” ensure you add the following flag to the end of that line.
--force-renderer-accessibility
The line should look something like the below line.
Exec=chromium-browser %U --force-renderer-accessibility
- Go through the entire file changing all the lines that start with the word “exec” as I have shown above.
- Save and close the file.
When you launch chromium, you will find that orca is able to read the contents of the page that has been loaded in chromium.
Credits
My thanks to
Vojt?ch šmiro and Sanchit Ghule
Derek says
Out of curiosity, why –no-recommends and all that? Seems you could’ve pulled in standard Mate, including all the stuff you mentioned separately. Too much installation time/bloat?
Pranav says
Hi Derek, The idea was to keep the bloat down but I am not sure if I achieved that.
Flip says
I’m trying to do this on Raspbian 4 2020/08/20, I think, lite version. The sources list is empty and I want to make sure I don’t need to use install or something like that on this step:
Install orca build dependencies
sudo apt-get build-dep gnome-orca
I will have the audio coming from the 3.5 mm jack, not HDMI or a dongle.
Thank you
Pranav says
Hi,
I do not know why your sources list is empty. That should not happen. I had to uncomment an entry there as I have shown.
Ethan Jackson says
Will orca be preinstalled if you install Ubuntu mate on the pi4.
Pranav says
Hi, I doubt it but cannot be sure.
Darryl says
Hi PRANAV,
Exellent write up and it helped me out massively. Just got my pi400 up and running with usb sound card , Lipo battery and with chromium and emacspeak I now have a full replacement for my wonderful old Voicenote which I still use for reading books and listening to music.
A couple of points for those trying out.
1. Do this first, steps. Get a bash shell up and espeak installed, all doable and testable over ssh.
2. I used raspi-config via putty on windows to turn off HDMI and to use composite video, without this I got no success. raspi-config via putty was accessible which surprised me.
3. I had to play a little with speech dispatcher configuration and set up with user only and pulse,alsa as the right setting. neither pulse or alsa alone worked. so type in “pulse,alsa”. Once the spd-say test ran after I did spd-conf I got a voice and then the rest of your instructions worked brilliantly.
4. I tried firefox and that was hopeless, the performance on YouTube was intolerable but chromium with adblock plus is just the ticket (I have dropped the video settings down).
Thaks for your great post and now onwards and upwards learning a new set of keystrokes, though I will mainly be staying inside emacs.
Cheers
Darryl
Pranav says
Hi Darryl, many thanks for your fantastic comment and I am glad I could help. Could you please elaborate on what you did to speech-dispatcher to get it working? I ask because whenever I have tried to play with its configuration files, I have landed up messing something up. In addition, what lipo battery are you using? I usually use a standard battery pack that you use to charge a mobile phone.
Darryl says
I am using, like you a basic phone charger battery. I made sure that it was the highest output wattage in the store. Still to do more testing with it as I am alittle that it can output enough charge when pushing the pi. The one I only around 18W which I think is around 2Amp so will need to check out over time and will keep an eye out for one that can output 3Amp.
I am mainly a windows user, and new to speech dispatcher and so have not done a great deal. For what it is worth I have done the following.
1. removed system level configuration
2. ran spd-conf and set up for user, leaving all values as default except for the sound engine which defaults to pulse. I tried alsa with no joy and then found that there was a “pulse,alsa” option, tried it out and done.
I am a fan of if it ain’t broke don’t fix it so have not had to dive any deeper into the dispatcher at this time.
Pranav says
Hi Darryl,
Many thanks for your answer. I have not touch the speech-dispatcher system configuration but it is good to know about your approach.
I too have been looking at USB phone chargers. See if you can get hold of a USB battery pack that supports pass through so that you can continue charging the pack while you run the pi from it. As for 5V 3A, see battery packs from One Plus. I saw them on amazon and that pack does have that output.
Guy Schlosser says
Hi there! I just bought a pi 400, and I’m considering flashing Ubuntu mate onto an SD card. How will your instructions differ, if any, in that configuration? Thanks for any advice.
Pranav says
Hi,
I doubt my instructions will differ too much. The biggest challenge I see is that there is no raspi-config program. You will need to search and determine if you can install that program on ubuntu. Other than that, I do not see any differences.
Micjkeyj4j says
It would be handy if Linux had support natively for accessibility, and upon installing an os had the option to install accessibility apps. My friend who is blind was wanting to use Linux and is trying out Mint Mate on her laptop. From her experience
As it stands many apps don’t work properly with Orca they give errors and she doesn’t know what’s there.
She said that apps could be easily coded with the necessary support so orca could access them but the app developers don’t think about it, especially if they don’t require the screen reader.
To achieve things and get a Linux os to be accessible for the blind is such a headache. , there have been small os built by indivuals that had allot 9f work done that have been abandoned when the person building them no longer can, or dies etc.
Linus is a great os but the lack of support for accessibility is so appalling. It actually goes against the ethos of why Linux was created in the first place.
Pranav says
Hi,
I hear you. Linux has native accessibility, see a speek up and the kernal level screen reader support.
Having said that, the GUI accessibility stack is a mess from what I know. Attemps are being done to resolve this in the form of cross platform accessibility APIs but they will take time.
Also, try arch linux which usually is on the latest versions of packages or, slint which is meant for accessibility and is well maintained.