Question About Creating DDSTs

OG Nerd

OG Nerd
Donator
Joined
Dec 7, 2021
Messages
226
When creating custom DDSTs for our machines, I have a couple questions;

1. What is recommended route to create a DDST using SSDTTIME? For example, I bypassed OPENCORE altogether and boot from the windows EFI and then create my DDST dump in windows. My line of thinking would be that this would be a more accurate DDST because it’s bypassing OPENCORE and any misconfiguration caused by OPENCORE. Is this correct or the best route to go?

2. With the EFIs that have ssdt-cspur or whatever SSDTs they have enabled, do we leave those in the EFI and if so, should our custom DDST be first in the ACPI list?


Thanks in advance
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
910
The developers of OpenCore don't recommend or want us to use Patched/custom DSDT.aml tables. They also don't want us to add the system DSDT.aml to the /EC/OC/ACPI folder, as the system will automatically add the DSDT.aml table when booting.

One of the reasons they don't want us using patched DSDT's is that each bios version has a different DSDT.aml and we would have to apply the patches each time the bios was updated. This can be messy, when two or more people have the same motherboard or laptop, but are using different Bios versions and thereby different DSDT.aml tables.

The people who create ACPI tables for system are not renown for their workmanship, in fact the opposite is true. Errors and poorly written code in DSDT.aml tables are very common, another reason not to mess with the DSDT.aml table.

The OpenCore developers recommend that we create custom SSDT.aml tables. These are used to accomplish the fixes that used to be applied to the system DSDT.aml. Once the custom SSDT.aml has been created it will work against/with the system DSDT.aml, whether you are Hacking a Laptop or Desktop system. No messing around with different bios versions etc.

SSDTTime doesn't change the DSDT.aml. It uses the DSDT.aml to create custom SSDT's such as SSDT-EC.aml, SSDT-HPET.aml and SSDT-PLUG.aml, which are fixes for issues that would previously have been applied as a DSDT.aml patch. The Script in SSDTTime interrogates the DSDT.aml and uses the information found in the DSDT to create the SSDT's based on known issues and fixes.

Forget about DSDT.aml patching. Stick with the creation of Custom SSDT's.
 

OG Nerd

OG Nerd
Donator
Joined
Dec 7, 2021
Messages
226
The developers of OpenCore don't recommend or want us to use Patched/custom DSDT.aml tables. They also don't want us to add the system DSDT.aml to the /EC/OC/ACPI folder, as the system will automatically add the DSDT.aml table when booting.

One of the reasons they don't want us using patched DSDT's is that each bios version has a different DSDT.aml and we would have to apply the patches each time the bios was updated. This can be messy, when two or more people have the same motherboard or laptop, but are using different Bios versions and thereby different DSDT.aml tables.

The people who create ACPI tables for system are not renown for their workmanship, in fact the opposite is true. Errors and poorly written code in DSDT.aml tables are very common, another reason not to mess with the DSDT.aml table.

The OpenCore developers recommend that we create custom SSDT.aml tables. These are used to accomplish the fixes that used to be applied to the system DSDT.aml. Once the custom SSDT.aml has been created it will work against/with the system DSDT.aml, whether you are Hacking a Laptop or Desktop system. No messing around with different bios versions etc.

SSDTTime doesn't change the DSDT.aml. It uses the DSDT.aml to create custom SSDT's such as SSDT-EC.aml, SSDT-HPET.aml and SSDT-PLUG.aml, which are fixes for issues that would previously have been applied as a DSDT.aml patch. The Script in SSDTTime interrogates the DSDT.aml and uses the information found in the DSDT to create the SSDT's based on known issues and fixes.

Forget about DSDT.aml patching. Stick with the creation of Custom SSDT's.
Ahhh, ok that makes sense… I appreciate the break down. I am still learning. So if I understand this correctly, I should remove the DDST.aml amd use SSDT-Plug etc to fix shut down issues? (I have an asrock mobo that don’t shut down, it reboots, even with usbtoolbox.) Odd thing is it sleeps and wakes perfectly
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
910
You are talking about the 2nd system listed in your signature, yes?
  • Could be an issue with the SMBUS device. Do you have an SSDT-SMBUS-MCHC.aml in your /OC/ACPI folder? What Device Path/IOReg name does the SMBUS device use? PCI0.SBUS is common.
  • Could be a USB issue, if the USBMap.kext is not set correctly. Easily done with an AMD system.
Post a copy of the EFI Folder you are using for this system and I will have a look to see if there are any specific/obvious issues that need attention.

Take this as GOSPEL -

