espes / Slave-in-the-Magic-Mirror

Open source implementation of AirPlay Mirroring. WIP.
610 stars 122 forks source link

OSX Client shows 'This AirPlay device is not compatible with this software` #5

Open robertoandrade opened 9 years ago

robertoandrade commented 9 years ago

Followed by Please update the AirPlay device to a newer version., I'm thinking it does that solely based on the mDNS TXT record info (version/features specifically).

I've had my own share of experience writing this kind of AirPlay Receiver software before and have seen it work for both iOS and OSX without any difference in implementation (other than screen resolution and payload size).

tzwenn commented 9 years ago

I'm experiencing the same on 10.9.5. @robertoandrade Can you elaborate? What did you announce on bonjour and which versions of iOS and OSX did you test?

luan007 commented 9 years ago

same problem here, running on ubuntu with fresh install, failing with iOS 8.3 & OSX 10.9.5.

mat128 commented 8 years ago

I was able to get further with the following patch:

@@ -763,9 +764,11 @@ class AirplayServer(object):
             port=port,
             properties={
                 'deviceid': u':'.join(self.device_id),
-                'features': u'0x39f7',
+                'features': u'0x4A7FFFF7,0xE',
                 'model' : u'AppleTV2,1',
-                'srcvers': u'120.2',
+                'srcvers': u'200.54',
+                'flags': u'0x44',
+                'vv': u'2',
             }

I got the info from a bug report on an mdns tool: https://github.com/hashicorp/mdns/issues/1

But then I got a AirTunes: 192.168.10.226 - - [23/Sep/2015 21:13:17] code 404, message Not Found AirTunes: 192.168.10.226 - - [23/Sep/2015 21:13:17] "POST /pair-setup HTTP/1.1" 404 -

And OS X told me Could not connect to “Slave in the Magic Mirror”

I'm not sure what the contract is for pair-setup, but I'm guessing they changed the handshake somehow and version 200 has a totally different setup.

A quick search of pair-setup resulted in https://github.com/brutella/hc/blob/master/netio/endpoint/pair-setup.go

Good luck :)

boltronics commented 8 years ago

From a glance, it looks like Apple may have updated the AppleTV firmware to support a completely different kind of pairing setup as found in iOS 9 devices. http://9to5mac.com/2015/09/11/apple-ios-9-airplay-improvements-screen-mirroring/ If true, it looks like getting this new protocol working is going to be a bit of work... but looking closer the problem here is probably different.

The firmwares over at http://www.iclarified.com/970/appletv-firmware-download-locations indicate second generation AppleTV devices support up to firmware version 6.2.1. However the download link suggests the AppleTV firmware is based on iOS 8. The 9to5mac.com article came out in September 2015, but the first post in this thread indicating an issue was from Feb 2015. Also, according to https://support.apple.com/en-au/HT201343#requirements Macs still support AppleTV second generation devices - but not using the new "peer-to-peer AirPlay" protocol (which is probably the iOS9 AirPlay thing).

So maybe the handshake isn't that different... until Apple drops second generation AppleTV device support at least.

robertoandrade commented 8 years ago

Looks like the same change in protocol from iOS 9 is also present in OSX 10.9+.

Once you advertise you're capable of handling the new method, obviously you have to either implement the new pairing routes or simply perform the DRM routines differently. The stream and some of the routes seem to have changed too so it's a significant effort to upgrade to be compatible with the newer OS. I had to do something similar for a client project and it took me a good month's effort to figure out all the changes needed.