[linux] AirPlay not detected by any Apple device
#1
I just found out about the AirPlay feature in XBMC and I'm thrilled. I have an ubuntu box with XBMC installed and have been using it for movies for over a year. AirPlay just doesn't seem to work, I looked through all similar threads as well and found nothing to help. Here is what I debugged/know so far:

- The xbmc log: http://xbmclogs.com/show.php?id=73214
- multicast or other router-related issue don't seem to be the problem, I have Serviio working between my wireless Mac and wired PS3
- iTunes doesn't show any AirPlay device on my Macbook Air
- I also installed Airfoil on the same Macbook and it doesn't find any device
- I also have an iOS7 iPhone which doesn't even show an AirPlay button (I'm assuming because of no devices detected)

Please let me know if you know of any other leads that I can follow, I have no idea how to debug this further. Thanks!
Reply
#2
I see airplay getting activated on the box:

Code:
00:30:14 T:140050427770624   DEBUG: CZeroconfAvahi::doPublishService identifier: servers.airplay type: _airplay._tcp name:XBMC (ubuntu) port:36667

Yeah it sounds like you are doing everything setup right and yeah in IOS7 it would just show an airplay icon in like music or youtube or pictures.
Same is iTunes it should show as a device.

Can you run this command on the CLI and see what the output is?

Code:
sudo iptables -L -n

maybe your firewall is blocking access?!?!
יונתן בן-חיים
Reply
#3
I don't know of having any firewall honestly, but this is the output for the iptables command (on my Linux-based XBMC box)

Code:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Reply
#4
yeah that looks good, can you run:

Code:
sudo avahi-browse  -a

And see what you get?
יונתן בן-חיים
Reply
#5
Code:
+   eth0 IPv6 XBMC (ubuntu)                                 _xbmc-events._udp    local
+   eth0 IPv4 XBMC (ubuntu)                                 _xbmc-events._udp    local
+   eth0 IPv6 8C89A51B872E@XBMC (ubuntu)                    AirTunes Remote Audio local
+   eth0 IPv4 8C89A51B872E@XBMC (ubuntu)                    AirTunes Remote Audio local
+   eth0 IPv6 XBMC (ubuntu)                                 _airplay._tcp        local
+   eth0 IPv4 XBMC (ubuntu)                                 _airplay._tcp        local
+   eth0 IPv6 XBMC (ubuntu)                                 _xbmc-jsonrpc._tcp   local
+   eth0 IPv4 XBMC (ubuntu)                                 _xbmc-jsonrpc._tcp   local
+   eth0 IPv6 XBMC (ubuntu)                                 _xbmc-jsonrpc-h._tcp local
+   eth0 IPv4 XBMC (ubuntu)                                 _xbmc-jsonrpc-h._tcp local
+   eth0 IPv6 XBMC (ubuntu)                                 Web Site             local
+   eth0 IPv4 XBMC (ubuntu)                                 Web Site             local
+   eth0 IPv6 Ovidiu Chereches___s Library                  Apple Home Sharing   local
+   eth0 IPv4 Ovidiu Chereches___s Library                  Apple Home Sharing   local
+   eth0 IPv6 15686041345D06EF                              iPod Touch Music Library local
+   eth0 IPv4 15686041345D06EF                              iPod Touch Music Library local
+   eth0 IPv6 Ovidiu___s MacBook Air                        _atc._tcp            local
+   eth0 IPv4 Ovidiu___s MacBook Air                        _atc._tcp            local
+   eth0 IPv6 ubuntu [8c:89:a5:1b:87:2e]                    Workstation          local
+   eth0 IPv4 ubuntu [8c:89:a5:1b:87:2e]                    Workstation          local
+   eth0 IPv6 ubuntu                                        Remote Disk Management local
+   eth0 IPv4 ubuntu                                        Remote Disk Management local
Reply
#6
OK, somehow it miraculously showed up now!! I can see ubuntu (XBMC) in the devices list in Airfoil.

However playing doesn't seem to work. As soon as I select XBMC as the AirPlay target it FREEZES COMPLETELY. here is the log the comes after selecting the XBMC as the AirPlay target:

