juhovh / shairplay

Apple airplay and raop protocol server
Other
1.34k stars 226 forks source link

Shairplay starts but immediately closes the connection. #50

Closed usamitysam closed 6 years ago

usamitysam commented 8 years ago

Feel free to close this and direct me to a better place for support.

Audio streaming from iOS9.1 Music App. To Ubuntu 14.04.3 LTS. Shairplay starts but immediately closes the connection. No audio comes out. Is there alsa config or port/socket config that I need to do? Example output below.

Thanks

/opt/shairplay$ sudo shairplay -a "test"

Initialized server socket(s) Initialized server socket(s) * WARNING * The program 'shairplay' uses the Apple Bonjour compatibility layer of Avahi. * WARNING * Please fix your application to use the native API of Avahi! * WARNING * For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=shairplay Accepted IPv4 client on socket 10 Local: 10.0.1.98 Remote: 10.0.1.125 Receiving on socket 10, 149 bytes http request TEARDOWN rtsp://10.0.1.98/2721839323984514330 CSeq:0 DACP-ID:D6EC2815874CA984 Active-Remote:2994705482 User-Agent:AirPlay/260.26 data (null)

Response: RTSP/1.0 200 OK CSeq: 0 Apple-Jack-Status: connected; type=analog Connection: close

Receiving on socket 10, 0 bytes Connection closed for socket 10

simonvetter commented 8 years ago
http request TEARDOWN rtsp://10.0.1.98/2721839323984514330

