Music players for the Pi Zero W
I have been investigating music players for the Pi Zero. I wanted to be able to control them using a mobile phone or tablet. I intended to put a couple around the house and re-cycle some old sound systems and computer speakers. The player also needs to connect to my fileserver that has my entire CD library on it.
I looked at “pi musicbox” first of all, it seemed to satisfy my requirements, but when I tested it I found some problems. These are my findings:-
- The image can be downloaded direct from their website. It has a small footprint and it works straight away.
- The configuration file is visible on a partition for windows users, so the wifi details can be plugged in before booting up while the sd card is still connected to a PC. This works great.
- Once the system was booted up, I could connect to the web server and control it from a PC and mobile. Additional configuration can be done from here. I tried to set up a link to my file server, but it didn’t work. I had to enable SSH and connect to the command terminal and hack the configuration file at /opt/musicbox/startup.sh. The line to mount a network server had to be changed to: mount -t cifs -o user=pi,password=pi //FILESERVER/pi-music /music/Network
- The system scans all the network files by default on boot up. This takes a lot of time and I am not sure why it is necessary.
- The web user interface was very slow to operate and got stuck a few times.
- There was an annoying spinning disk when waiting that didn’t go away on some browsers.
So I was not very impressed…….
I have not yet tried “Volumnio”.
The next product I tried was VLC which I have used on my PC for audio and video and it is quite robust and useful. It happens to have its on internal web server that can be switched on so I installed it on a headless pi with a GUI. (VLC can run without a GUI, but it is easier to configure with a GUI).
The setup to be done is as follows:
- Run VLC and go to the control page TOOLS / / PREFERENCES / / INTERFACE from the main menu bar. Click to check the box “All”, then select “main interfaces” from the left hand list and click to check the box “Web”.
- Select lua on the expanded “main interfaces” option and add a password for http access.
- Add the following file (with sudo) /usr/share/vlc/lua/http/.hosts and add entries to allow access to the web server. e.g. ::1 192.168.1.123 or just use 1:0 0.0.0.0 for everybody.
- I also added an entry to start the invisible VLC (called CVLC) on boot by adding @cvlc to the file /home/pi/.config/lxsession/LXDE-pi/autostart
- Once the server has started it can be accessed from any web browser. Note that it is on port 8080. (use http://my pi IP address whatever:8080 on the URL line of the browser)
- Mount the fileserver music library in the /home/pi folder as this is where browsing starts from. i.e.
add a mount command to /etc/fstab
//FILESERVER/pi-music /home/pi/MusicLibrary cifs user=pi,password=pi,uid=pi,gid=pi,x-systemd.automount 0 0
I found that the response was snappy and it worked well. There is a separate interface for mobiles and tablets with less functionality. VLC is quite useful in that playlists can be setup and access to other music streams can be setup.
I am currently using a USB to Audio widgit that plugs into the pi USB port. You can see this in the photo above. This cost less than a pound and took three weeks to arrive all the way from China. The pi recognises it without any fuss.
I hacked the file “mobile_browse.html” to add an extra button to play all the files. A copy is attached here :