Closed christianhuening closed 10 months ago
This is unfortunate, sorry to hear that. A few questions:
@haimgel
ddcctl (master) ✔ ./ddcctl -h (christian.huening-prod/kit-system)
D: NSScreen #751428481 (2560x1440 0°) 109.00 DPI
D: NSScreen #441056002 (2560x1440 0°) 109.00 DPI
I: found 2 external displays
2020-10-01 09:10:37.197 ddcctl[99479:1285798] ddcctl 0.1x - Usage:
Same for me:
./ddcctl -d 1 -i 17
D: NSScreen #724847437 (2560x1440 0°) 118.00 DPI
I: found 1 external display
I: polling display 1's EDID
I: got edid.serial: 9X2VY63516WL
I: got edid.name: DELL U2515H
D: action: i: 17
D: setting VCP control #96 => 17
Mac is connected to monitor through USB-C Digital AV Multiport Adapter, on hdmi1 port.
It seems that system hangs when program enters https://github.com/haimgel/ddc-macos-rs/blob/main/src/iokit/io2c_interface.rs#L94 . It does not happen always but often. If there is more info which I could provide please let me know.
I'm also seeing this issue running on a 2018 Mac Mini, Intel UHD Graphics 630 1536 MB.
ddcctl does work for me on this machine, but I'm looking to switch inputs based on USB devices being plugged in, so I was hoping to be able to use display-switch.
Have the modifications made by @michalskalski been incorporated into this project? TIA!
@abnovak Hi I did not proposed back my change here, because I don't fully understand the cause of this issue. Found some similar problems in ddcctl project, but I wanted to better understand sequence of events which leads to kernel panics. I will try come back to it this week.
Excellent, thanks @michalskalski. I'm happy to test anything if you need it, just let me know.
@michalskalski great investigation! Did the change that you did fixed the issue reliably?
I've also found this thread, which hints that AMD and Intel video drivers treat this delay at a different scale, e.g. AMD considers it to be nanoseconds and Intel treats it as milliseconds...
I think this is best handled at run-time, rather than as a build-time configuration setting. E.g. this will necessitate detection of the video hardware driver type, and setting the appropriate delay.
Unfortunately, I won't have time to dig deeper into this in the next few weeks, and don't have the hardware to test, but will review/accept PRs.
I tried to test @michalskalski's solution, but it still caused the freeze me.
~However, my Rust knowledge is close to zero, so could someone check if the following change is sufficient to apply his patch:~
Alright, the previous attempt was wrong. I tried it again with a properly "patched" dependency, but it still caused a freeze... 😢
# THIS STILL DOESN'T HELP
[patch.crates-io]
ddc-macos = { path = "../ddc-patch" }
After stepping through the code, I can confirm that it's definitely crashing on the I2C request, even with the patch. https://github.com/haimgel/ddc-macos-rs/blob/main/src/monitor.rs#L227
Same issue on MacBook Pro Late 2013
with Big Sur 11.6
Looks like this issue is no longer present (at least in recent-gen Macs), and I cannot reproduce it. Closing.
Hi, when running display-switch 0.3.0 on macOS 10.15.7 and i have monitors connected via HDMI, my mac goes into a complete freeze and won't wake up anymore. Only unplugging the monitors and hard-rebooting it, solves the issue.
The logs have this to say: