zearp / OptiHack

Dell OptiPlex 7020/9020 Hackintosh Stuff
https://zearp.github.io/OptiHack/
155 stars 53 forks source link

Lag after boot with new SMBIOS (MacMini7,1) #50

Closed Bresjee99 closed 3 years ago

Bresjee99 commented 3 years ago

I recently converted my Optiplex 9020 to the newest release with SMBIOS MacMini7,1 to be more compatible with Monterey. But the first 10 to 15 seconds after a fresh boot, the system is really laggy in Big Sur. I reverted my EFI to the SMBIOS iMac15,1 version and the lag immediately disappeared.

I'm using a 4790 with igpu only, combined with 24gb of ram and Samsung EVO 860 SSD.

zearp commented 3 years ago

Disregard anything I wrote in here earlier. I think I found the culprit but it will require some testing to see if the solution can be easy or has to involve some extra configuration steps depending on which SMBIOS is used. I hope the former can be done.

Bresjee99 commented 3 years ago

Thanks for diving in immediately. I've read your earlier posts in the mail.

If something needs to be tested, I'm here to help! I can swap my SSD's anytime

I've already did some testing with a spare SSD and a clean install. If I swap the EFIs between MacMini7,1 and iMac15,1 I can trigger the lag by that. (all on Big Sur 11.2.1, freshly installed)

zearp commented 3 years ago

Some small updates after running some tests and a bunch of reboots. I did my testing on Monterey might try some on Big Sur later but my focus is on getting ready for Monterey which will be out in a few months.

Dual screen: does not work properly at all using the Mac mini SMBIOS. It's either glitchy or crashes/panics. Some settings result in two black screens but remote desktop works fine. With others the boot just stalls. I've cycled trough all the bus-ids but nothing would give me fully working dual screens. Not sure what is needed to get this work on the Mac mini SMBIOS. It shouldn't be impossible though.

Single screen: all is fine and getting rid of the lag was relatively easy; disable the frame buffer on con0 (vga) and the lag is gone. I added all 3 connectors to the config and hopefully set them up correctly. Both DisplayPorts work too, just not at the same time for now. Audio over both also works, so it doesn't matter which of the DisplayPorts we use. With previous frame buffer configs audio would only work on one of the ports. I think that was fixed by using the same flags for both connectors.

I'll post my test frame buffer below.

zearp commented 3 years ago

fb

The fixes only apply to some edge cases, like some brands of screen don't turn back on after wake unless force-online is enabled. I tried with and without those fixes and they don't seem to do any harm. Dual screen problems remain even with the fixes removed.

The fbmem and stolenmem options might not be needed as well, but I think it did fix some 4k related things and also matches the dvmd-pre allocation to the 64mb we changed it to. It also doesn't seem to hurt anything.

                        <key>PciRoot(0x0)/Pci(0x2,0x0)</key>
                        <dict>
                                <key>AAPL,ig-platform-id</key>
                                <data>AwAiDQ==</data>
                                <key>disable-external-gpu</key>
                                <data>AQAAAA==</data>
                                <key>disable-hdmi-patches</key>
                                <data>AQAAAA==</data>
                                <key>enable-hdmi20</key>
                                <data>AAAAAA==</data>
                                <key>enable-max-pixel-clock-override</key>
                                <data>AQAAAA==</data>
                                <key>force-online</key>
                                <data>AQAAAA==</data>
                                <key>framebuffer-con0-enable</key>
                                <data>AQAAAA==</data>
                                <key>framebuffer-con0-alldata</key>
                                <data>AQAJAAEAAAARAAAA</data>
                                <key>framebuffer-con1-enable</key>
                                <data>AQAAAA==</data>
                                <key>framebuffer-con1-alldata</key>
                                <data>AgQKAAAEAACHAAAA</data>
                                <key>framebuffer-con2-enable</key>
                                <data>AQAAAA==</data>
                                <key>framebuffer-con2-alldata</key>
                                <data>AwYIAAAEAACHAAAA</data>
                                <key>framebuffer-fbmem</key>
                                <data>AAAAAw==</data>
                                <key>framebuffer-patch-enable</key>
                                <data>AQAAAA==</data>
                                <key>framebuffer-stolenmem</key>
                                <data>AAAABA==</data>
                                <key>hda-gfx</key>
                                <string>onboard-1</string>
                        </dict>

I don't know how to fix dual screen on the Mac mini SMBIOS but it must be possible. I'll test dual screen on Big Sur and the two iMac SMBIOS with the frame buffer above as well. Hopefully sometime this week. At leats the cause of the lag was found and fixed. Dual screens is something for another day to try and fix. It could even be a bug or a change in Monterey breaking dual screens and may need a WhateverGreen update or something else. Time will tell.

Let me know if disabling con0 fixes it for you too!

zearp commented 3 years ago

Added the connectors to the repo's config too: https://github.com/zearp/OptiHack/commit/03df443dd58acfa12e2b83d548ca7758f443619d

zearp commented 3 years ago

Closing as it has been resolved and the trouble making frame buffer has been removed here: https://github.com/zearp/OptiHack/commit/486d7d91b7b4826bc68ad8bebcdd52a2095bde94

This might also sort out other (weird) issues that were caused by that frame buffer being active.