Help us solving the AirPlay issue when using iOS7 devices

  Thread Rating:
  • 6 Votes - 4.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Audible101 Offline
Senior Member
Posts: 113
Joined: Jul 2010
Reputation: 0
Location: Sweden
Post: #391
(2014-03-21 03:03)Platypus2 Wrote:  
(2014-03-21 01:28)Audible101 Wrote:  Since the YouTube app plays html5 video, which is natively decoded it works, but I'm trying to airplay mkv format which is not natively decode it won't play. I'm I understanding it correctly?

Yes, correct.

(2014-03-21 01:28)Audible101 Wrote:  So for instance if I had a HTML5 video would that airplay from my iPads xbmc app?

Should do - provided it is natively decoded.

(2014-03-21 01:28)Audible101 Wrote:  Is there an add on or guide you know of that would accomplish that?

To accomplish what? Sorry not sure what you want the addon/guide to do. If you want to convert the video then there should be loads of guides around online on how to do that. If you want an addon / guide to stream an mkv then your probably better off using the iPad as a server (turning on UPnP or FTP sharing) and connecting to it on the 'host machine' that way. Short of using airplay mirroring (unsupported by XBMC) I don't think its possible to stream content from the iPad to any other device in a 'like airplay style but not airplay way'.

Unfortunately this is getting extremely off-topic, if you want to ask about how to do something unrelated to getting Airplay working with iOS 7, you best create a new topic before Memphiz gets annoyed Wink

I'm using smb to share my library, upnp was buggy for me. You are right though, simplest way is just to load stream on the host machine. Thanks for explaining everything Big Grin and I'm sorry Memphis for cluttering up the threadSmile
find quote
Memphiz Offline
Team-Kodi Developer
Posts: 11,056
Joined: Feb 2011
Reputation: 113
Location: germany
Post: #392
I think you want to stream FROM xbmc via airplay. This is not supported! Airplay support in XBMC is only as Airplay Target (e.x. receving music, video, pictures).

I guess what you did is:
1. Opened a Movie in XBMC
2. Backgrounded XBMC and swiped to the control center
3. Hit the pause button in the control center (which unpauses the movie playback in XBMC)
4. Now you hear the audio of the movie
5. And now you activated airplay in the control center to your atv2 or something.

The feature of backgrounding XBMC and continue playing audio is ment to be used for music only. iOS then allows you to airplay that audio to any other airplay target (e.x. airplay speakers). The fact that it sort of works with movie is a coincident.

