I first started running with the squeeze ecosystem in about 2008. I ordered an original squeezebox from slim devices, which took months to come and arrived as a rebranded logitech squeezebox (not as handsome as the original). I first ran the server software on a specially bought Fit PC (which cost £250!).
The Fit PC served me well, if slowly for several years. It travelled to New Zealand with us for a year, where I tried to install Windows 7 on it with no success. When we got back home I Father Christmas bought me one of the first generation of Raspberry Pis. With help from the internet I got the Pi running LMS (slowly). I was delighted.
By now my display on the squeezebox was fading, and one day it stopped working. I sold it on ebay only to discover it was only the power supply. Argh! I then built my own hacked around player (RPizeBox) that even worked with the remote control.
That got silly, so I bought a Squeezebox Touch in 2014. As new Raspberry Pis came out I updated the server by just moving on the sd-card.
The server was pretty badly hacked together over the years as I used peoples’ work to solve problems with the BBC, Spotify etc. Eventually it began to be problematic a lot of the time. I decided to rebuild the server from scratch.
But… before I did this I thought that things had moved on so much “there must be an image”. 2 minutes later and I was downloading max2play. Amazingly, within 20 minutes I had a working LMS. I was flabberghasted. So much work saved. I immediately dobbed them a 5 year license for all of €20. This new server was immediately more stable and faster than anything I had achieved with my RPi3. Half an hour later and an old RPi2 was plugged in to the living room amp through HDMI as a headless player. I ordered a HiFi Berry amp and 7″ touch screen for the RPi3 and a week later had a perfect replacement for my touch. No idea why I had not done this before. I guess it is time, but at the moment I am stuck at home recovering from a stupid operation in the sole of my foot.
I got really thinking and rebuilt the pi connected to the amp as retropie, added squeezelite and kodi and xsqueeze and now can control the seezelite with the TV remote. Result!
The troops are delighted and we all wonder why I never did this before. The only downside is the lack of remote for the new “Touch” in the kitchen, but I am hoping that hab-tunes.com can fill that gap.
Now I have the proof of concept for the RPi, I wanted to improve the code and have long term plans to make it remember tracks we skip, as well as allowing a blacklist! I wanted to keep some sort of version control, and this is where git comes in. I have been aware of git for a while but don’t really know much about it.
I now have created my own git hub for RPizeBox at https://github.com/thomaswwp/RPizeBox. I also forked PyLMS (which appears to be abandoned) and will eventually include it in my build as a module, rather than simply importing the code.
I have reduced the code to two scripts, but this looks like it has increased the CPU overhead to about 6%, so I may revert to what I had before.
I have also made a Fritzing diagram of the setup for future reference.
I also found that the skip forward button was broken on the remote, so just remapped other buttons.
The RPizeBox is great, but there are two main issues:
- The audio quality is as good as you would expect for the RPi, which is known for dodgy audio on the analogue 3.5mm plug (popping and fluttering). Not sure if this is fixable.
- The python script goes bonkers after being on pause for ages. I guess this is my dodgy code.
I sold my broken squeezebox on ebay. It turns out it was just the power supply. How incredibly frustrating.
So I decided to work on getting my RPi LMS a display. Notes.
https://github.com/WiringPi/WiringPi2-Python to install wiringPi for my LCD display, but it wouldn’t compile. Neither would https://github.com/WiringPi/WiringPi-Python.
https://github.com/WiringPi/WiringPi-Python/issues/7 fixed this and I compiled WiringPi2.
I had much more success with this
and could read what was playing on the SqueezeLite with no issues at all.
# Proof of concept - needs to be run as sudo<br>import wiringpi2 as wp<br><br>from pylms.server import Server<br>from pylms.player import Player<br><br># set up the display<br>wp.wiringPiSetup();<br>lcd = wp.lcdInit (2, 16, 4, 11,10 , 0,1,2,3,0,0,0,0) ;from pylms.player import Player<br><br># connect to the squeezebox<br>sc = Server(hostname="192.168.0.5", port=9090)<br>sc.connect()<br>sl = sc.get_player("b8:27:eb:eb:37:68")<br><br>#clear the lcd<br>wp.lcdClear(lcd)<br>wp.lcdPosition(lcd, 0, 0)<br>wp.lcdPuts(lcd,sl.get_track_title()[:16])<br>wp.lcdPosition(lcd, 0, 1)<br>wp.lcdPuts(lcd,sl.get_track_album()[:16])
So that is a start – now to make it update when the track changes and to scroll the titles. And…. And…
The squeezebox has been perfect all day. Here is the load on it whilst running streamed BBC radio and spotify one on a Squeezebox Radio and one on Squeezelite.
Not bad at only 14% processor utilisation.
pi@hood ~ $ top
I must remember to make a clone of this working sdcard.