Code Monkey home page Code Monkey logo

Comments (9)

adams-family avatar adams-family commented on June 11, 2024 15

I made some debugging and I discovered the following:

  • the format of the two Preferences files (Monterey and Big Sur) are different, that's where the code fails as it's expecting a key in the dictionary that does not exist
  • even if I remove the code that's trying to parse the Preferences file, the IOServiceGetMatchingServices function is returning an empty iterator, so I'm not able to get through

However, I have a good news for you and for myself, as well: there is a tool called m1ddc which is very short, very straightforward and working fine on M1 and Monterey (I'm using it right now), so that could serve you as a reference. Hope it helps!

from ddcctl.

azubala avatar azubala commented on June 11, 2024 2

@adams-family thanks for sharing the m1ddc tool!

from ddcctl.

kfix avatar kfix commented on June 11, 2024 1

I'll look into removing or fixing that code but M1s are not supported yet so this is the least of your issues.

from ddcctl.

adams-family avatar adams-family commented on June 11, 2024

Ok, I think this might be the file we are looking for?

/Library/Preferences/com.apple.windowserver.displays.plist

from ddcctl.

adams-family avatar adams-family commented on June 11, 2024

All right, I confirm that even if I change the file path to the above, the app is still failing with:

2022-02-14 16:08:21.539 ddcctl[6486:275857] D: CGDisplay C1BE29A5-BFC9-4EDA-82B0-1E638BB772F7 dispID(#2) (1920x1080 0°) HiDPI
2022-02-14 16:08:21.539 ddcctl[6486:275857] -[NSTaggedPointerString countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x96e7084facc55e4e
2022-02-14 16:08:21.539 ddcctl[6486:275857] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x96e7084facc55e4e'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001a8f2c1cc __exceptionPreprocess + 240
	1   libobjc.A.dylib                     0x00000001a8c7d7b8 objc_exception_throw + 60
	2   CoreFoundation                      0x00000001a8fbf1a0 -[NSObject(NSObject) __retain_OA] + 0
	3   CoreFoundation                      0x00000001a8e8c360 ___forwarding___ + 1728
	4   CoreFoundation                      0x00000001a8e8bbe0 _CF_forwarding_prep_0 + 96
	5   ddcctl                              0x0000000100c8b6bc getDisplayDeviceLocation + 428
	6   ddcctl                              0x0000000100c8c074 main + 852
	7   dyld                                0x0000000100d9d0f4 start + 520
)
libc++abi: terminating with uncaught exception of type NSException
Abort trap: 6

Which has been reported here:
#86

And I also found that my issue has already been reported here:
#114

Sorry for the duplicates. I'd love to help solving this, problem is my C programming skills are very limited.

from ddcctl.

vizcay avatar vizcay commented on June 11, 2024

However, I have a good news for you and for myself, as well: there is a tool called m1ddc which is very short, very straightforward and working fine on M1 and Monterey (I'm using it right now), so that could serve you as a reference. Hope it helps!

Unfortunately no luck for us using HDMI displays:

Please note that controlling a HDMI display via the 2020 M1 Mini's HDMI port is not working. You have to use DisplayPort over USB-C!

from ddcctl.

luco avatar luco commented on June 11, 2024

Getting this as well on i5 Mac Mini

from ddcctl.

Takdrift avatar Takdrift commented on June 11, 2024

I made some debugging and I discovered the following:

  • the format of the two Preferences files (Monterey and Big Sur) are different, that's where the code fails as it's expecting a key in the dictionary that does not exist
  • even if I remove the code that's trying to parse the Preferences file, the IOServiceGetMatchingServices function is returning an empty iterator, so I'm not able to get through

However, I have a good news for you and for myself, as well: there is a tool called m1ddc which is very short, very straightforward and working fine on M1 and Monterey (I'm using it right now), so that could serve you as a reference. Hope it helps!

m1ddc is perfect for M1 MacBook Pro, and you can change the input of display by just using a shortcut by automator, cheers!

from ddcctl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.