haimgel/ddc-macos-rs

M1 series SoCs not supported

gautamg795 opened this issue ยท 19 comments

Existing DDC control utilities on macOS no longer work on M1 SoCs, presumably due to the different GPU architecture.
More details on the changes (and required fixes) are here.

I may take a stab at this myself in the next week, but creating an issue to track progress anyhow.

note: I wasn't sure if you'd prefer this issue under display-switch; this library seemed more directly tied to the issue.

This is the perfect place for such a ticket, thank you! The link is also very helpful. I plan to get an M1, but I currently don't have one, so I cannot test/hack any of this. Any help is most welcome!

Making very slow progress trying to understand the code from https://github.com/alin23/Lunar and port it to Rust. this seems totally doable, just not something that will get done quickly.

I've found a short-term workaround though โ€” Lunar contains a CLI utility that can send DDC commands even on M1 machines. Using the external command feature of display-switch, it's possible to restore input-switching functionality by calling out to lunar. Might be worth noting in the main repo for any users having issues on M1.

sgade commented

I sadly am unable to contribute to the translation effort but would be willing to help test.

Making very slow progress trying to understand the code from https://github.com/alin23/Lunar and port it to Rust. this seems totally doable, just not something that will get done quickly.

I've found a short-term workaround though โ€” Lunar contains a CLI utility that can send DDC commands even on M1 machines. Using the external command feature of display-switch, it's possible to restore input-switching functionality by calling out to lunar. Might be worth noting in the main repo for any users having issues on M1.

Where is this CLI? There's ddcctl in the bin directory but that doesn't seem to support the M1. There's a Lunar binary inside the package contents of the app itself but it doesn't seem to take command line parameters that I can see. What did you work out?

The Lunar binary itself does some inspection of argv to determine if it should run in CLI mode. If I recall correctly, @ as the first argument causes it to run in CLI mode? (It's easiest to just put a shell script in ~/bin or something which calls Lunar.app with @ as the first argument and passes the remaining arguments)

and just FYI regarding my earlier comment, I'm not actively working on the M1 translation at the moment either. I switched to a monitor which doesn't seem to support DDC at all (ugh) so I'm not as motivated to get it working unfortunately

Thank you. I ended up getting my PC (second computer) to run display-switch and that works just as well it turns out.

Thanks guys, I've got my MBP M1 at work, will gather some courage to dive into this, and will try to fix.

@haimgel, any updates? I love this project!

Unfortunately, I didn't have the time to tackle this yet. Life got in the way :-(

bumping to say that I am interested in the solve as well.

https://github.com/waydabber/m1ddc

maybe this project can help us

Thanks for the tip @icepie, got display-switch working on my M1:

usb_device = "<DEVICE_ID>"
on_usb_connect_execute = "/usr/local/bin/m1ddc display <UUID> set input <n>"
on_usb_disconnect_execute = "/usr/local/bin/m1ddc display <UUID> set input <n>"

I'm not familiar with Rust so I just commented out the error-checking bits in display_control.rs and compiled it. External commands won't run if no DDC-compatible displays are found.

Unfortunately I can't use this workaround on my M2 Mac Mini: DDC only works over USB-C, not HDMI :(

here are some information that maybe helpful https://alinpanaitiu.com/blog/journey-to-ddc-on-m1-macs/

I was able to get display-switch working with this workaround on my M2 mac. Used Lunar instead of m1ddc as I already have Lunar installed.

Applied the changes from the above PR: haimgel/display-switch#137

Used these lunar commands in my config:

usb_device = "1a40:0101"

on_usb_connect_execute = "lunar displays external input displayport1"
on_usb_disconnect_execute = "lunar displays external input hdmi1"

What's the latest status on this issue?

Also looking for updates on this

Took me a while, but I've got this covered in #7 -- should work for M1/M2/M3, both DP and HDMI ports. I didn't test on M4, but it should work there as well.