haimgel / display-switch

Turn a $30 USB switch into a full-featured multi-monitor KVM switch
https://haim.dev/posts/2020-07-28-dual-monitor-kvm/
MIT License
2.83k stars 110 forks source link

Issues on macOS - Maybe M1 is to blame? #71

Open robpneu opened 2 years ago

robpneu commented 2 years ago

I'm on a MacBook Pro 14" (M1 Pro) so maybe these just aren't supported yet? I haven't been able to run it yet and I've encountered the following issues

  1. The pre-compiled binary was not executable so I had to make it executable manually with chmod (ie I couldn't just "right click and Open" as I was expecting)
  2. When running it from the terminal it can't seem to find the lsusb library. /usr/local/opt/libusb/lib/libusb-1.0.0.dylib Referenced from: /Users/robpneu/Downloads/display_switch Reason: tried: '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/usr/local/lib/libusb-1.0.0.dylib' (no such file), '/usr/lib/libusb-1.0.0.dylib' (no such file)

Any ideas? I installed lsusb and libusb from brew, but no luck so far.

blaenk commented 2 years ago

Just adding in case it helps, I just ran cargo build --release and it succeeded and running it from the terminal also succeeded. My problem is that it's outputting that no DDC-compatible monitors were found, but I'm not sure if that is or isn't a bug (I have three LG 27GL850-B monitors).

Anyway, don't mean to hijack the issue, just letting you know that it at least seems to run for me also on an MBP 14" M1 Max. I'm not sure what precompiled binary you're referring to.

haimgel commented 2 years ago

Yes, unfortunately, M1 SoCs are not supported at this time: this is being tracked in https://github.com/haimgel/ddc-macos-rs/issues/2

In general, if you use a pre-built binary from the pipeline in this repo, it will be an x86-only binary, and it will need an x86 libusb. The one @robpneu built with Homebrew is native ARM I presume, and it won't be compatible.

If you build display-switch from source on an M1 Mac, like @blaenk did, it will build as ARM binary and run successfully, but due to the lack of M1 SoC support it won't be able to control your monitors.

I currently don't have an M1 mac to tackle any of this, but I should get one through my employer towards the end of the year, and might be able to look into this issue, if nobody contributes a working patch by then.

robpneu commented 2 years ago

Thanks!

I'd grabbed the binary from the pipeline. I knew it was x86 but was hoping Rosetta would just handle it, which I guess it did but that doesn't fix the mismatch with the usb library nor the ddc.

I'll look into the ddc on M1 issue.

sgade commented 2 years ago

Having done the same steps and run into the exact same issues, how about adding a reference to this issue to the README while it is ongoing? This would clarify the situation for new M1 users.

haimgel commented 2 years ago

Good point, I've updated the readme.

chx commented 1 year ago

Please update the readme further: there's now a workaround in https://github.com/haimgel/ddc-macos-rs/issues/2#issuecomment-1356873695

Dentrax commented 2 months ago

Hey @haimgel, is this issue still the case?