Jivelite - A Touch Screen Interface for Raspberry Pi and Logitech Media Server

Stacks Image 1915
Some years ago Logitech made a device which was wildly popular (among audiophiles) called the Squeezebox Touch. It was a touch screen interface of Logitech Media Server which had some decent computer audiophile hardware. The software was open source, and the platform was quite hackable.

Even though the company folded the Squeezebox line the open source concept kept it very much alive. To this day many in the audiophile world use it as a home and office music server. It plays just about any file extension and my favorite attribute…….it streams Pandora, Spotify, and TuneIn radio in addition to many other plug-in apps such as Amazon CD Store, BBC, CBS Radio, Rhapsody……etc.

While this is an older project much of it no longer being maintained and archived, the platform seems stable and the software mature enough for long term deployment.

What you need:

- Raspberry Pi (I’m using an A+) $35
- HiFiBerry DAC+ $60
- micro SD Card w/ Reader $16
- 2.1 amp cell phone charger $15
- Pi Official Touch Screen $60
- WiFi dongle (optional but probably necessary) $11
- USB to ethernet dongle (not required if you use a Pi with an ethernet port. Pi A+ does not have an ethernet port)
Step 1. - Get a bootable Operating System. Two ways to go here. I use Arch Linux but Raspian Linux is clearly going to be the much easier route for several reasons. Also I’m doing this FROM A MAC. Writing to an SD card has different directions from different platforms. Follow my instruction if you have a Mac but if you have Linux or Windows get the directions from here at the bottom of the page.

Download Raspian from
here You want a version with a desktop so Download either the Jesse version (not Jessie Lite) or Wheezy. I’m going to use Jesse for this demonstration. Wheezy may be better suited to older, lower powered hardware.

NOTE: If you have a Raspberry Pi 2 you can use Jesse. If you have a B+, A+, B or A technically you can run Jesse but you have to patch it. No fun but challenging. I’d recommend Wheezy if you have another version of Pi besides the newest 2 version. I’ll cover the patch process later in the tutorial. You’ll see it’s not fun. You’ve been warned.

Download and then unzip the img file.
Stacks Image 1922
Now stick a blank SD card in your reader and and open a terminal and type

diskutl list
Stacks Image 1926
Note that my 16 GB card is /dev/disk1 IF YOU ISSUE THE FOLLOWING COMMANDS AND MISTAKENLY TYPE IN /dev/disk0 YOU ARE GOING TO DESTROY YOUR MAC OPERATING SYSTEM.

KNOW that you are writing this command to the correct drive returned from YOUR diskutil list query.

First unmount your disk in either Disk Utility or by this command:

diskutil unmountDisk /dev/disk1

And so it begins. In your terminal type

sudo dd if=

Then with your finder window open drag the image file into the terminal. Smart, huh?
Stacks Image 1930
Stacks Image 1932
Finally add the following to the command you just drug in.

of=/dev/rdisk1 bs=32m

you can add an “r” in front of disk, it is supposed to make it write faster. bs=block size. You’re writing 32 MB blocks at a time.
Stacks Image 1934
Now hit enter and your mac admin password when prompted. It will appear to do nothing like your computer or terminal is frozen. It isn’t. There just isn’t any progress bar. It will take 10 or 15 minutes or so probably. Relax.

Once it is written, eject your disk then place it in a pi, hook it to an ethernet router and boot. Sorry, no wifi yet. This is the way it has to be. In my example below I have a Raspberry Pi A+ with a HiFiBerry DAC Plus mounted on top. Use the one and only USB port to connect to your router like so:

Stacks Image 1940
Now you need the IP address of your Pi. Lots of ways to get it. I use an app on my iPhone / iPad called Net Analyzer. It will show up as “raspberry pi”. On mine the IP address is 10.0.1.197
Stacks Image 1944
Now you are probably tempted to hook up a monitor, keyboard and mouse at this point. Geeks don’t do that. Open your terminal program again and type

ssh 10.0.1.197 -l pi

remembering to use YOUR IP address, not mine. After the dash is a lowercase L, username pi. The password it asks for is

raspberry

once you get to a prompt type

sudo raspi-config

Then do the following items:

- Expand Filesystem
- Change user password
- In advanced options you can change the hostname. I changed mine to “jivelite”. I have too many pi’s and need to be as descriptive as possible.

Now reboot and log back in as before.

Now type the following two commands.

sudo apt-get update

sudo apt-get upgrade

After the second command it will ask you if you want to upgrade a bunch of packages. Say YES. Wait.

STEP 2.

Now we need to install:

- LogitechMediaServer
- Squeezelite player
- Jivelite

Logitechmediaserver is easy. Kinda. Go here and right click on the Debian Installer Package and copy the link. Now go back to your terminal and type the following commands

mkdir logitech
cd logitech

wget -O logitechmediaserver_all.deb $(wget -q -O - "http://www.mysqueezebox.com/update/?version=7.9.0&revision=1&geturl=1&os=deb")

After it downloads type

ls

and highlight and copy the file it downloaded and then type

