Shairport-sync no sound output

I’ve just installed music box and everything seems to work just fine apart from AirPlay streaming.
From an OSX computer I can see MusicBox as an Airplay server & the connection seems to be accepted just fine.
Starting to play a file (from Instacast) I can see the below in the /var/log/mopidy/mopidy.log

2015-02-25 10:38:05,840 - INFO     New MPD connection from [::ffff:]:48382

However nothing is outputted to my headphones.

It does look like something shairport-sync is doing something, cpu usage immediately spikes for this process

3311 root 20 0 63952 3120 1884 S 10.2 0.6 0:07.43 shairport-sync

Any help debugging this would be greatly appreciated. If I can get AirPlay working this solution would be perfect for me needs.

Thanks & Regards,

How exactly do you connect headphones to a RPi? 3,5 mm analog jack is a line out

Yes connected via standard headphones socket - do I need to configure shairport to use this ? mopidy / MOC seem to use this by default.

Having no Apple devices of my own, I’ve actually no idea how one uses Airplay. What is supposed to happen, is the following correct?

  1. Connect to Musicbox’s Airplay server from you OSX computer
  2. Select music on your OSX computer and play it
  3. Audio is streamed to Musicbox for output by whatever speaker is attached to it.

That local MPD connection is from the shairport-sync process telling Mopidy to stop (in case it’s currently playing). Once that command completes it should start playing using the default ALSA device; this should be the exact same device Mopidy uses. Apparently shareport-sync logs to syslog, is there anything interesting in /var/log/syslog ?

In a related note, the sound quality when connecting from the analogue lineout straight into ear/headphones is likely to be nasty. If this is for anything other than testing you’ll want want to go through some kind of amplifier first, almost anything will do.

Hi there. Did you get shairport sync sorted out?

Yes Airplay works so that the actual player (not a system mixer like with pulseaudio) on OS X allows you to select various audio output sinks, which can be (for example) on-board pc-speakers or alternatively airplay-network devices. After you select the device, all the audio from that player is directed to the device which passively reproduces it.

IIRC there are two versions of airplay an UDP version and a TCP version. Also, the airplay on PiMusicBox sometimes just fails. I have never checked the logs. I don’t use it much. I have simply tested it (from a Macbook) and had it work, though. At othe times the Macbook is “locked out”, so that it reports that connection failed as the device is already in use (by airplay) even if it is not.

That’s interesting, I actually borrowed an ipad and tried it tonight for the first time. As it happened it worked just fine. But next time it stops working for someone it’d be great if they could provide any log or error messages that might point to something we’ve setup wrong.

Not quite - I did buy a USB sound card and manually compiled shairport which improved things somewhat. Volume is still low and changing volume in alsamixer doesn’t seem to improve it. I keep meaning to use pulse but haven’t managed to find the time yet.

I wouldn’t recommend using Pulseaudio, TBH, as Shairport Sync is best running into ALSA. It is curious that using alsamixer doesn’t help with the volume – is it possible that you’re seeing another output device? To echo kingosticks’ comment above, if it stops working again, if might be worth turning on some diagnostics to get an idea what’s happening.

If you’re using it on a Raspberry Pi, it should work just fine into the built-in handphone jack, though the sound quality won’t be great.

Here’s what appears to happen: musicbox is used to play music and the stopped. After this trying to connect airplay device gives error “not able to connect to airplay device. Make sure that device is not used by other airplay device”. Nothing in mopidy.log