Preconfigured Airplay speaker (Shairport) - Rasp. Pi Image


52 posts   Page 1 of 3   1, 2, 3
by rapsberrye » Mon Apr 22, 2013 9:12 pm
Image

Update 2013-08-31
New image available for download with updates of Shairport, raspi kernel and better startup/watchdog scripts. Check downloads below.

This new release introduces a watchdog to make sure required services are running.
If Shairport does not start or crashes during use, make sure to wait for up to 10 minutes for the watchdog to catch it and restart Shairport.

---

This is a preconfigured Raspberry Pi Debian build with Shairport.

Write the image to a SD card (4GB or larger), plug in speakers and network, and an Airplay-capable player will show up on your network!

Other than that this is a standard Raspbian system with the default login.
Username: raspberry
Password: pi
(startx to start desktop)

Detailed build instructions are available at bottom of post.

Download
http://snippets.khromov.se/files/shairport-configured-latest.tar.gz

Release notes
2013-08-31 – Updated of Shairport, raspi kernel and better startup/watchdog scripts.
2013-04-21 – First release

Misc
Tested with Airfoil (PC/Mac) and Honey Player (Android).
Additional testing welcome. (In particular actual iOS devices!)

Blog post with more information
http://snippets.khromov.se/preconfigured-airplay-speaker-shairport-downloadable-raspberry-pi-image/

Build instructions
http://snippets.khromov.se/raspberry-pi-shairport-build-instructions/
Last edited by rapsberrye on Sat Aug 31, 2013 11:07 pm, edited 5 times in total.
Posts: 21
Joined: Sat Jul 07, 2012 12:25 am
by pzc » Fri Apr 26, 2013 5:24 pm
Worked first time!
I used 7-Zip (twice) to decompress the .gz file into a .tar file then into the .img on my Windows 7 laptop.
I used win32diskimager to burn the image to my SD card.
I booted up the Pi with screen, keyboard and mouse attached, logged in as pi (raspberry), ran 'startx' and then used WiFi Config to connect to my wireless network.
Logged Out, Shutdown (sudo shutdown now), then rebooted with no screen, keyboard or mouse attached - just the speakers connected.
Ran "Music" on my iPad, selected "My Shairport" using the icon next to the volume slider and - hey presto! - music to my ears!
The playback is a bit glitchy but that is probably due to my son hammering our WiFi through his XBox.
Nice one!
Posts: 5
Joined: Sat Aug 18, 2012 4:36 pm
by rapsberrye » Sun Apr 28, 2013 8:53 pm
Build instructions added at the bottom of first post.

pzc wrote:Worked first time!
Ran "Music" on my iPad, selected "My Shairport" using the icon next to the volume slider and - hey presto! - music to my ears!


Glad it worked for you. :)
I haven't had an opportunity to try running over wifi yet, but will try to resolve playback issues if there are any.
Posts: 21
Joined: Sat Jul 07, 2012 12:25 am
by mattpitts74 » Sun May 19, 2013 1:42 pm
This worked first time for me and I have now have it running through my usb DAC.

All I ended up doing was commenting out the the line below in the alsa-base.conf file.

#options snd-usb-audio index=-2

I've been testing for a couple of hours and all seems fine. I'm using the E-DAC 24 http://epiphany-acoustics.co.uk/product ... e-usb-dac/

Not sure if I'm getting the best sound, as most people have modified various other files, but i'm not that techy, so any suggetions would be great if anyone has any improvements that will improve sound quality.

Thanks

Matt
Posts: 6
Joined: Tue Jan 29, 2013 10:59 pm
by rapsberrye » Mon Jun 03, 2013 9:02 pm
There's a lot of interesting stuff happening on the Shairport Github:
https://github.com/abrasive/shairport/commits/1.0-dev

It looks like a new stable version will be released shortly. When that happens this build will be updated.
Posts: 21
Joined: Sat Jul 07, 2012 12:25 am
by SASDOE » Wed Jun 05, 2013 12:33 pm
I strongly recommend you do what is said here so as to get the best audio from your RPi. I haven't been able to test it yet (need to buy another RPi, first one has RasPlex on it: great stuff), but it sounds like some of you could get more from you RPi by doig so!
Posts: 7
Joined: Mon Apr 22, 2013 11:08 pm
by SASDOE » Wed Jun 05, 2013 12:34 pm
rapsberrye wrote:There's a lot of interesting stuff happening on the Shairport Github:
https://github.com/abrasive/shairport/commits/1.0-dev

