How I still got to use Spotify on my WiFi speaker

In my previous post, I discussed the problem with the Medion P69055 WiFi multiroom speaker and Spotify connect. It could and should support Spotify connect, but most probably lacks a firmware update to enable this feature. A big let down by Medion, but how to solve this? In the end, I opted just to use the line-in of the speaker and connect some “low-cost” device that supports Spotify. In this post, I will discuss three different devices to achieve this.

1. A netbook/laptop with Volumio and the Spotify plugin.

I already showed in my first post and youtube video, how to turn any old intel based laptop or netbook into a headless audio player that can be controlled by a webinterface on your smartphone or other PC, while closed and hidden from sight. In this case you just plug in this device into the line in of the speaker and voila. Pro: If you have an old laptop or netbook available and an SD card then you get it working without extra costs. Con: Even a small netbook is still a bulky device which is not easy to hide.

2. Chromecast Audio

With a price-tag of below €40, the Chromecast audio is a cheap and simple device to get Spotify on any speaker or audio system. It is also conveniently small. It gets powered via an micro usb port and with an extra accessory, you can also use an SPIF digital audio cable to connect the cast to your audio system. Setup is simple and straightforward to let it connect to your WiFi router. You can also set it up to allow your friends to connect to it with their android smartphone, so you can have an evening of music sharing.

The Chromcast audio is android phone centered and is not visible for other devices with the Spotify software until you activate it using the Spotify app on your android smartphone. If you use the Chrome browser you can circumvent this by using the Chromecast extension in combination with the Spotify web player. Pro’s: Cheap, small, easy to setup. Con: Really android phone centered.

Chromecast audio

3. DIY project: A Raspberry Pi zero with a DAC.

This last solution is a completely other beast. It’s not the cheapest solution and requires SOLDERING. So let’s list what you need:

  1. A Raspberry Pi zero. This is the most minimalistic, smallest and cheapest of the Raspberry Pies. Because of its popularity, it is also hard to get and the three webshops where you can get them only allow you to order one per customer. There is also this neat little website to see which web shops have them in stock: whereismypizero.com. A single Pi zero costs about €5, but most shops offer them in project kits between €15 and €35.
  2. The Pimoroni pHAT DAC. This is a Pi zero sized digital analog converter board, which uses the same chipset as the much more expensive HiFi-berry full-size boards. A single pHAT DAC board is available for prices between €14 and €20.
  3. GPIO headers. The Pi zero and pHAT DAC only have holes and no GPIO headers, so you have to solder these on yourself. This allows for more freedom to connect the pHAT DAC to Pi zero in different configurations depending on the size of your case. I just soldered a strip of male GPIO pins on the zero and a female header on the pHAT DAC board. You only need 5 pins to make the connection between the Pi zero and pHAT DAC working. I however, used the full 20 pins to make the connection also mechanically stronger.
  4. A Rasberry Pi compatible Wifi dongle, with a micro USB connector or a normal one and a micro to full-size USB adapter.  This should set you back for between €5 and €10 euro depending on the shop. Yes, the Pi zero has no onboard Wifi like the Raspberry Pi 3, which is a pity.
  5. A class 10 micro-SD card of 8 Gb or more, to install an OS and audio player software.
  6. A nice case to put it all in. I opted for this small polycarbonate case I found on amazon. It needs some adaptation to allow access to the 3.5 mm jack of the pHAT DAC and it is a snug fit with the pHAT DAC on top of the Pi-zero, but it is nice full enclosure with access to all ports and the micro SD card slot.
  7.  A USB 5V 2 A power adapter to power the Pi zero.
  8. Optional: a USB hub with Ethernet connector, for the initial setup op the audio software on the Pi zero before switching to Wifi. The software used, also allows initial setup using WPS, but I found that to be a bit of plug and pray feature. With a network connection via a cable, your sure it will work.

    The Pimoroni Wireless Audio Kit.

In the end, I opted for the Pimoroni pHAT DAC Wireless audio kit which consists of a Raspberry Pi zero, the Pimoroni pHAT DAC, the needed GPIO headers, a WiFi dongle with adapter and A 3.5 mm Jack cable male to male. It also includes some parts I did not use like the micro HDMI to HDMI adapter, the RCA out adapter that can be soldered onto pHAT DAC board and USB to micro USB adapter. But with a price tag at the time of around €30 euro it is still a good deal for the parts I needed. I also bought the USB 5V 2A powersupply for around €6 euro and the USB hub for just below €10. The small polycarbonate case set me back €6. So round and about 52 euro without the SD card, so let’s say €60 with.

The Pi-zero/pHAT DAC in the case. The slit to fit the top of the case over the pHAT DAC board is not very pleasing to the eye but functional.

