Install Raspotify for Sportify
- thomashk
- Jan 4, 2021
- 2 min read
One of the 2021 project is to enhance the audio quality of playing sportify.
Installation of respotify software
config the /etc/asound.conf
Install of respotify is easy:
reference site: https://dtcooper.github.io/raspotify/
Command: curl -sL https://dtcooper.github.io/raspotify/install.sh | sh
Then you need to config the /etc/asound.conf file in order to control the output of the sportify. Even you config the output to HDMI instead of the headphone.
Create the file: /etc/asound.conf
Paste the following code:
# /etc/asound.conf
###############################################################################
# Find your sound card:
# aplay -l
# Find your card's supported format(s) and sampling rate(s) While no other audio is being played:
# aplay -Dhw:<card #>,<device #> --dump-hw-params /usr/share/sounds/alsa/Front_Right.wav
# For example:
# aplay -Dhw:0,0 --dump-hw-params /usr/share/sounds/alsa/Front_Right.wav
# The output should look something like this if the card and device combination is correct:
# ACCESS: MMAP_INTERLEAVED RW_INTERLEAVED
# FORMAT: S16_LE S24_LE S32_LE
# SUBFORMAT: STD
# SAMPLE_BITS: [16 32]
# FRAME_BITS: [32 64]
# CHANNELS: 2
# RATE: [8000 192000]
# ...
# The above card supports formats S16_LE, S24_LE, and S32_LE, at up to a sampling rate of 192000.
# Uncomment and replace with the sampling rate of your choice.
# defaults.pcm.dmix.rate 48000
# Uncomment and replace with the format of your choice.
# defaults.pcm.dmix.format S16_LE
# Change to the card number or name that you want to be the default control card.
# Default: 0
defaults.ctl.card 1
# Change to the card number or name that you want to be the default playback card.
# It should usually be the same as defaults.ctl.card.
# Default: 0
defaults.pcm.card 1
# Change to the device number that you want to be the default device on the default card.
# 0 or 1 is usually the correct device number.
# Default: 0
defaults.pcm.device 0
# Change to the subdevice number that you want to be the default subdevice on the default device.
# Should rarely need to be changed.
# Default: -1
defaults.pcm.subdevice -1
# To install high quality samplerate converters on Debian based systems:
# sudo apt install -y --no-install-recommends libasound2-plugins
# To list available rate_converter's:
# echo "$(ls /usr/lib/*/alsa-lib | grep "libasound_module_rate_")" | sed -e "s/^libasound_module_rate_//" -e "s/.so$//"
# Uncomment and replace speexrate_medium with the rate_converter of your choice.
# defaults.pcm.rate_converter speexrate_medium
# Once everything is configure close and save this file and test with:
# speaker-test -c2 -l1
# While audio is playing you can verify your settings with:
# cat /proc/asound/card*/pcm*p/sub*/hw_params
I use the default card : card 1 simply because my pi's headphone is card 1:
pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
Subdevices: 3/4
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 4/4
Then you need to restart the respotify
sudo service raspotify restart
This should be it. Once I have my HIFIberry arrive. I will post the setup with my DAC and Headphone AMP for the final setup.
Comments