It looks like a new stable version will be released shortly. When that happens this build will be updated.



I can't seem to find much in the changelog, do you now what's new?
Posts: 7
Joined: Mon Apr 22, 2013 11:08 pm
by lektron » Wed Jun 05, 2013 1:12 pm
Thanks so much. it worked like a dream streaming from my iPhone & iPad.

Really appreciate your efforts in putting this together! I got it working on my own, but after 3 days it died and I could not get it working again. Also my version had horrible crackling when starting or stopping music. Yours is crystal clear :)
Posts: 1
Joined: Wed Jun 05, 2013 1:04 pm
by rapsberrye » Fri Jun 07, 2013 7:57 am
SASDOE wrote:
rapsberrye wrote:There's a lot of interesting stuff happening on the Shairport Github:
https://github.com/abrasive/shairport/commits/1.0-dev

It looks like a new stable version will be released shortly. When that happens this build will be updated.



I can't seem to find much in the changelog, do you now what's new?


Hey SASDOE,

The commit history I linked to is the changelog.
There isn't a new version of Shairport available yet, so a formal changelog isn't written. 1.0 should be the next release.
Last edited by rapsberrye on Fri Jun 07, 2013 8:03 am, edited 1 time in total.
Posts: 21
Joined: Sat Jul 07, 2012 12:25 am
by rapsberrye » Fri Jun 07, 2013 8:02 am
SASDOE wrote:I strongly recommend you do what is said here so as to get the best audio from your RPi. I haven't been able to test it yet (need to buy another RPi, first one has RasPlex on it: great stuff), but it sounds like some of you could get more from you RPi by doig so!


Hey,
Most of these performance tweaks are already applied.

Using JACK is not an option, because this image assumes you are going to use the built-in speakers.

Although, I will look into using HDMI for audio, so you can use a HDMI -> VGA+Audio splitter and get crystal clear audio from your HDMI port.

One like this:
Image
Posts: 21
Joined: Sat Jul 07, 2012 12:25 am
by BrianCotton4 » Fri Jun 07, 2013 8:52 pm
Hi,

Just thought i would weigh in on the devices i have successfully used to play music over my wifi connection using the software provided above incase anyone want to know. the devices i have used are as follows:

Ipad (retina display 30 pin connector model) - iOS 6 - stock music player app
Iphone 5 - iOS 6 - stock music player app
iMac - itunes
Nexus 7 - android 4.2.2 - Honey Player music app

Thanks to the person / peeps that have made it possible for me to do this.
Posts: 1
Joined: Fri Jun 07, 2013 8:45 pm
by pbattino » Mon Jun 17, 2013 3:44 pm
rapsberrye wrote:
Hey,
Most of these performance tweaks are already applied.

Using JACK is not an option, because this image assumes you are going to use the built-in speakers.

Although, I will look into using HDMI for audio, so you can use a HDMI -> VGA+Audio splitter and get crystal clear audio from your HDMI port.



