How to debug Airplay issues on Linux based XBMC ?
#1

Have been an avid user of XBMC.
Currently have Eden RC2 running on OpenELEC r10162 on Acer Revo RL100.
Works great (apart from some minor increase in the amount of buffering when playing hight bit-rate videos but that's another story).

I digress..the issue is Airplay does not work.
In Settings -> Network Service, it is enabled (so is Zeroconf).
xbmc.log shows that airplay server is started.

But when an iPhone is plays a video or shows a photo, there's NO Airplay icon on the iPhone to send the video or photo to XBMC.

Yes I have searched many threads hear and at the OpenELEC site but there's no conclusive threads that says - this is exactly how Airplay should work. Many folks claim thatir just works - mostly are Windows based XBMC'ers not Linux.
Most have given up ...as evident of threads that just die without resolution.

There very little knowledge shared at the OE site regarding this issue.

So ...how does one go about about debugging the issue ?
What logs (apart from xbmc.log) should we be looking for ?
What processes and apps should be running ?
How to tell is the server sees the iPhone client ?

Here's a snippet of the log:
Code:
23:33:01 T:3018520320   DEBUG: OnKey: 11 (0b) pressed, action is Select
23:33:01 T:3018520320    INFO: AIRPLAY Server: Successfully initialized
23:33:01 T:2735086400  NOTICE: Thread AirPlayServer start, auto delete: false
23:33:01 T:2819013440   DEBUG: CZeroconfAvahi::doPublishService identifier: servers.airplay type: _airplay._tcp name:XBMC (openelec) port:36667
23:33:01 T:2819013440   DEBUG: CZeroconfAvahi::addService() named: XBMC (openelec) type: _airplay._tcp port:36667
23:33:01 T:2951658304  NOTICE: Thread CAirTunesServer start, auto delete: false
23:33:01 T:2743479104   DEBUG: CZeroconfAvahi::doPublishService identifier: servers.airtunes type: _raop._tcp name:00262D4C705E@XBMC (openelec) port:36666
23:33:01 T:2743479104   DEBUG: CZeroconfAvahi::addService() named: 00262D4C705E@XBMC (openelec) type: _raop._tcp port:36666
23:33:01 T:3018520320   DEBUG: LIRC: Update - NEW at 10372180:160 0 KEY_OK_UP devinput (KEY_OK_UP)
23:33:02 T:2934872896   DEBUG: CZeroconfAvahi::groupCallback: Service successfully established
23:33:05 T:3018520320   DEBUG: Previous line repeats 1 times.
23:33:05 T:3018520320   DEBUG: LIRC: Update - NEW at 10375846:94 0 KEY_PROG1 devinput (KEY_PROG1)
23:33:05 T:3018520320   DEBUG: OnKey: percent (25) pressed, action is PreviousMenu
23:33:05 T:3018520320   DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
23:33:05 T:3018520320   DEBUG: ------ Window Deinit (SettingsCategory.xml) ------
23:33:05 T:3018520320   DEBUG: CGUIWindowManager::PreviousWindow: Activate new
23:33:05 T:3018520320   DEBUG: ------ Window Init (Settings.xml) ------
23:33:05 T:3018520320    INFO: Loading skin file: Settings.xml
23:33:05 T:2819013440   DEBUG: DoWork - took 112 ms to load special://skin/backgrounds/network.jpg
23:33:05 T:3018520320   DEBUG: LIRC: Update - NEW at 10376451:94 0 KEY_PROG1_UP devinput (KEY_PROG1_UP)
23:33:35 T:2743479104   DEBUG: Thread Jobworker 2743479104 terminating (autodelete)
23:33:35 T:2819013440   DEBUG: Thread Jobworker 2819013440 terminating (autodelete)
23:33:36 T:3018520320   DEBUG: SECTION:UnloadDelayed(DLL: special://xbmcbin/system/ImageLib-i486-linux.so)
23:33:36 T:3018520320   DEBUG: Unloading: ImageLib-i486-linux.so
It appears that Thread Jobworker 2743479104 is Avahi related and Thread Jobworker 2819013440 is Airplay server and they are being terminated but no reason given.

Anyone any experience to help fix (relay back to the devs what they need to fix) ?
Mac
Reply
#2
try adding the following to advancedsettings.xml
Code:
<enableairtunesdebuglog>1</enableairtunesdebuglog>

this can be found in http://wiki.xbmc.org/index.php?title=AirPlay
"PPC is too slow, your CPU has no balls to handle HD content." ~ Davilla
"Maybe it's a toaster. Who knows, but it has nothing to do with us." ~ Ned Scott
Reply
#3
Thx Irusak for the tip.
That setting does nothing.
That is, there is no change in any of the log files.
Unless it creates a new log file (which I cannot find), it seems it is only a space-holder for future.
The devs have not documented on the wiki what debug info it is supposed to log Sad

Any other ideas or tests to try ?
Reply
#4
1. that wiki entry is valid and should add more log entrys according to airtunes to the xbmc.log. Doublecheck that it is somewhere between the <advancedsettings></advancedsettings> tags.
2. post a full log, put it on pastebin and put the link here (no incomplete log snippets). There seems something b0rked when these threads get terminated, but your snippet doesn't show enough log entrys.
3. AirPlay works on a "normal" xbmc install on ubuntu. So this might be something with OE.

4. For further debugging you could use some zeroconf client tool which shows the announced services. Run such a tool from a different PC or device in your network and it should show the zeroconf announced airplay and airtunes services. (but as you already figured, these server threads get terminated so it won't work).
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#5
Just out of curiostiy, are you running DD-WRT on your router? Do you have "AP Isolation" turned on? I find that this blocks zeroconf services like airplay.
Reply
#6
(2012-03-22, 14:33)Memphiz Wrote: 1. that wiki entry is valid and should add more log entrys according to airtunes to the xbmc.log. Doublecheck that it is somewhere between the <advancedsettings></advancedsettings> tags.
2. post a full log, put it on pastebin and put the link here (no incomplete log snippets). There seems something b0rked when these threads get terminated, but your snippet doesn't show enough log entrys.
3. AirPlay works on a "normal" xbmc install on ubuntu. So this might be something with OE.
4. For further debugging you could use some zeroconf client tool which shows the announced services. Run such a tool from a different PC or device in your network and it should show the zeroconf announced airplay and airtunes services. (but as you already figured, these server threads get terminated so it won't work).
Hi Memphiz thax for your tips. See below:

1. I checked the advancedsettings.xml and the debug entry is there. Doubled confirmed by the xbmc.log file.

2. OpenELEC makes a ZIP file of all it's log files. I pasted it here. Download it and rename root.txt to macnb.zip. It contains XBMC.log together with other logs like kernel, etc). This is a snapsot with debugging on at boot time.

3. It may well be an OE issue but I am trying to help find why it does not work for me and for many others (non-OE users too). OE staff do not seem to know how to debug the issue. See this.

4. I don't really know anything about zeroconf but googled "zeroconf client tool" and did not come up with anything that I can try from a command line (except something maybe related called mdns-scan). Can you suggest any tool ?
I ran mdns-scan on my OpenMediaVault (OMV) Debian based server on the same home network as XBMC. It showed:
Code:
root@OMV:~#  mdns-scan
+ OMV [44:1e:a1:3b:6f:af]._workstation._tcp.local
+ OMV - Web administration._http._tcp.local
+ OMV - SSH._sftp-ssh._tcp.local
+ OMV - SSH._ssh._tcp.local
+ OMV - SMB/CIFS._smb._tcp.local
+ OMV - NFS - drive5._nfs._tcp.local
+ OMV - FTP._ftp._tcp.local
+ OMV - AFP._device-info._tcp.local
+ OMV - AFP._adisk._tcp.local
+ OMV - AFP._afpovertcp._tcp.local
+ EPSONFDDD35._http._tcp.local
+ 5c:59:48:37:d6:a9@fe80::5e59:48ff:fe37:d6a9._apple-mobdev._tcp.local
That does not show any xbmc or Openelec entries.

Please let me know what you find in the logs and what else I can try. Thx.
Mac

Reply
#7
(2012-03-22, 23:01)cowfodder Wrote: Just out of curiostiy, are you running DD-WRT on your router? Do you have "AP Isolation" turned on? I find that this blocks zeroconf services like airplay.
I am running on standard Netgear router - not dd-wrt. I don't see any AP Isolation config setting on my router.
I think the router is fine. I downloaded a MAC OSX app called Airmac an it run fine. Is is a standalone app that runs in the menubar. When I run the Photo app on the iDevice, the iDevice shows the Airplay icon and when I select the MAC, the photos are displayed on the MAC screen. Videos do not to play for some reason - just get the first frame then frozen. But the point is that it demonstrates that the iDevice does see an Airplay server - except XBMC.
Reply
#8
As i said and you already figured out. XBMCs zeroconf announcment thread does stop. Thats why you don't see anything on your iDevice and with mdns-scan.

Can't get that download to work. Says its an invalid zip... Imho you can't paste binarys as text to pastebin. That just won't work for everyone...

Beside that that mdns-scan tool should show some other servers from XBMC. So it might be still a issue in your network (for example upnp and json-rpc and http announcmenets... if you turned them on in network settings of xbmc)
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#9
Apologies re the log file - not sure why does not work.
I have uploaded just the xbmc.log here

Also found that OE has avahi-browse utility that shows some interesting stuff:
Code:
root ~ # avahi-browse -a
+   eth0 IPv4 OMV - AFP                                     _device-info._tcp    local
+   eth0 IPv4 OMV - AFP                                     _adisk._tcp          local
+   eth0 IPv4 OMV - AFP                                     _afpovertcp._tcp     local
+   eth0 IPv4 OMV - FTP                                     _ftp._tcp            local
+   eth0 IPv4 OMV - NFS - drive5                            _nfs._tcp            local
+   eth0 IPv4 MacPro530                                     _atc._tcp            local
+   eth0 IPv4 MacPro530                                     _odisk._tcp          local
+   eth0 IPv4 MacPro530                                     _ssh._tcp            local
+   eth0 IPv4 OMV - SSH                                     _ssh._tcp            local
+   eth0 IPv4 openelec                                      _ssh._tcp            local
+   eth0 IPv4 MacPro530                                     _sftp-ssh._tcp       local
+   eth0 IPv4 OMV - SSH                                     _sftp-ssh._tcp       local
+   eth0 IPv4 openelec                                      _sftp-ssh._tcp       local
+   eth0 IPv4 OMV - SMB/CIFS                                _smb._tcp            local
+   eth0 IPv4 OPENELEC                                      _smb._tcp            local
+   eth0 IPv4 XBMC (openelec)                               _xbmc-events._udp    local
+   eth0 IPv4 XBMC (openelec)                               _xbmc-jsonrpc-h._tcp local
+   eth0 IPv4 XBMC (openelec)                               _xbmc-jsonrpc._tcp   local
+   eth0 IPv4 XBMC (openelec)                               _xbmc-web._tcp       local
+   eth0 IPv4 OMV - Web administration                      _http._tcp           local
+   eth0 IPv4 XBMC (openelec)                               _http._tcp           local
+   eth0 IPv4 Web Server on openelec                        _http._tcp           local
+   eth0 IPv4 MacPro530 - Airmac                            _airplay._tcp        local
+   eth0 IPv4 XBMC (openelec)                               _airplay._tcp        local
+   eth0 IPv4 00262D4C705E@XBMC (openelec)                  _raop._tcp           local
+   eth0 IPv4 OMV [44:1e:a1:3b:6f:af]                       _workstation._tcp    local
+   eth0 IPv4 openelec [00:26:2d:4c:70:5e]                  _workstation._tcp    local
+   eth0 IPv4 5c:59:48:37:d6:a9@fe80::5e59:48ff:fe37:d6a9   _apple-mobdev._tcp   local
-   eth0 IPv4 5c:59:48:37:d6:a9@fe80::5e59:48ff:fe37:d6a9   _apple-mobdev._tcp   local
Interesting bits are: (1) two airplay services are listed - one on my MAC and the other on OE - suggesting the servers are still running(?). (2) the last two on the list are my iPhone - one has the "+" sign and the last one has "-".

As I said, the iPhone connects with the MAC Airmac server fine - so not sure it's a network issue.
I think more debug output is needed from the Airplay server - show why it terminates and if it has not terminated, why it is not connecting to the clients.
Reply
#10
Well as of that zeroconf browse printout your problem is far before airplay debugging would begin. Both AirTunes and AirPlay are successfully announced from OE. So in that state with a correct network your iDevice should show the XBMC as AirPlay target.

The xbmc.log shows that the debugoutput of libshairport was activated fine with your advancedsetting change.

Are you sure the ports 3666 and 3667 are not blocked with a firewall or so (not sure if openelec has iptables configured - i guess no). Don't know what to tell you more. The zeroconf announcment is there, the AirPlay/AirTunes servers are up (you can double check this by issuing "netstat --tcp -lnp" which should give you XBMC listening on ports 3666 and 3667).

Do you have more then 1 network card in the OE pc?
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#11
netstat -tlnp shows:
Code:
root ~ # netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      491/rpcbind
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      872/xbmc.bin
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      652/sshd
tcp        0      0 0.0.0.0:36666           0.0.0.0:*               LISTEN      872/xbmc.bin
tcp        0      0 0.0.0.0:36667           0.0.0.0:*               LISTEN      872/xbmc.bin
tcp        0      0 0.0.0.0:53085           0.0.0.0:*               LISTEN      872/xbmc.bin
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      1341/smbd
tcp        0      0 0.0.0.0:9090            0.0.0.0:*               LISTEN      872/xbmc.bin
tcp        0      0 :::111                  :::*                    LISTEN      491/rpcbind
tcp        0      0 :::53                   :::*                    LISTEN      485/connmand
tcp        0      0 :::22                   :::*                    LISTEN      652/sshd
root ~ #

Firewall is in the router and cannot see anything is blocked. OE port range is

Code:
root ~ # more /proc/sys/net/ipv4/ip_local_port_range
32768   61000

XBMC runs on Acer Revo RL100 and it has Gbe & WiFi. I am connected via Gbe LAN (eth0) and it's on a static IP 192.168.210. The WLAN is not connected to the router (i.e. has no IP address).

If debug is turned on in Airplay, how come there's no more debug ? e.g. when the iPhone tries to connect ?
Actually, shouldn't XBMC Airplay be broadcasting it's service to iDevices ?
That is, should it not be saying "Hey, I am here and you can connect to me on port 36666" ?
Otherwise, how does the iDevice know which port to connect to ?
What is strange is the debug output is so quite.

The log shows that two jobs are terminating (lines 583 & 584). That seems like Airplay. So something is still wrong in that netstat says xbmc.bin is listening on port 36666/7 however the two jobs have terminated ?? May be I have misunderstood how Airplay processes work.

Reply
#12
On an aside has anyone managed to get audio over HDMI on the RL100, mine has stopped working completely?
Reply
#13
you are highjacking your own thread. But nvm. There is no more output in the xbmc log because airplay server hasn't to do anything yet. zeroconf is announcing the service (saying hello here i am on port 3666 - connect to airplay if you want). But your iDevice doesn't see it. So basically the airplay code isn't hit yet because your setup gets stuck before. The ddns printout of yoursshows that thezeroconf announcement is there (airplay for video+photo and raop for airtunes). You could check if the mac address in the announcement matches your ethernet device and not your wifi which would be wrong if it isn't connected.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#14
(2012-03-25, 23:16)Memphiz Wrote: you are highjacking your own thread. But nvm.
I think you mean mjmills is highjacking my thread. But nvm.
(2012-03-25, 23:16)Memphiz Wrote: You could check if the mac address in the announcement matches your ethernet device and not your wifi which would be wrong if it isn't connected.

I ran avahi-browse -a -r and it showed:

Code:
=   eth0 IPv4 00262D4C705E@XBMC (openelec)                  _raop._tcp           local
   hostname = [openelec.local]
   address = [192.168.1.210]
   port = [36666]
   txt = ["vn=3" "txtvers=1" "tp=UDP" "sv=false" "ss=16" "sr=44100" "sm=false" "pw=false" "et=0,1" "ek=1" "cn=0,1" "ch=2"]
=   eth0 IPv4 XBMC (openelec)                               _airplay._tcp        local
   hostname = [openelec.local]
   address = [192.168.1.210]
   port = [36667]
   txt = ["srcvers=101.28" "model=AppleTV2,1" "features=0x77" "deviceid=0:26:2D:4C:70:5E"]

It shows that my wired LAN mac address is being used and not the wifi.

I checked the content of /etc/avahi/avahi.daemon.conf and it shows:
Code:
[server]
browse-domains=0pointer.de, zeroconf.org
use-ipv4=yes
use-ipv6=no
ratelimit-interval-usec=1000000
ratelimit-burst=1000

[wide-area]
enable-wide-area=yes

[publish]

[reflector]

[rlimits]
rlimit-core=0
rlimit-data=4194304
rlimit-fsize=0
rlimit-nofile=768
rlimit-stack=4194304
rlimit-nproc=3

Does that look OK ?
I could not find any other conf file related to Airplay.
Not sure what else to look for.
Reply
#15
Hi

Reading the thread, i know there was a bug with Netgear modems, which didn't allow for multicast between wired and wireless end points. Is your kodi-oe install on a wired interface? if so i would tried connecting wirelessly.
Reply

Logout Mark Read Team Forum Stats Members Help
How to debug Airplay issues on Linux based XBMC ?0