Volumio – the DIY Media Streamer

You can have an inexpensive media streaming device connected to your TV or HiFi by using an inexpensive Raspberry Pi and an SD card.

If you visit Volumio.org, you can download an image for a Raspberry Pi, PC or ASUS Tinkerboard. Once you have the image downloaded, attach a micro SD card to your computer and use Balena Etcher to write the image to it. If you need a quick tutorial on how to image an SD using Etcher, here’s a video that images the Raspberry Pi OS to SD. You would be imaging Volumio instead…

Once your SD image is complete, you will want to put the SD into your Pi. A Raspberry Pi 2, 3 or 4 should be sufficient, though a 3B is probably the lowest I would go because the Pi 2 would be quite slow. The Pi 3B has an advantage over the Pi 4B because it runs much cooler.

Then attach an ethernet cable to the Pi – because wifi will not be setup. This is the lamest part of the project but bear with me. Power up the Pi and let it run a boot cycle. You can setup your Volumio now by either downloading the Volumio app in the Google Play Store or the Apple App Store, or by typing volumio.local in your browser. Because the browser method isn’t reliable initially, I would use the app if possible.

After you launch the app on your phone/tablet, the app will search for any installations of Volumio. Make sure you are on the same network between the Pi and the phone. Once the app finds it, you will be instructed to give your setup a name and configure wifi settings. To setup your plugins, click on the setup icon in the bottom right corner. There are several plugins that allow your Volumio setup to connect to Spotify, Pandora, a Subsonic server etc. After you add and enable the plugins, you will need to go to the “installed plugins” tab to configure them with your username/password.

There are many other nice features, like the ability to make this setup a DLNA server. When everything is done and setup to your taste, you can go back into the menu, shut down the Pi and unplug the ethernet cable.

You can plug an HDMI cable into the Pi and run it into your TV or Stereo now and turn them both on. Once your Pi boots you will hear a chime through the TV/Stereo and that tells you it’s ready. You can now use your app to control Volumio to play internet radio, Spotify, etc.

You can also add music to Volumio. If you put mp3s or FLAC files on a thumb drive, plug it in before boot and the system will index the files so that you can play them. If you are technologically inclined, you can find your IP address by going into Volumio’s network settings. Then use that address, followed by /dev (example: 10.0.0.100/dev). From there, you can enable SSH, then use Filezilla or similar SFTP/FTP program to add music and video files to the /mnt/INTERNAL directory.

Volumio allows you to create an account. Though the setup is free, there is a paid tier that allows other features like the ability to use HiRes streaming services Tidal and Qobuz among other features like connecting a CDROM to rip CDs. At one time, I did subscribe to this a few years ago, but found that the free features like internet radio, local media and my own Subsonic server were enough. So for now I’m happy to use the free version. If you end up setting this up, I hope you enjoy it! I work from home and believe me, it’s nice.

Install Spotify Connect on your Raspberry Pi with ‘raspotify” on Raspberry Pi OS

Setting up Spotify Connect on the Raspberry Pi

First update your Pi’s OS:

sudo apt update
sudo apt upgrade

Install ‘curl’ and ‘apt-transport-https’

sudo apt install -y apt-transport-https curl

Add the raspotify repository and the GPG key:

curl -sSL https://dtcooper.github.io/raspotify/key.asc | sudo apt-key add -v - 
echo 'deb https://dtcooper.github.io/raspotify raspotify main' | sudo tee /etc/apt/sources.list.d/raspotify.list

Install ‘raspotify’:

sudo apt update
sudo apt install raspotify

You should now be able to go into the Spotify app on your phone or tablet and select your pi from the device choices.

Tweaking:

You can change your Pi’s device name and the bit rate of the stream by editing the configuration file:

sudo nano /etc/default/raspotify

Look for the device name and bitrate strings and make any desired edits. Then save and restart the raspotify service:

DEVICE_NAME="raspotify"
BITRATE="160"
sudo systemctl daemon-reload
sudo systemctl restart raspotify

Troubleshooting:
raspotify – no sound even though phone is connected to Pi