So on to the assembly of this device, which starts with soldering the GPIO headers on to the Pi-zero and pHAT DAC board. For any instructions on that just look on YouTube, like this video, this or this one. I myself used some blue-tac type putty to stabilize the PCBs on my table to do the soldering. With the GPIO pins and female header attached you can now connect the pHAT DAC board to the Pi-zero. I then modified the top lid of the polycarbonate case with a cutter knife and sanding stick to make a slit for jack line-out socket of the pHAT DAC. It came out to be, let’s say more functional than esthetical. But to my pity, I do not have a Dremel rotary tool to my disposal. It has to be a slit, as the top lid has to slide over the pHAT DAC board with no space to spare and this socket sticks out. With this modification done, the case can be closed. With this, most of the assembly work is already done. You can also find more detailed instruction on how to assemble a Pi zero with pHAT DAC combo elsewhere on the internet, like for example this one.

The next step is to prepare your SD card with an appropriate audio player dedicated OS. As described earlier, there is choice, such as  Volumio, Mood audio and Rune audio. For this project my choice was Max2play, which is really multiroom centered and supports Logitech Media Server (LMS) software using Squeezeplayer. I was already acquainted with this system, having a Logitech Squeezebox Duet in use and LMS, with the needed Spotify plugins, running on a local Linux machine. LMS has also the nice feature that you can synchronize playback of your speakers via wifi. Which is ideal for parties when you want the same background music everywhere around the house.

Setup is straightforward: Download the Max2play disc-image (in this case the image with Hifi-berry support) and write it to the SD card. I then inserted the SD card in the assembled Pi-zero, attached the USB hub to the USB peripheral port of the Pi-zero with the Wifi dongle and an ethernet cable inserted, the last of which in turn was connected to my router. I then powered up the Pi-zero using the 5V 2A USB PSU. On another computer I entered the URL: max2play/ and voila the Max2play setup interface was loaded. In this interface I set my Wifi SSID and password, activated Squeezeplayer and indicated that I wanted to use a Hifi-Berry (PI A/B) as audio output to activate the line-out on the pHAT DAC. This initial setup is also explained in this Max2play tutorial video. Then I initiated a shutdown, removed the USB hub and connect the Wifi Dongle directly to the Pi-zero. I could now connect the Pi-zero to the Medion P69055 speaker, select in-line, power up the Pi-zero and voila: A wifi enabled speaker with Spotify that I can control using my smartphone and more importantly with the Logitech Squeezebox duet controller I already used for my HiFi system in the living room. But after a couple of months, my trusted duet controller got battery charging issues, but that’s for another time.

The pro’s: More flexible and fun solution and great sound of a good quality DAC. The con’s: More expensive than the Chromecast, and you have to assemble it yourself. But for me that is half the fun!

Conclusion

So these are some solutions to the issue of no Spotify on the Medion P69055, but of course also applicable to any audio system with a line-in. The “low cost” aspect is rather relative of course, only the old disused laptop with Volumio is really low cost. The Chromecast audio and Pi-zero are 40 and 60 euro respectively and that to fix a speaker which cost me just about €100, bummer! But okay, now it works to my satisfaction so I am fine in the end. You may say that technically non of the solutions are genuinely Spotify-connect solutions. Yes that’s true, but all solutions allow you to play music using your Spotify premium account, they are just not using the Spotify Connect protocol. The Spotify Connect protocol is currently dissected by several enthusiasts, so I expect that this feature will become available for the Raspberry Pi zero in any shape or form. I will be keeping an eye on that. I like the Raspberry Pi zero pHAT DAC combination best as it is the more flexible solution in terms tweakablity. Do you want Apple Airplay or use Google Music instead of Spotify? The Rasberry Pi with Max2play has that flexibility. One thing to keep in mind is to use a good PSU for the Raspberry Pi zero pHAT DAC. Digital/Analog converters are very sensitive to power fluctuation and using a botched PSU may introduce interference. The Medion P65099 has for example a USB charging port, but powering the Pi zero pHAT DAC combination, but also the Chromecast via this port, resulted in background static. Real audiophiles use PSUs with linear power outs, to have the best sound quality, but I this case this is a bit overkill.

There are also other Chromecast audio like devices that are genuine Spotify Connect devices such as the Fon Gramofon and Rocki. Both start at a €65 price tag and especially the Rocki, a former Kickstarter project got bad reviews with difficult setup, bad customer support and melting batteries. The Gramofon I still find quite intriguing as it also uses the same Quallcomm Allplay technology that should allow the Medion P65099 speaker to use Spotify Connect. However with reviews questioning the sound quality of the Gramofon and the price tag of €65 make me hesitant.

The Fon Gramofon

Streaming audio to your Hifi? Just use an old laptop.

I’m probably not the only one who has shelves full of CDs, folders with between 10 and 100 GB of MP3s and is now consuming his music mostly via streaming services like Spotify. The latter two clearly aimed to personal use initially, on a MP3 player, iPod or your smartphone and some headphones. So If you want to play music on you Hifi, you perhaps still revert to ordinary FM radio or a CD. In the meanwhile all kinds of solutions for playing MP3 on your HiFi have been developed. Tuners/Amplifiers with USB or network input and WiFi connections that support DLNA, so that MP3s in a folder on your computer or network storage can be played.

logitech_duet