I have a similar splitter and had no luck with Shairport :(
really frustrating:
- using analog audio everything OK
- using HDMI + splitter with local files or web radios OK
- using HDMI + splitter + shairport: the audio stream is fine until the first interruption (say you select another song). After that the sound is corrupted : you hear one second of music every 5 seconds. I then have to reboot the Pi
I haven't been able to understand why, if it's my splitter that it's not working properly (but why other streams are OK?) or if it's shairport's fault. I'm trying to find shairport logs, but nothing found to date. I added the "-v" flag inside /etc/init.d/shairport but I found nothing in syslog or other files... So it's hard to diagnose. If I had another device that accepts HDMI audio in, I could try to see if the problem occurs only with the splitter. But the reason I bought the splitter is precisely that: I have no HDMI IN in my ampli! :(
Posts: 12
Joined: Wed Aug 15, 2012 11:35 am
by rapsberrye » Mon Jun 17, 2013 8:44 pm
pbattino wrote:I have a similar splitter and had no luck with Shairport :(
really frustrating:
- using analog audio everything OK
- using HDMI + splitter with local files or web radios OK
- using HDMI + splitter + shairport: the audio stream is fine until the first interruption (say you select another song). After that the sound is corrupted : you hear one second of music every 5 seconds. I then have to reboot the Pi
I haven't been able to understand why, if it's my splitter that it's not working properly (but why other streams are OK?) or if it's shairport's fault. I'm trying to find shairport logs, but nothing found to date. I added the "-v" flag inside /etc/init.d/shairport but I found nothing in syslog or other files... So it's hard to diagnose. If I had another device that accepts HDMI audio in, I could try to see if the problem occurs only with the splitter. But the reason I bought the splitter is precisely that: I have no HDMI IN in my ampli! :(


Interesting!

Will check if I can replicate this on 1.0-dev.
Updating the Raspi firmware through rpi-update has been known to solve some audio issues - I was having issues with stuttering audio at first, an rpi-update fixed that, you might want to try it!
Posts: 21
Joined: Sat Jul 07, 2012 12:25 am
by pbattino » Tue Jun 18, 2013 8:11 am
rapsberrye wrote:
Interesting!

Will check if I can replicate this on 1.0-dev.
Updating the Raspi firmware through rpi-update has been known to solve some audio issues - I was having issues with stuttering audio at first, an rpi-update fixed that, you might want to try it!


YOU MADE MY DAY! The thing is: I had updated the firmware, but as a last resort, just to improve the analog output, when I had already gave up on the HDMI front (I had found nowhere indications that the update could fix an HDMI problem, nobody seemed to have my problem).
So AFTER the update I did not try a last time with the HDMI, but only with the analog output. When I read your comment I had a :idea: moment, I tried and in fact SHAIRPORT WORKS PERFECTLY!!!!

I put an end to weeks of endless pain: I have hi-fi audio from all my sources now.
Posts: 12
Joined: Wed Aug 15, 2012 11:35 am
by Mathious » Fri Jun 28, 2013 4:26 am
I put this on my pi and it works great with iOS devices but on my Android phone I am using the media app DoubleTwist which has AirPlay support and doesn't want to play with the Shairport.
Posts: 2
Joined: Sat Jun 01, 2013 6:48 pm
by bumphere » Thu Jul 04, 2013 11:05 am
Double Twist have released an open version of AirPlay called MagicPlay. There is a guide from one of the developers on how to get MagicPlay running on the Pi. http://nanocr.eu/2013/07/02/amplify-your-music-with-magicplay/
Posts: 2
Joined: Thu Jul 04, 2013 11:02 am
by rapsberrye » Thu Jul 04, 2013 10:46 pm
bumphere wrote:Double Twist have released an open version of AirPlay called MagicPlay. There is a guide from one of the developers on how to get MagicPlay running on the Pi. http://nanocr.eu/2013/07/02/amplify-your-music-with-magicplay/


That's interesting! Maybe there will be a separate build for that later. But there doesn't seem to be any iPhone support yet, which is a shame.

Speaking of Android, the newly released AirAudio app lets you play all your audio through AirPlay speakers. Finally it should be possible to stream Spotify, Pandora etc. It requires a rooted device. I will test its compatibility with Shairport in the coming week.

https://play.google.com/store/apps/deta ... udio&hl=en
Posts: 21
Joined: Sat Jul 07, 2012 12:25 am
by mikey11 » Sun Jul 07, 2013 2:02 am
Just wanted to say that I tried this as well and it worked without issue. I used Honey on Android as client for this. If anyone knows of a free android app to achieve results, I would love to hear about it.

I took the step of installing a WIFI adapter, and it runs flawlessly over that as well.

Something that I would like to do is set it up so that my WIFI adapter runs an ad-hoc network, or acts as a DHCP server so that I can use it in my car, but the problem is that I would like to be able to access the device without killing my tablets access to 3G.

One thing that would work is to have the pi boot and look for open networks, and then connect to them, but I don't have the know how to do that.... yet. This way, I could use my tablet as an access point and assign the pi an IP to use and access it that way.

Anyone have thoughts?
Posts: 78
Joined: Tue Jun 25, 2013 6:18 am
by castalla » Sun Jul 07, 2013 10:15 am
Can't see MagicPlay getting anywhere unless they quickly release binaries for other chipsets, eg. i386, Windows, etc.
Posts: 527
Joined: Thu Jul 19, 2012 3:46 pm
by adamwilliams84 » Sat Jul 13, 2013 12:39 am
Alright, so I'm still getting acquainted with Linux. Can someone tell me how to change the Airplay name on this image from My Shairport to say Airpi?
Posts: 2
Joined: Sat Jul 13, 2013 12:36 am
by rapsberrye » Sun Jul 14, 2013 4:16 pm
adamwilliams84 wrote:Alright, so I'm still getting acquainted with Linux. Can someone tell me how to change the Airplay name on this image from My Shairport to say Airpi?


Edit the file:
Code: Select all
/etc/init.d/shairport


Change the following line:
Code: Select all
NAME="My Shairport"


Save file and reboot.
Posts: 21
Joined: Sat Jul 07, 2012 12:25 am
by adamwilliams84 » Mon Jul 15, 2013 12:37 am
Thank you so much!
Posts: 2
Joined: Sat Jul 13, 2013 12:36 am
by Lennard » Sat Jul 20, 2013 3:13 pm
Hi all,

I am totally new this - had my Raspberry Pi lying around for a few months until I finally installed AirPi on it (with some issues) using this step by step giude http://trouch.com/2012/08/03/airpi-airplay-audio-with-raspberry/. I am very happy overall, but experiencing a few minor "issues" (probably just first world problems) but wanted to find out of these are normal:

- There is a 2-3 second delay between me hitting play on Spotify/iTunes/soundcloud and hearing the sound come through the speakers (iPad and MacBook). Could this be due to me not using a sound card? Or not using a Wi-Fi dongle? Is there any way to reduce this delay?

- When I listen to music (from spotify/soundcloud) from my iPhone 4 or iPad 2, the sound crackles/stutters a little - basically its not smooth the whole time. However, the sound through my iPad mini and MacBook is fine. Can anybody explain the issue here? Is there any way to get around it?

Thanks for your help in advance :)
Posts: 4
Joined: Sat Jul 20, 2013 2:49 pm
by DirkPrefect » Sun Jul 21, 2013 9:32 pm
Lennard wrote:Hi all,

I am totally new this - had my Raspberry Pi lying around for a few months until I finally installed AirPi on it (with some issues) using this step by step giude http://trouch.com/2012/08/03/airpi-airplay-audio-with-raspberry/. I am very happy overall, but experiencing a few minor "issues" (probably just first world problems) but wanted to find out of these are normal:

- There is a 2-3 second delay between me hitting play on Spotify/iTunes/soundcloud and hearing the sound come through the speakers (iPad and MacBook). Could this be due to me not using a sound card? Or not using a Wi-Fi dongle? Is there any way to reduce this delay?

- When I listen to music (from spotify/soundcloud) from my iPhone 4 or iPad 2, the sound crackles/stutters a little - basically its not smooth the whole time. However, the sound through my iPad mini and MacBook is fine. Can anybody explain the issue here? Is there any way to get around it?

Thanks for your help in advance :)



