GithubHelp home page GithubHelp logo

mikebrady / shairport-sync Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abrasive/shairport

6.9K 6.9K 563.0 11.44 MB

AirPlay and AirPlay 2 audio player

License: Other

C 92.32% Shell 1.20% Makefile 0.69% M4 1.52% C++ 3.85% Dockerfile 0.42%
airplay airplay-2 audio audio-player audio-streaming embedded-systems multi-room-audio multi-speaker synchronized-audio

shairport-sync's People

Contributors

abrasive avatar albertz avatar andywebs avatar belboj avatar bootc avatar charlesomer avatar dasl- avatar ejurgensen avatar jclehner avatar joerg-krause avatar kingosticks avatar lrusak avatar mag- avatar mazdermind avatar mflint avatar mikebrady avatar mptre avatar mrpippy avatar mspasov avatar nettings avatar nipsufn avatar okertanov avatar p3ck avatar plietar avatar rjyo avatar splbio avatar tillz avatar toofishes avatar yannpom avatar yubiuser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shairport-sync's Issues

Stutter with AirAudio on Android

Hello,
I'm having problems with playback on my raspberry pi musicbox with shairport sync. I'm using AirAudio on Android and it worked with Shairport. After a few seconds of playback I get some nasty interruptions.
I use the last MB image, where wouter updated shairport-sync.
I can access the box via ssh.
How can I give you some decent debug output?

Best Regards
David

Support password option

It would be nice to be able to set a password to start airplay. The original shairport supported this.

-k, --password=PW   require password to stream audio

Can't set the D/A converter to 44100 -- set to 48000 instead.

I've been using shairport-sync on two devices (Pi) with great success. However, only one of them have a proper DAC and then I found an old "3D Sound" USB card laying around, so I figured that I would hook it up to the other Pi to get a bit better sound from it.

However, the USB card only seem to support 48KHz. I found the below thread on volumio.org. Any news on this 'issue'? Or should I bit the bullet and get another proper DAC?

https://volumio.org/forum/new-version-shairport-with-audio-synchronisation-t1302.html

Daemon returned 2 as return value.

Hi Mike,

thanks for the fantastic rework on shairport. I suscessfully cross-compiled shairport-sync as a package within buildroot. But trying to start shairport as a daemon fails with:

Daemon returned 2 as return value.

I previous used shairport from abrasive, which ran fine as a daemon. Any suggestions?

Airplay device discovery wifi vs. wired

On a Raspberry Pi running shairport-sync on archlinux arm, I have a this problem: When the raspi is connected via wifi, airplay from a mac computer and from an iphone (both on wifi) works nicely -- but the device is only discovered reliably once, when shairport-sync is started. If the mac or the iphone are then dis- and reconnected from the wifi, they don't always show the airplay device again... only sometimes, it behaves a little strange and I couldn't work out what exactly is needed to reproduce. Doesn't look like a timeout either. Strangely, when the raspi is connected via ethernet, everything works like a charm, the airplay device always getting listed immediately.
I couldn't make out whether the problem is located in my router, in the network configuration, the avahi configuration or shairport, so any pointers would be greatly appreciated ;)

# shairport-sync -V
2.1.15-openssl-Avahi-ALSA-soxr

startup:

shairport-sync -a RPI --statistics -v -S soxr -t 20 -- -d hw:1 -t hardware -c PCM
Jan 04 22:20:48 alarmpi systemd[1]: Starting ShairportSync AirTunes receiver...
Jan 04 22:20:48 alarmpi systemd[1]: Started ShairportSync AirTunes receiver.
Jan 04 22:20:49 alarmpi shairport-sync[131]: Hardware mixer has dB volume from -128.000000 to 0.000000.
Jan 04 22:20:49 alarmpi shairport-sync[131]: Has mute ability.
Jan 04 22:20:49 alarmpi shairport-sync[131]: startup
Jan 04 22:20:49 alarmpi shairport-sync[131]: avahi: avahi_register.
Jan 04 22:20:49 alarmpi shairport-sync[131]: avahi: register_service.

In any case, the syncing works absolutely great, thanks for this project!

Unable to `make` on Raspberry Pi

Just installed a fresh image of raspbian on a SD card to play with Shairport sync but hitting an error during make

Makefile:370: recipe for target 'shairport-sync' failed

Here are the steps I took to install

$ sudo apt-get install autoconf libtool libdaemon-dev libasound2-dev libpopt-dev
$ sudo apt-get install avahi-daemon libavahi-client-dev
$ autoreconf -i -f
$ ./configure --with-alsa --with-avahi

Also tried

$ ./configure --with-alsa

The full output from the error

$ make
make  all-recursive
make[1]: Entering directory '/home/pi/projects/airplay/shairport-sync'
Making all in man
make[2]: Entering directory '/home/pi/projects/airplay/shairport-sync/man'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/pi/projects/airplay/shairport-sync/man'
make[2]: Entering directory '/home/pi/projects/airplay/shairport-sync'
gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT shairport.o -MD -MP -MF .deps/shairport.Tpo -c -o shairport.o shairport.c
mv -f .deps/shairport.Tpo .deps/shairport.Po
gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT rtsp.o -MD -MP -MF .deps/rtsp.Tpo -c -o rtsp.o rtsp.c
mv -f .deps/rtsp.Tpo .deps/rtsp.Po
gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT mdns.o -MD -MP -MF .deps/mdns.Tpo -c -o mdns.o mdns.c
mv -f .deps/mdns.Tpo .deps/mdns.Po
gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT mdns_external.o -MD -MP -MF .deps/mdns_external.Tpo -c -o mdns_external.o mdns_external.c
mv -f .deps/mdns_external.Tpo .deps/mdns_external.Po
gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT common.o -MD -MP -MF .deps/common.Tpo -c -o common.o common.c
mv -f .deps/common.Tpo .deps/common.Po
gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT rtp.o -MD -MP -MF .deps/rtp.Tpo -c -o rtp.o rtp.c
mv -f .deps/rtp.Tpo .deps/rtp.Po
gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT player.o -MD -MP -MF .deps/player.Tpo -c -o player.o player.c
mv -f .deps/player.Tpo .deps/player.Po
gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT audio.o -MD -MP -MF .deps/audio.Tpo -c -o audio.o audio.c
mv -f .deps/audio.Tpo .deps/audio.Po
gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT audio_pipe.o -MD -MP -MF .deps/audio_pipe.Tpo -c -o audio_pipe.o audio_pipe.c
mv -f .deps/audio_pipe.Tpo .deps/audio_pipe.Po
gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT audio_alsa.o -MD -MP -MF .deps/audio_alsa.Tpo -c -o audio_alsa.o audio_alsa.c
mv -f .deps/audio_alsa.Tpo .deps/audio_alsa.Po
gcc  -g -O2   -o shairport-sync shairport.o rtsp.o mdns.o mdns_external.o common.o rtp.o player.o alac.o audio.o audio_dummy.o audio_pipe.o   audio_alsa.o      -lasound   -lpopt   -lm -lpthread -ldaemon -lrt
rtsp.o: In function `handle_announce':
/home/pi/projects/airplay/shairport-sync/rtsp.c:597: undefined reference to `base64_dec'
/home/pi/projects/airplay/shairport-sync/rtsp.c:606: undefined reference to `base64_dec'
/home/pi/projects/airplay/shairport-sync/rtsp.c:607: undefined reference to `rsa_apply'
rtsp.o: In function `apple_challenge':
/home/pi/projects/airplay/shairport-sync/rtsp.c:663: undefined reference to `base64_dec'
/home/pi/projects/airplay/shairport-sync/rtsp.c:698: undefined reference to `rsa_apply'
/home/pi/projects/airplay/shairport-sync/rtsp.c:699: undefined reference to `base64_enc'
rtsp.o: In function `make_nonce':
/home/pi/projects/airplay/shairport-sync/rtsp.c:718: undefined reference to `base64_enc'
collect2: ld returned 1 exit status
Makefile:370: recipe for target 'shairport-sync' failed
make[2]: *** [shairport-sync] Error 1
make[2]: Leaving directory '/home/pi/projects/airplay/shairport-sync'
Makefile:420: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/pi/projects/airplay/shairport-sync'
Makefile:276: recipe for target 'all' failed
make: *** [all] Error 2

Am I doing something wrong or have I found a bug?

How to debug or increase log-level?

Hi,

I'm trying to run shairport-sync on the Rasberry Pi model B (version 1) on Raspbian, and everything seems to be working fine while installing. Even the sox resampling code compiles file and links in perfectly. I've adapted the /etc/init.d/shairport-sync file to use the command from the Readme: shairport-sync -d -a "Mike's Boombox" -- -d hw:0 -t hardware -c PCM and I've also tested it manually without the daemon mode. Everything seems to be running fine.