Streaming anything else but audio from XBMC via airplay is not supported (and won't be ever).

Hope i got it right - its hard to tell from your descriptions...

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-03-21 11:29 by Memphiz.)
find quote
jyavenard Offline
Junior Member
Posts: 21
Joined: Mar 2009
Reputation: 2
Post: #393
Here are my $0.02. I've implemented the AirPlay service on MythTV, and I've spent extensive amount of time looking into the issue (haven't found a good 100% reliable solution yet)

From what I've investigated:
- the iOS device will only show the screen device if RAOP and AirPlay advertises matches
- AirPlay and RAOP versioning must match if version > 120.x. Before that they could be different and it would work.
- If you use a version > 120 in your advertisement, FairPlay will be used, even if you make the RAOP service advertise that it only supports RSA or no encryption

The only way to have the service show up as a full screen (rather than just an audio device) with 100% success rate, you must advertise that your RAOP service supports FairPlay. IF you don't, it works but not reliably. I'd say about 2/3rd of the time the device will show as a speaker only, and not a screen.

If you use version < 120, and only advertise RAOP as supporting RSA, you can get audio to work easily. But then video and photo sharing is a hit and miss.

If you advertise RAOP to support fairplay, then for video and photo sharing that will work better.
However, while the device will show in the airplay device list, you're not guaranteed that it will work 100% of the time.
When you attempt to play a video, if it tries to connect only to the video service, it will work just fine.

However, I've found that sometimes, before connecting to the AirPlay video service, it will first connect to RAOP which if it succeeds will then drop RAOP connection and switch to AirPlay video.
But if you have advertise FairPlay *or* use version >= 120, the iOS device will attempt to establish a FairPlay handshake, this fails and then playback on the iOS device drops back to the default iphone screen.

So from what I've gathered, there's no way to have it working 100% of the time, every time.

Either it will not advertise as a full device and will show up from time to time as an audio device, but then if it does happen to show as a full device it will work 100% of the time and audio works fine.

You can get the custom airplay device to show 100% of the time in the list, but then actual playback/audio or photo sharing may not work from time to time.

My guess is that the iPhone device when it browse for devices, doesn't always behave the same way; either a bug in their code, or done on purpose. My guess is that their code being implemented to only work with a genuine Apple TV, so there's no handling of mismatching Audio & Video server.

Note that I have access to the MFi internal documentation, there's nothing documented on this matter, it expects that you use their FairPlay key, but that's unique to your MFi account and as such not usable in an OpenSource .

Now if you guy find a solution, I would *love* to know... Many sleepless night on this topic is driving me insane...

You add: we have a similar ticket opened in mythtv bug tracking:
https://code.mythtv.org/trac/ticket/11901#comment:4

In there I mentioned a few Apple TV official device from different version. Apple TV 2 running a very old iOS 4
And Apple TV running iOS 5 and iOS 6

The iOS 4 version itself doesn't reliably show in the iPhone list. So the problem isn't just with our code (or xbmc), Apple device itself has this problem. I've lodged a bug at Apple on this, the answer was "upgrade your Apple TV"

I should also add that AirServer, a commercial solution has *exactly* the same problem I mentioned earlier.
AirServer will 100% reliably show in the device list, but it *will* fail just the same under some circumstances: when the iphone attempts to first connect via RAOP but that fail and so the connection is dropped.
AirServer advertises as supporting FairPlay, but they don't.

They don't do audio nor HLS so they don't care much. They only support video and mirroring. But it will fail just as much.
The difference is that you pay for the privilege.
(This post was last modified: 2014-03-23 07:52 by jyavenard.)
find quote
jyavenard Offline
Junior Member
Posts: 21
Joined: Mar 2009
Reputation: 2
Post: #394
(2014-03-17 00:48)Memphiz Wrote:  We have a fix ... are you sleeping? ^^

Unfortunately, I can report that even with today's nightly build xbmc-20140321-6155f03-Gotham-x86_64.dmg; it doesn't work

Out of ten run of xbmc, it showed up as a full device only twice. All other time an audio only.

This is what I use to guarantee it shows 100% of the time as a full device:
_airplay.tcp server:
"srcvers=130.14" "model=AppleTV2,1" "features=0x39f7" "deviceid=XX:XX:XX:XX:XX:XX"

_raop.tcp server:
"sf=0x4" "am=AppleTV2,1" "vs=130.14" "vn=65537" "tp=UDP" "ss=16" "sr=44100" "sv=false" "pw=false" "md=0,1,2" "et=0,3,5" "da=true" "cn=0,1,2,3" "ch=2" "txtvers=1"

that's what an AppleTV 2 with iOS 6 shows

Then video and photo sharing works reliably , audio only won't work...

What I'm thinking I should do is advertise two devices.
One that works reliably for video (though not 100% of the time, if it happens that the iOS attempts to connect to RAOP first before starting the video)
One that always work for audio, which is you plain RAOP like what shairplay does, which is emulate an old Airport Express.

There may not be a proper solution anyway
find quote
DBMandrake Online
Fan
Posts: 415
Joined: Feb 2013
Reputation: 12
Location: UK
Post: #395
(2014-03-23 08:07)jyavenard Wrote:  
(2014-03-17 00:48)Memphiz Wrote:  We have a fix ... are you sleeping? ^^

Unfortunately, I can report that even with today's nightly build xbmc-20140321-6155f03-Gotham-x86_64.dmg; it doesn't work
I don't think the fix has been merged into mainline yet - if it had I think Memphiz would have told us, as its uncertain whether it will make it in for Gotham 13.0. What you describe are the symptoms without the fix.

Does it work for you using the airplay test build 10 linked at the beginning of this thread ? That and the latest Raspbmc build from miappa (and possibly Millhouse's OpenElec builds but I haven't tried them) are the only builds that contain this fix at the moment.

It works well for me - maybe 1 out of 10 times the youtube app gets a bit confused about whether it is actually sending video or not, but as you say I see exactly the same occasional intermittent issues with other servers like Reflector...so I think that its fixed as well as it can be (assuming the patch does get accepted and merged before 13.0 is released) unless someone makes another breakthrough.

It does always show as a video device within a few seconds and 9/10 times it works perfectly.
(This post was last modified: 2014-03-23 09:31 by DBMandrake.)
find quote
jyavenard Offline
Junior Member
Posts: 21
Joined: Mar 2009
Reputation: 2
Post: #396
(2014-03-23 09:18)DBMandrake Wrote:  
(2014-03-23 08:07)jyavenard Wrote:  
(2014-03-17 00:48)Memphiz Wrote:  We have a fix ... are you sleeping? ^^

Unfortunately, I can report that even with today's nightly build xbmc-20140321-6155f03-Gotham-x86_64.dmg; it doesn't work
I don't think the fix has been merged into mainline yet - if it had I think Memphiz would have told us, as its uncertain whether it will make it in for Gotham 13.0. What you describe are the symptoms without the fix.

That would explain.

Anyhow, I think Memphiz nailed it.. I've implemented a similar mechanism that he did which is updating the mDNS record at regular interval, and sure enough, the device appears very reliably on the AirPlay device list.

awesome....

So far it has worked 100% and I've been trying to fault it for about 3 hours now...

BTW, a side question, why bother with different mDNS/Bonjour implementation between various platforms (OSX, Avahi etc...)

There's a universal API, supported by all mDNS implementation I know of. There's also an official API to update a record..

Allocating a service:
https://developer.apple.com/library/ios/...ceRegister

Updating a record:
https://developer.apple.com/library/ios/...dateRecord

in avahi it's part of the Bonjour compatibility layer

Updating the record is something perfectly official and work across all platforms
find quote
Memphiz Offline
Team-Kodi Developer
Posts: 11,056
Joined: Feb 2011
Reputation: 113
Location: germany
Post: #397
We support mdnsresponder (using it on windows and android) - its just that we now have those 3 apis working and now affords have been made to use the same api on all of them. Also i don't expect any major changes in the zeroconf part because everything we need is there. (so no real reason for spending time on it).

That said the fix has been merged to master. It also will hit the gotham branch (its up to the release managers when they do the backport - didn't look if they did already).

Thx for all the users involved in testing and digging deeper into that issue. It wouldn't have happend with your help.

Special thanks to brownard once more as he found that workaround.

Time for unsticking that thread - and hopefully it will die in history and won't be brought up again ...

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-03-23 19:19 by Memphiz.)
find quote
darkm00n Offline
Junior Member
Posts: 6
Joined: Mar 2014
Reputation: 0
Post: #398
(2014-03-23 19:18)Memphiz Wrote:  We support mdnsresponder (using it on windows and android) - its just that we now have those 3 apis working and now affords have been made to use the same api on all of them. Also i don't expect any major changes in the zeroconf part because everything we need is there. (so no real reason for spending time on it).

That said the fix has been merged to master. It also will hit the gotham branch (its up to the release managers when they do the backport - didn't look if they did already).

Thx for all the users involved in testing and digging deeper into that issue. It wouldn't have happend with your help.

Special thanks to brownard once more as he found that workaround.

Time for unsticking that thread - and hopefully it will die in history and won't be brought up again ...

Dear All,
Do you know in which generic xbmc nightly build this would be compiled ?
I tried with a build of 24.03 and still have problems with Airplay and IOS7.
Thanks
DM
find quote
Memphiz Offline
Team-Kodi Developer
Posts: 11,056
Joined: Feb 2011
Reputation: 113
Location: germany
Post: #399
what operating system - which hardware?

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
darkm00n Offline
Junior Member
Posts: 6
Joined: Mar 2014
Reputation: 0
Post: #400
(2014-03-25 12:54)Memphiz Wrote:  what operating system - which hardware?

Generic Build - openelec 4.0 - gotham 13 - From here : http://xbmcnightlybuilds.com/category/openelec-generic/
(This post was last modified: 2014-03-25 15:41 by darkm00n.)
find quote
Memphiz Offline
Team-Kodi Developer
Posts: 11,056
Joined: Feb 2011
Reputation: 113
Location: germany
Post: #401
We don't know when openelec syncs to our master code. Most likely the fix was not in the build you tested. Ask in the openelec forum or try the milhouse builds (somewhere in our rbpi forum i guess) - which should have the fix *iirc*.

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
dantaylorseo Offline
Junior Member
Posts: 4
Joined: Mar 2014
Reputation: 0
Post: #402
Hi there,

on iPad Air (ios 7.0.2) and almost every app works (youtube etc) except the one I want it for. The app in question is premierleaguepass.

The app worked perfect in an earlier test build (I think it was 8) can I get hold of the test build 8?

Dan
(This post was last modified: 2014-03-25 20:46 by dantaylorseo.)
find quote
Memphiz Offline
Team-Kodi Developer
Posts: 11,056
Joined: Feb 2011
Reputation: 113
Location: germany
Post: #403
which operating system?

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
dantaylorseo Offline
Junior Member
Posts: 4
Joined: Mar 2014
Reputation: 0
Post: #404
Sorry Windows 7 and Windows 8.1
find quote
bobby8921 Offline
Junior Member
Posts: 15
Joined: Feb 2013
Reputation: 0
Location: France
Post: #405
Sorry if has been asked Sad
Does Airplay work now on a raspberry Pi ? If yes, with what OS ? Raspbmc? OpenElec?
I'm looking for buying a RPi but I need the AirPlay support

Thanks for your answer
find quote
Post Reply