jakehilborn / displayplacer

macOS command line utility to configure multi-display resolutions and arrangements. Essentially XRandR for macOS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to rotate screen on Monterey 12.1 - Mac mini M1

R-Gaurav opened this issue · comments

Hello there,

I have installed displayplacer using the instructions in this repo. After executing the displayplacer list command, I am getting the output command (mentioned below) which I am supposed to run to fix my two monitors' orientation. Following is the command:

displayplacer "id:17AD77BD-C20A-49CA-9008-6461D9BDA646 res:1920x1080 hz:60 color_depth:8 scaling:off origin:(0,0) degree:0" "id:BCD7365D-2867-440C-BFE4-97AEC319098C res:1080x1920 hz:60 color_depth:8 scaling:off origin:(1920,-546) degree:270"

However, upon executing the above command (with the screens' orientation currently messed up), I get the following error:

Error rotating screen BCD7365D-2867-440C-BFE4-97AEC319098C
Screen ID BCD7365D-2867-440C-BFE4-97AEC319098C: could not find res:1080x1920x60 color_depth:8 scaling:off

I have two Asus VG275Q monitors. Any suggestions on how to fix it? :).

I haven't figured this out yet but from what I can tell this is because IOKit has been deprecated on Apple Silicon.
https://github.com/glfw/glfw/blob/97da62a027794d9ff0f4512268cb9a73a8fb5073/src/cocoa_monitor.m#L44

I don't know if the problem is coming from

io_service_t service = CGDisplayIOServicePort(screenId);

or from

int retVal = IOServiceRequestProbe(service, options);

but it seems like one of these two functions (or maybe both) no longer works on Apple Silicon and I can't find a similar API in Apple's developer documentation. GLFW lists something about 10.15 introducing [NSScreen localizedName] instead but I'm not sure how that API is related. I'll keep looking but if anyone else finds something that would be awesome.

Hey @jrmoulton ! Thanks for your response!

There's some relief though with the latest update of Mac OS. I am on Monterey 12.2.1 (and of course M1, 2020). I see that with this update the issues of randomly switching orientations after a screen lock has become less frequent. And if at all the orientations are switched, I simply lock the screen again (i.e. click on the X button) and activate my screen again by either pressing any random key or clicking my mouse. The lock screen gets activated again in correct orientation, which makes it easier to simply enter the password and unlock it.

Just an extra hassle of locking again and unlocking the screen, but this is far better than me getting up and manually detaching and re-attaching the ports. Hope it is either permanently fixed from Apple's end soon someone finds a related API! I think we can probably close this issue for now.

@R-Gaurav Looks like we got the same issue. I found my two external monitors settings(same brand, same model) change to others randomly if I lock my screen and unlock it. I have to unplug the cable every time which is very annoying. I have no idea how to solve this...

Hey @HoweChen , as mentioned above, I am still facing the same random rotation issues, albeit with less frequency and easy fix up as mentioned above. I have recently upgraded my Mac to Monterey 12.3, although as mentioned in my previous comment, I had some relief since Monterey 12.2.1 . Try upgrading your OS version and see if it helps!

It is still happening for me with Monterey 12.3.1 and I also get the error rotating screen.

Happening on 2 ThinkVision P24h-10.

Hmm.. I am not sure how frequent this random screen rotation is on your set-up. But I am on Monterey 12.3 (not yet upgraded to 12.3.1) with 2 VG275Q ASUS monitors. For me, the issue is still there, but as explained above, it's quite infrequent and I am able to fix it without unplugging/plugging the monitors to my Mac mini.

That sounds good.

I observed that if I plug the monitors one after another only once the first screen is on, my Macbook Pro M1 understands which screen is which and does not mix up both screens.

We'll see if it's a durable solution or not.

Hope so!

I'm experiencing this issue too when changing orientation. But I don't follow what you guys are saying. It seems like you're saying latest OS release got better at remembering screen configuration and you don't need displayplacer as much, or you are saying that displayplacer seem to behave a bit better.

Personally, I can't figure for the life of me how this thing is supposed to work, but not sure if I'm too stupid or if there is an issue with Apple Silicon.

❯ displayplacer "id:D4D577DD-C8DD-4BDA-A60A-AB00D90E32D9 res:1920x1080 hz:60 color_depth:8 scaling:off origin:(-1920,152) degree:0"

Error rotating screen D4D577DD-C8DD-4BDA-A60A-AB00D90E32D9
Screen ID D4D577DD-C8DD-4BDA-A60A-AB00D90E32D9: could not find res:1920x1080x60 color_depth:8 scaling:off

Well, yeah, duh you'll find that resolution once you rotate the screen...

I'm experiencing this issue too when changing orientation. But I don't follow what you guys are saying. It seems like you're saying latest OS release got better at remembering screen configuration and you don't need displayplacer as much, or you are saying that displayplacer seem to behave a bit better.

Personally, I can't figure for the life of me how this thing is supposed to work, but not sure if I'm too stupid or if there is an issue with Apple Silicon.