sudo dpkg -i logitechmediaserver_all.deb

Hit enter and then it installs. Wait a few minutes after it installs and then go to a browser on your computer (on the same network) and type youripaddress:9000

10.0.1.197:9000

If you have a Raspberry Pi 2 and Jesse this should have just worked and logitechmediaserver should have started and now is accessible. If you have a Pi A+ and Raspian Jesse you’re going to find it didn’t work and isn’t accessible. Once again you’ll find my advice at the top of the best most sound. If you do not have a Pi 2 install Raspian Wheezy version.


*******Here’s the ugly part I warned you about********

My media server did not start. The log files said it was just endlessly restarting. Okay patching time. Do this.

sudo service logitechmediaserver stop

Download this file. Presumably it will land in /home/pi/Downloads. If it doesn’t set the path to where it did land. I didn’t have a lot of luck just downloading via the terminal with wget. I had to hook the pi to the TV, download it from the browser and then do the commands just below. Your mileage may vary but I had trouble.

cd

cd Downloads

wget http://www.gerrelt.nl/RaspberryPi/LMSserver/logitechmediaserver_7.9.0_CPAN_5.20_armv6hf.tar.gz


sudo tar xvzf logitechmediaserver_7.9.0_CPAN_5.20_armv6hf.tar.gz -C /

sudo chown -R squeezeboxserver:nogroup /usr/share/squeezeboxserver/



After the first command you should see a bunch of files getting unzipped and written to the destination directory.

Now you can start the server again

sudo service logitechmediaserver start

Give it a couple minutes and it should start. Go to your browser and type your IP address as you did above with a :9000

10.0.1.197:9000

It will take you to a page where you can create an account. Once logged in you can add apps. I have Pandora, Spotify and TuneIn Radio. Pandora and Spotify require pay accounts.
Stacks Image 1948
Stacks Image 1950
STEP 3.

Time for squeezelite. This isn’t so bad. You can cut and paste through this pretty quick.

First we need to configure the DAC though. Follow the directions here

Basically all I did was paste a command at the bottom of /boot/config.txt

sudo nano /boot/config.txt

add this line to the bottom of the file (for HiFiBerry DAC+) then reboot

dtoverlay=hifiberry-dacplus
Stacks Image 1954
Now lets add squeezelite.

cd

mkdir squeezelite

cd squeezelite

wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/squeezelite/squeezelite-armv6

Now do this:

mv ./squeezelite-armv6 /usr/bin/squeezelite

This moves the file and renames it. Easier to call, easier to type.

Now this to change the permissions:

chmod ug+x /usr/bin/squeezelite


If you did everything right it will list your output devices when you type this at a terminal.

squeezelite -l
Stacks Image 1958
Now open your browser and get to your logitechmediaserver again with IPADDRESS:9000

In the terminal type this command:

squeezelite -o sysdefault:CARD=sndrpihifiberry -n AnyNameYouWannaGiveIt -s 127.0.0.1

I named mine “jivelite”. Let’s see if it worked.
Stacks Image 1962
Now let’s start squeezelite at boot. Somebody is going to email me and tell me my method of doing this sucks. Maybe it does. But it works. Yes I’m painfully aware I can write a much better script but this does the job. I’ve been using LMS and squeezelite for years and this is solid.

cd

cd squeezelite

sudo nano startup.sh

paste this text in

#!/bin/bash

squeezelite -o sysdefault:CARD=sndrpihifiberry -n jivelite -s 127.0.0.1

Ctl key to X and Y key to save it. You just wrote a script that will launch squeezelite at boot. Now make it executable.

sudo chmod +x startup.sh

now type the following

sudo VISUAL=nano crontab -e

paste this in at the bottom of the file

@reboot /home/pi/squeezelite/startup.sh
Stacks Image 1966
Now reboot and test logitechmediaserver and squeezelite. You should be able to play music. You can test with one of the apps. TuneIn Radio is free, you just need to register.

STEP 4.

JIVELITE! Almost done. Well not really………

In a terminal

sudo apt-get install git libsdl1.2-dev libsdl-ttf2.0-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libexpat1-dev

Now we need to get luajit



cd

mkdir luajit

cd luajit

git clone http://luajit.org/git/luajit-2.0.git

cd luajit-2.0

make

sudo make install

sudo ldconfig


Now lets get jivelite

cd

mkdir jivelite

cd jivelite


git clone https://github.com/ralph-irving/triode-jivelite.git

cd triode-jivelite

sudo make PREFIX=/usr/local

./bin/jivelite


That final command only launches jivelite if it is hooked to a display. You cannot launch it from an ssh shell from a terminal.

If you have a pi A+ like me you’ll need a USB hub to continue. You need to hook a keyboard up and of course you need ethernet so I would need two USB ports. The A+ only has one. If you have another pi you’re okay, hook up your ethernet, display and keyboard

*********AUTOSTARTING AND TOUCH SCREEN CONFIG SOON**********



Perfect time to configure wifi now.

open /etc/network/interfaces

sudo nano /etc/network interfaces