Your client device (iOS9) is closing the connection, not shairplay. Which version are you using? I had to upgrade mine to latest master when ios9 came out because iOS started issuing GET_PARAMETER queries which are, it seems, mandatory (https://github.com/juhovh/shairplay/commit/498bc5bcdd305e04721f94a04b9f26a7da72673f implements the feature).

I'm not a dev, just thought i'd chime in. Hope this helps.

usamitysam commented 8 years ago

I'm using the master branch. Do I need to use one of the others, maybe "progress"?

juhovh commented 8 years ago

Sorry for being late on this, master branch should be ok. I'm not really sure what is going on here either, it indeed looks like the client device is closing the connection gracefully. If there was some error it should print it, but I don't see any errors here. So I need to investigate this further and try to find out if I can reproduce.

bg-o commented 8 years ago

Hi,

I've trying to get music to play from a iOS 9.2 (iPhone 6S) and a 9.1 (Ipad Mini) to a Raspian compiled Shairplay, but got into the exact same issue as mentionned by @usamitysam. Right after stream starts, client seem to close the connection:

Accepted IPv6 client on socket 10
Local: fe80:0000:0000:0000:486d:73de:21e8:38ab
Remote: fe80:0000:0000:0000:00ff:351e:7ebf:941d
Receiving on socket 10
Got challenge: n1YzrDb8YTTDfCUe+NDPAw==
Got response: mIZP0eGq5RNW+y2bSzlA5cu0Jyjs8yVIK3NSNgBOLMFxJ1A1XQihltdJNGwb/Qc5T2fJ6ahSFSj04po5aCLfdFLfoZJgAL85j5GFrgfwy+By43U7bS2eEEvIeS3r1D6gOFb6oxN5GeV4o3DXyV2Qs6qCYWkrfxqmFcNIe2CLdXBbXhsmJBHGjyk5HGjh8ZmiDQea2z20L/sG+RYrsLpUfuG6PHM8LVDC567rKBaGZQE4gD5iGG8UriOe3kNpeJhtSsK2+DDI3g6p2bR0w6dVvToFG5rzCfC7m3620JUaCuwkydSZo4msZaO6iS8q5qQ8wsbo7CYMmxsGy4N0sRXFTg
Handled request OPTIONS with URL *
Receiving on socket 10
connection: IN IP6 fe80::ff:351e:7ebf:941d
rtpmap: 96 AppleLossless
fmtp: 96 352 0 16 40 10 14 2 255 0 0 44100
rsaaeskey: Dra6WXtYHbNJr54VT3BoZxqouZWtvLECRV7OCxNeNPlEw1fdBcoFq/T5nhXHPxdZHyTDAs+e6C/FfRNw6WDFk7Om/06IChgo+Ph0ANYZUHB3nbtlPNj+X3URjOaOWtZl5f7LKUX2C/orpNrCJx9PkANJ0NUV8yJyROsieGkKtW2w8SWq0on1YeA5BnPFsdsqp2BzSfvSt+GNPUNJ0k/E07BbkB5W0ce21nWDzCqFpX5kQQqEMbkhYuU/m/wPkNhwbAEYJ0HNcXySgTIh3I+/OvJeH0gAJqNgAtCGCJJEmZc6FcZV4g0JKvCEtNShq65M6cQqjIAglH/mlEg/HTdrVA==
aesiv: Ir+jdZA1ZhpYq61plEYOjw==
aeskeylen: 16
aesivlen: 16
Handled request ANNOUNCE with URL rtsp://fe80::486d:73de:21e8:38ab/4747132326579554898
Receiving on socket 10
Transport: RTP/AVP/UDP;unicast;mode=record;timing_port=65256;control_port=54917
Found remote timing port: 65256
Found remote control port: 54917
Responding with RTP/AVP/UDP;unicast;mode=record;timing_port=57508;events;control_port=36213;server_port=52300
Handled request SETUP with URL rtsp://fe80::486d:73de:21e8:38ab/4747132326579554898
Receiving on socket 10
Handled request GET_PARAMETER with URL rtsp://fe80::486d:73de:21e8:38ab/4747132326579554898
Receiving on socket 10
Exiting UDP RAOP thread
Handled request TEARDOWN with URL rtsp://fe80::486d:73de:21e8:38ab/4747132326579554898
Receiving on socket 10
Connection closed for socket 10

This works fine if I stream from an iOS 8.3 (iPhone 5c). Maybe you got a clue ? Let me know if I can do anything to dig this!

Thanks,

juhovh commented 8 years ago

@mrshoki This should be fixed on the latest master.

bg-o commented 8 years ago

@juhovh, I cloned a fresh repo yesterday (so head from yesterday) and compiled from there. Hence not sure this got fixed. Let me know if I can enable useful debug output to dig this.

juhovh commented 8 years ago

Ok, I have look into this.

arpadtamasi commented 8 years ago

Same here. I paste the log, hope it helps.

Initialized server socket(s)
*** WARNING *** The program 'shairplay' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=shairplay>
Accepted IPv6 client on socket 10
Local: fe80:0000:0000:0000:efec:2241:df26:6fc5
Remote: fe80:0000:0000:0000:0867:f914:5239:7b83
Receiving on socket 10
Got challenge: jZE2HO6rIJyR50v4CqRL2w==
Got response: zx13j0+5yEbtFd8LQqnzEzu9BbpprJfiagYIuxHqdkHXN6Tt4wv15FOSPiLWEj1zHHZHXdB+T8/GvY0KbzzTaoP20yySqEHhB+OJ3KsNOQlwzmz4SYhfbYc/wCgeSUa86ndIbTc7igEsPuwKtyKf75/kd6X98ogibQlWQrzZX+EozKj7OsA6XtmNkcYj5cmjXsClRVDqwuT14a6kmbPfQNfyiUlVQ8M+jlNmyD+khgrdzzuw8eubr9vX1kjaQuO+7pWEQa0PzBUB48qsJkwzfoxnwCSg6JVoGKfQme9lhZSoEoAyD8X1FlF4uRzhH2zW8Zz6KENjEcThFSDBoyofmA
Handled request OPTIONS with URL *
Receiving on socket 10
connection: IN IP6 fe80::867:f914:5239:7b83
rtpmap: 96 AppleLossless
fmtp: 96 352 0 16 40 10 14 2 255 0 0 44100
rsaaeskey: EkS9XHjI+Iva9ky1V5bE0IPmqtXvdHR1GHAPLTJ/ccRP9bVs+8drtlZPPHf3phU1wP42f3zrXHxHJ6hlu6qlYpCV4b3nqKg6+08PL2AX9G6ipqISAmOxiXxQ+7fN4+ZbEX9ghzNwsGftsor18vOeUEriaq9PcKKPiBz5TKspQWUM87KZdemRKgY00Ew27c8jD1L+dBtLT3G4+a20MU5plBaQ43ihJT7qmrClDiRAmSyC/VhMna3qgbR/JkJERtsduZtvAp2C9ymRHStVHHH28LrBrqLiIhggFxj1WlNT27jVjSwCZZyjmyOUOz6NnKF0lg4Tkke5Ma3d9P47bueXYA==
aesiv: ydCiHAcNZR3rPX9zf6QurA==
aeskeylen: 16
aesivlen: 16
Handled request ANNOUNCE with URL rtsp://fe80::efec:2241:df26:6fc5/15148376763562149641
Receiving on socket 10
Transport: RTP/AVP/UDP;unicast;mode=record;timing_port=55450;control_port=54508
Found remote timing port: 55450
Found remote control port: 54508
Responding with RTP/AVP/UDP;unicast;mode=record;timing_port=46872;events;control_port=50402;server_port=40767
Handled request SETUP with URL rtsp://fe80::efec:2241:df26:6fc5/15148376763562149641
Receiving on socket 10
Handled request GET_PARAMETER with URL rtsp://fe80::efec:2241:df26:6fc5/15148376763562149641
Receiving on socket 10
Exiting UDP RAOP thread
Handled request TEARDOWN with URL rtsp://fe80::efec:2241:df26:6fc5/15148376763562149641
Receiving on socket 10
Connection closed for socket 10
salzig commented 8 years ago

seems to be the same problem with El Capitan 10.11.4 Beta (15E27e). Everything works perfekt with iOS7.

root@raspberrypi:~/shairplay# shairplay -a piplay
Initialized server socket(s)
*** WARNING *** The program 'shairplay' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=shairplay>
Accepted IPv6 client on socket 10
Local: fe80:0000:0000:0000:0ce8:a983:e4d2:0434
Remote: fe80:0000:0000:0000:5ab0:35ff:fe7b:9342
Receiving on socket 10
Got challenge: +whXt3d9Kh4fgG6PjL+KWw==
Got response: ARa5IOGnKOBeAOABEb1BWGexncjpr6fkRjhRqKwIGBzA8LFcTQYs8mkVbNvN5p2MVlmEljYcFdR0ZWQ8Wir6zwRMWpzOS8VIfkt5Q1XAQK/xfF62MHhMALPQwk+2UypU7+2E83M/m60fKVxatcqQJzLaXIq86C9z4gWmHCtR5eXEK3s59SenQT9oLcl2mI3VMblPu5GIqls+xeVTa6JiobSyhLc6CvRi14Qr0xVuwDB/FKz0ZLoLBphsrgFL6tgyma3wowhejHovG+KOYhwuBxW/UOfE5LlLBIVPmH+ILeJpfyc7Jif5/jT4E4J+GF+0Z3Dky4nsMNT65F6Rx69FkQ
Handled request OPTIONS with URL *
Receiving on socket 10
connection: IN IP6 fe80::5ab0:35ff:fe7b:9342
rtpmap: 96 AppleLossless
fmtp: 96 352 0 16 40 10 14 2 255 0 0 44100
rsaaeskey: pFyBURUXhEzTg9yl3Bw8wRPFsahelJ3I/Q0zFBinFKhsIMXgcqeD0DkDg9NiIJooc+Jk1YWvEBFZOzNuRF36pydi5Zd7KiWbpcUdn9e0nx6i7Qk8+hHutqZLrJh49docaeloK9yFcoxYV80tIe/FpxjNVGrB812LdAP42kNUW2DIjC85NcnFuS83NLkuuTHReh23TGFvqKZGwRyvh/IkN4T2ZJoUX732wafdr5oqgvHleByaX6dUNNRDX/+14PissP8kXTwM0pBUbNRhV0qBlNbutZkXCETrzqKuYTK/LyHJxeBp189BQYjh/zsc3GhN8GWm2YYigFdAEMNcIWYJLA==
aesiv: jBMiL2Wr1xPeG49Pkedd8A==
aeskeylen: 16
aesivlen: 16
Handled request ANNOUNCE with URL rtsp://fe80::ce8:a983:e4d2:434/5130270239594203718
Receiving on socket 10
Transport: RTP/AVP/UDP;unicast;mode=record;timing_port=50221;control_port=58106
Found remote timing port: 50221
Found remote control port: 58106
Responding with RTP/AVP/UDP;unicast;mode=record;timing_port=53942;events;control_port=58063;server_port=56051
Handled request SETUP with URL rtsp://fe80::ce8:a983:e4d2:434/5130270239594203718
Receiving on socket 10
Handled request GET_PARAMETER with URL rtsp://fe80::ce8:a983:e4d2:434/5130270239594203718
Receiving on socket 10
Exiting UDP RAOP thread
Handled request TEARDOWN with URL rtsp://fe80::ce8:a983:e4d2:434/5130270239594203718
Receiving on socket 10
Connection closed for socket 10

**Edit***: using master (ce80e00)

raphaelyancey commented 8 years ago

I have the same problem with shairplay 0.9.0 (from apt) and an iPhone 6S on iOS 9.3.4.

Accepted IPv6 client on socket 10
Local: fe80:0000:0000:0000:ea4e:06ff:fe26:e687
Remote: fe80:0000:0000:0000:1c30:d4cb:f1cd:ae7f
Receiving on socket 10
Got challenge: kYDyjDUBkq3KiCSlfIXZFA==
Got response: Ib4Ib6xmLTaKOK9MsShqyQPx5TIytlIHUVpvAXRgIT1OQT5Ymwo6zkgA6Gs1fcCA6ETdxQV2vW3QZAN3OMulv916LSgENIp4pHfIu7LrnU7i3MT3JyMkEmaDyTiyHCx6jpTO/cjZ/4qml5/Ag22r4vfuL3d/ImJ+HVJXJ+UigmkJeOFsAIb8dzOvInIE2WaJaGiCMop7CrEezMkaChgET8qFnUz+879NTEc+AXDFjuyMdII95tZEi2gfpl2wR/IccDwjLSSEnbah1rtII4Ibc+E0oeRSYJNt5aa0SmfVDWcbJoxiacbGT8uhdt9XjHlnHb0J5XiuunrMqwqEa+oI9g
Handled request OPTIONS with URL *
Receiving on socket 10
connection: IN IP6 fe80::1c30:d4cb:f1cd:ae7f
rtpmap: 96 AppleLossless
fmtp: 96 352 0 16 40 10 14 2 255 0 0 44100
rsaaeskey: RwcSI80ajxszQ7EcnPtiu6fcPNUACycjT4JAHTgzUYTsuWluOZixZ8b7pfm/s/Cx7cSfHCjEvWOhM1AvHeC+x3cVNKmWCJkoSsJyJpAhGyQOhK9XbG7bXokhB7wa+jjHaNwj6n4mBzRX8PGXCIe4V59tC2yIVdNxg9pwiqvdfgNFfqJOGSpqNdewK9ND7dAAFj5ByDgmoFHbrN6b4oEAq6FCAZq0uHNp9OC0pbjAFMrkGtKmYLfXtElLqVr3DZJQWtNeavvlyxa/4F6YM9BMil2UrPmZVNuKPj1HWfi4F89cYoFf3Xq327vd/J2XPgG635BTB/5FoSpZ8ckpQaKSdg==
aesiv: Zp+5ACysBdUFuk8wHBk5Jw==
aeskeylen: 16
aesivlen: 16
Handled request ANNOUNCE with URL rtsp://fe80::ea4e:6ff:fe26:e687/11724667843158626129
Receiving on socket 10
Transport: RTP/AVP/UDP;unicast;mode=record;timing_port=65275;control_port=61690
Found remote timing port: 65275
Found remote control port: 61690
Responding with RTP/AVP/UDP;unicast;mode=record;timing_port=51392;events;control_port=33253;server_port=58331
Handled request SETUP with URL rtsp://fe80::ea4e:6ff:fe26:e687/11724667843158626129
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
Receiving on socket 10
Handled request GET_PARAMETER with URL rtsp://fe80::ea4e:6ff:fe26:e687/11724667843158626129
Receiving on socket 10
Exiting UDP RAOP thread
Handled request TEARDOWN with URL rtsp://fe80::ea4e:6ff:fe26:e687/11724667843158626129
Receiving on socket 10
Connection closed for socket 10

Thanks for you work, it's really a wonder on a RPi hooked to my audio rig :)