Piradio Airplay Crackly/Buffering


#1

Hi,

I’ve built and installed Airplay on the pirate radio but the sound is really crackly and it buffers every minute or so. I’ve got a good WiFi signal throughout my house and use AirPlay with Apple TV regularly without any issues. Any ideas?

Thanks


#2

I’ve not used Airplay on a Pi Zero, but I didn’t have this issue on a Pi 2 using the same setup- an Apple TV, streaming to a Raspberry Pi. In my case I had headphones plugged in to the Pi so I didn’t have to trail the headphone cable across the floor. I’m guessing the Pi Zero is just not up to the job of decoding the AirPlay stream.

Might be worth checking the shairport-sync docs to see if there’s a way to improve this.


#3

My Pi Zero W seems to work fine both as an Airplay speaker and an internet radio streaming device.

Did you make sure to use the lite version of Raspbian when setting up the radio? It can often make a quite big difference on CPU drain, which could result in poor audio quality.


#4

Ooooh, very good point!


#5

If you are using the full Raspbian, try setting it to boot to command line instead of the desktop. Its what I did on my Pirate Radio. I have been tempted to start over with the lite version, just to lazy at the moment.


#6

It crackles for me sometimes too, using jessie lite. I might try to install the updated version of shairport-sync at some stage.


#7

Thanks, where would I find these please?


#8

I’ve definitely installed the lite version. I’ve got the internet radio installed as well - would there be any CPI drain from this at all do you think? I may try installing it again and see if that improves it.


#9

Can you let me know if you find anything please.


#10

Not unless you’re actually running an internet stream at the same time. I have my own radio set up the same as yours it seems.
Re-installing is kinda the software equivalent of re-booting, but it’s worth a shot! :D


#11

A job for the weekend then! Thanks


#12

It might be worth trying: sudo iw wlan0 set power_save off

This will turn off the wireless power management.

And if it makes a difference, edit /etc/network/interfaces and:

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    wireless-power off # <----- Add this line

And it might also help to edit /boot/config.txt and set gpu_mem=16

I seem to have crackle and stutter free playback on a Zero W with these settings, but it’s still prone to having the phone forget it’s supposed to be playing to Airplay if it’s paused for a moment. I don’t know if that’s an iOS problem or a Shairport Sync problem.


#13

Do you have any thoughts on updating to the latest version of shairport-sync and whether that might be useful for iOS 11 (Airplay 2)?


#14

This issue covers the topic fairly extensively: https://github.com/mikebrady/shairport-sync/issues/535 albeit with a focus on multiroom speaker setups which may or may not ever work with Shairport Sync and are distinctly different from the one-device-playing-to-one-speaker setup you might be familiar with.

TLDR: It looks like Shairport Sync will continue to work with iOS 11 devices, since they would have to support the legacy Airplay protocol anyway to avoid consumer uproar. It’s still possible Apple could do something (intentionally or unintentionally) to thwart this, but Shairport has kept up pretty well with things so far.

Since ShairPort is derived from reverse-engineering a private key ( https://arstechnica.com/gadgets/2011/04/shairport-emulates-airport-express-to-receive-airplay-streams/ ), it will always be at odds with Apple and open to potentially ceasing to function between device updates either temporarily, or permanently. It’s still nonetheless fantastic to have when it works, and I hope it continues to do so!


#15

Cheers, are there any advantages to using the most up-to-date shairport-sync? The version 3 release notes, specifically mention “Pimoroni PHAT DAC” for instance.


#16

Looks like it was a fix related to software volume control in ALSA. I don’t know what the advantages might be of running the most up-to-date version, but I tend to build it from source from the master branch on GitHub.

It looks like some of the fixes as of release 3.1.1 on GitHub are interesting, though, and sound similar to some issues I encountered last week when testing a Shairport Sync setup on a Zero W. Looks like I should jump on a 3.2 release when it lands!


#17

I’m still getting occasional crackle with some of the fixes you advised. It might just be network congestion. I was downloading something on my main computer and airplay didn’t seem to be very happy about that.

If I wanted to compile an up to date version of shairport-sync any idea what options I should set it up with? Would be nice if the pirate radio script could be updated to use this. (Possibly the page needs to be updated too, to tell people not to use Raspbian Stretch).


#18

I’ve more or less solved the crashing issue with Stretch- it’s the fault of the dmix ALSA plugin it appears- so I just need to make sure it works and drop a new asound.conf into the Pi VU Meter repo.

As for crackle, I don’t know if it’s possible to eliminate completely but you may have luck with a USB WiFi adaptor if you’ve got one sitting around to test with. I know it sounds absurd using an adaptor with a Pi that already has built-in WiFi, but the onboard WiFi is apparently not terribly good. My own experiences with Parsec and 1080p video streaming seem to back this up, but it could be confirmation bias!

If I ever get the time, I may conduct some objective tests to confirm or deny this.

The README on Shairport-Sync’s GitHub goes into far more detail than I could about what configuration options to use. I believe it’s possible certain options may make a difference to performance, but I haven’t explored them in any depth.


#19

Did the stuff around stretch get fixed? Are there any pros/cons to upgrading for the radio? Cheers!


#20

The fix for Stretch is in these instructions: https://gist.github.com/Gadgetoid/3301cec3e47495e75b31d3120d8f17d9

Unfortunately the removal of Pulse Audio has some unintended side-effects, I would suggest not upgrading at the moment unless there’s something in particular you want from Stretch.

The pop reduction config should also work with Jessie