But when I try to stream to the device, both using an Android app and try to stream from my Linux laptop with pulseaudio (haven't got an Apple device to test with), nothing plays. I can't seem to find anything in /var/log/messages, next to a simple startup, so I wondered how I could bump up the log/debug level somewhere to figure out what's up?

Any help?

b.

latency options -L only way to sync Airfoil for mac

Hi,

If I pass -L 88200 options to Shairport-sync then Airfoil for mac syncs perfectly with everything in the house. But when using iTunes to send audio, Shairport is slightly ahead.
Below is the command I'm currently using to launch Shairport.

sudo shairport-sync -d -a "Stereo" -S soxr -L 88200 -- -d hw:0

The issue is, if I pass both -i 88200 -A 88200 instead of the -L option, Shairport-Sync is still slightly behind the rest of the airplay devices. Even though passing both those options at the same number should do exactly the same thing as the -L option.

I'm happy to use Airfoil for all my audio syncing, but hope you don't remove the -L option anytime soon.

Thanks for the app

Compilation fails with Pulseaudio 5.0

I have previously installed PulseAudio 5.0, as the tutorial on the link:
http://www.raspberrypi.org/forums/viewtopic.php?f=29&t=87138
As you may notice after installing the prerequisites, I have to remove libpulse0.
I state that I have compiled and installed by /abravive/shairport without issue and run regularly with PulseAudio 5.0.
So I installed shairport-sync as your instruction and I find the following errors:

pi@raspberrypi ~/shairport-sync-2.2 $ ./configure --with-alsa --with-avahi --with-pulseaudio --with-ssl=openssl
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for clock_gettime in -lrt... yes
checking for daemon_log in -ldaemon... yes
checking for pthread_create in -lpthread... yes
checking for exp in -lm... yes
checking for POPT... yes
checking encryption libraries chosen... checking for CRYPTO... yes
checking for SSL... yes

Including Avahi mDNS support
checking for avahi_client_new in -lavahi-client... yes
checking for avahi_strerror in -lavahi-common... yes
Including an ALSA back end
checking for ALSA... yes
Including a PulseAudio back end --- N.B. this is probably broken!
checking for pa_simple_new in -lpulse-simple... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking getopt_long.h usability... no
checking getopt_long.h presence... no
checking for getopt_long.h... no
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking mach/mach.h usability... no
checking mach/mach.h presence... no
checking for mach/mach.h... no
checking for memory.h... (cached) yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking for inline... inline
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for error_at_line... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for clock_gettime... yes
checking for gethostname... yes
checking for gettimeofday... yes
checking for inet_ntoa... yes
checking for memchr... yes
checking for memmove... yes
checking for memset... yes
checking for pow... yes
checking for select... yes
checking for socket... yes
checking for stpcpy... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strstr... yes
checking for strtol... yes
checking for strtoul... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating man/Makefile
config.status: creating config.h
config.status: executing depfiles commands

pi@raspberrypi ~/shairport-sync-2.2 $ make
make all-recursive
make[1]: Entering directory /home/pi/shairport-sync-2.2' Making all in man make[2]: Entering directory/home/pi/shairport-sync-2.2/man'
make[2]: Nothing to be done for all'. make[2]: Leaving directory/home/pi/shairport-sync-2.2/man'
make[2]: Entering directory /home/pi/shairport-sync-2.2' gcc -DHAVE_CONFIG_H -I. -g -O2 -MT shairport.o -MD -MP -MF .deps/shairport.Tpo -c -o shairport.o shairport.c mv -f .deps/shairport.Tpo .deps/shairport.Po gcc -DHAVE_CONFIG_H -I. -g -O2 -MT rtsp.o -MD -MP -MF .deps/rtsp.Tpo -c -o rtsp.o rtsp.c mv -f .deps/rtsp.Tpo .deps/rtsp.Po gcc -DHAVE_CONFIG_H -I. -g -O2 -MT mdns.o -MD -MP -MF .deps/mdns.Tpo -c -o mdns.o mdns.c mv -f .deps/mdns.Tpo .deps/mdns.Po gcc -DHAVE_CONFIG_H -I. -g -O2 -MT mdns_external.o -MD -MP -MF .deps/mdns_external.Tpo -c -o mdns_external.o mdns_external.c mv -f .deps/mdns_external.Tpo .deps/mdns_external.Po gcc -DHAVE_CONFIG_H -I. -g -O2 -MT common.o -MD -MP -MF .deps/common.Tpo -c -o common.o common.c mv -f .deps/common.Tpo .deps/common.Po gcc -DHAVE_CONFIG_H -I. -g -O2 -MT rtp.o -MD -MP -MF .deps/rtp.Tpo -c -o rtp.o rtp.c mv -f .deps/rtp.Tpo .deps/rtp.Po gcc -DHAVE_CONFIG_H -I. -g -O2 -MT player.o -MD -MP -MF .deps/player.Tpo -c -o player.o player.c mv -f .deps/player.Tpo .deps/player.Po gcc -DHAVE_CONFIG_H -I. -g -O2 -MT alac.o -MD -MP -MF .deps/alac.Tpo -c -o alac.o alac.c mv -f .deps/alac.Tpo .deps/alac.Po gcc -DHAVE_CONFIG_H -I. -g -O2 -MT audio.o -MD -MP -MF .deps/audio.Tpo -c -o audio.o audio.c mv -f .deps/audio.Tpo .deps/audio.Po gcc -DHAVE_CONFIG_H -I. -g -O2 -MT audio_dummy.o -MD -MP -MF .deps/audio_dummy.Tpo -c -o audio_dummy.o audio_dummy.c mv -f .deps/audio_dummy.Tpo .deps/audio_dummy.Po gcc -DHAVE_CONFIG_H -I. -g -O2 -MT audio_pipe.o -MD -MP -MF .deps/audio_pipe.Tpo -c -o audio_pipe.o audio_pipe.c mv -f .deps/audio_pipe.Tpo .deps/audio_pipe.Po gcc -DHAVE_CONFIG_H -I. -g -O2 -MT mdns_avahi.o -MD -MP -MF .deps/mdns_avahi.Tpo -c -o mdns_avahi.o mdns_avahi.c mv -f .deps/mdns_avahi.Tpo .deps/mdns_avahi.Po gcc -DHAVE_CONFIG_H -I. -g -O2 -MT audio_alsa.o -MD -MP -MF .deps/audio_alsa.Tpo -c -o audio_alsa.o audio_alsa.c mv -f .deps/audio_alsa.Tpo .deps/audio_alsa.Po gcc -DHAVE_CONFIG_H -I. -g -O2 -MT audio_pulse.o -MD -MP -MF .deps/audio_pulse.Tpo -c -o audio_pulse.o audio_pulse.c mv -f .deps/audio_pulse.Tpo .deps/audio_pulse.Po gcc -g -O2 -o shairport-sync shairport.o rtsp.o mdns.o mdns_external.o common.o rtp.o player.o alac.o audio.o audio_dummy.o audio_pipe.o mdns_avahi.o audio_alsa.o audio_pulse.o -lpulse-simple -lasound -lavahi-common -lavahi-client -lssl -lcrypto -lcrypto -lpopt -lm -lpthread -ldaemon -lrt /usr/bin/ld: audio_pulse.o: undefined reference to symbol 'pa_strerror@@PULSE_0' /usr/bin/ld: note: 'pa_strerror@@PULSE_0' is defined in DSO /usr/lib/libpulse.so.0 so try adding it to the linker command line /usr/lib/libpulse.so.0: could not read symbols: Invalid operation collect2: ld returned 1 exit status make[2]: *** [shairport-sync] Error 1 make[2]: Leaving directory/home/pi/shairport-sync-2.2'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pi/shairport-sync-2.2'
make: *** [all] Error 2

Note in the config: >>Including a PulseAudio back end --- N.B. this is probably broken!

But in the directory / usr / lib I find:

/usr/lib/libpulse.la
/usr/lib/libpulse.so
/usr/lib/libpulse.so.0
/usr/lib/libpulse.so.0.17.3
/usr/lib/libpulsecoer-5.0.la
/usr/lib/libpulsecoer-5.0.so
etc...

If I continue the installation manually with the command

gcc -g -O2 -o shairport-sync shairport.o rtsp.o mdns.o mdns_external.o common.o rtp.o player.o alac.o audio.o audio_dummy.o audio_pipe.o mdns_avahi.o audio_alsa.o audio_pulse.o -lpulse-simple -lasound -lavahi-common -lavahi-client -lssl -lcrypto -lcrypto -lpopt -lm -lpthread -ldaemon -lrt -lpulse

and with the addition of -lpulse I can compile shairport-sync and so I can proceeding by installing shairport-sync, I run shairport-sync with the command:

./shairport-sync -a 'Ale' -- -t pulseaudio

it works, but I do not hear anything and mostly do not start with pulseaudio.
Also with
./shairport-sync -a 'Ale' -- -d hw:0
run, but but I do not hear the music

From the pact of pulse audio I see:

pi@raspberrypi ~ $ sudo pactl list clients
Client #0
Driver: protocol-native.c
Owner Module: 1
Properties:
application.name = "Old Abrasive Shairport"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "29"
application.process.id = "2302"
application.process.user = "root"
application.process.host = "raspberrypi"
application.process.binary = "shairport"
application.language = "C"
application.process.machine_id = "d3670ff77a0bb988a953e7f053a3f4e7"

Client #3
Driver: protocol-native.c
Owner Module: 1
Properties:
application.name = "pactl"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "29"
application.process.id = "7764"
application.process.user = "root"
application.process.host = "raspberrypi"
application.process.binary = "pactl"
application.language = "en_GB.UTF-8"
window.x11.display = ":0.0"
application.process.machine_id = "d3670ff77a0bb988a953e7f053a3f4e7"

with the old shairport, but not with shairport-sync.

If I install libpulse0 again,

sudo apt-get install libpulse0

of course I perform successfully both ./configure that make and make install, but PulseAudio 5.0 does not work. With the command:
./shairport-sync -a 'Ale' -- -d hw:0

I hear the music, but this is not the right way as abrasive/shairport run, without installing libpulse0 again.
Is there something wrong that I have done or have not done?

Won't playback on raspbian with Airfoil

Hi,
I'm having trouble getting shairport-sync to work on my Raspberry-pi and Banana-Pi.
I use Airfoil on the PC and Allstream on the Android.
Both work with shairport.
I don't have any Apple devices to test.
I could be making a noob mistake here (just got RasPI recently), so please have patience.
I remember it was working some time ago (but can't recall the version).
I tried re-installing Raspbian, but same results.

root@pi:~/shairport-sync# shairport-sync -a test -vvv
statistics_requester status is 0.
daemon status is 0.
rtsp listening port is 5000.
Shairport Sync player name is "test".
Audio Output name is "(null)".
on-start action is "(null)".
on-stop action is "(null)".
wait-cmd status is 0.
mdns backend "(null)".
latency is 0.
AirPlayLatency is 88200.
iTunesLatency is 99400.
stuffing option is "(null)".
resync time is 2205.
busy timeout time is 120.
startup
avahi: avahi_register.
avahi: register_service.
culling threads.
new RTSP connection.
    Apple-Challenge: 6rfJYsyTV8OOzqNjcS+kHg.
    CSeq: 1.
    User-Agent: iTunes/7.6.2 (Windows; N;).
    Client-Instance: 5F30383159966582.
    DACP-ID: 24AFCE3001BA4CB9.
    Client-instance-identifier: 1c7cf450-c4fb-4696-b159-48dddd8e5031.
    Apple-Response: Cvrdz5JNsWKQDRWUV0UkCJnanteA4a5P7x6SLpHmD1Ba36r7ebNrEOcUU/bMKiiOGfGz1b+qBh8lOk1mK5AtcCZ0jB83Ai5dQzuKOa36ZipMwC/+8+KqhbDyyqrPGAPiPTk3QYMNXlXOKzMRjEN0hlzV+EQK0/+TwEMuogMBS06hJ5HeR0kqGUGGgm6NiFfFU2+/c1mHOjheOME0z+XiP+HKMJ0cJDBDaS2xhM2cKZw/8vXQJPWsvu8UrFc44mmb0hMW5GOB30INZZgu0qlesCT7CkZzBaur8NfrryjZS3ffatAs1Scnm/BthjZUxlAKkeMMCdSScMO2u00EQMFz5w.
    CSeq: 1.
    Audio-Jack-Status: connected; type=analog.
    Public: ANNOUNCE, SETUP, RECORD, PAUSE, FLUSH, TEARDOWN, OPTIONS, GET_PARAMETER, SET_PARAMETER.
    Client-computer-name: MARGE-PC.
    Content-Type: application/sdp.
    Content-Length: 575.
    CSeq: 2.
    User-Agent: iTunes/7.6.2 (Windows; N;).
    Client-Instance: 5F30383159966582.
    DACP-ID: 24AFCE3001BA4CB9.
    Client-instance-identifier: 1c7cf450-c4fb-4696-b159-48dddd8e5031.
Play connection from "iTunes/7.6.2 (Windows; N;)".
    CSeq: 2.
    Audio-Jack-Status: connected; type=analog.
    Transport: RTP/AVP/UDP;unicast;interleaved=0-1;mode=record;control_port=6002;timing_port=6003.
    CSeq: 3.
    User-Agent: iTunes/7.6.2 (Windows; N;).
    Client-Instance: 5F30383159966582.
    DACP-ID: 24AFCE3001BA4CB9.
    Client-instance-identifier: 1c7cf450-c4fb-4696-b159-48dddd8e5031.
rtp_setup: cport=6002 tport=6003.
Connection from IPv4: 192.168.128.64:64294
listening for audio, control and timing on ports 60053, 51217, 57926.
    CSeq: 3.
    Audio-Jack-Status: connected; type=analog.
    Transport: RTP/AVP/UDP;unicast;interleaved=0-1;mode=record;control_port=51217;timing_port=57926;server_port=60053.
    Session: 1.
    Range: npt=0-.
    RTP-Info: seq=8001;rtptime=0.
    CSeq: 4.
    User-Agent: iTunes/7.6.2 (Windows; N;).
    Client-Instance: 5F30383159966582.
    DACP-ID: 24AFCE3001BA4CB9.
    Client-instance-identifier: 1c7cf450-c4fb-4696-b159-48dddd8e5031.
    Session: 1.
    CSeq: 4.
    Audio-Jack-Status: connected; type=analog.
    Audio-Latency: 88200.
    Content-Type: text/parameters.
    Content-Length: 11.
    CSeq: 5.
    User-Agent: iTunes/7.6.2 (Windows; N;).
    Client-Instance: 5F30383159966582.
    DACP-ID: 24AFCE3001BA4CB9.
    Client-instance-identifier: 1c7cf450-c4fb-4696-b159-48dddd8e5031.
    Session: 1.
    CSeq: 5.
    Audio-Jack-Status: connected; type=analog.
Sync packet received before we got a timing packet back.
syncing to seqno 38240.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Aliasing of buffer index -- reset.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Aliasing of buffer index -- reset.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Aliasing of buffer index -- reset.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Aliasing of buffer index -- reset.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Aliasing of buffer index -- reset.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Sync packet received before we got a timing packet back.
Aliasing of buffer index -- reset.
Sync packet received before we got a timing packet back.
shutdown requested...
avahi: avahi_unregister.
shutting down playing thread.
RTSP shutdown requested.
closing RTSP connection.
shutting down RTP thread
Audio receiver -- Server RTP thread interrupted. terminating.
Control RTP thread interrupted. terminating.
Timing RTP thread interrupted. terminating.
rtp_timing_sender thread interrupted. terminating.
Closed and terminated timer requester thread.
Timing RTP thread terminated.
terminating RTSP thread.
exit...

Problems with sync

My setup is a bit of an edge case... I'm using MusicBee (v2.4.5404) with the Remote Speakers plugin (http://emilles.dyndns.org/software/out_apx.html) v. I'm running Shairport-sync on an Ubuntu machine. The shairport instance appears fine within the plugin but I'm getting this from the plugin:

Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5311.
syncing to seqno 47739.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5124.
syncing to seqno 47978.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5378.
syncing to seqno 48217.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5192.
syncing to seqno 48456.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5416.
syncing to seqno 48695.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5253.
syncing to seqno 48934.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5125.
syncing to seqno 49173.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5284.
syncing to seqno 49412.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5139.
syncing to seqno 49651.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5249.
syncing to seqno 49890.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5108.
syncing to seqno 50129.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5301.
syncing to seqno 50368.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5170.
syncing to seqno 50607.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5407.
syncing to seqno 50846.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5213.
syncing to seqno 51085.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5090.
syncing to seqno 51324.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5279.
syncing to seqno 51563.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5102.
syncing to seqno 51802.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5346.
syncing to seqno 52041.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5208.
syncing to seqno 52280.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5313.
syncing to seqno 52519.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5151.
syncing to seqno 52758.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5376.
syncing to seqno 52997.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5241.
syncing to seqno 53236.
Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5445.
syncing to seqno 53475.

And it continues ad nasaum.

Help!

Where to begin?

Thanks.

terrible audio quality upon using the -a option to set the advertised name

Hi Mike,

as the topic says, i have a very, very strange problem on my Raspberry Pi B+. I am a newbie on linux, but making rapid progress in understanding.

So first, i have to admit that i couldn't get the code to compile myself on Raspian Wheezy because at the point of your building and installing tutorial where the ./configure command is given, it throws an error at me that the compiler is not working, the logfile says it's Error 77. I exactly followed your tutorial on a fresh and updated Rasperian. You might want to check on this step of the tutorial. Google wouldn't help me after 3 days.

I have drawn the complied version "2.1.5-openssl-Avahi-ALSA" out the Image from http://www.woutervanwijk.nl/pimusicbox/ and started it sucessfully without arguments, testing and everything works just fine.

However, working myself deeper into the arguments and commands alongside with a lot of testing, i narrowed my problem to the "-a" option: When setting this option with an advertised name as argument, the output sound becomes awfully bad, it sounds like it has been overmodulated and then turned very quiet played back on an 8 or 7 bit soundcard one could buy 20 years ago. If this option is not set, the audio quality is excellent.

I cannot see the reason why this certain setting should do this, as i don't think it tampers with the mixers settings.

It would be nice if you could have a look at this problem. Thank you, Mike for maintaining the shairport project. I have used shairport4w and other airplay-software-receivers but never was satisfied because of the sync issues in multiple rooms. Keep up the great work!

Greetings from Germany to Ireland!

Using shairport-sync with Logitech Media Server on Ubuntu 14.04.1 LTS

Hi there Mike,

I stumbled across shairport-sync whilst trying to enable airplay from my iOS device to my Logitech Media Server.

First of all I tried shairport, which I soon realised would not allow me to stream to all the devices currently managed under my LMS. I could 'see' the devices separately but could not actually play to them (not exactly sure why, but it didn't fill my requirement so I went searching again). I found your fork, but need a bit of help with configuring.

I don't want to use the 'issues' area of GitHub to post something that is, in all likelihood, a user knowledge problem. Is there a better place to get help?

Anyway, here's some detail I assume would be helpful, gleaned from reading other posts:

loz@SqueezeCenter:~/shairport-sync$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty

loz@SqueezeCenter:/shairport-sync$ shairport-sync -vvv -t 0 &
[1] 2380
loz@SqueezeCenter:
/shairport-sync$ statistics_requester status is 0.
daemon status is 0.
rtsp listening port is 5000.
Shairport Sync player name is "Shairport Sync on SqueezeCenter".
Audio Output name is "(null)".
on-start action is "(null)".
on-stop action is "(null)".
wait-cmd status is 0.
mdns backend "(null)".
latency is 0.
AirPlayLatency is 88200.
iTunesLatency is 99400.
stuffing option is "(null)".
resync time is 2205.
busy timeout time is 0.
tolerance is 88 frames.
password is "(null)".
startup
avahi: avahi_register.
avahi: register_service.

loz@SqueezeCenter:~/shairport-sync$ /etc/init.d/shairport-sync start
Daemon returned 2 as return value.

I haven't really changed anything from defaults, and I'm guessing that might be the problem!

Cheers,
Loz

Sound not Sync on Raspberry Pi (Resolved with --iTunesLatency=95000 )

Hello,

Not a real issue, but for people having trouble with sync, these can help them.

The problem: The sound on the pi has a delay of some millisecond

My installation: Emmitter: Itunes on 11.4 on Macbook pro Mid 2009 OS X 10.9.5 (WiFi connection)
Receiver: Raspbery PI B+ (Ethernet Connection) (+the macbook pro emmiting sound)
Speaker: Output jack 2.0 plug on samsung HT-THX25 (5.1)

The solution: launch with option: --iTunesLatency=95000

Maybe this could help someone ;)

Thanks for your fork !

Latency Problem with forked-daapd & Airfoil for Mac

Hi, at first let me thank you for your amazing work! I enjoy it every day!

I just found an minor issue. Playing music with forked-daapd and streaming it to shairport-sync and my other airplay devices (airport express, apple TV, Yamaha Receiver) - shairport-sync is out of sync.

My setup (described above) is totally in sync by setting the latency (via -L) to 99400. But by using this setting with Airfoil for Mac it occurs that shairport-sync is out of sync.

I guess that Airfoil needs 88200 and forked-daapd 99400 as the latency setting. As described in this Issue "#23"

"(1) making the default latency 88,200 rather than 99,400 frames,
(2) if a player identifies itself as iTunes, using a latency of 99,400 for iTunes >= 10 and 88,200 >otherwise."

Is it possible to add 99400 frames for forked daapd? I was not able to get the information regarding the identifier send by forked-daapd.

Proposal: use `--with-ssl=` and `--with-zeronf=`

With the current configure options a user can (unintentionally) use --with-openssl --with-polarssl both together. Same with --with-avahi --with-tinysvcmdns.

To inhibit this, I would suggest to use:

  • --with-ssl= which takes openssl or polarssl as an argument (eg. --with-ssl=openssl)
  • --with-zeroconf= which takes avahi or tinysvcmdns as an argument (eg. --with-zeroconf=tinysvcmdns)

IMO, this also better reflects that these options are mutually exclusive.

Command to pause/stop Shairport-sync playback?

I have been looking for a shell command I can use to pause/stop Shairport-sync playback similar to mpc's pause/stop command for mpd, http://volumio.org/forum/shairport-and-mpd-won-get-along-t332.html

Do you know if there is such command available?
I have searched around but found nothing that can be used on Shairport and/or Shairport-sync.

I know I can kill or restart Shairport-sync by command but that is not a good idea if I am going to run this command everytime another app, e.g. mpd plays sound.

Delay between pausing & sound stopping

I just set up shairport-sync on raspbian with a usb audio device like this:

sudo apt-get --yes install autoconf libtool libdaemon-dev libasound2-dev libpopt-dev avahi-daemon libavahi-client-dev libssl-dev
git clone https://github.com/mikebrady/shairport-sync.git /package/shairport-sync/
cd shairport-sync
git checkout 2.2
autoreconf -i -f
./configure --with-alsa --with-avahi --with-ssl=openssl
make
sudo ./shairport-sync -a AirPi --statistics -- -d hw:0 -t hardware -c PCM

On osx 10.8 it shows up as an audio output device and I can send sound to it, but I see pretty close to 2s of delay in response with (un)pausing, and with the osx volume change clicks (although the actual volume changes immediately).

The statistics output looks like

Sync error: -45.8 (frames); net correction: 194.3 (ppm); corrections: 194.3 (ppm); missing packets 0; late packets 0; too late packets 0; resend requests 0; min DAC queue size 6098, min and max buffer occupancy 208 and 235.
Sync error: 70.7 (frames); net correction: -110.4 (ppm); corrections: 110.4 (ppm); missing packets 0; late packets 0; too late packets 0; resend requests 0; min DAC queue size 6088, min and max buffer occupancy 227 and 235.
Sync error: 73.1 (frames); net correction: -121.7 (ppm); corrections: 121.7 (ppm); missing packets 0; late packets 0; too late packets 0; resend requests 0; min DAC queue size 6057, min and max buffer occupancy 224 and 236.

I previously had abrasive/shairport running on this machine. When I saw this delay with shairport-sync, I thought maybe it was loading a shairport lib so I reinstalled shairport to see what files it copies over so I could remove them, and it looks like shairport's make install just installs the binary (no libs).

I also had pulseaudio set up via apt but uninstalled all those packages:

The following packages will be REMOVED:
  gstreamer0.10-pulseaudio gstreamer1.0-plugins-bad{a} libasound2-plugins{a} libdirectfb-1.2-9{u} libfluidsynth1{a} libmad0{u}
  libmikmod2{u} libportmidi0{u} libpulse0 libsdl-image1.2{a} libsdl-mixer1.2{a} libsdl-ttf2.0-0{a} libsdl1.2debian{a}
  libsmpeg0{a} libts-0.0-0{u} libvorbisfile3{u} pulseaudio pulseaudio-module-x11 pulseaudio-module-zeroconf{a} pulseaudio-utils
  python-pygame{a} python3-pygame{a} tsconf{u}

Thanks so much for an awesome project and for your help!

Support for metadata

The original shairport supports metadata, do you plan on bringing this feature to shairport-sync? I would understand if you think this overcomplicates things, just asking!

24/96kHz support

Hi Mike,

I have IQAudio Pi-DAC+ which supports 24/96kHz audio. Is it possible to configure the shaiport-sync that it can use this high quality settings? Now the airplay port is seen by all devices as 16bit/44kHz output device.

Thanks for the response and keep up that great work!

COPYING file is misleading

The Git repository contains a COPYING file with the text of the GPLv3 license. However, none of the shairport-sync code seems to be released under the GPLv3, it's apparently under MIT and BSD-3c. So having this COPYING file is a bit misleading.

multiple instances of shairport-sync on one machine

Is it possible to run more than one shairport-sync instance on one machine? I'm using a raspberry pi with shairport-sync and a bluetooth speaker but I would also like to run another instance on the same machine which makes use of a usb audio device.

First process:
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -d -a "Shairport (bluetooth)" -- -d bluetooth || return 2

Second process:

start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -d -a "Shairport (USB-Audio)" -- -d hw:1 || return 2

Is this possible?

--on-stop and --on-start options throw error

The on-start and on-stop arguments do not function as expected. This exact setup is working with the original shairport.

rtp_setup: cport=40863 tport=45972.
Connection from IPv4: 192.168.1.127:38936
listening for audio, control and timing on ports 58607, 37928, 47629.
Execution of on-start command failed to start
Error executing on-start command /root/squeezelite-stop
....
RTSP shutdown requested.
closing RTSP connection.
shutting down RTP thread
Audio receiver -- Server RTP thread interrupted. terminating.
Control RTP thread interrupted. terminating.
Timing RTP thread interrupted. terminating.
rtp_timing_sender thread interrupted. terminating.
Closed and terminated timer requester thread.
Timing RTP thread terminated.
Execution of on-stop command failed to start
Error executing on-stop command /root/squeezelite-start
terminating RTSP thread.

No -M option to know what's playing on ?

Hi,

Not sure if it's a regression, but on shairport, there was an option which store the Metadata in a file :
To enable the output of metadata, the -M flag must be set to instruct shairport where to save the output. A fifo named now_playing will be created, and records will be written to it when tracks are changed.

Would you get it work ? It might be usefull :)

Thanks for your work
Regards

Miguelonthenet

GCC options for fast builds

I'm using shairport-sync for a few MIPS machines, they are limited to like 300MHz at least some of them, now i tried to find the fastest compiling options, i already tried
CFLAGS = -s -O3 -funroll-loops -fopenmp -ffast-math
that reduces the CPU usage from like 21% to 9% using SOXR

But on the other machine the compile options don't benefit.
I'm not sure if libsoxr uses FPU for the older architecture, or GCC isn't optimized.
Someone tried to build shairport-sync with llvm? any speed improvement?

wrong gain curve for the digital volume control

I'm using toslink to digitally/optically transmit the audio signal from the receiver to the stereo, since there is no real volume control on such digital signals I have to rely on the digital volume control, which works perfectly, but seems to follow a linear curve.
The problem is that the human perception of loudness is not linear and the volume control feels unnatural when using a linear curve.

here's a bit more detailed information about the topic:
http://www.dr-lex.be/info-stuff/volumecontrols.html

please fix the behavior of the digital volume control, thanks!

How to specify subdevice & use hardware mixer?

I have a Creative XFi that has several outputs:

$ aplay -l | grep card
card 0: XFi [Creative X-Fi], device 0: ctxfi [Front/WaveIn]
card 0: XFi [Creative X-Fi], device 1: ctxfi [Surround]
card 0: XFi [Creative X-Fi], device 2: ctxfi [Center/LFE]
card 0: XFi [Creative X-Fi], device 3: ctxfi [Side]
card 0: XFi [Creative X-Fi], device 4: ctxfi [IEC958 Non-audio]

With the original shairport I could specify what output to use like so:

shairport -a bathroom -- -d hw:XFi,0
shairport -a kitchen -p 5001 -- -d hw:XFi,1

This also works with shairport-sync, unless I try to specify a mixer:

$ shairport-sync -a kitchen -- -d hw:XFi,1 -t hardware -c Surround
ALSA lib conf.c:4578:(parse_args) Unknown parameter 1
ALSA lib conf.c:4711:(snd_config_expand) Parse arguments error: No such file or directory
ALSA lib control.c:953:(snd_ctl_open_noupdate) Invalid CTL hw:XFi,1
Failed to attach mixer

Is there any way to make this work? Otherwise it works really well, the sync-feature is awesome, thanks a lot!

Itune says device not compatible

If you use Itune to stream airplay music to multiple shairport-sync, have you notice Itune sometimes says says device not compatible or similar?

Something like this
https://discussions.apple.com/thread/4675327?tstart=0

Rebooting the shairport-sync device sometimes can resolve this error message.
I know shairport have a similar problem but I would expect Shairport-sync not to have such error when it is designed for synchronized playback.

If you can't reproduce this, is there something I can do to get useful log so you can see what might be the cause?

shairport-syng is beeing used by someone else.

I love this little application that makes my raspberry pi very useful. However with the latest version installed as a service (the only one I've tried I sometimes get the error: shairport-syng is beeing used by someone else. Even though I am the only one using it. Sometimes a service restart works and sometimes I have to restart the raspberry pi. Sometimes that even does not work.. I can't seem to find any log.. Can you help me?

less timeout when not cleanly disconnecting

I once turned off my ipad when it was connected to shairport-sync. Turned out that shairport-sync hogs the audio output for a couple of minutes, before it was possible to reconnect (even with the -t option set to 0). Maybe it is an idea to have a shorter timeout. Maybe 10-15 seconds for these rare occurances.

I can atleast imagine one scenario with -t 0 (aka party mode): The person playing, is leaving the party, music stops for several minutes, nobody can connect to shairport-sync, causing mucho problemo and panic :D

Edit: come to think of it, with -t 0, one would expect shairport-sync to accept new connections anyways, even if the previous connection wasnt cleanly disconnectes

Static on loading some pages in Chrome

Apologies that I'm very new to all of this, so I may be describing a problem on my end, or a feature-not-a-bug, or I may give insufficient information to diagnose it, but I'll do my best. Basically, certain things I do on my laptop (which is providing the audio source) cause the speakers connected to my Pi, which are otherwise silent when no audio is transmitted, to produce static for a few seconds. It seems to occur whenever I load a webpage that might play some form of media, even if it isn't going to play it yet (e.g., facebook, feedly, youtube).

I assume this is a result of priming for video that might be coming from the browser, but I wanted to see if there's a fix to prevent this static, or if it's a problem on my end that I could solve (or that I can't solve until I get better audio hardware). Thanks!

Can you fix the --on-start --on-stop options?

This is from abrasive#296 (comment):

Btw can you fix the --on-start --on-stop options?
with the commandline /usr/local/bin/shairport -d -a hostname --wait-cmd --on-start='/usr/local/bin/mpc -q stop' -- -d plughw:0,0 I get:
/usr/local/bin/shairport: invalid option -- 'q'
/usr/local/bin/shairport -d -a hostname --wait-cmd --on-start="/usr/local/bin/mpc -q stop" -- -d plughw:0,0 -- -d plughw:0,0 doesn't give the invalid option but doesn't work either. The same happens with /usr/local/bin/shairport -d -a hostname --wait-cmd --on-start='/usr/local/bin/mpc\ -q\ stop' -- -d plughw:0,0

It works with the official version, and also when I merged the on-start/stop/wait commit myself into shairport-sync 2.0. Of course I see why it doesn't work, and I could just make a script, but..

Disable "Busy" Signal?

Hello,

I'm wondering if it's possible to disable the "busy" signal? I actually like that the last one playing wins. Maybe add it as an command line option?

Thank you

"Shairport Sync sends back a "busy" signal if it's already playing audio from another source, so other sources can't disrupt an existing Shairport Sync session. (If a source disappears without warning, the session automatically terminates after two minutes and the device becomes available again.)"

Compilation of libsoxr on raspbian (Raspberry PI)

This is no issue, but should rather serve as a compact documentation for how to install shairport-sync on a Raspberry PI with libsoxr support. Since libsoxr is currently not available as a package it needs to be compiled separately before the compilation of shairport-sync:

  • Download the source code from SourceForge: http://sourceforge.net/projects/soxr/files/
  • Extract the file in a folder and enter that folder.
  • Compile libsoxr according to the file INSTALL.
  • Now follow the README.md of shairport-sync

I adjusted my /etc/init.d/shairport-synccommand to:
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -d -a "rPI-sync" -S soxr -L 24000 || return 2
This ensures that the resampler (-S soxr) is used and a delay of half a second is set (-L 24000).
My system currently runs Raspbian with kernel 3.12.29+and the DAC from HifiBerry.

@mikebrady Thank you very much for your effort! It is highly appreciated!

I wrote this short description to show my appreciation and make it for others with a Raspberry PI easier to find some instructions.

Problem playing from Synology NAS

This from HiFiJ:

Hi Mike,

I compiled shairport-sync on two RasPis and on my Ubuntu Thinkpad and tried to use it with the itunes server implementation (so no "real" itunes) on my Synology NAS (a DS 114 to be exact).
I have done this before with the original shairport, and that worked well (meaning good sound quality on RasPis/Openelec/XBMC), but of course without multi player synchronisation.

Now, with shairport-sync I have the problem that the stream is constantly disrupted, playing for a second or so (varying), then stopping for a couple of seconds. I already did a log with -vv which I could send or post, if you are interested in looking into this. I suppose the main parts are these errors with changing frame counts:

syncing to first seqno 871C.
Lost sync with source -- flushing and resyncing. Error of 11591 frames.
syncing to first seqno 884E.
Lost sync with source -- flushing and resyncing. Error of 12257 frames.
syncing to first seqno 8978.
Lost sync with source -- flushing and resyncing. Error of -3345 frames.

(btw, network connection is fine on both raspis and laptop, shairport and squeezelite are working good).

I guess synology devices are quite common, and I personally now three other persons who use them as an Itunes server, so perhaps this is of some interest to you as it would provide an Apple free, linux based environment for multiroom audio as an alternative to SqueezeCenter/LMS and squeezelite.

Thanks for your work!

Joost

No audio when running as daemon on Raspberry Pi

First of all, well done on this awesome project and the level of documentation.

I am experiencing some strange behaviour, but only when running as a Daemon (on a Raspberry Pi B+, Raspbian GNU/Linux 7 (wheezy))

When I run Shairport-Sync directly from the shell (./shairport-sync) all works well. However, when I Daemonize it all appears to work (My ipad sees it and can connect to it), there is just no audio. First I though it was because the daemon runs as root and perhaps the audio settings for root are different (they are not afaik), but after jumping through some hoops to let my 'pi' account write to '/var/run/shairport-sync.pid' I still get no audio.

I have taken the relevant bit out of /etc/init.d/shairport-sync to make testing easier.

sudo start-stop-daemon --start --pidfile /var/run/shairport-sync.pid --chuid pi --exec /usr/local/bin/shairport-sync -- -d -a "Living Room CLI"

I have tried different audio devices as well and tried separate tests with the audio cable in the RasPi audio out as well as the USB based DAC.

There are no errors in syslog either. I get the same problem on 2 separate RasPis

The original Shairport ran fine as a daemon using the exact same user account.

Any idea what may be wrong?

Long delay before playing sound file with Streambels

If using Streambels on Android for streaming an audio file to the device it takes around 10 seconds before shairport-sync starts to play the music. Here is the log, I added a comment where the delay happens:

new RTSP connection.
    CSeq: 1.
    User-Agent: Streambels 3.0.
    DACP-ID: 299e23b2ad6e6379.
    Client-Instance: 7877980bf58832a4.
    Active-Remote: 203815810.
    Apple-Challenge: SdX9kFJVxgKVMFof/Znj4Q.
    Apple-Response: BjAJLIanqVc5aT7/IoKqFFIUPBDaHQdoXXhCYUpN+JTUsR9VjqMC8YA0sRxQDNai452XgavLRWJn8axSJXdyy3FjTjD1EL/T2k77piUlSo/Wv2eW1bx0gZ50/Vx8xRLMqTr8CH5JaleEcD31Xy+HECUbvyGCF280B4PTta0tFM2Z4rt43L0/yed0XOXci5OZhkni4Ykhf0yc0NQqeGkRhmbc3RNP0otGxecZX97lZ045BVkG8b9nvo7M78A/VMWFENsFcR2GSq901J9uDNsaB0tJ6Xqis+5JLwC2QdGSkBx9+ARE1ML/esUeYhYHJfeJFU7u8b5BvjjIHhJxETU0BA.
    CSeq: 1.
    Audio-Jack-Status: connected; type=analog.
    Public: ANNOUNCE, SETUP, RECORD, PAUSE, FLUSH, TEARDOWN, OPTIONS, GET_PARAMETER, SET_PARAMETER.
    CSeq: 2.
    User-Agent: Streambels 3.0.
    DACP-ID: 299e23b2ad6e6379.
    Client-Instance: 7877980bf58832a4.
    Active-Remote: 203815810.
    Content-Type: application/sdp.
    Content-Length: 566.
Play connection from "Streambels 3.0".
    CSeq: 2.
    Audio-Jack-Status: connected; type=analog.
    CSeq: 3.
    User-Agent: Streambels 3.0.
    DACP-ID: 299e23b2ad6e6379.
    Client-Instance: 7877980bf58832a4.
    Active-Remote: 203815810.
    Transport: RTP/AVP/UDP;unicast;interleaved=0-1;mode=record;control_port=34545;timing_port=34546.
rtp_setup: cport=34545 tport=34546.
Connection from IPv4: 192.168.2.176:47477
listening for audio, control and timing on ports 38153, 41883, 50810.
    CSeq: 3.
    Audio-Jack-Status: connected; type=analog.
    Transport: RTP/AVP/UDP;unicast;interleaved=0-1;mode=record;control_port=41883;timing_port=50810;server_port=38153.
    Session: 1.

===> 10 seconds delay here!

    CSeq: 4.
    User-Agent: Streambels 3.0.
    DACP-ID: 299e23b2ad6e6379.
    Client-Instance: 7877980bf58832a4.
    Session: 1.
    Active-Remote: 203815810.
    RTP-Info: seq=1;rtptime=88552.
    Range: npt=0-.
    CSeq: 4.
    Audio-Jack-Status: connected; type=analog.
    Audio-Latency: 88200.
    CSeq: 5.
    User-Agent: Streambels 3.0.
    DACP-ID: 299e23b2ad6e6379.
    Client-Instance: 7877980bf58832a4.
    Session: 1.
    Active-Remote: 203815810.
    Content-Type: text/parameters.
    Content-Length: 18.
    CSeq: 5.
    Audio-Jack-Status: connected; type=analog.
    CSeq: 6.
    User-Agent: Streambels 3.0.
    DACP-ID: 299e23b2ad6e6379.
    Client-Instance: 7877980bf58832a4.
    Session: 1.
    Active-Remote: 203815810.
    RTP-Info: rtptime=88552.
    Content-Type: application/x-dmap-tagged.
    Content-Length: 71.
unrecognised parameter: >>mlit<< (4).
    CSeq: 6.
    Audio-Jack-Status: connected; type=analog.
syncing to seqno 1.

Output to stdout

Is it possible to make this output the raw PCM data to stdout by any chance?

Apple TV running Ubuntu make error

Hi! When I'm trying to install the newest version of Shairport Sync (2.1+) on my old 32-bit Apple TV 1, I get this error when I run the make command:

rtsp.o: In function handle_announce': /shairport-sync-2.1/rtsp.c:581: undefined reference tobase64_dec'
/shairport-sync-2.1/rtsp.c:590: undefined reference to base64_dec' /shairport-sync-2.1/rtsp.c:591: undefined reference torsa_apply'
rtsp.o: In function apple_challenge': /shairport-sync-2.1/rtsp.c:647: undefined reference tobase64_dec'
/shairport-sync-2.1/rtsp.c:682: undefined reference to rsa_apply' /shairport-sync-2.1/rtsp.c:683: undefined reference tobase64_enc'
rtsp.o: In function make_nonce': /shairport-sync-2.1/rtsp.c:702: undefined reference tobase64_enc'
collect2: ld returned 1 exit status
make[1]: *** [shairport-sync] Error 1
make[1]: Leaving directory `/shairport-sync-2.1'
make: *** [all] Error 2
root@crystalbuntu:/shairport-sync-2.1#

Shairport-sync 2.0 is working fine. How can this be fixed?

Iphone 6+ cannot find shairport-sync

Do you have any idea why Iphone 6+ running iOS 8.0.2 cannot find shairport-sync using airplay?
Iphone 6 probably have the same problem.

Strangely, Iphone 5S and 4S, also running iOS 8 can find shairport-sync without any problems..
Latest windows version of Itune also works fine with shairport-sync without any problems..

Connection time, half a minute

Not sure if this is a bug or by design. After selecting the shairport-server in iTunes(Mac OS X latest) it takes almost half a minute until it starts playing. Is there a way to speed things up?

I'm running shairport on an ubuntu 14.04 box with ALSA.

Alsa and wifi broken with shairport-sync

Hi Mike,

I've an ARM-based wireless audio device running shairport-sync 2.1.11. Mostly, it plays very solid. However, I've investigated a problem which occurs rarely, but is very annoying. I stream the music from my iPhone to the wireless audio device. This runs for a while and suddenly playback stops. I've restarted the device and the iPhone can see the audio device, but after selecting it as playback device it disappears.

I've logged the output from shairport-sync -vvv -t 0. It's a lot of output and I've cut after the kernel dump. The brcmfmac is the wifi driver:

# shairport-sync -vvv -t 0 &
# daemon status is 0.
rtsp listening port is 5000.
Audio Output name is "(null)".
on-start action is "(null)".
on-stop action is "(null)".
wait-cmd status is 0.
mdns backend "(null)".
latency is 0.
AirPlayLatency is 88200.
iTunesLatency is 99400.
stuffing option is "(null)".
resync time is 2205.
busy timeout time is 0.
Successful startup.
avahi: avahi_register.
avahi: register_service.
[  610.643727] cfg80211: Calling CRDA to update world regulatory domain
[  618.174092] brcmfmac: brcmf_cfg80211_del_key: invalid key index (4)
[  618.181538] brcmfmac: brcmf_cfg80211_del_key: invalid key index (5)
[  618.211642] cfg80211: Calling CRDA for country: DE
culling threads.
new RTSP connection.
    CSeq: 0.
    X-Apple-Device-ID: 0xc86f1dca95e2.
    Apple-Challenge: knyoKOumYzlXqYOG3y/ODQ==.
    DACP-ID: DF510BDF6B5E6630.
    Active-Remote: 508739709.
    User-Agent: AirPlay/211.3.
rsa_apply encrypt
rsa_apply exit
    Apple-Response: iX/301G2XCF+qZtEuRbVGgNGi8FPMUoFAzf3GkEF6JwQpx7hzKCSQvpqAkSXYRjQpLcqSgT7qelVJSnfvTaocLeclDxYmw177uGGLKpuhuzr4KWjULTD2V5wxYd5T8c+SDXaTj4EFWxRJQsWAEYM3pJZAgN+Ok2mJfQLg1rDds45hruHshu8jtd58rg4NpjnL/gBJ8hcC3UueoT8cc7zsNq3uK2tEde511A4zWVM9xXVZJY4S5JmHAH5V8AF5G5VxyvwUs6WAs8Av9ce67JLcc0qLINZtp/82Sq1RNrfZnfDlt/BFYbCtay+vcw8xBgUKEzTP5Z5HsOisRKrd9WmtQ.
    CSeq: 0.
    Audio-Jack-Status: connected; type=analog.
    Public: ANNOUNCE, SETUP, RECORD, PAUSE, FLUSH, TEARDOWN, OPTIONS, GET_PARAMETER, SET_PARAMETER.
    X-Apple-Client-Name: iPhone.
    CSeq: 1.
    X-Apple-Device-ID: 0xc86f1dca95e2.
    DACP-ID: DF510BDF6B5E6630.
    Active-Remote: 508739709.
    Content-Type: application/sdp.
    Content-Length: 656.
    User-Agent: AirPlay/211.3.
rsa_apply decrypt
rsa_apply exit
Play connection from "iPhone".
    CSeq: 1.
    Audio-Jack-Status: connected; type=analog.
    Transport: RTP/AVP/UDP;unicast;mode=record;timing_port=53964;x-events;control_port=56318.
    CSeq: 2.
    X-Apple-Device-ID: 0xc86f1dca95e2.
    DACP-ID: DF510BDF6B5E6630.
    Active-Remote: 508739709.
    User-Agent: AirPlay/211.3.
rtp_setup: cport=56318 tport=53964.
Connection from IPv4: 192.168.178.35:50028
listening for audio, control and timing on ports 48823, 36089, 39113.
    CSeq: 2.
    Audio-Jack-Status: connected; type=analog.
    Transport: RTP/AVP/UDP;unicast;interleaved=0-1;mode=record;control_port=36089;timing_port=39113;server_port=48823.
    Session: 1.
    Range: npt=0-.
    X-Apple-Durations: b=16; c=165; au=529; an=482; sa=77.
    CSeq: 3.
    X-Apple-Device-ID: 0xc86f1dca95e2.
    DACP-ID: DF510BDF6B5E6630.
    Active-Remote: 508739709.
    User-Agent: AirPlay/211.3.
    CSeq: 3.
    Audio-Jack-Status: connected; type=analog.
    Audio-Latency: 88200.
    CSeq: 4.
    X-Apple-Device-ID: 0xc86f1dca95e2.
    DACP-ID: DF510BDF6B5E6630.
    Active-Remote: 508739709.
    Content-Type: text/parameters.
    Content-Length: 19.
    User-Agent: AirPlay/211.3.
    CSeq: 4.
    Audio-Jack-Status: connected; type=analog.
    RTP-Info: seq=21031;rtptime=645592839.
    CSeq: 5.
    X-Apple-Device-ID: 0xc86f1dca95e2.
    DACP-ID: DF510BDF6B5E6630.
    Active-Remote: 508739709.
    User-Agent: AirPlay/211.3.
    CSeq: 5.
    Audio-Jack-Status: connected; type=analog.
Dropping flushed packet in player_put_packet, seqno 21031, timestamp 645588649, flushing to timestamp: 645592839.
Dropping flushed packet in player_put_packet, seqno 21032, timestamp 645589001, flushing to timestamp: 645592839.
Dropping flushed packet in player_put_packet, seqno 21033, timestamp 645589353, flushing to timestamp: 645592839.
Dropping flushed packet in player_put_packet, seqno 21034, timestamp 645589705, flushing to timestamp: 645592839.
Dropping flushed packet in player_put_packet, seqno 21035, timestamp 645590057, flushing to timestamp: 645592839.
Dropping flushed packet in player_put_packet, seqno 21036, timestamp 645590409, flushing to timestamp: 645592839.
Dropping flushed packet in player_put_packet, seqno 21037, timestamp 645590761, flushing to timestamp: 645592839.
Dropping flushed packet in player_put_packet, seqno 21038, timestamp 645591113, flushing to timestamp: 645592839.
Dropping flushed packet in player_put_packet, seqno 21039, timestamp 645591465, flushing to timestamp: 645592839.
Dropping flushed packet in player_put_packet, seqno 21040, timestamp 645591817, flushing to timestamp: 645592839.
Dropping flushed packet in player_put_packet, seqno 21041, timestamp 645592169, flushing to timestamp: 645592839.
Dropping flushed packet in player_put_packet, seqno 21042, timestamp 645592521, flushing to timestamp: 645592839.
syncing to seqno 21043.
[  630.905601] WM8524: Sampling Rate=44100Hz
[  630.909838] WM8524: MCLK=16.934MHz
RTP: Packets out of sequence: expected: 21179, got 21187.
requesting resend on 8 packets starting at 21179.
RTP: Packets out of sequence: expected: 21191, got 21179.
RTP: Packets out of sequence: expected: 21187, got 21191.
+++++++++
+++++++++
    CSeq: 6.
    X-Apple-Device-ID: 0xc86f1dca95e2.
    DACP-ID: DF510BDF6B5E6630.
    Active-Remote: 508739709.
    User-Agent: AirPlay/211.3.
    CSeq: 6.
    Audio-Jack-Status: connected; type=analog.
    Public: ANNOUNCE, SETUP, RECORD, PAUSE, FLUSH, TEARDOWN, OPTIONS, GET_PARAMETER, SET_PARAMETER.
+++++++++
+++++++++
+++++++++
+++++++++
RTP: Packets out of sequence: expected: 21292, got 21294.
RTP: Packets out of sequence: expected: 21295, got 21292.
RTP: Packets out of sequence: expected: 21294, got 21295.
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
    CSeq: 7.
    X-Apple-Device-ID: 0xc86f1dca95e2.
    DACP-ID: DF510BDF6B5E6630.
    Active-Remote: 508739709.
    User-Agent: AirPlay/211.3.
    CSeq: 7.
    Audio-Jack-Status: connected; type=analog.
    Public: ANNOUNCE, SETUP, RECORD, PAUSE, FLUSH, TEARDOWN, OPTIONS, GET_PARAMETER, SET_PARAMETER.
RTP: Packets out of sequence: expected: 21574, got 21575.
+++++++++
RTP: Packets out of sequence: expected: 21589, got 21574.
RTP: Packets out of sequence: expected: 21575, got 21589.
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
RTP: Packets out of sequence: expected: 21679, got 21687.
+++++++++
+++++++++
RTP: Packets out of sequence: expected: 21691, got 21679.
+++++++++
+++++++++
+++++++++
RTP: Packets out of sequence: expected: 21683, got 21684.
+++++++++
+++++++++
RTP: Packets out of sequence: expected: 21687, got 21691.
+++++++++
+++++++++
RTP: Packets out of sequence: expected: 21699, got 21700.
+++++++++
RTP: Packets out of sequence: expected: 21714, got 21699.
RTP: Packets out of sequence: expected: 21700, got 21714.
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++
[  662.176344] brcmfmac: brcmf_cfg80211_del_key: invalid key index (4)
[  662.185919] brcmfmac: brcmf_cfg80211_del_key: invalid key index (5)
[  662.210854] cfg80211: Calling CRDA to update world regulatory domain
Sync error: -102.2 (frames); net correction: 470.7 (ppm); corrections: 470.7 (ppm); missing packets 3082; late packets 19; too late packets 0; resend requests 8; min DAC queue size 5619, min and max buffer occupancy 0 and 233.
[  663.897530] cfg80211: Calling CRDA to update world regulatory domain
Error sendto-ing to timing socket: Network is unreachable
[  683.779869] brcmfmac: brcmf_cfg80211_del_key: invalid key index (4)
[  683.801745] brcmfmac: brcmf_cfg80211_del_key: invalid key index (5)
[  683.819398] cfg80211: Calling CRDA to update world regulatory domain
[  685.505203] cfg80211: Calling CRDA to update world regulatory domain
[  685.581831] brcmfmac: brcmf_cfg80211_del_key: invalid key index (4)
[  685.595654] brcmfmac: brcmf_cfg80211_del_key: invalid key index (5)
[  685.607862] cfg80211: Calling CRDA for country: DE
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Sync error: -102.2 (frames); net correction: 470.7 (ppm); corrections: 470.7 (ppm); missing packets 6840; late packets 19; too late packets 0; resend requests 8; min DAC queue size 1000000, min and max buffer occupancy 512 and 0.
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Sync error: -102.2 (frames); net correction: 470.7 (ppm); corrections: 470.7 (ppm); missing packets 10598; late packets 19; too late packets 0; resend requests 8; min DAC queue size 1000000, min and max buffer occupancy 512 and 0.
Error sendto-ing to timing socket: Network is unreachable
Sync error: -102.2 (frames); net correction: 470.7 (ppm); corrections: 470.7 (ppm); missing packets 14356; late packets 19; too late packets 0; resend requests 8; min DAC queue size 1000000, min and max buffer occupancy 512 and 0.
[  758.195573] brcmfmac: brcmf_cfg80211_del_key: invalid key index (4)
[  758.208210] brcmfmac: brcmf_cfg80211_del_key: invalid key index (5)
[  758.237955] cfg80211: Calling CRDA for country: DE
Error sendto-ing to timing socket: Network is unreachable
Sync error: -102.2 (frames); net correction: 470.7 (ppm); corrections: 470.7 (ppm); missing packets 18114; late packets 19; too late packets 0; resend requests 8; min DAC queue size 1000000, min and max buffer occupancy 512 and 0.
[  806.205639] brcmfmac: brcmf_cfg80211_del_key: invalid key index (4)
[  806.227530] brcmfmac: brcmf_cfg80211_del_key: invalid key index (5)
[  806.244206] cfg80211: Calling CRDA to update world regulatory domain
[  807.880283] cfg80211: Calling CRDA to update world regulatory domain
Error sendto-ing to timing socket: Network is unreachable
Sync error: -102.2 (frames); net correction: 470.7 (ppm); corrections: 470.7 (ppm); missing packets 21872; late packets 19; too late packets 0; resend requests 8; min DAC queue size 1000000, min and max buffer occupancy 512 and 0.
Sync error: -102.2 (frames); net correction: 470.7 (ppm); corrections: 470.7 (ppm); missing packets 25630; late packets 19; too late packets 0; resend requests 8; min DAC queue size 1000000, min and max buffer occupancy 512 and 0.
[  843.127782] brcmfmac: brcmf_cfg80211_del_key: invalid key index (4)
[  843.134232] brcmfmac: brcmf_cfg80211_del_key: invalid key index (5)
[  843.167562] cfg80211: Calling CRDA to update world regulatory domain
[  844.847262] cfg80211: Calling CRDA to update world regulatory domain
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
[  855.225117] brcmfmac: brcmf_cfg80211_del_key: invalid key index (4)
[  855.234596] brcmfmac: brcmf_cfg80211_del_key: invalid key index (5)
[  855.248122] cfg80211: Calling CRDA for country: DE
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Error sendto-ing to timing socket: Network is unreachable
Sync error: -102.2 (frames); net correction: 470.7 (ppm); corrections: 470.7 (ppm); missing packets 29388; late packets 19; too late packets 0; resend requests 8; min DAC queue size 1000000, min and max buffer occupancy 512 and 0.
[  899.624759] brcmfmac: brcmf_cfg80211_del_key: invalid key index (4)
[  899.649874] brcmfmac: brcmf_cfg80211_del_key: invalid key index (5)
[  899.678066] cfg80211: Calling CRDA to update world regulatory domain
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
Error -32 writing 352 samples in play() Broken pipe.
Error -- ALSA device in incorrect state (4) for play.
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
Error -32 writing 352 samples in play() Broken pipe.
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
Error -32 writing 352 samples in play() Broken pipe.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
Error -32 in delay(): Broken pipe. Delay reported is 0 frames.
Error getting dac_delay at start of loop.
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
Error -32 writing 352 samples in play() Broken pipe.
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
Error -32 in delay(): Broken pipe. Delay reported is 0 frames.
Error getting dac_delay at start of loop.
[  901.387321] cfg80211: Calling CRDA to update world regulatory domain
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
Error -32 writing 352 samples in play() Broken pipe.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
Error -32 writing 352 samples in play() Broken pipe.
Error -- ALSA device in incorrect state (4) for play.
[  901.799454] ------------[ cut here ]------------
[  901.804332] WARNING: CPU: 0 PID: 104 at drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c:1076 brcmf_netdev_wait_pend8021x+0xe0/0xf4 [brcmfmac]()
Error -- ALSA device in incorrect state (4) for play.
[  901.866565] Modules linked in:
ALSA lib pcm.c:7843:(snd_pcm_recover) un[  901.876083]  brcmfmacderrun occurred

[  901.880586]  brcmutilError -32 writing 352 samples in play() Broken pipe.
[  901.907705] 
[  901.909298] CPU: 0 PID: 104 Comm: wpa_supplicant Not tainted 3.18.3 #1
Error -- ALSA device in incorrect state (4) for play.
[  901.959287] [<c000de40>] (unwind_backtrace) from [<c000c1f4>] (show_stack+0x10/0x14)
[  901.993628] [<c000c1f4>] (show_stack) from [<c0016400>] (warn_slowpath_common+0x68/0x88)
[  902.016243] [<c0016400>] (warn_slowpath_common) from [<c00164bc>] (warn_slowpath_null+0x1c/0x24)
[  902.040249] [<c00164bc>] (warn_slowpath_null) from [<bf016304>] (brcmf_netdev_wait_pend8021x+0xe0/0xf4 [brcmfmac])
[  902.067408] [<bf016304>] (brcmf_netdev_wait_pend8021x [brcmfmac]) from [<bf0061d8>] (brcmf_cfg80211_get_key+0x1a8/0x374 [brcmfmac])
[  902.098434] [<bf0061d8>] (brcmf_cfg80211_get_key [brcmfmac]) from [<bf00770c>] (brcmf_cfg80211_del_key+0x1d8/0x2e0 [brcmfmac])
Error -- ALSA device in incorrect state (4) for play.
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
Error -32 writing 352 samples in play() Broken pipe.
[  902.164527] [<bf00770c>] (brcmf_cfg80211_del_key [brcmfmac]) from [<bf0078ec>] (brcmf_cfg80211_add_key+0xd8/0x248 [brcmfmac])
[  902.213096] [<bf0078ec>] (brcmf_cfg80211_add_key [brcmfmac]) from [<c037f368>] (nl80211_new_key+0x108/0x144)
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
Error -32 writing 352 samples in play() Broken pipe.
[  902.253581] [<c037f368>] (nl80211_new_key) from [<c02ccb98>] (genl_rcv_msg+0x22c/0x39c)
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
Error -32 in delay(): Broken pipe. Delay reported is 0 frames.
Error getting dac_delay at start of loop.
[  902.290997] [<c02ccb98>] (genl_rcv_msg) from [<c02cc12c>] (netlink_rcv_skb+0xb4/0xd8)
Error -- ALSA device in incorrect state (4) for play.
[  902.325813] [<c02cc12c>] (netlink_rcv_skb) from [<c02cc958>] (genl_rcv+0x20/0x34)
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
Error -32 writing 352 samples in play() Broken pipe.
[  902.363540] [<c02cc958>] (genl_rcv) from [<c02cbaa8>] (netlink_unicast+0x14c/0x1cc)
[  902.399402] [<c02cbaa8>] (netlink_unicast) from [<c02cbe98>] (netlink_sendmsg+0x2b8/0x39c)
Error -- ALSA device in incorrect state (4) for play.
[  902.435798] [<c02cbe98>] (netlink_sendmsg) from [<c0297860>] (sock_sendmsg+0x84/0xa8)
Error -- ALSA device in incorrect state (4) for play.
[  902.477184] [<c0297860>] (sock_sendmsg) from [<c0298d28>] (___sys_sendmsg.part.32+0x284/0x290)
[  902.486197] [<c0298d28>] (___sys_sendmsg.part.32) from [<c0299d34>] (__sys_sendmsg+0x4c/0x7c)
Error -- ALSA device in incorrect state (4) for play.
Error -- ALSA device in incorrect state (4) for play.
[  902.555011] [<c0299d34>] (__sys_sendmsg) from [<c0009620>] (ret_fast_syscall+0x0/0x44)
Error -- ALSA device in incorrect state (4) for play.
[  902.591178] ---[ end trace 93a9f5360e80c5ca ]---

brcmfmac is the wifi driver, cfg80211 is the wifi API driver. The messages:

[  610.643727] cfg80211: Calling CRDA to update world regulatory domain
[  618.174092] brcmfmac: brcmf_cfg80211_del_key: invalid key index (4)
[  618.181538] brcmfmac: brcmf_cfg80211_del_key: invalid key index (5)
[  618.211642] cfg80211: Calling CRDA for country: DE

are caused by avahi.

Any idea what's going on here?

Pulseaudio compilation fails

On Debian Jessie (8.0), if shairport-sync is configured with the option --with-pulseaudio, make fails with the error:

mv -f .deps/player.Tpo .deps/player.Po
gcc -g -O2 -o shairport-sync shairport.o rtsp.o mdns.o mdns_external.o common.o rtp.o player.o alac.o audio.o audio_dummy.o audio_pipe.o mdns_avahi.o  audio_alsa.o   audio_pulse.o   -lpulse-simple -lasound  -lavahi-common -lavahi-client -lsoxr -lpolarssl -lpopt  -lm -lpthread -ldaemon -lrt 
/usr/bin/ld: audio_pulse.o: undefined reference to symbol 'pa_strerror@@PULSE_0'
//usr/lib/x86_64-linux-gnu/libpulse.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:447: recipe for target 'shairport-sync' failed

If, however, I run the same gcc command manually with the option -lpulse added, the compilation works, and I can install shairport-sync as normal.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.