11 ms·
Open AirPlay 2 Receiver
- lloeki 4y agoGreat to see some movement on that front. shairport-sync had it long brewing, I think it's currently still in a dev branch but does work to some extent. https://github.com/mikebrady/shairport-sync/issues/535#issuecomment-1002299880 https://github.com/mikebrady/shairport-sync/issues/535#issue... EDIT: details here https://github.com/mikebrady/shairport-sync/blob/development/AIRPLAY2.md#features-and-limitations https://github.com/mikebrady/shairport-sync/blob/development...
- maerek 4y agoAdding on, the AirPlay 2 implementation by Shairport-sync works very well. I have approximately 6 different Rpis/thin clients around the house I use as AirPlay 2 receivers and can vouch for how well the system works. NQPTP is built by the same team.
- mr_sturd 4y agoshairport-sync also has the option to output to FIFO/stdout, which I couldn't see details of in this Open AirPlay 2 implementation. Indispensable for tying in to SnapCast!
- dmix 4y agoCould you hypothetically run this on two different Pi’s, one for bookshelf and one for a separate sub, but synchronized? I’m trying to avoid a bulky receiver and want something more custom, with the option to turn the sub off digitally.
- mmastrac 4y ago> FairPlay (v3) authentication and decryption of AES keys - the first and only Python implementation. Credit to @systemcrash for implementation. Damn... that took a lot longer to extract the keys that AirPlay 1 did. I'd love to know more about this story.
- keepquestioning 4y agoI often wonder how DRM systems obfuscate the keys. They must be in memory, right?
- droopyEyelids 4y agoThat's the point of all these TPM chips/subprocessors Apple and Microsoft are sticking into their computers. The key can stay on the TPM chip which does the decrpytion
- keepquestioning 4y agoIf the key was extracted from the Secure Enclave, that's huge.
- akmarinov 4y agoProbably not, there are a bunch of products out there that support Airplay 2 like LG and Samsung TVs that don’t have a Secure Enclave
- filleokus 4y agoI don't know they did it. But one approach I (badly) tried was to use the firmware image for the old AirPort Express that got AirPlay 2 support. Someone had already extracted the key which was used to encrypt the firmware, so you could download the firmware from Apple and look at the unencrypted firmware blob. Perhaps even boot it using something like QEMU? But I never got anywhere with that...
- tra3 4y agoIf only I could get my airport expresses to stay connected to my wifi. When they do, the multiroom audio is magic.
- azinman2 4y agoWhat I really want is for someone to crack the Sonos S1 protocol — the one that allows for low-latency P2P sharing - and then to use one of these Airplay 2 bridges with it. Right now the best I can do is to pipe an icecast stream to one which adds seconds of latency. That would allow my older S1 Sonos gear (which I spent thousands on) to have basically unlimited life.
- newfonewhodis 4y ago> That would allow my older S1 Sonos gear (which I spent thousands on) to have basically unlimited life 2 years ago, I bought some used Yamaha (not "smart") speakers and AVR. They are 8 years old now and work flawlessly. My solution to making them "smart" was to just Cast to my Android TV that's plugged into the AVR. That entire set up cost me <$200 and has no end in sight with a very clean upgrade path. It's unfortunate that so much modern hardware is paperweight in a few years just because the company can't be bothered to maintain the software.
- JustSomeNobody 4y ago> the company can't be bothered to maintain the software. or open source it and let enthusiasts maintain it.
- kitsunesoba 4y agoIn my experience AirPlay equipped receivers are also a pretty decent bet for long term support. My receiver is a 7 year old midrange Marantz model and its AirPlay has always worked great. It still gets software updates occasionally too which is nice. If I upgrade it’ll be due to changing HDMI standards (it can’t handle high framerate 4K video), not protocol support. As I understand Airport Express models from the 2000s still work with AirPlay from modern Apple devices too, though I don’t own any and can’t vouch for them personally.
- azinman2 4y agoAirPlay 1 doesn't have the nice multi-room audio support that AirPlay 2 does. It only has a much hackier version that works from iTunes, but not from your iPhone's media controller. But if you only ever want to play to 1 device, then you're set.
- just_steve_h 4y agoThis is amazing! For many years, I've been a happy customer (no other affiliation) of Rogue Amoeba, whose (closed-source, commercial) Airfoil software: https://rogueamoeba.com/airfoil/mac/ https://rogueamoeba.com/airfoil/mac/ does all this & more (MacOS and iOS only). I've had a multi room audio setup with Airport Expresses and dumb powered M-Audio bookshelf speakers for the past 10 years going strong! I love this project, but for folks who use MacOS and want something that simply works, I can't recommend Airfoil highly enough.
- copperx 4y agoDo they license AirPlay from Apple? Or did they also reverse engineer the protocol?
- lapcat 4y agoReverse engineered. Apple doesn't have AirPlay licensing for software products, just for hardware.
- krnlpnc 4y ago+1 to airfoil, the only thing I wish they would do is reduce the pricetag and update the interface. Software works great though!
- Qerub 4y ago> […] Airfoil software does all this & more […] Not quite; Airfoil Satellite does not implement an AirPlay 2 receiver which is what this is all about. See https://weblog.rogueamoeba.com/2018/06/25/current-notes-on-airfoil-airplay-2/ https://weblog.rogueamoeba.com/2018/06/25/current-notes-on-a... : > Can Airfoil Satellite receive AirPlay 2 audio? Airfoil Satellite receives audio via the AirPlay 1 protocol. Because of this, it can’t currently be part of a multi-speaker group receiving audio from iOS. Still a great piece of software (that I also can recommend).
- yccs27 4y agoDoes this play the AP2 audio directly? Or is it possible to redirect that to an HTTP stream?
- banana_giraffe 4y agoIt plays directly. It is possible to capture the audio data directly with a little hacking. For instance, something like with open("data.dat", "ab") as f: f.write(frame.planes[0].to_bytes()) in Audio's process() does indeed dump out the captured data to something that can be replayed.
- babypuncher 4y agoI've been using shairport-sync to receive audio from my iPad while working. It has proven a really convenient means to turn my iPad into a 2nd display for watching videos. I've been wanting to use this on Windows as well but had no luck getting sound to work with WSL last time I tried. This new app looks like a promising cross-platform replacement.
- amaccuish 4y agoThis is why I will replace my phone with an iPhone. The chromecast protocols are so locked down, it makes casting really suck, and chromecast audio pucks are no more.
- grishka 4y agoChromecast works differently. Casting something causes the receiving device to load a web app that then plays whatever you were playing. Yes, that tiny thing actually runs a cut-down version of Chrome OS. In other words, it's not merely an audio/video streaming protocol. Your phone/computer acts as a remote, and it's the Chromecast itself that does the streaming.
- mikepurvis 4y agoThat's only for apps that support doing that, though, like Netflix, YouTube, Spotify, Twitch, etc. If you're casting a game or something that's local content, then it will obviously still stream it directly.
- hackmiester 4y agoAirPlay does this for some apps as well.
- Knifa 4y agoArguably, this is about just as locked down.
- throitallaway 4y agoAside from specialty DoD-type phones, iPhones (and Apple devices in general) are the most locked down devices on the market. You can't even install an open source app without going through hoops. On Android you download the APK and click the "accept risk" button.
- oynqr 4y agoThis was not about the devices, but the protocol.
- lvl102 4y agoFor all the audiophiles out there, M1 Mac Mini is an incredible digital player. You can basically play lossless audio over iTune/Apple Music and it’s well-integrated with the rest of the Apple ecosystem.
- azalemeth 4y agoIt's worth stating that the actual crypto code itself is "moderately insane" – https://github.com/openairplay/airplay2-receiver/blob/master/ap2/fairplay3.py https://github.com/openairplay/airplay2-receiver/blob/master... contains the warning: """ GPLv2 Python implementation by systemcrash 2022 Original C implementation of OmgHax by (credit to original author and Foxsen) If you want this to work, don't touch anything. It's a steaming hot rats nest of crypto mess which works. It's quite performant. Resist the urge to refactor. :) Avoid +=, -=, ^= etc operators in Garble: they don't account for overflow. """ before going into lovely detail, containing lines (e.g. in a method appropriately called Garble) such as buffer1[15] = ((3 * (((buffer1[72] >> (buffer4[buffer1[190] % 21] & 7)) ^ (buffer1[72] << ((7 - (buffer4[buffer1[190] % 21] - 1) & 7)))) - (3 * buffer4[buffer1[126] % 21]))) ^ buffer1[15]) & 0xff print(f'buffer1[15]:{hex(buffer1[15])}') Really, really hats off to whoever worked this out. I have no idea where you'd start.
- justapassenger 4y agoThis looks like someone decompiling Apple's code and basically putting output of that into their project. This method can have some legal risk attached to it (INAL).
- joshspankit 4y agoAre you saying that because you have knowledge of Apple’s code?
- sandermvanvliet 4y agoThis is generally how you’d make this kind of encryption/decryption work for apps that don’t have documented/open interfaces. In fact, it’s what I’ve done to reverse engineer the encryption for Zwift for example (and a ton of other apps)
- baobob 4y agoNo knowledge of Apple's code here, but looks like they simply gave up trying to reformat decompiler/disassembler output in that Garble class. Humans don't write code like that, optimizers do
- aaaaaaaaaaab 4y agoCan't wait to have this in Kodi!
- mychele 4y agoCan you elaborate on the PTP requirement part of the next steps?
- newman314 4y agoFWIW, a number of other AirPlay 2 repos that I have been tracking: * https://github.com/openairplay/goplay2 https://github.com/openairplay/goplay2 * https://github.com/openairplay/airplay2-receiver https://github.com/openairplay/airplay2-receiver
- O5vYtytb 4y agoAlso see https://github.com/badaix/snapcast https://github.com/badaix/snapcast which also supports AirPlay: https://github.com/badaix/snapcast/blob/master/doc/player_setup.md#airplay https://github.com/badaix/snapcast/blob/master/doc/player_se...
- Rhubarrbb 4y agoHow does one get this to run on an Android TV?