Don't ever add your system DSDT.aml table to your /OC/ACPI folder, unless you have patched it to fix a specific problem that can't be fixed by the addition of a custom SSDT.

AMEN!
 

OG Nerd

OG Nerd
Donator
Joined
Dec 7, 2021
Messages
226
You are talking about the 2nd system listed in your signature, yes?
  • Could be an issue with the SMBUS device. Do you have an SSDT-SMBUS-MCHC.aml in your /OC/ACPI folder? What Device Path/IOReg name does the SMBUS device use? PCI0.SBUS is common.
  • Could be a USB issue, if the USBMap.kext is not set correctly. Easily done with an AMD system.
Post a copy of the EFI Folder you are using for this system and I will have a look to see if there are any specific/obvious issues that need attention.

Take this as GOSPEL -

Don't ever add your system DSDT.aml table to your /OC/ACPI folder, unless you have patched it to fix a specific problem that can't be fixed by the addition of a custom SSDT.

AMEN!
Got it! Removed it! If you could spot what is causing the reboot rather than shutdown, I would really appreciate it! It's been driving me nuts.

On the Legion 5, I probably will not work on it today, I am upgrading some of my processors in some of my hackintoshes. (Retiring some of the Ryzen 5 3600's and upgrading a couple other ones to Ryzen 7 5700x and the Asrock I bought a Ryzen 9 for and putting the ryzen 5 5600 in it in my file server. so today is busy.)
 

Attachments

  • EFI.zip
    10.8 MB · Views: 6

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
910
The most obvious place to look, your UTBMap.kext shows your USB setup is not correct.

Your Asrock X570 Phantom Gaming 4 motherboard has no physical USB2 ports. But you have a port (XHC1 - HS03) configured as USB2 (0).

Neither of the 2 possible USB2 Internal ports are enabled, or set correctly.

The Type-A USB3.2 Gen2 ports should be set as USB3 (3) not Type-c+sw (9)

Your motherboard has the following USB ports:

  • 1 x USB 2.0 Header (Supports 2 USB 2.0 ports) 2 x Internal (255)
  • 2 x USB 3.2 Gen1 Headers (Support 4 USB 3.2 Gen1 ports) 8 x USB3 (3)
  • 2 x USB 3.2 Gen2 Type-A Ports (10 Gb/s) - 4 x USB3 (3)
  • 6 x USB 3.2 Gen1 Ports - 12 x USB3 (3)

Anything different from the above and you will have issues shutting down your system, as the USB ports incorrectly set will cause a power call and reboot the system.

Other issues:
You don't have a PTXH USB controller, so the SSDT-Sleep-PTXH.aml ACPI table should not be used with your system.

NVMeFix.kext is being loaded before VirtualSMC.kext in your config.plist. This should never be the case. None of the Lilu.kext plugins listed in the link below should ever be loaded before VirtualSMC.kext.


You might want to look at the use of revcpu=1 boot argument, as I am sure there is a better way to get your CPU identified and named.
 

OG Nerd

OG Nerd
Donator
Joined
Dec 7, 2021
Messages
226
The most obvious place to look, your UTBMap.kext shows your USB setup is not correct.

Your Asrock X570 Phantom Gaming 4 motherboard has no physical USB2 ports. But you have a port (XHC1 - HS03) configured as USB2 (0).

Neither of the 2 possible USB2 Internal ports are enabled, or set correctly.

The Type-A USB3.2 Gen2 ports should be set as USB3 (3) not Type-c+sw (9)

Your motherboard has the following USB ports:

  • 1 x USB 2.0 Header (Supports 2 USB 2.0 ports) 2 x Internal (255)
  • 2 x USB 3.2 Gen1 Headers (Support 4 USB 3.2 Gen1 ports) 8 x USB3 (3)
  • 2 x USB 3.2 Gen2 Type-A Ports (10 Gb/s) - 4 x USB3 (3)
  • 6 x USB 3.2 Gen1 Ports - 12 x USB3 (3)

Anything different from the above and you will have issues shutting down your system, as the USB ports incorrectly set will cause a power call and reboot the system.

Other issues:
You don't have a PTXH USB controller, so the SSDT-Sleep-PTXH.aml ACPI table should not be used with your system.

NVMeFix.kext is being loaded before VirtualSMC.kext in your config.plist. This should never be the case. None of the Lilu.kext plugins listed in the link below should ever be loaded before VirtualSMC.kext.


You might want to look at the use of revcpu=1 boot argument, as I am sure there is a better way to get your CPU identified and named.
working on it now.... what is best way to clean up usbmap.kext?
 

OG Nerd

OG Nerd
Donator
Joined
Dec 7, 2021
Messages
226
Start again!

But with the attributes of specific known ports fresh in your mind.
I have what might be a stupid question, but I read and re-read USBToolboxes instructions and I am not seeing anything about changing the USB port types, I remapped in windows 3 times and it detects the ports that you listed that are not there. What am I missing?
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
910
Sorry, I use Hackintool and IOreg for my intel Hacks and Corpnewt's USBMap to configure the USB ports on my AMD Hacks. I have never used USBToolBox to configure USB ports in Windows.

USBToolBox is based off Corpnewt's USBMap script, so it may have a similar process for changing USB port connector types.

In USBMAp you use the Capital letter 'T' to select the ports where you need to change their Type .

It appears to be the same in USBToolBox in macOS.
  1. First enter S on the options screen, to enter the Select Ports and build Kext option.Screenshot 2022-07-06 at 17.47.52.png
  2. Then use the formula highlighted at the base of the screenshot below to select the ports you want to change, along with the type you want to change them to.Screenshot 2022-07-06 at 17.39.29.png USBToolBox in macOS Terminal.
So as an example if you wanted to change ports 1, 3 and 5 to Internal you would use the following formula:

T: 1, 3, 5: 255
If they were USB2 and needed to be changed to USB3 your would use the following formula:

T: 1, 3, 5: 3

The information below about using Names is also helpful. As setting names for the ports can help with troubleshooting issues later. For example Front Case USB3 tells you where the port is and which connector should be used. If you then notice you set it as USB2 or Type-c you know it is wrong and the kext needs to be edited before it will work correctly.

The screenshot below shows the USB ports from a Coffee Lake hack, the comments section contains the Names of the ports, which is included in the kext created. This is the same idea as using the Custom Names in USBToolBox.

Screenshot 2022-07-06 at 17.55.40.png

Hope this helps.
 

OG Nerd

OG Nerd
Donator
Joined
Dec 7, 2021
Messages
226
Sorry, I use Hackintool and IOreg for my intel Hacks and Corpnewt's USBMap to configure the USB ports on my AMD Hacks. I have never used USBToolBox to configure USB ports in Windows.

USBToolBox is based off Corpnewt's USBMap script, so it may have a similar process for changing USB port connector types.

In USBMAp you use the Capital letter 'T' to select the ports where you need to change their Type .

It appears to be the same in USBToolBox in macOS.
  1. First enter S on the options screen, to enter the Select Ports and build Kext option.View attachment 6511
  2. Then use the formula highlighted at the base of the screenshot below to select the ports you want to change, along with the type you want to change them to.View attachment 6510 USBToolBox in macOS Terminal.
So as an example if you wanted to change ports 1, 3 and 5 to Internal you would use the following formula:

T: 1, 3, 5: 255
If they were USB2 and needed to be changed to USB3 your would use the following formula:

T: 1, 3, 5: 3

The information below about using Names is also helpful. As setting names for the ports can help with troubleshooting issues later. For example Front Case USB3 tells you where the port is and which connector should be used. If you then notice you set it as USB2 or Type-c you know it is wrong and the kext needs to be edited before it will work correctly.

The screenshot below shows the USB ports from a Coffee Lake hack, the comments section contains the Names of the ports, which is included in the kext created. This is the same idea as using the Custom Names in USBToolBox.

View attachment 6512

Hope this helps.

That makes sense... I changed the ports to what I think they should be, if you could take a look and see if that and the kext order are where they should be? I will note, that even with these changes, it still reboots rather than shut down.
 

Attachments

  • EFI.zip
    10.8 MB · Views: 2

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
910
Questions:
  1. How many physical USB ports are there on your ASRock X570 motherboard? - Answer 0
  2. How many USB ports have been set with the connector type for a physical USB2 port in your UTBMap.kext? - Answer 7
  3. How many USB Type-C ports are there on your ASRock motherboard? - Answer 0
  4. How many ports have been set with the connector type for a Type-C port in your UTBMAp.kext? - Answer 2
  5. Guess how many ports are set with an incorrect Connector Type? - Answer 9
If you go back to post #6, I provided this information regarding your ASRock motherboard, it wasn't provided for my benefit.
  • 1 x USB 2.0 Header (Supports 2 USB 2.0 ports) 2 x Internal (255)
  • 2 x USB 3.2 Gen1 Headers (Support 4 USB 3.2 Gen1 ports) 8 x USB3 (3)
  • 2 x USB 3.2 Gen2 Type-A Ports (10 Gb/s) - 4 x USB3 (3)
  • 6 x USB 3.2 Gen1 Ports - 12 x USB3 (3)
ALSO STATING - Anything different from the above and you will have issues shutting down your system, as the USB ports incorrectly set will cause a power call and reboot the system.

So why have you set 7 ports with the USB2 connector type, when your motherboard only has virtual USB2 ports served from the physical USB3 ports? The USB3.2 Gen2 ports are Type-A, not Type-C so why have you set them as Type-C?

Screenshot 2022-07-06 at 22.42.52.png

The 7 ports set as USB2 (0) connector type need to be changed to USB3 (3) connector type. As do the 2 ports set as Type-C.

Try this revised UTBMap.kext, all the errors mentioned above have been fixed. See if the system automatically reboots when you shut it down after using this kext.

Remember to use the ResetNvramEntry.efi driver before you boot with this kext in your EFI.
 

Attachments

  • UTBMap.kext.zip
    2.4 KB · Views: 0

OG Nerd

OG Nerd
Donator
Joined
Dec 7, 2021
Messages
226
Questions:
  1. How many physical USB ports are there on your ASRock X570 motherboard? - Answer 0
  2. How many USB ports have been set with the connector type for a physical USB2 port in your UTBMap.kext? - Answer 7
  3. How many USB Type-C ports are there on your ASRock motherboard? - Answer 0
  4. How many ports have been set with the connector type for a Type-C port in your UTBMAp.kext? - Answer 2
  5. Guess how many ports are set with an incorrect Connector Type? - Answer 9
If you go back to post #6, I provided this information regarding your ASRock motherboard, it wasn't provided for my benefit.
  • 1 x USB 2.0 Header (Supports 2 USB 2.0 ports) 2 x Internal (255)
  • 2 x USB 3.2 Gen1 Headers (Support 4 USB 3.2 Gen1 ports) 8 x USB3 (3)
  • 2 x USB 3.2 Gen2 Type-A Ports (10 Gb/s) - 4 x USB3 (3)
  • 6 x USB 3.2 Gen1 Ports - 12 x USB3 (3)
ALSO STATING - Anything different from the above and you will have issues shutting down your system, as the USB ports incorrectly set will cause a power call and reboot the system.

So why have you set 7 ports with the USB2 connector type, when your motherboard only has virtual USB2 ports served from the physical USB3 ports? The USB3.2 Gen2 ports are Type-A, not Type-C so why have you set them as Type-C?

View attachment 6520

The 7 ports set as USB2 (0) connector type need to be changed to USB3 (3) connector type. As do the 2 ports set as Type-C.

Try this revised UTBMap.kext, all the errors mentioned above have been fixed. See if the system automatically reboots when you shut it down after using this kext.

Remember to use the ResetNvramEntry.efi driver before you boot with this kext in your EFI.
I have 2 usb 2.0 headers on this mobo, one goes to the fenvi Wi-Fi for bt and the other goes to a usb 2.0 dual port on the case. On the usb c I changed those in types in usbtoolbox and then rebuilt the kext… I don’t get why it’s reverting back to that configuration… I wonder if it has to do with the Enabling all populated ports and disable unused ports options in usbtoolbox? I select those after changing the type’s and before rebuilding the kext.

Oh and I reset nvram with each change.
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
910
The 2 x USB2 Internal headers will provide a maximum of 4 x USB2 ports, each port will need to be set as 'Internal' with the connector type '255', not as USB2 '0'. So the physical case front ports are not real physical USB2 ports, as they connector to an INTERNAL header. Same goes for the Bluetooth module connection.

Your ASRock X570 motherboard has NO physical USB2 ports, and these are the only ports that should ever be set with the Connector Type '0'. As can be seen on the rear I/O plate from your ASRock X570 Phantom Gaming 4 below.

Screenshot 2022-07-07 at 13.29.19.png 8 x USB3 ports on the rear I/O plate, no physical USB2 or Type-C ports.

The 8 x USB3 ports on the I/O plate will provide 16 x ports, 8 x virtual USB2 and 8 x Physical USB3. All 16 ports should be set with the connector type '3' as they need to be set to match the physical port. None of the 8 x USB2 virtual ports should be set with the connector type '0'.

Same goes for any case front USB3 ports. They need to be set with the connector type '3', including the virtual USB2 ports.
 

OG Nerd

OG Nerd
Donator
Joined
Dec 7, 2021
Messages
226
The 2 x USB2 Internal headers will provide a maximum of 4 x USB2 ports, each port will need to be set as 'Internal' with the connector type '255', not as USB2 '0'. So the physical case front ports are not real physical USB2 ports, as they connector to an INTERNAL header. Same goes for the Bluetooth module connection.

Your ASRock X570 motherboard has NO physical USB2 ports, and these are the only ports that should ever be set with the Connector Type '0'. As can be seen on the rear I/O plate from your ASRock X570 Phantom Gaming 4 below.

View attachment 6529 8 x USB3 ports on the rear I/O plate, no physical USB2 or Type-C ports.

The 8 x USB3 ports on the I/O plate will provide 16 x ports, 8 x virtual USB2 and 8 x Physical USB3. All 16 ports should be set with the connector type '3' as they need to be set to match the physical port. None of the 8 x USB2 virtual ports should be set with the connector type '0'.

Same goes for any case front USB3 ports. They need to be set with the connector type '3', including the virtual USB2 ports.
Ahhhh, I was setting the virtual ports to 0 and one of the internal… ok will redo it. Thank you for the education and going into detail, I really do appreciate the education
 

OG Nerd

OG Nerd
Donator
Joined
Dec 7, 2021
Messages
226
The 2 x USB2 Internal headers will provide a maximum of 4 x USB2 ports, each port will need to be set as 'Internal' with the connector type '255', not as USB2 '0'. So the physical case front ports are not real physical USB2 ports, as they connector to an INTERNAL header. Same goes for the Bluetooth module connection.

Your ASRock X570 motherboard has NO physical USB2 ports, and these are the only ports that should ever be set with the Connector Type '0'. As can be seen on the rear I/O plate from your ASRock X570 Phantom Gaming 4 below.

View attachment 6529 8 x USB3 ports on the rear I/O plate, no physical USB2 or Type-C ports.

The 8 x USB3 ports on the I/O plate will provide 16 x ports, 8 x virtual USB2 and 8 x Physical USB3. All 16 ports should be set with the connector type '3' as they need to be set to match the physical port. None of the 8 x USB2 virtual ports should be set with the connector type '0'.

Same goes for any case front USB3 ports. They need to be set with the connector type '3', including the virtual USB2 ports.

Is this the correct form, Sensi? (Barely lifts foot off the ground...)

IMG_0281.jpeg
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
910
Yes that looks good. It's not finished though, is it?

These are the ports you are using, in their companion pairings.
5 + 17
6 + 18
11 + 19
12 + 20
21 + 25
23 + 27
24 + 28

You have 8 x USB3 and 8 x USB2 ports paired up, I assume from the 8 x Physical USB3 port on the rear I/O plate.
You have Port 14 set as the Internal USB2 Hub, which is serving the case front USB2 ports and bluetooth.

You have 11 ports, some paired that are not being used.
1 + 7
2 + 8
3 + 9
13, 15 & 16 (not paired)
22 + 26

The 4 x paired ports are probably the ports served by the 2 x USB3 internal headers.
You may not be connecting both USB3 headers to the case front ports, so you may only need to identify the two pairs you are using.

Good work so far!
 

OG Nerd

OG Nerd
Donator
Joined
Dec 7, 2021
Messages
226
Yes that looks good. It's not finished though, is it?

These are the ports you are using, in their companion pairings.
5 + 17
6 + 18
11 + 19
12 + 20
21 + 25
23 + 27
24 + 28

You have 8 x USB3 and 8 x USB2 ports paired up, I assume from the 8 x Physical USB3 port on the rear I/O plate.
You have Port 14 set as the Internal USB2 Hub, which is serving the case front USB2 ports and bluetooth.

You have 11 ports, some paired that are not being used.
1 + 7
2 + 8
3 + 9
13, 15 & 16 (not paired)
22 + 26

The 4 x paired ports are probably the ports served by the 2 x USB3 internal headers.
You may not be connecting both USB3 headers to the case front ports, so you may only need to identify the two pairs you are using.

Good work so far!
Correct, I only have one USB3.0 Port on the case that is plugged into one of the Internal USB 3.0 Headers, the other one is not used. I am thinking that is Port 10 & 4.

If this is the case shouldn't I switch Port 10 & 4 to INTERNAL since they are connected to the internal USB 3 header?, or is the kext ready to build as is or do I need to do anything else?
 

OG Nerd

OG Nerd
Donator
Joined
Dec 7, 2021
Messages
226
I think I see what you mean, there are only 8 USB 3.0 Ports populated when there should actually be the 8 external plus the one internal... hmmmmm.....
 
Top Bottom