Code:
02:08:58 T:140236940089088    INFO: AIRTUNES: Accepted IPv6 client on socket 33
02:08:58 T:140236940089088    INFO: AIRTUNES: Local: fe80:0000:0000:0000:8e89:a5ff:fe1b:872e
02:08:58 T:140236940089088    INFO: AIRTUNES: Remote: fe80:0000:0000:0000:ba8d:12ff:fe0e:2e90
02:08:58 T:140236940089088   DEBUG: AIRTUNES: Receiving on socket 33
02:08:58 T:140236940089088   DEBUG: AIRTUNES: Got challenge: RC8KhlEjKUU2lSGprqmZiQ
02:08:58 T:140236940089088   DEBUG: AIRTUNES: Got response: O5e36LbpWHAvTxFU49jwp564gnv+HEq8xsnbuI5f/r1Nvm9BpkvEmLZNu5OlTsMm2eBxF3ksZNuMHGrPGP13pG5WJM9TQ3wAvKUoIKX4BaNZ097krvz/S7kml0VeDOk4c1vDBKbkHRsBQgumZ6PNqVzo9rn1hz0Iuw8nQGblNf88HseJulen8luMeKsnafit5pwhcOrOVzV0nCv7yUai3aPcmSBoYm39janPTb5Al4RZ7xvICn9sjClBMoB7m0XVjoaeR2Qlv8k9NcNWbevoA/XP4jwH6orhBluY3LYQPVRfzWB8xJaSbb89Xajvjz4LF+Dr7JMjQDQAIbpObozkNg
02:08:58 T:140236940089088   DEBUG: AIRTUNES: Handled request OPTIONS with URL *
02:08:58 T:140236940089088   DEBUG: AIRTUNES: Receiving on socket 33
02:08:58 T:140236940089088   DEBUG: AIRTUNES: connection: IN IP4 0.0.0.0
02:08:58 T:140236940089088   DEBUG: AIRTUNES: rtpmap: 96 AppleLossless
02:08:58 T:140236940089088   DEBUG: AIRTUNES: fmtp: 96 352 0 16 40 10 14 2 255 0 0 44100
02:08:58 T:140236940089088   DEBUG: AIRTUNES: rsaaeskey: Gr8qH5+zsUtaMxUYMMgoZQbqt06ALtW7FD916WSnEBW8mRNypyRO13a4D5bUaVH2HOcYHYNO49jAn6zmIJo4IpdqBAkVXqLfSQAU3WlPJxleLJhNtMJv/yn0v8gD6lFBZhhDhxgHyUCrYbI63SZhSoZv8aiFyh/RE1XQFmDsbt/QzkjIWy5zXbkPNX227UP7/b1s9gwRbPYVmD29fyt3cjhJageU64hTDAOYgECQ6TCo9zQMoRTNQzdQLpcxfoDLctGuBZExByyoBEkroh0cD+JQFKrO1aPf5g9HWF9Gqo0cGrrb9JknPjYPoI0Rr3uegjU717+R1WippeQJiIporw
02:08:58 T:140236940089088   DEBUG: AIRTUNES: aesiv: AAECAwQFBgcICQoLDA0ODw
02:08:58 T:140236940089088   DEBUG: AIRTUNES: aeskeylen: 16
02:08:58 T:140236940089088   DEBUG: AIRTUNES: aesivlen: 16
02:08:58 T:140236940089088   DEBUG: AIRTUNES: Handled request ANNOUNCE with URL rtsp://fe80::ba8d:12ff:fe0e:2e90/3465247034
02:08:58 T:140236940089088   DEBUG: AIRTUNES: Receiving on socket 33
02:08:58 T:140236940089088    INFO: AIRTUNES: Transport: RTP/AVP/UDP;unicast;interleaved=0-1;mode=record;control_port=6002;timing_port=6003
02:08:58 T:140236940089088   DEBUG: AIRTUNES: Found remote control port: 6002
02:08:58 T:140236940089088   DEBUG: AIRTUNES: Found remote timing port: 6003
02:08:58 T:140236940089088    INFO: AIRTUNES: Responding with RTP/AVP/UDP;unicast;mode=record;timing_port=37881;events;control_port=38335;server_port=46787
02:08:58 T:140236940089088   DEBUG: AIRTUNES: Handled request SETUP with URL rtsp://fe80::ba8d:12ff:fe0e:2e90/3465247034
02:08:58 T:140236940089088   DEBUG: AIRTUNES: Receiving on socket 33
02:08:58 T:140236940089088   DEBUG: AIRTUNES: Handled request RECORD with URL rtsp://fe80::ba8d:12ff:fe0e:2e90/3465247034
02:08:58 T:140236940089088   DEBUG: AIRTUNES: Receiving on socket 33
02:08:58 T:140236940089088   DEBUG: AIRTUNES: Handled request SET_PARAMETER with URL rtsp://fe80::ba8d:12ff:fe0e:2e90/3465247034
02:08:58 T:140237099484928   DEBUG: CAnnouncementManager - Announcement: OnVolumeChanged from xbmc
02:08:58 T:140237099484928   DEBUG: GOT ANNOUNCEMENT, type: 64, from xbmc, message OnVolumeChanged
02:08:58 T:140237882210176   DEBUG: CPlayerCoreFactory::GetPlayers(pipe://4/)
02:08:58 T:140237882210176   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: system rules
02:08:58 T:140237882210176   DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: system rules
02:08:58 T:140237882210176   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtv
02:08:58 T:140237882210176   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: hdhomerun/myth/mms/udp
02:08:58 T:140237882210176   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: lastfm/shout
02:08:58 T:140237882210176   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtmp
02:08:58 T:140237882210176   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtsp
02:08:58 T:140237882210176   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: streams
02:08:58 T:140237882210176   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvd
02:08:58 T:140237882210176   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvdimage
02:08:58 T:140237882210176   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: sdp/asf
02:08:58 T:140237882210176   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: nsv
02:08:58 T:140237882210176   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: radio
02:08:58 T:140237882210176   DEBUG: CPlayerCoreFactory::GetPlayers: matched 0 rules with players
02:08:58 T:140237882210176   DEBUG: CPlayerCoreFactory::GetPlayers: adding audiodefaultplayer (3)
02:08:58 T:140237882210176   DEBUG: CPlayerCoreFactory::GetPlayers: for video=0, audio=1
02:08:58 T:140237882210176   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: PAPlayer (3)
02:08:58 T:140237882210176   DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=1
02:08:58 T:140237882210176   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: DVDPlayer (1)
02:08:58 T:140237882210176   DEBUG: CPlayerCoreFactory::GetPlayers: added 2 players
02:08:58 T:140237882210176   DEBUG: FactoryCodec - Audio: passthrough - Opening
02:08:58 T:140237882210176   DEBUG: FactoryCodec - Audio: passthrough - Failed
02:08:58 T:140237882210176   DEBUG: FactoryCodec - Audio: pcm - Opening
02:08:58 T:140237882210176   DEBUG: FactoryCodec - Audio: pcm - Opened

When I deselect it as the AirPlay target everything is resumed and all the actions I made (left/right arrows) are rapidly applied. Ideas?
Reply
#7
That looks pretty good.
you can see your MacBook Air from the Ubuntu box and you can see the local service as well.

I run Eden and IOS 5 but I have ran into issues where I had to close my app like youtube and use a native app like iphoto and it picks up the airplay target than I can reopen youtube or iheartradio and it detects the airplay device as well.

and from iTunes you still dont have any devices?
יונתן בן-חיים
Reply
#8
(2013-10-22, 01:00)nokdim Wrote: and from iTunes you still dont have any devices?

Sorry, please check my previous post

This might be the key...

Code:
02:08:58 T:140237882210176   DEBUG: FactoryCodec - Audio: passthrough - Opening
02:08:58 T:140237882210176   DEBUG: FactoryCodec - Audio: passthrough - Failed
02:08:58 T:140237882210176   DEBUG: FactoryCodec - Audio: pcm - Opening
02:08:58 T:140237882210176   DEBUG: FactoryCodec - Audio: pcm - Opened
Reply
#9
This is insane!

So basically AirPlay in XBMC works, _sometimes_. And I have no idea how to debug it when it does not. Sometimes when I least expect it my XBMC machine (which is open 24/7) will appear in the AirPlay devices list on my Mac. Awesome, but as soon as I turn my head around, meaning the Mac goes into standby or I close/open Airfoil/iTunes, it disappears. And then there's no way to get it back.

At first restarting avahi worked, then it couldn't be replicated, it had not effect. The same with pkill coreaudiod on my Mac, it worked once or twice then nothing. Then the only way to make it appear again was to REBOOT both my Mac and the XBMC Ubuntu machine, and only in a certain order. The last time not even that worked, so I had to put my router in the mix and restart it as well. It won't last long...

There are no errors in the XBMC logs, so it must be something related to my home network, any ideas? Thanks!
Reply

Logout Mark Read Team Forum Stats Members Help
[linux] AirPlay not detected by any Apple device1