Fix shutdown issue

stefancosd

New member
AMD OS X Member
Joined
Dec 19, 2021
Messages
26
Currently my MacOS 11.6.3 restarts after I shutdown the system.

I found this solution that could fix it:

So what I tried is to creating a FixShutdown-USB-SSDT.aml but it does not work as expected.

Hopefully someone of you can tell me what I am missing.

Steps I took:

I dumped a DSDT file (see attachment), and based on the this file, I adjusted the FixShutdown-USB-SSDT.dsl file to this:

Screenshot 2022-02-08 at 14.24.49.png


After that I created the .aml file, put it in the OpenCore ACPI folder, and added the plist values from FixShutdown-Patch.plist to my config.plist (https://github.com/dortania/OpenCore-Post-Install/blob/master/extra-files/FixShutdown-Patch.plist)

Now when I shutdown my system, it still restarts.

Did I used the wrong value in my .dsl file or what is wrong?

Thanks in advance for your help.


PS. the motherboard I have is a Gigabyte Aorus Ultra x570 (don't know if it is relevant)
 

Attachments

  • DSDT.zip
    10 KB · Views: 4
  • Result FixShutdown-USB-SSDT.aml.zip
    866 bytes · Views: 4

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,373
Have you created a custom USB configuration for your system? Either a USBPorts.kext, USBMap.kext or SSDT-UIAC.aml? Is it set correctly?

Not having a custom USB config, or having one that is incorrectly set are common causes of Sleep/wake issues.

You must have stopped searching in your DSDT.aml when you found the section in the screenshot you posted above, as there are other XHC related sections in your DSDT.aml, which you haven't included in the SSDT. Search for XHC in your bios and these sections will be found.

Screenshot 2022-02-08 at 13.38.49.png

Screenshot 2022-02-08 at 13.37.42.png

Screenshot 2022-02-08 at 13.38.16.png

Screenshot 2022-02-08 at 13.38.32.png

Your system may need all these sections included in the SSDT if it is to work. The example you followed was probably for an Intel system, which normally has just the one main XHC_ entry. AMD systems commonly have two or more USB controllers.

What does the Hackintool > USB tab show for your system?
 

stefancosd

New member
AMD OS X Member
Joined
Dec 19, 2021
Messages
26
Thanks for your response @Edhawk

Besides the aml file I just created, I am using 4 SSDT files (which I found over here:)

  • SSDT-USBX (USB power tables)
  • SSDT-PLUG (CPU power management)
  • SSDT-SBRG (Correcting EC, RTC memory & IRQ conflicts)
  • SSDT-SBUS-MCHC (SMBus Support)
  • SSDT-XHC (USB rename's)

I don't use an USBMap.kext file. I tried to create it, but I felt in unexpected issues (for example mouse/keyboard that didn't respond anymore).

I tried to make a USBMap using hackintool and using https://github.com/corpnewt/USBMap.

What I am missing is some documentation how to do it properly for AMD systems. I couldn't find it.

Here is a screenshot of the USB section in hackintool:



Screenshot 2022-02-08 at 15.02.25.png
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,373
Are you Enabling the XhciPortLimit quirk in your config.plist?
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,373
OK, just checking it wasn't enabled.
 

stefancosd

New member
AMD OS X Member
Joined
Dec 19, 2021
Messages
26
I just did a new try to create a USBMap using Hackintool and it seems working well this time:

Screenshot 2022-02-08 at 20.43.53.png


Unfortunately, the restart after shutdown still happens. So I probably still need the shutdown aml but I have no idea how to do that properly.
Is there a guide somewhere that could help?
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,373
Ok, your ports look to be set with the wrong connector Types. As you have more than one USB controller you are not limited to 15 ports. Each USB controller can theoretically contain 15 ports, so running with 30 active ports between the three USB controllers in your setup would not be wrong.

When you were undertaking the USB port discovery, did you make a note of which port was activated when you inserted a USB2, pen drive, a USB3 pen drive or a Type-c device?

Your Motherboard contains the following USB ports:

Screenshot 2022-02-08 at 19.44.01.pngThis gives a total of 30 USB ports split between the three USB controllers

This should match with your Hackintool Usb tab's display. It does in number when looking at the image in post #3. not so with the mage shown in post #7. Neither image looks correct with regards connector types.

You should have the following connector Types in your config:
  • 4 x USB2 physical ports - set with USB2 port type
  • 4 x USB2 headers - set as Internal port type (assuming both headers are fully populated)
  • 2 x USB3 Gen3.2 headers (4 x USB2 & 4 x USB3 ports) - all set as USB3 port type (assuming both headers are fully populated)
  • 1 x Type-c header (2 x Type-c ports) - set as type-c or type-c+sw (depending on how the case front ports react when a type-c device is inserted explained below)
  • 1 x type-c Gen2 port (2 x Type-c ports) - set as type-c or type-c+sw (depending on how the case front ports react when a type-c device is inserted explained below)
  • 1 x USB3.2 Gen2 port Type-A Red (1 x USB2 & 1 x USB3 ports) - both set with the USB3 port type
  • 1 x USB3,2 Gen2/1 port Type-A Red ( 1x USB2 & 1 x USB3 ports) - both set as USB3 port type
  • 3 x USB3,.2 Gen1 ports (3 x USB2 & 3 x USB3 ports - all set with the USB3 port type
Therefore your USB config should contain the following:

4 x Internal port types (max depending on whether both USB2 headers are populated)
4 x USB2 port types
18 x USB3 port types (max depending on whether both USB3 headers are populated)
4 x Type-C port types (with or without switch) (max depending on whether the Type-c Header is populated)

These are the standard USB port types:
Screenshot 2022-02-08 at 20.12.28.png

The way to tell if a port is Type-c or Type-c+sw is as follows:

Screenshot 2022-02-08 at 20.13.25.png Flipping means turning the device 180 degrees and reinserting.

Here are two images you can use to identify the USB ports in your system:

Screenshot 2022-02-08 at 19.44.31.png Gigabyte Aorus Ultra x570 Motherboard image

Screenshot 2022-02-08 at 19.44.51.png Gigabyte Aorus Ultra x570 Rear I/O plate image
 

stefancosd

New member
AMD OS X Member
Joined
Dec 19, 2021
Messages
26
Thanks again for your response.

I will retry to make a USBMap in the upcoming days and will post the result.
 

stefancosd

New member
AMD OS X Member
Joined
Dec 19, 2021
Messages
26
Does this mapping make sense?

I used this tool for it: https://github.com/corpnewt/USBMap

The Devices I used to identify the ports are:

  • USB 3.0 USB stick (name below = Ultra)
  • USB 2.0 USB stick (name below = Flash Card Reader/Writer)
  • USB-C cable connected Samsung Portable SSD T5 (name below = Portable SSD T5)
  • USB-C cable connected phone (name below = Mi 9T Pro)
I am not sure what the ITE Device(8595) is, but from what I found on internet is that it could be RGB stuff. I don't use that at all, but I thought type 255 (internal) makes sense for it.

Screenshot 2022-02-09 at 17.30.39.png

Here you can see the USB Types I could choose
Screenshot 2022-02-09 at 21.06.59.png
 
Last edited:

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,373
No, it is not correct.
  • The two Type-c ports XHC1 > PRT2 and PRT6 are set as if they were USB ports ON a Phone. This is wrong.
  • XHC1 > PRT7 and PRT9 are the corresponding USB3 ports for the Type-C connectors.
  • All four ports should all be set as Type 10
As shown below.

Screenshot 2022-02-09 at 20.21.11.png Mainly seen in phones, does not mean the type to use when you connect a phone, ignore the Type 8 option.
  • You have 7 x USB2 (0) ports in your setup above, when your system only has 4 x USB2 physical ports.
  • At least three of the ports set with type (0) should be set as type USB3 (3), assuming they are the virtual USB2 side to a physical USB3 port.
  • More should be changed if you are not activating all 4 of the USB2 physical ports on the rear I/O plate.
  • You have two USB2 header ports identified, this is fine if you are only using one physical header port, or you have both header ports in use but only one port from each header is active.
Just to confirm:
If you are testing a physical USB3 port it will have two sides. A Physical USB3 side and a Virtual USB2 side. BOTH sides need to be set as Type (3), as they are both served from the Physical USB3 port.

Only a physical USB2 port should be set with the type (0) USB2. No other ports should be set with this type.

Each USB2 header port will support/provide 2 x Internal ports, so your system with 2 x USB2 header port will support 4 x USB2 ports, which have to be set as Internal (255)

Oddly enough, USB3 header ports each support 4 ports, 2 x USB2 (virtual) and 2 x USB3 physical. As your system contains 2 x USB3 headers they can support/provide a total of 8 ports. All of which would need to be set with the type (3).

Questions:
  1. Did you test each and every port with the USB Flash card reader (assumed to be a USB2 device)?
  2. Did you test each and every port with the USB3 Ultra drive?
  3. Did you test each of the USB Type-c ports with the Portable SSD T5?
  4. Did you 'Flip' the Type-C connector 180 degrees and reinsert it in to the type-c connector on the rear I/O plate & case front?
It matters not if you tested any of the ports with the phone, as that is a waste of time, and an incorrect device to use.
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,373
Also under XHC0 you only have 13 ports active.

You can activate 15 ports within the XHC0 controller and all 10 of the ports under the XHC1 controller.
 

AMDPUSH

Donator
Donator
AMD OS X Member
Joined
May 2, 2020
Messages
275
If i remembered me, 2 other solutions can be explored.
1/ in the bios seting
2/ like me, i have an usb powered interface, and as i unplugged it, i can shutdown the computer without any pb
 

tatofuma

Member
AMD OS X Member
Joined
Jan 20, 2021
Messages
54
Currently my MacOS 11.6.3 restarts after I shutdown the system.

I found this solution that could fix it:

So what I tried is to creating a FixShutdown-USB-SSDT.aml but it does not work as expected.

Hopefully someone of you can tell me what I am missing.

Steps I took:

I dumped a DSDT file (see attachment), and based on the this file, I adjusted the FixShutdown-USB-SSDT.dsl file to this:

View attachment 5044


After that I created the .aml file, put it in the OpenCore ACPI folder, and added the plist values from FixShutdown-Patch.plist to my config.plist (https://github.com/dortania/OpenCore-Post-Install/blob/master/extra-files/FixShutdown-Patch.plist)

Now when I shutdown my system, it still restarts.

Did I used the wrong value in my .dsl file or what is wrong?

Thanks in advance for your help.


PS. the motherboard I have is a Gigabyte Aorus Ultra x570 (don't know if it is relevant)
Look for ERP on your BIOS. It must be DISABLED
 
Last edited:

stefancosd

New member
AMD OS X Member
Joined
Dec 19, 2021
Messages
26
@Edhawk, first of all, thanks for the time you take to respond to my issue.

I plugged the usb sticks + external ssd in all available usb ports and this is the result (see image)

Is this more accurate (including the port types i've set?)

I've put the usb-c port device twice in every usb-c port (Second time 180 degree cable flipped). Flipping did not change the port.
The usb sticks i've put in every USB port

It seems the USB2 ports are available using USB2.0 hubs only.

Note that port 2 and 5 are not populated anymore now I haven't connected my phone using an usb-c port.

The Devices I used to identify the ports this time are:
  • USB 3.0 USB stick (name below = Ultra)
  • USB 2.0 USB stick (name below = Flash Card Reader/Writer)
  • USB-C cable connected Samsung Portable SSD T5 (name below = Portable SSD T5)

Answers to your questions:
  1. Did you test each and every port with the USB Flash card reader (assumed to be a USB2 device)? YES
  2. Did you test each and every port with the USB3 Ultra drive? YES
  3. Did you test each of the USB Type-c ports with the Portable SSD T5? YES
  4. Did you 'Flip' the Type-C connector 180 degrees and reinsert it in to the type-c connector on the rear I/O plate & case front? YES


Screenshot 2022-02-10 at 18.38.20.png
 

Attachments

  • Screenshot 2022-02-10 at 15.41.21.png
    Screenshot 2022-02-10 at 15.41.21.png
    213.4 KB · Views: 13
Last edited:

stefancosd

New member
AMD OS X Member
Joined
Dec 19, 2021
Messages
26
If i remembered me, 2 other solutions can be explored.
1/ in the bios seting
2/ like me, i have an usb powered interface, and as i unplugged it, i can shutdown the computer without any pb
What should I change in the bios according to you? I checked all the settings multiple times and couldn't find a setting that could trigger this (or I missed something)
 

stefancosd

New member
AMD OS X Member
Joined
Dec 19, 2021
Messages
26
Also under XHC0 you only have 13 ports active.

You can activate 15 ports within the XHC0 controller and all 10 of the ports under the XHC1 controller.
What is the benefit of that? Since I can't identify the port type yet.

I assume I need to do the mapping again when I plugin new cables to the usb connectors on my motherboard in the future
 
Last edited:

tatofuma

Member
AMD OS X Member
Joined
Jan 20, 2021
Messages
54
I don't want to disable ERP, because it will prevent the device will shutdown completely and my keyboard backlight will flicker in that case.
I know, but it was the only solution to the problem for me. I also have an Aorus
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,373
  1. Which of the Ports are associated with the 4 x Physical USB2 ports on the rear I/O plate?
    1. The 4 ports should be set with the connector type 0.
    2. None of the Ports in the screenshot above are set as USB2 (0)
  2. The ITE hub how is that identified, i.e which physical port are you connecting a USB Device to when it is discovered?
    1. Is it a Case Front port connected to an internal header port? Or
    2. An LED USB that is automatically activated, with you not needing to do anything?
One wrongly set USB port will mess with your USB port configuration and can cause Sleep/Wake issues and unexplained kernel panics.
 
Back
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.