Adding AirPlay to Mac (and Sidecar) support for older models
With macOS monterey, Apple added a ton of new features to the OS including a new Safari, Shortcuts, etc. Today I wanted to take a peak at one of theses features: AirPlay to Mac
The idea is simple, allow your Mac running Monterey to become an AirPlay 2 complaint receiver supporting both audio and video streams. However internally it was decided to limit support to a select few Intel models instead of allowing the feature across the line.
Official minimum supported models by Apple:
MacBookAir8,x - 2018 T2 MacBook Air - Intel Coffee Lake MacBookPro15,x - 2018 T2 MacBook Pro - Intel Coffee Lake + AMD Polaris dGPU iMac19,x - 2019 iMac - Intel Coffee Lake + AMD Polaris dGPU Macmini9,1 - 2020 Mac mini - Apple Silicon M1 MacPro7,1 - 2019 Mac Pro - Intel Cascade Lake + AMD Polaris dGPU
Why did Apple only support these models?
At first glance, this limitation seems to be based off the T2 however upon closer inspection we see this is incorrect. Specifically iMac19,1 has no T2 and ships with a basic Polaris 20 dGPU core, then there’s the 2018 Mac mini with identical specs to the 2018 MacBook Pro 13”. Clearly the decision for which models were supported was not technical.
So is AirPlay to Mac reliant on H.265? If so, why did Skylake Macs get dropped?
Well when we look at AirPlay to Mac, we see it actually has no H.265 requirement. This is because AirPlay To Mac, unlike Sidecar, is almost entirely video decode based instead of encode. Why this is important is that Apple’s graphics stack already supports proper hardware accelerated decode on H.264 based GPUs
For Sidecar however, the only GPUs to properly support encode support are Intel’s Skylake+ iGPUs as well as Apple’s T2 chip. Older Intel iGPUs will fall back on software encoding by default however AMD and Nvidia dGPUs do not automatically.
So where does Apple hard code support?
So with macOS Big Sur and newer, Apple moved to a massive dyld cache approach for storing all the binaries. This means that on disk there are no longer any proper binaries to grep the system for, instead one massive file that will take a week to load into a decompiler. Thanks to a great observation by @zhuowei, we’re able to extract all the binaries that reside in this cache.
After compiling and running his file, I was able to rip all the binaries from Monterey’s dyld cache.
After this, it was trivially easy to find out where Apple hard coded the SMBIOS. After about 5 min, I found that AirPlaySupport.framework holds the array of blacklisted models (oddly enough, Apple made 2 arrays. Taking a closer look, array 1 is a copy paste of SidecarCore’s blacklist Ben-z discovered in Catalina):
# First Array (Identical that that found in SidecarCore) iMac13,1iMac13,2iMac13,3iMac14,1iMac14,2iMac14,3iMac14,4iMac15,1iMac16,1iMac16,2MacBook8,1MacBookAir5,1MacBookAir5,2MacBookAir6,1MacBookAir6,2MacBookAir7,1MacBookAir7,2MacBookPro9,1MacBookPro9,2MacBookPro10,1MacBookPro10,2MacBookPro11,1MacBookPro11,2MacBookPro11,3MacBookPro11,4MacBookPro11,5MacBookPro12,1Macmini6,1Macmini6,2Macmini7,1MacPro5,1MacPro6,1
# Second Array iMac17,1iMac18,1iMac18,2iMac18,3MacBookPro13,1MacBookPro13,2MacBookPro13,3MacBookPro14,1MacBookPro14,2MacBookPro14,3MacMini8,1
Something you may have noticed is that MacBook9,1 and MacBook10,1 are not included. It seems with Developer Beta 1, the engineers completely forgot that they even made a 12” Skylake/Kaby Lake Machines. I fully expect before release for someone to notice and correct.
Working around this software lock
I’ve written some patch sets to allow for support of both AirPlay to Mac as well as Sidecar on supported SMBIOS into SidecarFixup and below is the documented patches (Sidecar patches originate from Ben-z):
# System/Library/PrivateFrameworks/SidecarCore.framework/Versions/A/SidecarCore ### find: 694E6163 31372C31 00694E61 6331382C 3100694E 61633138 2C320069 4E616331 382C3300 4E616342 6F6F6B50 726F3133 2C31004E 6163426F 6F6B5072 6F31332C 32004E61 63426F6F 6B50726F 31332C33 004E6163 426F6F6B 50726F31 342C3100 4E616342 6F6F6B50 726F3134 2C32004E 6163426F 6F6B5072 6F31342C 33004E61 634E696E 69382C31 ### replace: 694E6163 31372C31 00694E61 6331382C 3100694E 61633138 2C320069 4E616331 382C3300 4E616342 6F6F6B50 726F3133 2C31004E 6163426F 6F6B5072 6F31332C 32004E61 63426F6F 6B50726F 31332C33 004E6163 426F6F6B 50726F31 342C3100 4E616342 6F6F6B50 726F3134 2C32004E 6163426F 6F6B5072 6F31342C 33004E61 634E696E 69382C31
# System/Library/PrivateFrameworks/AirPlaySupport.framework/Versions/A/AirPlaySupport ### find set 1: 694D6163 31372C31 00694D61 6331382C 3100694D 61633138 2C320069 4D616331 382C3300 4D616342 6F6F6B50 726F3133 2C31004D 6163426F 6F6B5072 6F31332C 32004D61 63426F6F 6B50726F 31332C33 004D6163 426F6F6B 50726F31 342C3100 4D616342 6F6F6B50 726F3134 2C32004D 6163426F 6F6B5072 6F31342C 33004D61 634D696E 69382C31 ### replace set 1: 694E6163 31372C31 00694E61 6331382C 3100694E 61633138 2C320069 4E616331 382C3300 4E616342 6F6F6B50 726F3133 2C31004E 6163426F 6F6B5072 6F31332C 32004E61 63426F6F 6B50726F 31332C33 004E6163 426F6F6B 50726F31 342C3100 4E616342 6F6F6B50 726F3134 2C32004E 6163426F 6F6B5072 6F31342C 33004E61 634E696E 69382C31 ### find set 2: 694D6163 31332C31 00694D61 6331332C 3200694D 61633133 2C330069 4D616331 342C3100 694D6163 31342C32 00694D61 6331342C 3300694D 61633134 2C340069 4D616331 352C3100 694D6163 31362C31 00694D61 6331362C 32004D61 63426F6F 6B382C31 004D6163 426F6F6B 41697235 2C31004D 6163426F 6F6B4169 72352C32 004D6163 426F6F6B 41697236 2C31004D 6163426F 6F6B4169 72362C32 004D6163 426F6F6B 41697237 2C31004D 6163426F 6F6B4169 72372C32 004D6163 426F6F6B 50726F39 2C31004D 6163426F 6F6B5072 6F392C32 004D6163 426F6F6B 50726F31 302C3100 4D616342 6F6F6B50 726F3130 2C32004D 6163426F 6F6B5072 6F31312C 31004D61 63426F6F 6B50726F 31312C32 004D6163 426F6F6B 50726F31 312C3300 4D616342 6F6F6B50 726F3131 2C34004D 6163426F 6F6B5072 6F31312C 35004D61 63426F6F 6B50726F 31322C31 004D6163 6D696E69 362C3100 4D61636D 696E6936 2C32004D 61636D69 6E69372C 31004D61 6350726F 352C3100 4D616350 726F362C 31 ## replace set 2: 694E6163 31332C31 00694E61 6331332C 3200694E 61633133 2C330069 4E616331 342C3100 694E6163 31342C32 00694E61 6331342C 3300694E 61633134 2C340069 4E616331 352C3100 694E6163 31362C31 00694E61 6331362C 32004E61 63426F6F 6B382C31 004E6163 426F6F6B 41697235 2C31004E 6163426F 6F6B4169 72352C32 004E6163 426F6F6B 41697236 2C31004E 6163426F 6F6B4169 72362C32 004E6163 426F6F6B 41697237 2C31004E 6163426F 6F6B4169 72372C32 004E6163 426F6F6B 50726F39 2C31004E 6163426F 6F6B5072 6F392C32 004E6163 426F6F6B 50726F31 302C3100 4E616342 6F6F6B50 726F3130 2C32004E 6163426F 6F6B5072 6F31312C 31004E61 63426F6F 6B50726F 31312C32 004E6163 426F6F6B 50726F31 312C3300 4E616342 6F6F6B50 726F3131 2C34004E 6163426F 6F6B5072 6F31312C 35004E61 63426F6F 6B50726F 31322C31 004E6163 6D696E69 362C3100 4E61636D 696E6936 2C32004E 61636D69 6E69372C 31004E61 6350726F 352C3100 4E616350 726F362C 31
AirPlay to Mac works on virtually every Mac and every metal GPU without issue however Sidecar does require an H.265 iGPU to function.
- Its been discovered that you can force systems with AMD GPUs into software encode by forcing an iMac19,x or iMac20,x SMBIOS and running the following command:
defaults write com.apple.AppleGVA gvaForceAMDKE -boolean yes
Nvidia dGPU only machines seem to be out of luck unfortunately regarding Sidecar.
Overall for a first developer beta, I am quite impressed with the stability of AirPlay to Mac. However from a technical point of view, I am disappointed in how management decided to cripple older, very capable Macs for no real purpose. Unlike Sidecar, AirPlay already works fantastic and honestly could save some old Macs from the trash heap and instead become AirPlay displays for newer Macs in the future. Even if Target Display Mode is dead on most Macs, AirPlay to Mac gives them some simple, easy way to live on.
But even if Apple Internal decided one way, I’m still determined to find ways to patch in support just like our OpenCore Legacy Patcher project for many older machines.