There’s no IOFramebuffer that we can call IOFBCopyI2CInterfaceForBus on. So it turns out the I/O structure is very different on M1 (more similar to iPhones and iPads than to previous Macs). I just hoped this was an easy fix and headed to bed. The monitor wasn’t being controlled in any way. I launched it through Rosetta and the app window showed up as expected, every UI interaction worked normally but DDC was unresponsive. Meanwhile I kept working on the 2019 MacBook because my day job was also a night job when deadlines got tight.īefore I went to sleep, I wanted to test Lunar just to get an idea of what happens on M1. Just as the day turned into evening, the delivery guy called me about a laptop: the custom configured M1 MacBook Pro that costed as much as 7 junior developer monthly salaries has arrived!Īfter charging the laptop to 100%, I started the installation of my enormous Brewfile and left it on battery as an experiment. Snowy forests in Răcădău (Braşov, Romania)īut I was fortunate, as I had my trusty 2019 MacBook Pro to keep my hands warm while I was cranking code that will be obsolete in less than 6 months on my day job. Days were cold and less than 10km away from my place you could take a walk through snowy forests. Io_service_t framebuffer = 0 CGSServiceForDisplayNumber ( displayID, & framebuffer ) io_service_t interface if ( IOFBCopyI2CInterfaceForBus ( framebuffer, bus ++, & interface ) != KERN_SUCCESS ) return IOI2CConnectRef connect if ( IOI2CInterfaceOpen ( interface, kNilOptions, & connect ) = KERN_SUCCESS ) IOObjectRelease ( interface ) Without analytics, I had no idea that Lunar had so many active users! # Constructing the DDC request The previous APIs weren’t working anymore on the M1 GPU, the IOFramebuffer was now an IOMobileFramebuffer and the IOI2C* functions weren’t doing anything.Īll of a sudden, I was getting countless emails, Twitter DMs and GitHub issues about how Lunar doesn’t work anymore on macOS Big Sur (most M1 users were thinking the OS upgrade was causing this, disregarding the fact that they’re now using hardware and firmware that was never before seen on the Mac) M1 Macs came with a different kernel, very similar to the iOS one. On Intel Macs this worked really well because macOS had some private APIs to find the framebuffer of a monitor, send data to it through I☬, and best of all, someone has already done the hard part in figuring this out in this ddcctl utility. I develop an app called Lunar that can adjust the real brightness, contrast and volume of monitors by sending DDC commands through the Mac GPU. # Adjusting monitor brightness on Intel Macs This is a story about how getting an M1 made me quit my job, bang my head against numerous walls to figure out monitor support for it and turn an open source app into something that I can really live off without needing a “real job”. This already starts to sound like those happy stories about seeing how awesome M1 is, but it’s far from that. So I got it! With long delays and convoluted delivery schemes because living in a country like Romania means incredibly high prices on everything Apple. I also had the excuse that users of my app couldn’t control their monitor brightness anymore, so I could justify the expense easily in my head. One lazy evening in November 2020, I watched how Tim Cook announced a fanless MacBook Air with a CPU faster than the latest 16 inch MacBook, while my work-provided 15 inch 2019 MacBook Pro was slowly frying my lap and annoying my wife with its constant fan noise. Home Blog Notes Stuff Contact Résumé RSS The journey to controlling external monitors on M1 Macs How the transition to Apple Silicon made all monitor-controlling apps useless overnight, and how Lunar got past that
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |