Help us solving the AirPlay issue when using iOS7 devices

  Thread Rating:
  • 6 Votes - 4.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
mrfatboy Offline
Senior Member
Posts: 193
Joined: Jun 2011
Reputation: 0
Post: #571
Here is the log. BTW, I do get a TV monitor icon and not a speaker on my iphone when I select what airplay target to use.

http://pastebin.com/c43pmZc5


Is this the problem you are talking about?

13:46:25 T:4420 ERROR: CCurlFile::Stat - Failed: Couldn't resolve host name(6) for http://Offices-iPhone-5s.local:7001/1/af...8.MOV|User-
(This post was last modified: 2014-06-12 23:03 by mrfatboy.)
find quote
snelvuur Offline
Member
Posts: 52
Joined: Dec 2009
Reputation: 0
Post: #572
Yes, thats the same issue i have. Since you run xbmc on windows we can rule out that its a openelec issue. Basicly it just takes your name of your iphone and adds .local behind it which your xbmc cant resolve.

Knowing this i added my iphones hostname iErik.local to my hosts file with the correct ip number. Now i get streaming video on my xbmc. Ofcourse this is not a workaround you would want to implement, somewhere it goes wrong with that name. If you only have 1 xbmc at home you could just add these to your hosts file for the time being.

@mrfatboy, you could try adding offices-iphone-5s.local with the correct ip of the phone to your host file, that should work (as test)
find quote
mrfatboy Offline
Senior Member
Posts: 193
Joined: Jun 2011
Reputation: 0
Post: #573
@snelvuur,

I added "192.168.1.152 offices-iphone-5s.local" to my hosts file in c:\windows\system32\drivers\etc.

My videos are now playing correctly on XBMC airplay. So it seems there is a problem with resolving hosts. I'm going to try a couple of more experiments and will post back. Do you have anything else that you would like me to test?
(This post was last modified: 2014-06-13 00:30 by mrfatboy.)
find quote
mrfatboy Offline
Senior Member
Posts: 193
Joined: Jun 2011
Reputation: 0
Post: #574
I just took a shot in the dark and made some changes to my router and iphone name. Same problem. ERROR: CCurlFile::FillBuffer - Failed: Couldn't resolve host name(6). See the above log for more detail.

The two things I tried.

1) Changed my iphone name to just 'iphone5s'. I removed any special characters and spaces.
2) Made my iphone a static IP address on my DDWRT router.

It was worth a try Smile
find quote
DBMandrake Offline
Fan
Posts: 353
Joined: Feb 2013
Reputation: 8
Location: UK
Post: #575
(2014-06-12 23:55)snelvuur Wrote:  Yes, thats the same issue i have. Since you run xbmc on windows we can rule out that its a openelec issue. Basicly it just takes your name of your iphone and adds .local behind it which your xbmc cant resolve.

Knowing this i added my iphones hostname iErik.local to my hosts file with the correct ip number. Now i get streaming video on my xbmc. Ofcourse this is not a workaround you would want to implement, somewhere it goes wrong with that name.
Your problem is that bonjour name resolution is not working at an OS level.

The name iErik.local is a valid bonjour hostname - .local is the standard domain suffix used by dynamically published bonjour host names.

I just tested pinging the bonjour hostname of my ipad (Simons-iPad.local) from both a Windows 7 machine and from my Raspbmc install and both worked fine, and Airplay works to both as well.

If you can't ping iErik.local from the windows command prompt most likely on your windows machine you do not have bonjour for windows installed or working properly.

Make sure you either have Bonjour for Windows installed or iTunes, which bundles bonjour for windows. If that doesn't work it may be that you have set the domain suffix for your network to .local (check with ipconfig /all) - if you do so name resolution for bonjour hosts will not work - you need to remove your domain suffix or use something else so that bonjour can claim the .local suffix.

For OpenElec check that you can ping iErik.local from the command prompt - if not check Zeroconf is enabled and if that doesn't work you need to talk to the OpenElec guys as bonjour name resolution not working from the command line is an OS problem not an XBMC problem. It's certainly working for me with Raspbmc.

If you publish a domain suffix of .local from the DHCP server on your network then all clients will be using that suffix, so that could explain both Windows and OpenElec not working, so check your DHCP configuration on your router.
(This post was last modified: 2014-06-13 08:01 by DBMandrake.)
find quote
snelvuur Offline
Member
Posts: 52
Joined: Dec 2009
Reputation: 0
Post: #576
@dbmandrake: i dont use windows, but the zeroconf makes sense though. I'll check if i can ping them and look a bit futher. Pretty much everything is on dhcp, i've setup my own dhcp server with some dns forwarding for myself to keep it all easy. Perhaps thats causing an issue too. I am certain i dont publish .local behind it as mrfatboy is on windows and have the same it looks like a standard thing.

I'll play around a bit more, and if this does indeed need some more settings i'll report it back or unless mrfatboy beats me too it Wink
(This post was last modified: 2014-06-13 09:47 by snelvuur.)
find quote
DBMandrake Offline
Fan
Posts: 353
Joined: Feb 2013
Reputation: 8
Location: UK
Post: #577
Sorry snelvuur I was confusing you and mrfatboy - but some of the same comments apply - you should be able to log into the machine running XBMC and ping your iOS device by name, eg ping iErik.local - if that doesn't work bonjour name resolution is not working properly, so that needs to be addressed to solve the problem.

On OpenElec it may either be something wrong with the avahi configuration, (I'm not very familiar with OpenElec, I'm a Raspbmc user) or that you're using a .local domain suffix on your local network. That's what I'd check first. It could also be that your wireless network or router is filtering out some bonjour announcements on the network so that the XBMC machine never receives the host name announcement from the iOS device.
(This post was last modified: 2014-06-13 11:15 by DBMandrake.)
find quote
snelvuur Offline
Member
Posts: 52
Joined: Dec 2009
Reputation: 0
Post: #578
@dbmandrake: i'll go check it out when i am behind it again, maybe it is just turned off or something Wink but also like i mentioned, on my macbookpro it works just fine though. (but thats not OE) will report my findings.
find quote
DBMandrake Offline
Fan
Posts: 353
Joined: Feb 2013
Reputation: 8
Location: UK
Post: #579
Possibly an OpenElec issue then - I've briefly used OpenElec a couple of times but I have never tested Airplay with it.

Strange thing is - when I test an airplay session (at least on my work network, to Raspbmc) the debug log shows that XBMC is being given a URL with an IP address instead of a hostname... so I don't know what causes an iOS device to sometimes decide to provide a hostname instead of an IP address...

Code:
10:33:47 T:2803790912  NOTICE: Creating InputStream
10:33:47 T:2803790912   DEBUG: CFileCache::Open - opening <1/7909ddb0-bb4a-5447-a21d-3efca691ee63.MOV> using cache
10:33:47 T:2803790912   DEBUG: CurlFile::Open(0x4be13c0) http://10.0.13.86:7001/1/7909ddb0-bb4a-5447-a21d-3efca691ee63.MOV
10:33:47 T:2803790912  NOTICE: Creating Demuxer
(This post was last modified: 2014-06-13 11:40 by DBMandrake.)
find quote
Memphiz Offline
Team-Kodi Developer
Posts: 10,827
Joined: Feb 2011
Reputation: 113
Location: germany
Post: #580
(2014-06-12 17:10)popcornmix Wrote:  
(2014-06-12 16:44)Memphiz Wrote:  @lupurus go to the raspberry pi forum - i saw this multiple times now and it seems related to using rbpi only ...

Not sure if I'll be able to help. This is failing before any omxplayer specific code has run. It looks like ffmpeg doesn't like the "pipe://1/" stream.
Is that the same filename as when it is working correctly? I didn't know xbmc used pipes for talking to xbmc.

pipe://1/ is correct its a PipeFile.cpp implementation from our vfs - its needed because i get the audio data buffers via callbacks from libshairplay and have no other way to play that file in XBMC (thats why it is wrapped into a pipe layer).

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
find quote
DBMandrake Offline
Fan
Posts: 353
Joined: Feb 2013
Reputation: 8
Location: UK
Post: #581
Hmm, just noticed some more odd behaviour. I'm in the Photos app on my iPad scrolling through several videos - it was working properly at first where it showed a still image when first swiping to a video then switched to video playback when I hit play, but I'm now in a state where simply swiping from one video to another causes XBMC to start playing the video even though I have not hit play and as far as the iPad is concerned the video has not been told to play! (The iPad is still showing the preview still with the play button indicating that it is not playing)

I remember reading in the open airplay spec that there is a protocol option to "preload" images and videos at the airplay receiver - where the iOS device tells the Airplay receiver the URL of one or more resources that it MAY soon ask it to display - such as the next few photos in a list of photos so that by the time the command is sent to actually display them they have already been at least partially downloaded.

It seems like the photos app is passing the URL for the video that has not yet been played so that the Airplay receiver can start buffering it ready to play, but XBMC is jumping the gun and playing it anyway even though it has not been told to play it yet.... Memphiz ?

