[raspberry-vi] Raspbian Mate Article

  • From: Mike Ray <mike@xxxxxxxxxxxxxxx>
  • To: raspberry-vi@xxxxxxxxxxxxx
  • Date: Tue, 2 Aug 2016 22:30:45 +0100

Hello.

I have written a very fast markdown-formatted article on what I have
done to make a Raspbian Lite image into a full Raspbian Mate image with
SPeakUP and Orca.

I will put this on the Web site but in the meantime here is the text,
with all the usual text-wrapping problems associated with email clients:

# How to take a Raspbian Lite Image and Accessify it

This article explains exactly how to use a Raspbian Lite image and add
accessibility tools to it so
that it will:

* Provide the SpeakUp console screen-reader
* Provide the Orca screen-reader in the Mate graphical desktop

## The Choice of Desktop

The desktop of choice from the Raspberry Pi Foundation images is `LXDE`.
 I have so far had no luck
in making it speak with Orca, so we're going to use the `Mate` desktop.

## USB Audio

I have explained elsewhere what happened with the ALSA driver in 2013
and why eSpeak stutters very,
very badly in the console and regularly causes a kernel oops.  I have
also explained elsewhere how
to use my OpenMAX Integration Layer code library to bypass the broken
ALSA driver and render speech
directly on the Raspberry Pi GPU.

Because I have never written a `speech-dispatcher` sound module to use
the OpenMAX IL code, this
image uses a different approach.  It uses a USB sound dongle to produce
the audio.

The USB sound dongles cost about $10.  Any dongle with the C-Media
chip-set will work, and probably
others too.

## Get Raspbian Lite

Go to the Raspberry Pi Foundation download pages and grab the latest
Raspbian Lite image.

You will need a card bigger than 4GB to be confident it will fit on the
card and there will be space
for all of the desktop components and other things you will want to install.

## Configure USB Audio

You will need to configure the audio system so that the USB audio device
is the default.

To do this for all users on more recent versions of Raspbian, edit:

        /lib/modprobe.d/aliases.conf

And change the line:

        options snd-usb-audio index=-2

By commenting it out:

        #options snd-usb-audio index=-2

This causes the USB sound dongle to be device number zero, the default.

The next step is optional and causes sound through both the analogue
socket and the HDMI socket to
be disabled.

Edit /boot/config.txt

And comment out the line:

        dtparam=audio=on

Note that no other program will use either HDMI or analogue audio unless
specifically directed to do
so, since we have changed the default device to the USB dongle.

## Enable the SpeakUp Console Screen-reader

Now edit /etc/modules, and add this line to the end of it:

        speakup_soft

Also now run this command:

        sudo modprobe speakup_soft

And now install espeak and espeakup like this:

        sudo apt-get install espeak espeakup

Now reboot, and you will hear, assuming you have a speaker or phones
plugged into the USB sound
dongle, the Pi shutting down.  You will hear some pops and then the boot
messages.

You can avoid hearing the boot messages if you add ' quiet' to the end
of /boot/cmdline.txt.

So you now have console speech with `SpeakUp`.

## Install Mate

First do an update to ensure you have the latest of everything in your
package cache:

        sudo apt-get update

This will be a minimal image which will have the minimum of stuff
installed for you to customize.

There will be no:

* Web browser, but iceweasel is easy to install
* Email client, but icedove is easy to install also
* Libre Office

When you install these they will appear in the menus.

There is a basic text editor, called `pluma`.

There is a terminal called mate-terminal.

### What is Mate?

Mate is a fork of the older Gnome 2 desktop, now defunct.

### Installation

To install Mate:

        sudo apt-get install mate-core mate-desktop-environment

This will take a long time.  You might want to add the -yqq switch to
stop it asking for
confirmation and to make it run quietly.

Now install the `lightdm` desktop-manager:

        sudo apt-get install lightdm

And now install Orca:

        sudo apt-get install gnome-orca

### Accessibility Switches

You will need to run this command to inspect the accessibility switch:

        gsettings get org.mate.interface accessibility

It should report that it is currently set to `false`.

Set it to true like this:

        dbus-launch gsettings set org.mate.interface accessibility true

Note that I am assuming you are doing this in a console or over an `SSH`
connection, which makes the `dbus-launch` prefix necessary.

Confirm it worked by running the first command again if you like.

I don't know whether you need to set it for root as well like this:

        sudo dbus-launch gsettings set org.mate.interface accessibility true

But it does no harm.

### Speech-dispatcher Configuration

To change `speech-dispatcher` to use `ALSA` instead of `pulseaudio`:

Edit /etc/speech-dispatcher/speechd.conf, and change the line:

        # AudioOutputMethod "pulse

To read like this, note it has been uncommented:

        AudioOutputMethod "alsa"

You also need to edit /etc/pulse/client.conf, and change:

        ; autospawn = yes

To:

        autospawn = no

You may also need to delete any files from:

        /usr/share/alsa/

Which have `pulse` in the name, including files in:

        /usr/share/alsa/alsa.conf.d/

Also do this:

        sudo chmod -x /usr/bin/start-pulse*

Which stops other unrelated stuff launching `pulseaudio`.

*Important*, we have all witnessed the console being silent while the
GUI talks and despite SpeakUp
being configured.

This is because of the way `espeak` is compiled, it tries to use
`pulseaudio` if it sees it is
running, or `ALSA` if it is not.

This has one bad consequence, if `pulseaudio` is running for another
user, `espeak` will fall
silent.

And if `speech-dispatcher` is configured to use `pulseaudio`, then
`lightdm` will have started an
instance of `speech-dispatcher` under the `lightdm` user, which clobbers
`espeak` in the console.

### `lightdm` Configuration

You must make a small change to the configuration file of the `lightdm`
desktop-manager if it is to
speak before you log in to the `Mate` desktop.

Edit:

        /etc/lightdm/lightdm.conf

Find the line which reads:

        #greeter-wrapper=

And change it to read:

        greeter-wrapper=/usr/bin/orca-dm-wrapper

## Finished

Now you have installed and configured everything you need.  Reboot:

        sudo reboot

If you have not added ' quiet' to `/boot/cmdline.txt` you will hear,
after a short while, the boot
messages.

You should also hear, talking over the boot messages after a while, Orca
saying 'screen reader on'.

To shut up the boot messages after a while, press `control+alt+F1` and
then mash the control key a
few times.

You can log into a virtual console by pressing one of `control+alt+Fn`
where n is 1 to 6.

Get to the GUI console with `control+alt+F7`, and log in with username
and password.

## Very Basic Keyboard Commands for Mate

Press ALT+F1 to bring up the menu.

Press ALT+F2 to type in the name of a program to launch, for example:

        mate-terminal

The terminal is also available in the menus.





-- 
Michael A. Ray
Analyst/Programmer
Witley, Surrey, South-east UK

Eyes-free Linux:
http://eyesfreelinux.ninja/

Raspberry VI:
http://www.raspberryvi.org/

=========================================================== 
The raspberry-vi mailing list 
Archives: //www.freelists.org/archives/raspberry-vi
Administrative contact: <mike.ray@xxxxxxxxxxxxxx>
-----------------------------------------------------------
Raspberry Pi and the Raspberry Pi logo are trademarks of the Raspberry Pi 
Foundation.

This list is not affiliated to the Raspberry Pi Foundation and the views and 
attitudes expressed by the subscribers to this list do not reflect those of the 
Foundation.

Mike Ray, list creator, January 2013

Other related posts: