Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

M1 mac mini display keeps losing scaling

I just got an M1 Mac mini, and it's great! Except for one annoying problem so far: whenever my Mac comes back from sleep, my display scaling is messed up.


I have two monitors connected to it, a 4K HDR by LG and a 1080p by HP. The 4K monitor is set to be scaled to be "like 2560x1440," and that one will occasionally reset to be "like 1920x1080." When this happens, if I go back to the Displays system preference page, it'll be set back to "default for display." If I set it to "scaled" again, it won't actually update the scaling unless I set it to a different size (like 3840x2160) and go back to 2560x1440.


Has anyone else experienced this issue, and is there any way to fix it so that my display settings stop getting messed up every time my machine wakes from sleep?


Mac mini, macOS 11.1

Posted on Jan 7, 2021 12:44 PM

Reply
Question marked as Best reply

Posted on Feb 4, 2021 7:19 PM

Figured out a workaround to restore display scaling for my Mac mini M1 and LG HDR 4K display, using Hammerspoon (watch for display wake) and displayplacer (set resolution). Works for Big Sur 11.2 - hopefully won't need it in future updates.


The quirky thing is that for it to work properly, I have displayplacer set to a smaller resolution first, and then the desired resolution immediately after. It switches so fast you don't even see the smaller res. Here's sample code for Hammerspoon.


function displayWatch(eventType)
	if (eventType == hs.caffeinate.watcher.screensDidWake) then
		hs.execute("/opt/homebrew/bin/displayplacer 'id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX res:2560x1440 hz:60 color_depth:8 scaling:on origin:(0,0) degree:0'")
		hs.execute("/opt/homebrew/bin/displayplacer 'id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX res:3008x1692 hz:60 color_depth:8 scaling:on origin:(0,0) degree:0'")
	end
end

displayWatcher = hs.caffeinate.watcher.new(displayWatch)
displayWatcher:start()

Similar questions

46 replies

Feb 4, 2021 7:50 AM in response to inzekt

Okay, those sound like pretty serious problems to me. I haven’t experienced anything like that, but those problems would be very frustrating to me as well.


But this forum thread is about one specific minor problem I have been having, and I would appreciate it if people would stick to discussing this problem. I’m sure there’s threads about the problems you’re having, and they also sound serious enough that you should be talking directly to Apple support and maybe returning the computer as defective.


In any case, don’t attack other users for not having the same problems as you or bot being aware of the problems you’re having.

Feb 4, 2021 7:45 PM in response to GVNYC

Ah, nice, Hammerspoon looks a lot easier to deal with than Sleepwatcher. And yeah you have to change the resolution out and back, or else the display system doesn't think there's any changes to apply (which is probably also why the manual System Preferences fix requires changing the scaling to something else before changing it back too).

Feb 6, 2021 1:16 PM in response to fluffy

I don't have a M1 Mac mini but I have not had any trouble with my Monitor and Big Sur. This must be a specific issue with M1 and some even report losing USB C ports altogether. I have to wonder if this could be a hardware issue as in a defect that is showing up since apparently nothing get's reported in beta testing. You would think with so many experiencing this that beta testing would have least reported this as a potential issue. I have to consider a hardware issue because it appears that issues occur no matter if you use HDMI or DisplayPort to connect to monitor. I That sort of follows back to a problem with graphic chip if you ask me.

Feb 6, 2021 1:21 PM in response to John Scott1

Possibly, and issues like these are why I was hesitant to jump over to Apple Silicon so quickly since all first-gen Apple machines have problems like these. But I was due for an upgrade and didn't want to be stuck on Intel.


My monitor is connected directly via HDMI but I've also had issues with my Thunderbolt dock disconnecting on sleep, which causes the OS to complain about unsafely disconnecting my Time Machine volume (which is connected via that dock). I haven't had any trouble with the USB-A ports, though, or with my directly-USB-C-connected NVMe drive.

Feb 18, 2021 10:54 AM in response to fluffy

I have this issue if i use my caldigit dock with my M1 mac Mini.


I have 2 Benq Monitors, 1 4k connected via display port via the caldigit dock, the other a 1080p connected via hdmi.

when coming back from sleep the content of both monitors would show on the 4k screen with a black bar at the bottom and the 1080p screen would also display as expected while it's displayed on the 4k monitor if that makes sense.

To fix it i either, power off the 4k monitor or change the scaling down to 1080p and back again.


i've since located the usb3 cable for the monitor and connected that directly to the thunderbolt port on the mac and i've not had the issue since.

So if you can connect that way give it a go.


Stu

Mar 11, 2021 4:25 PM in response to fluffy

Similar issue here.

M1 with an LG display 4k connected in hdmi.

When I turn on my mac mini from sleep, the display return on it’s default scale for a moment and the set correctly the “2560x1440” option.

The issue is that all the windows results smaller, and I must resize them everytime.

I hope they will fix very soon!

Mar 24, 2021 5:08 PM in response to nb1204

After starting up Hammerspoon you shoul dget a little hammer icon in your menu. Click on that and select "open config," then copy-paste the code into it. Then you'll need to open up Terminal and type "displayplacer list" and that'll give you the ID to put into the Hammerspoon configuration. For example, when I type "displayplacer list" it tells me (on the very last line)


displayplacer "id:98AD201D-167F-2937-3D19-FC1626C9B248 res:2560x1440 hz:60 color_depth:7 scaling:on origin:(0,0) degree:0" "id:1D8AB08D-7B12-48C9-0857-D6964E3302DB res:1920x1080 hz:60 color_depth:8 scaling:off origin:(2560,-60) degree:0"


so my screen ID is id:98AD201D-167F-2937-3D19-FC1626C9B248, so my resulting Hammerspoon config says:


displayWatcher = hs.caffeinate.watcher.new(function (eventType)
    for k,v in pairs(hs.caffeinate.watcher) do
        if eventType == v then
            print("Got display event: " .. k)
            break
        end
    end

    -- https://discussions.apple.com/thread/252282046?answerId=254547027022#254547027022
    if (eventType == hs.caffeinate.watcher.screensDidWake) then
        print("Refreshing screen resolution")
        hs.execute("/opt/homebrew/bin/displayplacer 'id:98AD201D-167F-2937-3D19-FC1626C9B248 res:3840x2160'")
        hs.execute("/opt/homebrew/bin/displayplacer 'id:98AD201D-167F-2937-3D19-FC1626C9B248 res:2560x1440'")
    end
end)
displayWatcher:start()

You can also make sure that displayplacer is working by selecting "console" from the hammerspoon menu and watch the log entries happen.

Mar 26, 2021 8:53 PM in response to nb1204

How did you install displayplacer? If you're getting "command not found" it means that it's not in your execution path. If you didn't install it using homebrew, try putting it in /usr/local/bin (which you can open in Finder by running "open /usr/local/bin" from Terminal).


Just closing the Hammerspoon window should be enough to make it run, yes. Also if you open the console you can see what error is happening when it tries to run. If you put displayplacer in a different location you'll need to change the script to point to it as well. The script I provided assumed you used Homebrew to install it (thus /opt/homebrew/bin) but if you put it in /usr/local/bin then it'll need to be /usr/local/bin/displayplacer.

M1 mac mini display keeps losing scaling

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.