The delay is based on the size of the buffer used for shairplay. If memory serves the older version that used perl had a fairly large buffer but the new version based on the dev-1.0 branch uses a smaller buffer as default. The new version should help with the crackle and stutter from the older devices as well since there was a bug fix in the code that addressed this issue. Building the newest version from the dev-1.0 branch and using an updated /etc/init.d/shairport file should fix these issues for you.
Posts: 24
Joined: Tue May 07, 2013 3:07 am
by Lennard » Tue Jul 23, 2013 5:38 pm
DirkPrefect wrote:The delay is based on the size of the buffer used for shairplay. If memory serves the older version that used perl had a fairly large buffer but the new version based on the dev-1.0 branch uses a smaller buffer as default. The new version should help with the crackle and stutter from the older devices as well since there was a bug fix in the code that addressed this issue. Building the newest version from the dev-1.0 branch and using an updated /etc/init.d/shairport file should fix these issues for you.


Thanks Dirk.
I have put the below together to try and do the update as you suggested.
Can you let me know if this is correct and will update my Pi?

pi@raspberrypi:~$ sudo su
root@raspberrypi:/home/pi# cd
root@raspberrypi:~#
root@raspberrypi:~# cd shairport
root@raspberrypi:~/shairport#
root@raspberrypi:~/shairport# cd /etc/init.d/shairport
root@raspberrypi:/etc/init.d/shairport# update-rc.d shairport defaults

Thanks!
Posts: 4
Joined: Sat Jul 20, 2013 2:49 pm