❯ displayplacer "id:D4D577DD-C8DD-4BDA-A60A-AB00D90E32D9 res:1920x1080 hz:60 color_depth:8 scaling:off origin:(-1920,152) degree:0"



Error rotating screen D4D577DD-C8DD-4BDA-A60A-AB00D90E32D9

Screen ID D4D577DD-C8DD-4BDA-A60A-AB00D90E32D9: could not find res:1920x1080x60 color_depth:8 scaling:off

Well, yeah, duh you'll find that resolution once you rotate the screen...

I've never been able to figure it out either. Newer versions of macOS don't fix it for me. I've done quite a bit of digging and the issue is that Apple has deprecated a function and it just isn't supported (at least on some) Apple silicon. Apple's official response to others with the issue is that it is deprecated and there is no replacement. (I couldn't find the link).

@ybizeul well, my screens still switch their set orientations - but as you read.. it's quite infrequent now, on Monterey 12.3.1. I did install displayplacer earlier to help me out out, but it didn't help me due the above-mentioned reasons (I didn't remove it from my system though).

So it seems like, the latest OS release is better at remembering screen orientation, unless displayplacer has some role to play in it.. i.e. it uses some APIs which were somewhat fixed by Apple in their latest release. Let us know your experience too!

I'm having the same issue on 12.3.1 Monterrey M1 chip ("error rotating screen"). It is not at all "quite infrequent" and quite frequent for me. Unfortunately I see not solution to this beyond manually rotating periodically when I log back in.

Is this problem solved? Or is there any other way to sort monitors.

I desperately need a fix because my M1 Mac is annoying me every time my M1 Mac wakes up from hibernate the app windows are misplaced.

Is this problem solved? my computer is m1 MacBook Air.
arthurdeMacBook-Air:Downloads root# ./displayplacer "id:37D8832A-2D66-02CA-B9F7-8F30A301B230 res:1440x900 hz:60 color_depth:8 scaling:on origin:(0,0) degree:0" "id:890CAAC6-F3A6-981F-0857-D6964E3302DB res:1440x2560 hz:60 color_depth:8 scaling:off origin:(1440,-1162) degree:0"
Error rotating screen 890CAAC6-F3A6-981F-0857-D6964E3302DB
I do not know how to do, who can help me? thanks very much.

I don't think the problem is solved yet. I have mentioned all the steps I took to resolve this auto-rotation of screens and somehow it worked for me - in a way.. i.e. frequency of auto-rotation has decreased and I can simply re-login after pressing the cross sign in case the screen is rotated. The re-login fixes the screen orientation and I no longer have to manually unplug and plug the display cables.

Please note that I am connected to one ASUS montior directly via HDMI and another ASUS monitor (same model) with USB C to HDMI converter.

I haven't tested it out, but I surmise that if we connect monitors without converters in between e.g. HDMI to HDMI monitor input, USB C to USB C monitor input, such auto-rotation of screens shouldn't happen. I may be wrong here.

I use Displaylist for quickly setting my display configuration and BetterDisplay to mirror my second display into a window in my main display.

But I've noticed that BetterDisplay is able to rotate the displays consistently.

It seems there's an old open source branch there. I don't know the first thing about programming in macOS but, maybe the solution could be there?

https://github.com/waydabber/BetterDisplay

I use Displaylist for quickly setting my display configuration and BetterDisplay to mirror my second display into a window in my main display.

Probably a dumb Question but what is displaylist?

also do you know if there is a way to use automator or something else in conjunction with BetterDisplay to configure screen with a button press?

I use Displaylist for quickly setting my display configuration and BetterDisplay to mirror my second display into a window in my main display.

Probably a dumb Question but what is displaylist?

It's not a dumb question, it was just a mistake I made. Since I had been running displayplacer list non-stop trying to find a way to rotate my displays, my brain combined the two words into displaylist. Sorry about that.

By the way, in the last few betas of Ventura my issues seem to have gone away. Everytime my computer goes to sleep or I turn it off and on again the display configuration and placement stays the same. I hope this makes it to the official release.

also do you know if there is a way to use automator or something else in conjunction with BetterDisplay to configure screen with a button press?

Not that I know of, sorry.

Dupe of #105 (or vice-versa since this is older). But can you see if the solution posted in there works?

@R-Gaurav @jrmoulton @HoweChen @rfortmann-ewolff @ybizeul @DavisOwen @GanZhiXiong @huhu415 @ccarpiog @PastorHotdog M1/M2 screen rotation has been fixed in release v1.3.0. Could you try it out and let me know if it works on your setup?

@jakehilborn seems no one ever replied, but i was testing the latest release today with Apple Silicon, seems to work!

@jakehilborn cool it works, thanks that things what you do!🥳🥳

@jakehilborn I have setup an automator at login with the command (to be run) as the output of displayplacer list. Fortunately, that helps in correct arrangement of screens. Thank you!

I have changed my Mac Mini to 2018 one though (Intel based) and am on Sonoma 14.5.