Wednesday, February 17, 2016

Raspberry PI Spotify and Airplay, continued (DAC!)


This is the time where I finally was able to get a Hifiberry DAC+ and install it in the RPI.
Things to do to enable it? After an update, I'm on 4.1.17 kernel; so I went for the 3.1.18+ guide (honestly I started with the 3.12 guide by mistake.. and I had to revert quite a few things)

Hifiberry configuration guide

Notes:
1) You won't find the blacklist file, I just skipped that part (at least I didn´t find it)
2) etc/modules was empty too. (Maybe because this was Raspbian Jessy Lite?)
3) Adding the hifiberry dac in the config.txt file did the job, so aplay -l shows it
4) The configuration should be changed as indicated in /etc/asound.conf 
5) Success!

pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ HiFi pcm512x-hifi-0 []
  Subdevices: 0/1
  Subdevice #0: subdevice #0

I need to check if anything is wrong with the previous article's configuration.. will spotify connect and airplay still work? Answer: apparently yes. The only thing I changed was the command below in the startup script (spserver.sh). Not sure yet if it's necessary or not.

# set sound output to analog:
sudo amixer -c 0 cset numid=3 0

Additional notes:
- Trying to play some test wav won't work as (I believe) spotify connect is "taking over" the sound card (DAC) and then, you got a device busy error.


IMPORTANT:
Shairport seems to be having issues to work together with Spotify Connect Web (Did it work before? I think it did!). Now trying with Shairport-sync.

UPDATE to make both services work together:

* previously create a spkill.sh in /home/pi:

#!/bin/bash
sudo pkill -f main.py
sudo pkill spotify-connect


* add in /etc/shairport-sync.conf this line,
// Advanced parameters for controlling how a Shairport Sync runs
sessioncontrol =
{
run_this_before_play_begins="/home/pi/spkill.sh";
run_this_after_play_ends="/home/pi/spstart.sh";



Links:

(Also revisited soft volume stuff)
https://github.com/Fornoth/spotify-connect-web/issues/11
http://www.redsilico.com/multiroom-audio-raspberry-pi

No comments:

Post a Comment