MacPro7,1 = ASRock X570 ITX/TB3, 5900X, RX-570: chasing sleep/wake stability

AudioGod

Guru
Guru
Joined
Nov 7, 2020
Messages
1,386

atanvarno

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
228
That ssdt you are using is GPRW but with the file name changed…lol (I hate it when people do that)
Basically it’s the same solution as @atanvarno is using already.
I looked at this file and it honestly feels like more of the "splatter across the wall and see what sticks" approach :)

0x0D, 0x06, 0x09 etc...Basically set aside a day or two and get ready for lots of step-by-step testing and restarts.
 

AudioGod

Guru
Guru
Joined
Nov 7, 2020
Messages
1,386
I looked at this file and it honestly feels like more of the "splatter across the wall and see what sticks" approach :)

0x0D, 0x06, 0x09 etc...Basically set aside a day or two and get ready for lots of step-by-step testing and restarts.
It’s trying to be universal that’s why.
it works for him as is so I guess all good…lol
 

atanvarno

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
228
After much trial and error or various values, I decided to remove HibernationFixup.kext and start with initial XLNC's SSDT:

Code:
DefinitionBlock ("", "SSDT", 2, "XLNC", "GPRW", 0x00000000)
{
    External (XPRW, MethodObj)    // 2 Arguments

    Method (GPRW, 2, NotSerialized)
    {
        If (_OSI ("Darwin"))
        {
            If ((0x08 == Arg0))
            {
                Return (Package (0x02)
                {
                    0x08, 
                    Zero
                })
            }
        }

        Return (XPRW (Arg0, Arg1))
    }
}

This Zero instead of 0x04 as second argument was all that's needed. Much thanks to XLNC for taking the time to answer on Discord.

Note: TB3 is set in bios as Enabled (No Security) so that USB-C works, which is great, all my ports are working.
EFI on GitHub is updated with latest changes.

I noticed that sleep would sometime take 30+ seconds but it will eventually succeed. Wake was much quicker, mouse and keyboard would be available almost instantly while screen would appear after 5-10s. Screen taking longer is not unusual in my build, it's the same when booting, there's a similar delay between Apple logo going away and login screen appearing.
 

atanvarno

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
228
I have now enabled sleep by idle, so will see in upcoming days are there any issues.

Screenshot 2021-10-16 at 15.32.30.png
 

atanvarno

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
228
Well, this is interesting.

  • If I initiate Sleep from Apple menu, it reliably goes to sleep and wake (after few minutes) reliably works.
  • If I let it go idle and it goes to sleep on its own, sleep works but wake fails.
 

Aluveitie

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
895
@atanvarno Weird, USB functionality should not depend on the TB3 being enabled/disabled.
The port is connected to a USB controller and should be mapped as such.

At least it worked that way when I was using the board. I connected a USB-C display and USB+Video were working just fine with TB3 disabled.

Maybe try with Network Access disabled too.
 

atanvarno

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
228
@atanvarno Weird, USB functionality should not depend on the TB3 being enabled/disabled.
The port is connected to a USB controller and should be mapped as such.

At least it worked that way when I was using the board. I connected a USB-C display and USB+Video were working just fine with TB3 disabled.
I'll try again when I can, but XHCITR literally disappeared when I set it to Disabled in BIOS.
 

atanvarno

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
228
Just tried again, switching Thunderbolt support from Enabled (No Security) to Disabled. This on BIOS P3.00

Screenshot 2021-10-17 at 10.02.27.pngScreenshot 2021-10-17 at 12.30.52.png
 

Aluveitie

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
895

atanvarno

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
228
With BIOS 3.0, this is how it behaves:

By default (no USBmap.kext), XHCITR has 4 ports. When I connect external USB-C disk to it (in Windows), only one of those ports (0x03) lights up, showing USB 3.0 or 3.1 speeds. That's the port from my first screenshot.

When I connected external USB hub, USB3.0 port was that same one, accompanied by USB 2.0 port 0x04 on XHC0.

I mention Windows because I was mapping using USBtoolbox.
 

atanvarno

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
228
I am getting somewhere with sleep/wake.

I hazily recall reading somewhere that WEG can cause sleep/wake issue. So decided to try without it. The only reason I added it is that its unfairgva=0x01 fixes Safari+Netflix and TV+ DRM issues.