Logitech Squeezbox Duet.

I myself purchased the Logitech Squeezebox Duet, for this purpose, back in 2009. This solution consists of two devices. The receiver box to connect to your HiFi set and the controller, a remote with an iPod-like jog button to go through the different menus. The two devices talk to each other using Wifi (or wired network connection in the case of the receiver) and a PC with your MP3 collection, running a special server-software. This set-up was at the start not a very easy configurable and stable solution.

However if you also want to use streaming services on your Hifi, you need to make another step. (In the case of the Squeezebox this was a small one, but I will perhaps cover this in another post.) You can of course connect your smartphone directly to your Hifi, but that is not very practical. You can invest again in new streaming ready devices. There are a lot of wifi and streaming enabled speakers available these days, with SONOS as maybe the best known but certainly not the cheapest example. However a lot of tweakers have come up with cheap and workable DIY alternatives.

raspberry_pi_3

Raspberry Pi revision 3.

Especially the arrival of the Raspberry Pi seems to have been a catalyst for all kinds of solutions to stream your audio in a simple way to your Hifi. For those who do not know: The Raspberry Pi is a relatively inexpensive mini-computer (~ € 35 without a housing) of credit card size. We now arrived at version 3 of this computer, that has a micro-SD card slot for the software and also an HDMI output, audio/video jack, 1 micro usb for power and further a LAN port, 4 full size USB ports, WiFi and Bluetooth. Furthermore, the Raspberry Pi has the so-called “general purpose input / output pins” or simply GPIO pins. These pins can be used to control all kinds of stuff. In the case of Hifi there are beautiful solutions such as high-quality digital to analogue audio converters boards, that give superior sound quality compared to the standard audio chip of the Raspberry. Examples of this are the Hifiberry range and Pomorino’s Phat DAC.

Nice pieces of hardware you might think, but what about the software? The Raspberry Pi has a fantastic community of tweakers who develop both hardware and software, mostly as open source, freeware. When it comes to so-called “standalone” or “headless” audio players, there is choice. There is Max2play, who also offers multi-room speakers support and three other packages, which have a shared history: Moode audio, Rune audio and Volumio. Max2play, Mood and Rune audio are all focused on just the Raspberry Pi and similar minicomputers, Volumio however, has two bonuses: Support for Intel computers, or in other words: Any old PC or Laptop may have lying around, and a Spotify plugin .

eeepc4g

The Asus eeePC 4G.

In my case I still had an early netbook lying around and I was wondering if Volumio would run or not, on such a underwhelming machine. I am talking about an ASUS EeePC 4G, see here for its specification. The existing 500 mb of RAM, I replaced for 1Gb. The internal storage of 4GB is also tiny, but we do not need it, in this case, as we run Volumio from a SD card. It should be possible to install Volumio on the internal storage, but this is (still) a bit cumbersome.

In itself, the installation is fairly straightforward and clearly explained on the Volumio website. I also made a YouTube video where I run through the required steps, which you can watch below.  First of all, you must download an SD disk image, the Intel (x86 / x64) version in this case, from the Volumio website. Then use a software tool like Win32imager or Rufus to write this image on an SD card of at least 4Gb and speed class 6. Generally it is advised to use a class 10 card, but I had only a class 6 SD around and it works well. Now it’s just a matter of booting from the SD card. This requires some modifications to the BIOS settings. After that, it takes some time for Volumio to get ready for its first use. After this lengthy initial start-up, reboots are going much quicker.

Volumio is primarily intended as a “headless” audio player, which means you control it via a web interface on your PC, laptop, tablet or smartphone. You can use this interface by entering the URL: /volumio.local or IP address of your Volumio machine in a webbrowser. The laptop has a screen so you can also control it using this. This is especially useful for the setup of you Wifi connection for the first time. I also noticed that the interface on the laptop itself was a lot slower than the webinterface on another PC or smartphone, which is striking. Via the (Web) interface, you can also configure other things such as the connection to your music folders and of course installing and setting up the Spotify plugin. You’ll need a Spotify Premium account for that. As you will see in the video, Volumio is working properly on this underwhelming mini laptop. So if you’ll be using a newer model,  there is no reason, for it to work as well.

The only minor thing I run into was, that for a true headless audio player, you would like to use it with the lid closed. You can then connect to your hifi and hide it. Unfortunately, many laptops go into a sleep mode if you close the lid and then the music stops. This is not convenient, but for this I have found a “hack” to solve this. Volumio is based on a Linux operating system and you can use the software tool PuTTY (Windows) to create a so-called SSH connection. You can than give commands to the Linux backend. In this way, you can disable all sleep and suspend modes and it will continu to play the music, when you close the lid. This is also shown in my Youtube video below. After logging in via SSH (Putty) using the IP Address of your Volumio machine with user: Volumio and password: Volumio. You should than enter the following command:

systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Followed by pressing <Enter>. This will disable all sleep modes in your settings. In this case it is important to always keep your laptop plugged in, the battery will otherwise run out of juice a can damage your SD card.

Success!