Skip to content
Marc René Schädler edited this page Jul 30, 2018 · 16 revisions

Hardware

Basic setup

  1. Download Raspbian stretch lite: https://www.raspberrypi.org/downloads/raspbian/
  2. Install the Raspbian image on the SD card: https://www.raspberrypi.org/documentation/installation/installing-images/
  3. Check all hardware parts and batteries
  4. Connect a USB-keyboard and HMDI-compatible display to the raspberry
  5. Connect the remaining hardware, but not the powerbank
  6. Connect the powerbank
  7. Try to log in, default user is "pi" and default password "raspberry" (with German keyboard layout letters "z" and "y" are swapped)

Advanced setup

  1. Complete the basic setup
  2. Run sudo raspi-config (with German keyboard layout the "-" (dash) is on the "?"-key)
    1. Configure your keyboard layout (localization options)
    2. Configure your wi-fi country (localization options)
    3. Enable SSH access (interfacing options)
    4. Change the hostname
    5. Toggle console auto-login (boot options, desktop/cli)
    6. "Finish" the configuration and run "sudo reboot"
    7. Try to log in again
  3. Deactivate frequency-scaling: Add a new line with force_turbo=1 at the end of /boot/config.txt
  4. Disable on-board audio: Comment out dtparam=audio=on in /boot/config.txt"
  5. Configure wifi with hostapd (example hostapd.conf) to enable wireless remote access via ssh: https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/
  6. Resource for further low latency audio suggestions: https://wiki.linuxaudio.org/wiki/raspberrypi?&

Sound card setup

  1. Add a new line with dtoverlay=audioinjector-wm8731-audio at the end of /boot/config.txt
  2. Power off: sudo poweroff
  3. Connect the sound card
  4. Power on
  5. Resource for further instructions: http://www.flatmax.org/phpbb/viewtopic.php?f=5&t=3

The default configuration of the sound card is odd. You will need to configure it using alsamixer. Once you are happy with your configuration you can use sudo alsactl store to store that configuration. It will be loaded the next time you boot. Here is an example configuration. Place it in /var/lib/alsa and it will be loaded on the next reboot or with sudo alsactl restore

Bluetooth controller

Pair Bluetooth controller: https://www.cnet.com/how-to/how-to-setup-bluetooth-on-a-raspberry-pi-3/

Software

Update the already installed software and reboot afterwards: sudo apt dist-upgrade

Generally it is advisable to install several packages, some of which are required and some are just for comfort: sudo apt install build-essential haveged ssh mosh byobu git tig htop nmon "build-essential" is needed for building software, "haveged" seems to help saving entropy which is needed to start the encrypted wifi connections, "byobu" is handy to tile and detach console sessions.

Jack audio server

  1. Install jackd: sudo apt install jackd2 libjack-jackd2-dev
  2. Add the following line to the end of the file "~/.bashrc": export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
  3. Create the file /etc/dbus-1/system-local.conf and copy the content of the provided example.
  4. Reboot the Raspberry: sudo reboot
  5. Look at a list of the sound cards: aplay -l
  6. Try to start jackd with the following command, replacing SOUNDCARD with the name of the soundcard (e.g., "audioinjectorpi" for the Audioinjector soundcard): jackd -dalsa -dhw:SOUNDCARD -p96 -n4 -r48000 -s
  7. Stop jackd pressing Ctrl+C

njconnect

It can be difficult to connect and disconnect jack clients in the terminal. You can use "njconnect" which is a simple ncurses based interface to control jack connections: https://sourceforge.net/projects/njconnect/

  1. To compile it, you first will need to install the ncurses librar"buildy headers sudo apt install libncurses5-dev
  2. Compile with: make
  3. Run with: ./njconnect
  4. Press "a" to see the available and established connections and use "tab" to switch between panels "build

openMHA

  1. Clone the openMHA source code with git: git clone https://github.com/HoerTech-gGmbH/openMHA.git
  2. Follow the installation instructions in the README.md file
  3. Use the example configuration which works with the proposed setup using the Audioinjector soundcard
  4. There is also a simple script to start openMHA which starts jack and openMHA, opening the configuration on port 33337.

Remote access via SSH

  1. Start sudo raspi-config
    1. Change the default password
    2. Enable SSH access (interfacing options)
  2. Connect the Raspberry Pi to a local area network
  3. Check if it got an IP address: ifconfig (default 172.24.1.1)
  4. Try to connect to that IP address (or the hostname) from a remote PC with ssh
  5. Use the -L option of SSH to enable port-forwarding of the MHA-control port: ssh -L33337:localhost:33337 pi@HOSTNAME

Text to speech

  1. Install flite: sudo apt install flite
  2. See actions.sh for example usage

Autostart

To run openMHA automatically when booting the Raspberry Pi: Add the autostart example to the end of "~/.bashrc"

Create an SD card image

An image of the SD card can be created to share a pre-configured setup.

Tests and configure the device

  1. Calibrate the device
  2. Measure the latency
  3. Take note of the limitations due to feedback
  4. Fit the device to an individual hearing profile