Category: Music
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
Review of the Murfie.com Streaming Service with comparisons to the competition.
The Murfie Streaming Service has a new owner and the service is almost ready to launch. Is it worth using?
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.
Prince 4Ever
To Prince’s credit (you could put MANY things to his credit), he didn’t have too many cash-out live albums or complications. Prince 4Ever is a great collection of his songs that really encapsulates his career. Any long term fan could pick on the list, though I can find few faults. I would have swapped one of the lesser-known songs out for Erotic City but it’s all good. If you were saddened by his death this year but wanted to start somewhere with Prince, I would say this is a really great way to.