After multiple software sleep (choose Sleep in Apple menu) and idle sleep (letting machine go to sleep along with the display) attempts I can tentatively conclude that WEG patching is indeed the culprit for wake issues: every one of those sleep/wake tries was working. I still needed to press mouse or keyboard few times, but that's really irrelevant.

So I picked up WEG source code to look what it actually does. Looking at commit that implements unfairgva all it seem to be doing is enforcing board-id to be the same as iMacPro1,1, where it's known that all DRM stuff works:

Code:
DBGLOG("unfair", "setting hwgva-id to iMacPro1,1");
entry->setProperty("hwgva-id", const_cast<char *>("Mac-7BA5B2D9E42DDD94"), static_cast<uint32_t>(sizeof("Mac-7BA5B2D9E42DDD94")));

There's more C++ code which I can't understand, but this looks to be the crux of the unfairgva. Given that I never had success with sleep/wake on iMacPro1,1 SMBIOS, this DRM fix may also cause issues with sleep on AMD.

I wonder if this hwgva-id setting can be done with SSDT or through DeviceProperties somehow...if that is all it's doing.
 

AudioGod

Guru
Guru
Joined
Nov 7, 2020
Messages
1,386
i used to use WEG forever up until I got my RX 6800 and never had any sleep issues using the DRM boot argument so theres a flaw in your thinking over it. It’s a ASRock thing as there’s to many user cases of sleep being a problem on ASRock boards.
By the way if your not using WEG then DRM should be working across the board for you.
I have everything including Apple TV working perfectly fine without it. 👍
 

atanvarno

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
228
By the way if your not using WEG then DRM should be working across the board for you.
I have everything including Apple TV working perfectly fine without it. 👍
I expected that too but it is not.

  • Just tried and Netflix works in Safari (it did not before). Thus some of the changes I did in last 2-3 weeks fixed that. Wish I knew what exactly.
  • AppleTV+ remains an issue. Plays audio but video is just series of vertical green lines, regardless of the show.
 

AudioGod

Guru
Guru
Joined
Nov 7, 2020
Messages
1,386
I expected that too but it is not.

  • Just tried and Netflix works in Safari (it did not before). Thus some of the changes I did in last 2-3 weeks fixed that. Wish I knew what exactly.
  • AppleTV+ remains an issue. Plays audio but video is just series of vertical green lines, regardless of the show.
I’ve tried Netflix, Amazon, Apple TV, Disney Plus and they all work with no DRM arguments and WEG disabled but mind you I’m using a 6800 and a 6900 XT before that so I can’t speak for Polaris or Navi GPUs, Should be the same deal though using a Navi.
 

atanvarno

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
228
i used to use WEG forever up until I got my RX 6800 and never had any sleep issues using the DRM boot argument so theres a flaw in your thinking over it. It’s a ASRock thing as there’s to many user cases of sleep being a problem on ASRock boards.
I agree it's ASRock ACPI as root cause. ACPI is what all these fixes and patches lean on. Thus some patching may cause different consequences on ASRock than on Asus or Gigabyte.

Hence I'm trying to make do with what I have :) and am eliminating potential factors. I don't know what else is WEG doing (apart from unairgva which I asked of it) thus my desire to try and replicate unfairgva with just SSDT or device-properties or some other patch without the rest of WEG.
 

atanvarno

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
228
I've upgraded my BIOS to 3.20 (from 3.00). I figured why not — it's few months out now, if there were any issues it would be withdrawn.

Reverted back to WEG being active and so far - things are looking good. Multiple random sleep / wake cycles, all working fine. So 🤞🏻
 

atanvarno

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
228
In the last day, I had about 15+ successful wake / sleep cycles and 2 instances 😒 of something locking up (which requires turning wall-power off).

It's really annoying that I can't figure out what is causing the issue, because nothing changes between successes and failures. Nothing is attached or detached from the machines, it's always the same components and accessories attached.
 

Aluveitie

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
895
To brighten up, Monterey Beta 10 brings new issues with internal Bluetooth not working on wake up :D
 

atanvarno

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
228
To brighten up, Monterey Beta 10 brings new issues with internal Bluetooth not working on wake up :D
Joooolly nice.

My rule of thumb is "wait for macOS .2 before upgrading, wait for iOS .1 before upgrading" thus I hope Monterey issues will be fixed by Apple until then. ;)
 
Top Bottom
  AdBlock Detected
Sure, ad-blocking software does a great job at blocking ads, but it also blocks some useful and important features of our website. For the best possible site experience please take a moment to disable your AdBlocker.