Source for further investigation: https://github.com/dtcooper/raspotify/issues/31

Use aplay -l to see devices. Sample output:

pi@lab9:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Subdevices: 3/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3

card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3

card 2: sndrpihifiberry [snd_rpi_hifiberry_dacplusadc], device 0: HiFiBerry DAC+ADC HiFi multicodec-0 [HiFiBerry DAC+ADC HiFi multicodec-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Edit the raspotify configuration:

sudo nano /lib/systemd/system/raspotify.service

Find the “ExecStart” line and add the device.
In this case (example above), desired device is sndrpihifiberry.
Card is 2 and Device is 0. Use “–device hw:2,0” in configuration.

ExecStart=/usr/bin/librespot --name ${DEVICE_NAME} $BACKEND_ARGS --bitrate ${BITRATE} $CACHE_ARGS $VOLUME_ARGS $OPTIONS --device hw:2,0

Restart the service:

sudo systemctl daemon-reload
sudo systemctl restart raspotify

Ripping Compact Discs with dbpoweramp

I am working on a mass CD-ripping project. Currently, I do have a hard drive filled with FLAC copies of all my CDs. The only issue is that they were ripped over the span of 10+ years and I can’t trust their accuracy. I was thinking of re-ripping them all at the same time with the best DVD/CDROM drives I can find and the best CD ripping program.

The CD ripper I’m using is called dbpoweramp. It reports errors on discs by comparing the rip to the central database. I am seeing 1-2 errors in about one out of six discs with my CD collection. Some of the CDs are as old as 1986, when I first started buying them. In some cases, It’s enough to clean the disc and they rip without errors. In other cases, there are tiny scratches and nothing can fix the issue. There’s almost 2k cds to rip so in most of the cases, I have to make a quick determination of whether I have time to try again and again to rip the discs. So far the favorite ones have been re-ripped. At this point, I’m not even sure if one inaccurate track will even play in a way that seems off.

On a side note, the dbpoweramp suite comes with a batch ripper, so I’m able to rip from several CD drives at once. Right now I have five drives connected with two on the way. When all of the drives are running and the CDs aren’t in rough shape, the system can average a combined ripping speed of 150-205x.

I bought a case to house the DVD/CDROM units called Copystars Duplicators Case (see above). The case was designed for a CD/DVD duplicator system but it keeps five drives nice and tidy. I can cram all of the cables on the inside of the case. The SATA connector cables I’m using are called Inateck SATA to USB 3.0 Converter Adapter. I have also installed a USB 3.0 PCIe card called FebSmart 4 Ports USB 3.0 for fast transfers of data. Please let me know if you have any questions about the setup. So far I’m very happy with this project and I’m well underway, having ripped about 25% of the collection.

 

Ripping compact discs with Ubuntu OS

The two main Linux programs I use in Ubuntu to rip CDs are Sound Juicer and XCFA.

Sound Juicer is the easiest to use and setup. However there are limitations. If a CD is not in the MusicBrainz database, the program will error out. Also, the type of encoders you choose cannot be fine tuned (AAC, mp3, FLAC). You can’t choose the level of compression. There’s also no apparent way to add album art.

XCFA has much more fine tuning, however, this increases the complexity. You can chose the level of compression. There are many more encoders like APE, WavP, Ogg, Mpc, etc. Another caveat is that it is more confusing and difficult to setup in Ubuntu. I had to do some workarounds to get it going.

The best way to figure out your CD ripping process is likely to try them both. I tend to use Sound Juicer for the mainstream artists and XCFA for CDs I’m having trouble with (like no entry in the MusicBrainz database).

The easiest way to install Sound Juicer in Ubuntu is to open the Ubuntu Software store, type “sound juicer” in the search and select install. If you want to install it in the terminal, here’s how:

sudo apt-get install sound-juicer

Once you install, you will simply need to update the settings from the “preferences” pull-down.

Installing XCFA is a bit more complicated. First you need to install the program, then the “goodies”, then any missing programs (like the ripper).

sudo apt-get install xfce4
sudo apt-get install xfce4-goodies

Once these two programs are installed, you will need to launch the program and install the missing programs. These include: a52dec, mp3check, faac, and so on. You can see which programs are present and missing under the “Applications externes” tab. I couldn’t figure out how to install some of these programs, including ‘aacplusenc’ and ‘monkeys-audio’ but for now I’m not interested in that functionality. Once you update your system with the missing external programs, restart XCFA and fill out your settings with the “preferences’ tab.

Once you have completed your burning task, you will probably want to verify and update some metadata/tags. A great program for this is ‘Kid3-qt’. To install, do a search for “kid3” in the Ubuntu Software store or:

sudo apt-get install kid3-qt

There are other programs too; if you find a good one, let me know!

Good luck and happy burning.

Subsonic issues on Ubuntu Server?

HTTP ERROR: 503 Can’t load server

My subsonic installation was not working! I tried everything (or so I thought) including reinstalling subsonic, looking at my router settings (is 4040 configured properly?) etc. Finally I found the solution: cleaning up a corrupt Subsonic Database. If you are being met with a 503 html error, this could be your fix.

Stop Subsonic

sudo service subsonic stop

Backup your /var/subsonic/db/subsonic.script file
This file contains a handful of SQL statements that will be used later to recreate your users, media directory settings, etc.

sudo cp /var/subsonic/db/subsonic.script /root/

Delete the contents of your /var/subsonic/db/ directory

sudo rm /var/subsonic/db/*

Restore your subsonic.script file

sudo cp /root/subsonic.script /var/subsonic/db/

Start Subsonic

sudo service subsonic start

Your Subsonic media library will now be empty, you’ll want to go to “Settings…” “Media Folders…” and click “Scan media folders now”

Raspberry Pi as a Spotify Connect source

This is verified to work with a Raspberry Pi model 3 B+ with Raspbian Stretch on 01/20/19. It really should work with any Pi using Jessie too.

The program we will use to stream music from any device to our Pi is called “raspotify“, which makes our Pi into a Spotify connect source. We will install the program and then make changes to the configuration file to customize the bit rate and Spotify Connect name which can be anything you choose.

Install raspotify from console:
https://dtcooper.github.io/raspotify/

From script:

curl -sL https://dtcooper.github.io/raspotify/install.sh | sh

Or manually:
# Install curl and https apt transport
sudo apt-get -y install curl apt-transport-https

# Add repo and its GPG key
curl -sSL https://dtcooper.github.io/raspotify/key.asc | sudo apt-key add -v –
echo ‘deb https://dtcooper.github.io/raspotify jessie main’ | sudo tee /etc/apt/sources.list.d/raspotify.list

# Install package
sudo apt-get update
sudo apt-get -y install raspotify

Restart raspotify:
sudo systemctl restart raspotify

If raspotify does not appear after boot, here are some options.

——————
Now you can send Spotify to your Pi using Spotify Connect from any device!

If you want to make changes to the Pi as a Spotify Connect source:
sudo pico /etc/default/raspotify

You will need to comment out the “#” for each option.

Change the device name:
DEVICE_NAME=”Spotify on the Pi”

If you want to change the bitrate:
BITRATE=”320″

Change the audio output, first the :
–device hw:0,5
(Note: you will need to type “lsusb” to find the Bus and Device Number)

Save the file and restart the service:
sudo systemctl restart raspotify

Final comments: I found this to work beautify.  Regarding the option to change the audio out hardware, my USB device was spotty. If you leave this option alone and simply use the audio out jack or HDMI you will find it is very reliable.

Update Subsonic on Ubuntu

To update Subsonic from the Ubuntu console, it’s best to log into a terminal window from Windows or Mac using Putty (or the Mac terminal).
Using your web browser from Windows/Mac, visit the download page.
Find the Ubuntu download link and copy the link location.
Example: http://www.subsonic.org/pages/download2.jsp?target=subsonic-6.1.5.deb

Log into your server using Putty/terminal. Download the new file.
wget http://www.subsonic.org/pages/download2.jsp?target=subsonic-6.1.5.deb

Now execute the update command:
>sudo dpkg -i subsonic-6.1.5.deb

Updated and back in business!