(here’s the bottom portion of my file) Put # signs in front of the wlan0 stuff and add a new section in.

#allow-hotplug wlan0
#iface wlan0 inet manual
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid “YOUR WIFI SSID”
wpa-psk “YOUR PASSWORD”

allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Stacks Image 1971
Ctl + X then Y to save and shut down, install your wifi dongle, and then reboot.

NOTE: Don’t forget you will be assigned a new IP address which you will need to find again.
Okay. Time to autostart JiveLite. I had a heck of a time figuring this out as most all tutorials on line are based on Debian Wheezy and we have Raspbian Jesse. All you need to do is tell which desktop to start.

sudo nano /usr/bin/startlxde-pi

Scroll to the bottom of the file and you’ll see the last line says this:

exec /usr/bin/lxsession -s LXDE-pi -e LXDE

Change it to this by putting a # sign in front of that line

#exec /usr/bin/lxsession -s LXDE-pi -e LXDE

Add another line below it that says this:

exec /home/pi/jivelite/triode-jivelite/bin/jivelite

Ctl + X then Y to save and then reboot. Your Pi should now reboot into Jivelite
Stacks Image 1977
I gravitated all this over to an Official Raspberry Pi touch screen. The skin you use for that for size is the JogglerSkin. Refer to this page for getting Jivelite to start on a smaller screen. On that page I have a 3.5” PiTFT screen and must use the WQVGA screen which already has the wallpapers. We’re using the JogglerScreen here on a 7” screen which only has a plain black wallpaper. Yuck.

However I stumbled into this which allows you to add wallpapers to the 800x480 environment.

Here are the two files already modified.

Download them and my assumption is they will land in /home/pi/Downoads If not adjust accordingly.

Now lets make sure if we booger this up we can go back. (where my preceding commands are not bold black in color means you may have to adjust the path accordingly to your installation). This is how I did it. And yes I know I could have used the move (mv) command. I like to see that things worked. Especially on this kind of task.

MAKE SURE YOU USE THE RIGHT PATH HERE. WHEN I FIRST WROTE THIS THE REPOSITORY FOR GITHUB MADE A DIRECTORY CALLED "jivelite". SINCE THEN THE PROJECT WAS ARCHIVED AND MOVED AND RENAMED AND WITH THE HELP OF SOMEONE FOLLOWING MY DIRECTIONS I THINK I FIXED MOST OF THE ISSUES HE FOUND. ANYWAY THE PATHS BELOW MAY HAVE TO BE MODIFIED TO SUIT YOUR INSTALLATION.

I'M LEAVING THIS AS IT IS BELOW BECAUSE THIS IS MY CURRENT INSTALLATION ON TWO DEVICES SO I CAN CUT AND PASTE. YOU MIGHT NEED TO CHANGE YOUR PATHS.

cd

sudo cp /home/pi/jivelite/jivelite/share/jive/applets/JogglerSkin/JogglerSkinApplet.lua /home/pi/jivelite/jivelite/share/jive/applets/JogglerSkin/JogglerSkinApplet.lua.old

that renames the working file with a .old extension so you can retrieve it if you need to.

Now

sudo rm -r /home/pi/jivelite/jivelite/share/jive/applets/JogglerSkin/JogglerSkinApplet.lua

That deletes the original.

Now

sudo cp /home/pi/Downloads/JogglerSkinApplet.lua /home/pi/jivelite/jivelite/share/jive/applets/JogglerSkin/

Okay lets do it again with the other file.

cd

sudo cp /home/pi/jivelite/jivelite/
share/jive/applets/SetupWallpaper/SetupWallpaperApplet.lua /home/pi/jivelite/jivelite/share/jive/applets/SetupWallpaper/SetupWallpaperApplet.lua.old

sudo rm -r
/home/pi/jivelite/jivelite/share/jive/applets/SetupWallpaper/SetupWallpaperApplet.lua

sudo cp /home/pi/Downloads/SetupWallpaperApplet.lua /
home/pi/jivelite/jivelite/share/jive/applets/SetupWallpaper/

Now download the jivelite wallpapers on the commit page and place them in /home/pi/jivelite/jivelite/share/jive/applets/SetupWallpaper/wallpaper/

I have Samba set up on my Pi so I just drug and dropped them in the right folder. And I made a couple of my own wallpapers. Just be sure to size them to 800x480 and name them like this: pcp_nameoffile.png

Phew! Here’s what my new wallpaper looks like on my Jivelite project1
Stacks Image 14506
UPDATE:

Running

sudo apt-get update

sudo apt-get upgrade

stopped me from booting into Jivelite. It instead booted into the Wheezy desktop. Re-do these steps to fix:

sudo nano /usr/bin/startlxde-pi

Scroll to the bottom of the file and you’ll see the last line says this:

exec /usr/bin/lxsession -s LXDE-pi -e LXDE

Change it to this by putting a # sign in front of that line

#exec /usr/bin/lxsession -s LXDE-pi -e LXDE

Add another line below it that says this:

exec /home/pi/jivelite/jivelite/bin/jivelite
15,572