Here is a video showing the effect: (Sorry I didn't have any videos with much movement on the iPad but rest assured it is a video that is playing on XBMC not a still image of the video preview)

https://dl.dropboxusercontent.com/u/7826...G_5390.MOV

Here is the log file captured during the video: (Somewhere near the end of the log)

http://www.xbmclogs.com/show.php?id=225249

PS, after the video has played on XBMC when it was only sitting on the preview screen on the iPad, if I actually hit play, the iPad changes to a grey screen that says "Airplay - This movie is now playing on ..........." and sits on that screen indefinitely, while XBMC does not visibly react. Attempts to adjust the position scrubber are rebuffed - it jumps back to where it was when you release.
(This post was last modified: 2014-06-13 12:25 by DBMandrake.)
find quote
Memphiz Offline
Team-Kodi Developer
Posts: 10,827
Joined: Feb 2011
Reputation: 113
Location: germany
Post: #582
Just wanted to say that the issues where *.local domains are not resolved are exactly like DBMandrake described it. Those are multicast DNS domains which have to be resolved by the OS somehow (either static entry in hosts file or better via avahi/zeroconf/bonjour - ideally this should work without user interaction).

@DBMandrake - this is a wonky client - it definitly told me to play the video. Also the asset-cache is only available for pictures and as we are not announcing support for it we should never be called with cache commands (and i hadn't any app call us with this yet). If it would be that we would see unhandled command errors in xbmc.log.

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
(This post was last modified: 2014-06-13 16:30 by Memphiz.)
find quote
DBMandrake Offline
Fan
Posts: 353
Joined: Feb 2013
Reputation: 8
Location: UK
Post: #583
(2014-06-13 12:45)Memphiz Wrote:  @DBMandrake - this is a wonky client - it definitly told me to play the video. Also the asset-cache is only available for pictures and as we are not announcing support for it we should never be called with cache commands (and i hadn't any up call is with this yet). If it would be that we would see unhandled command errors in xbmc.log.
Well the wonky client is an iPad 3 running iOS 7.1.1 Wink

It seems to me that there is some problem with the exchange of commands in the control channels between client and server that is causing the iPad to get out of sync and loose track of the state of the receiver. From what you say and what I have seen previously it does seem like the bug is on the iOS side, (because rebooting the iOS device fixes it, rebooting XBMC does not, and a second iOS device can connect and work when the first iOS device is stuck misbehaving until a reboot) however there must be a difference in behaviour on the XBMC side compared to an Apple TV that triggers the bug on the iOS side so that they get out of sync.

I think it's very possible that the same issue is causing the intermittent problems with airplay audio I'm still seeing - because that too seems to be a similar case where the iPad thinks it is playing but XBMC is not receiving anything - I've had full debugging turned on and there is absolutely NOTHING happening in the log to give any clue why audio isn't playing when the audio playback problem occurs.

It's almost as if the iPad makes a request, assumes that it completed successfully without checking, but when the request failed (maybe a network error) they get out of sync from then on. Since I can't see anything in the debug log I'm not sure what else to check but there is definitely a problem with the client and server falling out of sync under certain conditions.
(This post was last modified: 2014-06-13 13:21 by DBMandrake.)
find quote
mrfatboy Offline
Senior Member
Posts: 193
Joined: Jun 2011
Reputation: 0
Post: #584
(2014-06-13 11:13)DBMandrake Wrote:  Sorry snelvuur I was confusing you and mrfatboy - but some of the same comments apply - you should be able to log into the machine running XBMC and ping your iOS device by name, eg ping iErik.local - if that doesn't work bonjour name resolution is not working properly, so that needs to be addressed to solve the problem.

On OpenElec it may either be something wrong with the avahi configuration, (I'm not very familiar with OpenElec, I'm a Raspbmc user) or that you're using a .local domain suffix on your local network. That's what I'd check first. It could also be that your wireless network or router is filtering out some bonjour announcements on the network so that the XBMC machine never receives the host name announcement from the iOS device.


I have the latest itunes 11 and bonjour 3.0.0.10 installed on two windows machines. I am unable to ping my iphone using iphone5s.local. I can ping it with it's IP address. When I do an ipconfig /all the primary dns suffix is blank.

It seems that bonjour is not working on both machines. That seems weird because I never had a problem with it before. I am using an Asus router with DDWRT install on it. Could it be a router setting blocking bonjour?

Any ideas how to troubleshoot this bonjour problem?


UPDATE:
I am able to ping both windows 7 pc's using their respective host names (office-pc.local & acer-pc.local). does that give anybody a clue why my iphone5s.local can't be pinged?

MORE INFO:
I am able to "ping iphone5s." (not the . at the end) but not 'ping iphone5s.local'


SOLVED! (I guess. Maybe. Airplay video playing now works on my systems)
I made some changes to my router settings so my iphone5s would be discover-able with "iphone5s.local" as a hostname. I never had to do this before and XBMC airplay always worked (less the ios 7 bugs). I'm not sure if I just covered up the real problem or what. Here are the changes I made to my DDWRT router.

If anybody knows of a way to fix this without changing the router settings please let me know Smile

[Image: mzhxdCZ.jpg]
(This post was last modified: 2014-06-13 20:33 by mrfatboy.)
find quote
snelvuur Offline
Member
Posts: 52
Joined: Dec 2009
Reputation: 0
Post: #585
Trying to use a search suffix domain as .local too now, but it still a dirty way to do it. I do have zeroconf turned on but i just cant ping those names.
find quote
Post Reply