First test with Moode and the official Raspberry Pi touch display

My experience on how to configure Moode r23 and r24 for the official Raspberry Pi touch display and controlling MPD via touch screen

Posted on October 25, 2015 by @lorenzoferrara and updated on November 08, 2015

WARNING: Please note that this article describes my experience and the results you might get reproducing what I did could be different. Please understand that I am not responsible for the results you might get reproducing what I did. If you choose to follow my notes and something bad happens, don't blame me, you are responsible for what you do. In doubt, my advice is to go and read some news.

UPDATE AVAILABLE: This tutorial has been updated. Plead check out the new one at The Raspberry Pi official touchscreen in Moode.

@MoodeAudio tweeted us that version r23 already runs 4.1.10 kernel, so the kernel/firmware upgrade part of this post will be removed. Also the part on the filesystem resizing has been updated.

We thank @MoodeAudio for this update.


The idea is to use a touch display to control an MPD client. We start using Moode because it has already everything configured for the Raspberry Pi, has great support for DACs, and uses Raspbian.

This is what the display will show at the end of this guide

Notice: for this test I used Moode versions r23 and r24.

After flashing the moode-sdimg-r23.img image file to the microsd card, we connect the official Raspberry Pi touch display to the Raspberry Pi, insert the microsd card in the Raspberry Pi and boot up the system.

Expand SD card filesystem

UPDATE 2015-11-08: Previously, this part of the post mentioned the use of fdisk. Moode provides a more friendly way to expand the filesystem, so this part has been updated.

Once Moode is running, we need to find the IP address of the Raspberry Pi and open a browser pointing to the device.

In the top right menu, clicking on "Configure" the "Configuration settings" pops-up. Under the "System" option we need to find the "Expand SD Card storage" option and enable it. Moode will reboot and expand the filesytem on the SD card.

Configure the audio device

Before proceeding with the configuration of the touch display we configure Moode.

We open a browser and point it to the Raspberry Pi IP address. For the tests I'm using a PiFi DAC+, compatible with the HiFiBerry DAC+.

In the top-right menu pressing on "Customize" we can select the device at the bottom of the pop-up window. I choose HiFiBerry DAC+. Usually I also change the "Volume warning limit" to 80. Then click on "Update".

In the same top-right menu and, we click on "Configure", then on "System". In this page we change the I2S audio device (in my case to HiFiBerry DAC+).

Again, in the top-right menu choose to reboot. You will see a message informing that the browser will automatically reconnect to the page once Moode is up-and-running again. After a while, if the webpage does not refresh automatically, remove the tcmods.php part from the url and reopen Moode web GUI.

Once Moode has rebooted, reopen the top-right menu and click on "Configure" and then "MPD". You should now see that the "Audio output" option is set to "I2S audio device". I can also change the Volume control to "Hardware" because PiFi DAC+ supports hardware volume control. Then we click on "Apply" (at the top of page). It takes a bit to refresh.

If all is OK you should now be able to hear music while something is playing.

Configure the display (optional)

UPDATE 2015-11-08: Previously, this part of the post mentioned the use of rpi-update. Since Moode r23 already has an updated kernel, this part has been removed.

This part is optional. You could already have the screen correctly working. In some hardware configurations the DAC mounted on the back of the Raspberry Pi may force you to use the screen upside down, if so you need to rotate the screen.

ssh root@192.168.1.163 # password moode
echo "lcd_rotate=2" >> /boot/config.txt

If we reboot we should have both Moode and the display working correctly.

Install all the things

We can now proceed installing some software to use with the display. The point is to install MPD clients to control music playback via touch screen. We have various options. These are the once I this are the best:

  • Iceweasel: this is a browser, the idea is to use it to access the Moode web interface
  • uzbl: another browser
  • Ario: a GTK MPD client
  • GMPC: Gnome Music Player Client, a GTK MPD client
  • Sonata: a GTK MPD client
  • Midori: a GTK MPD client

Again, we start by logging in via ssh and then installing the various software

ssh root@192.168.1.163 # password moode
apt-get update
apt-get install -y lightdm
apt-get install -y matchbox

apt-get install -y iceweasel
apt-get install -y uzbl
apt-get install -y ario
apt-get install -y gmpc gmpc-plugins
apt-get install -y sonata
apt-get install -y midori

Next, we configure lightdm to autologin to a pi use session. We open the /etc/lightdm/lightdm.conf file

nano /etc/lightdm/lightdm.conf

and change the autologin-user option to pi and the autologin-user-timeout to 1:

autologin-user=pi
autologin-user-timeout=0
autologin-in-background=true

Then we create the home directory for the pi user and configure what need to be started on boot

mkdir -p /home/pi
touch /home/pi/.xsession
mkdir /home/pi/.config
chmod -R 775 /home/pi
chmod -R 775 /home/pi/.config/
nano /home/pi/.xsession

You can copy-and-paste the next block of lines to the /home/pi/.xsession file.

##
# This is the content of the the /home/pi/.xsession file to be used
# to experiment with the official Raspberry Pi touch display and some
# MPD clients
#
# For more information read:
##

xset s off
xset -dpms
xset s noblank

##
# uzbl
# Uncomment the following line to startup the uzbl
# browser to control Moode via web GUI.
#
#uzbl -u http://localhost/ -n rataks.com -g 800x480+0+0

##
# Midori
# Uncomment the following two lines to startup the Midori
# browser to control Moode via web GUI. 
#matchbox-window-manager -use_cursor no -use_titlebar no &
#midori -e Fullscreen -a http://localhost/

##
# Iceweasel
# Uncomment the following two lines to startup the Iceweasel
# browser to control Moode via web GUI.
#
#matchbox-window-manager -use_cursor no -use_titlebar no &
#iceweasel -private -fullscreen -url http://localhost/

##
# Ario
# Uncomment the two lines to use Ario
##
#matchbox-window-manager -use_cursor no -use_titlebar no &
#ario

##
# gmpc
# Uncomment the two lines to use gmpc
#
#matchbox-window-manager -use_cursor no -use_titlebar no &
#gmpc

##
# sonata
# Uncomment the two lines to use sonata
##
#matchbox-window-manager -use_cursor no -use_titlebar no &
#sonata

##
# xterm
# Uncomment the line if you need xterm
##
#xterm

##
# Shutdown the Raspberry Pi if we quit the application
##
sudo halt

Each block represents a configuration. The applications can be used decommenting the relative lines. Each time you choose to try a different software you need to shutdown the Raspberry Pi and the display, then turn everything on again. Sometimes the display wont work after a reboot.

Other links:

More images: