Build a wall-mounted "SqueezePlayer"-based network music player using Squeezelite, Jivelite and a Raspberry Pi. I built this project because Logitech has stopped making its "Squeeze" line of networked music players. Since the server software is open source, and because I continue to have several network players around the house that only work off of the Logitech Media Server (originally called the Squeezebox Server), and finally because a few intrepid souls in the Squeeze forums (http://forums.slimdevices.com/showthread.php?97046-Announce-Squeezelite-a-small-headless-squeezeplay-emulator-for-linux-%28alsa-only%29) built software emulators for a network music player and its interface; I decided to put together this project.
Here is a video of the completed player:
This project shows how to both build the hardware and set up a Raspberry Pi with the correct software. The parts required may vary based on what kind of a system you want; but here I use a Raspberry Pi Model B and a Mimo UM-720F USB Touchscreen Display (http://www.mimomonitors.com/products/mimo-720-f-flex-screen-mountable-touchscreen-usb-monitor). In addition, I've used a Rosewill powered USB hub to power both the Raspberry Pi and the monitor, and a T-amp amplifier to power a pair of JBL in-ceiling speakers.
The project consists of two main parts. First, prepare the Raspberry Pi to run the appropriate software to connect to the music server and display the interface; and second, install the hardware in the wall.
For those who don't want to build their own system up from scratch, I have created a disk image of a working system. You can download the compressed image from here. You may select the image for the Raspberry Pi 1 or the Raspberry Pi 2. Unzip the file and write it to a SD card (2GB or larger should work).
You will need to change the root password (currently "root" and the squeezeuser password (currently "squeeze"). You will also need to copy the appropriate xorg config file to /etc/X11/xorg.conf.d/20-displaylink.conf. There are two examples in the /home/squeezeuser/ directory. One is for the Mimo screen used in this project and the other is for the Lilliput 7" UM-70/C/T MiniUSB Touch Screen Monitor. As delivered, the image uses the Lilliput xorg file. Finally, you will need to calibrate your touchscreen by uncommenting the xinpu_calibrator line in the .xinitrc file in the squeezeuser's home directory. The output will be in a text file and you should copy this information into /etc/X11/xorg.conf.d/90-calibrator.conf.
# nano /etc/locale.gen
# locale-gen
# ls /usr/share/zoneinfo/
# ls /usr/share/zoneinfo/America
# ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
# echo squeezeboxPi > /etc/hostname
# useradd -m -g users -G audio -s /bin/bash squeezeuser
# passwd squeezeuser
# EDITOR=nano visudoadd the line:
# pacman -Syu
# reboot
$ sudo pacman -S alsa-utils xorg-server xorg-server-utils xorg-xinit xf86-video-fbdev xorg-twm xorg-xclock xterm sudo mlocate openboxAudio should work out of the box. If it does not, make sure that your user (in the examples here, "squeezeuser") is part of the "audio" group. If not, add them with:
$ sudo usermod -aG audio squeezeuser
$ alsamixer
$ speaker-test -c 2If none of that works, make sure that the appropriate module has been loaded:
$ lsmod | grep sndYou should see snd_bcm2835 as part of the output. If not try:
$ sudo modprobe snd_bcm2835And then test again to see if the audio device has been loaded. If not, I recommend you post to the RaspberryPi Forum
$ ls /dev/fb*And you can similarly see the touchscreen name with:
$ ls /dev/input/by-id/Here is what my xorg config file looks like:
################ DisplayLink Stuff ###################
Section "Device"
Identifier "DisplayLinkDevice"
Driver "fbdev"
BusID "USB" # needed to use multiple DisplayLink devices
Option "fbdev" "/dev/fb1" # change to whatever device you want to use
Option "ShadowFB" "off"
# Option "rotate" "CCW" # uncomment for rotation
EndSection
Section "Monitor"
Identifier "DisplayLinkMonitor"
EndSection
Section "Screen"
Identifier "DisplayLinkScreen"
Device "DisplayLinkDevice"
Monitor "DisplayLinkMonitor"
# DefaultDepth 16
EndSection
####################### TOUCHSCREEN ####################
Section "InputDevice"
Identifier "touchscreen"
Driver "evdev"
# Option "Device" "/dev/input/event3"
Option "Device" "/dev/input/by-id/usb-e2i_Technology__Inc._USB_Touchpanel_L000000000-event-if00
Option "DeviceName" "touchscreen"
Option "ReportingMode" "Raw"
Option "SendCoreEvents" "On"
Option "Calibrate" "1"
Option "InvertY" "true"
# Option "InvertX" "true"
# Option "MinX" "630"
# Option "MinY" "31000"
# Option "MaxX" "31700"
# Option "MaxY" "1000"
EndSection
Section "ServerLayout"
Identifier "default"
Screen 0 "DisplayLinkScreen" 0 0
InputDevice "touchscreen" "CorePointer"
EndSection$ sudo pacman -S --needed base-devel
$ sudo pacman -S git wget
$ cd ~
$ mkdir builds
$ cd builds
$ wget
$ tar -xvzf squeezelite-git.tar.gz
$ cd squeezelite-git
$ makepkg -s
$ ls *.tar.xz
$ sudo pacman -U squeezelite-git-0.r78.gae7f3e0-1-armv6h.pkg.tar.xz
$ ip link
################################################### # file located at /lib/systemd/system/squeezelite.service # use "systemctl enable squeezelite.service to load # based on a template from RPMFusion and R.G. Newbury from this thread: # <a href="http://www.gossamer-threads.com/lists/mythtv/users/516650?search_string=mythbackend.service%20;#516650" rel="nofollow"> <a href="http://www.gossamer-threads.com/lists/mythtv/user..." rel="nofollow"> http://www.gossamer-threads.com/lists/mythtv/user...</a>> #Usage: ./squeezelite [options] [] # Connect to server server at given IP address, otherwise uses autodiscovery # -o Specify output device, default "default" # -l List output devices # -a: Specify ALSA buffer_time (ms) and period_count, default 20:4 # -b : Specify internal Stream and Output buffer sizes in Kbytes # -c , Restrict codecs those specified, otherwise loads all available codecs; known codecs: flac,pcm,mp3,ogg,aac # -d = Set logging level, logs: all|slimproto|stream|decode|output, level: info|debug|sdebug # -f Write debug to logfile # -m Set mac address, format: ab:cd:ef:12:34:56 # -n Set the player name # -r Max sample rate for output device, enables output device to be off when squeezelite is started # -z Daemonize # -t License terms [Unit] Description=Squeezelite Daemon Requires=network.target sound.target After=network.target sound.target [Service] Type=simple # NOTE: using the "squeezeuser" user, NOT root. User=squeezeuser ## note use your mac address as given by ifconfig and the name you wish to give your player ExecStart=/usr/bin/squeezelite -m [xx:xx:xx:xx:xx:xx] -a 80 -n "Pi Player" [Install] WantedBy=multi-user.targetNote: if you get popping or other sound distortion, alter the squeezelite command line by upping the figure after "-a" to 160.
$ cd ~
$ cd build
$ git clone https://code.google.com/p/jivelite/>
$ cd jivelite
$ wget <a href="https://raw.github.com/ggalt/RaspberryArch/master/fix_lua_includes.patch" rel="nofollow"> https://raw.github.com/ggalt/RaspberryArch/master...>
$ git apply --check fix_lua_includes.patch
$ git am --signoff fix_lua_includes.patch(NOTE: you could issue “git apply fix_lua_includes.patch”, but using “git am --signoff” documents your application of the patch in case you later want to modify your branch).
$ sudo pacman -S luajit sdl sdl_image sdl_ttf sdl_gfxMake the jivelite binary using the PREFIX define we inserted with the patch file:
$ make PREFIX=/usrJivelite should now be in a "bin" file in the directory where you built jivelite.
To start openbox and the jivelite client, you will need to prepare an .xinitrc file that establishes your environment. An example of what I used can be found at my github page. You will need to make sure that the last line is correct for your path to the jivelite binary file.
$ chmod +x .xinitrc
Modify Openbox Configuration
Openbox relies upon a simple XML configuration file. For our touchscreen we don't want to show any of the standard window decorations that a normal window manager shows so we need to make a slight edit to this file.
First create a directory in the squeezeuser's home director call ".config". Please NOTE the "." before the word "config" and make sure it is there. This will make this directory a hidden directory and it is where Openbox will look for the configuration file. Next, make a subdirectory within the ".config" directory entitled "openbox".
$ mkdir .config $ mkdir .config/openbox
Next, copy the standard Openbox configuration file into this directory.
$ cp /etc/xdg/openbox/rc.xml ~/.config/openbox/
Finally edit the rc.xml file to add the following lines near the bottom:
$ nano ~/.config/openbox/rc.xml
<!-- match all windows and remove their decorations --> <application class="*"> <decor>no</decor> </application>
This should be inserted just before the end of the document right after the lines that read:
# end of the example<br>-->
And right before the very end of the document, which ends with:
</applications>
</openbox config>
so the full end of the document should be:
<br># end of the example<br>--><br> <!-- match all windows and remove their decorations --><br> <application class="*"><br> <decor>no</decor><br> </application><br></applications><br></openbox config><br>
Run the appropriate cables for your setup. Proper cable management is important as you have limited space, and while the Raspberry Pi doesn't put out much heat, together with the amp you want to make sure you have reasonable airflow.
During the construction of the room in which the player was being installed, I had run speakerwire and an Ethernet cable to the location where the circuit breaker cabinet was located. After the room was finished, I cut holes in the ceiling to insert the in-ceiling speakers. I used these JBL speakers that were reasonably priced and good quality (don't pay the price listed on the JBL site, they are much cheaper elsewhere).
Test you speaker connections before you insert the speakers in the ceiling. They will come back out if you work at it, but it can be difficult.
Once you have everything working, close up the circuit breaker cabinet. In my circuit breaker cabinet, the front plate contains small breakouts for each circuit breaker. If you need to get access to the interior of the cabinet to adjust the volume or to otherwise work with the other parts, you would not be able to reach through any of the holes. Instead, I cut out the portion of the plate (behind the door) that holds the circuit breakers. This gives a reasonable sized opening so you can easily access the interior of the circuit breaker cabinet. Make sure you clean up your cuts and debur the opening.
I hope you enjoy this project.
George Galt