Contribute
Register

[Guide] Creating a Custom SSDT for USBInjectAll.kext

Ok can't believe I'm getting stuck on this, but I'm port mapping right now. I found that the port my keyboard/mouse is plugged into HS03. When I try this step with these bootflags:

"Next, we boot with -uia_exclude_hs uia_include=HS03 to test SSxx and USRx ports."

It doesn't include HS03 and I can't type. I've tried it with other ports ie HS14, HS04,(and moving the keyboard to the appropriate port) but still nothing.
 
Ok can't believe I'm getting stuck on this, but I'm port mapping right now. I found that the port my keyboard/mouse is plugged into HS03. When I try this step with these bootflags:

"Next, we boot with -uia_exclude_hs uia_include=HS03 to test SSxx and USRx ports."

It doesn't include HS03 and I can't type. I've tried it with other ports ie HS14, HS04,(and moving the keyboard to the appropriate port) but still nothing.

Sorry for the double post but dunno how to delete a post. I got past this point by finding another way to map the ports with a tool that helps you check HSR and SSR simultaneously.
 
I've followed every step of this guide, reading carefully through each step, and I'm pretty confident that I did everything as it should... But I don't see any change at all on my IOReg tree.

USB works fine with InjectAll.kext + disabling port limit, but I'd like to do this the "right way," because I'm having trouble setting up my broadcom bluetooth controller (probably a separate issue).

A few interesting things to note
  • my USB ports are all showing under a single address (both USB2 and USB3, under HSxx and SSxx, respectively)
  • I am now seeing an nvCommandQueue device being attached and disconnected, continuously, and the whole system is stuttery, having weird hangups. Perhaps an unrelated issue to custom USB SSDTs? Others have been experiencing the same:
Problem Reporting:

I have used the usbinjectall.kext, and port-limit patch. Then I configured my ports and eliminated unused ports. Below is a list of problems that I am having and need help with. PLEASE HELP! I’ve been trying to figure this out for 2 months now and am at a dead end.

Issue #1)

HS01 is a physical usb 3.0 port, and yet it only shows up as usb2 (HS01) when configuring my ports with usb inject all and the port limit patch. No corresponding “SS01” show up when plugging in a usb3 device to that port.

a)Why is this happening?

b) How do I fix this?

c) Does this indicate something wrong with my motherboard, or is the problem due to a fixable error in my mac os?

D) Does this have to do with exposed bugs in my ACPI implementation of _PLD and _UPC (whatever that means)?

Issue #2)

I cannot for the life of me achieve USB3.0 speeds on my usb 3 ports. Aside from HS01, which is supposed to be a physical usb3 port, all of my usb 3 ports have been configured correctly (I think). However, when I plug in a usb3 stick to any of my usb ports, Black Magic Disk Speed test shows them as having a write speed of no more than 25MB/s. When I plug in a usb 3 external hard drive, Black Magic Disk speed test can achieve no more than 100MB/s write speeds. These seem much more like usb 2.0 speeds than usb 3.0 speeds.

a) Is there something I am doing wrong and is there something I can do to remedy this situation in order to get usb3
speeds from these ports?

Issue #3)

In my IOReg, i have items such as “RootDomainUserClient”, “nvCommandQueue”, “nvDevice”, “nvSharedUserClient”, nvShareGroupContext, CCCapture, AppleKeyStoreUserClient, and “com_intel_driver_EnergyDriverClient” showing up in green and then immediately becoming crossed out in red letters.

View attachment 284489
View attachment 284490
View attachment 284491
View attachment 284492
View attachment 284493

a) What are these items and why are they constantly being disconnected and reconnected?
b) Should I be worried about this and does this have anything to do with either my USB speeds
not working properly, or my power management?

Attached Files:
Below I have attached my IOReg, my clover config.file (without any serial number for obvious reasons), my patched UIAC.aml, and screenshots of the crossed out components in IOreg in a zip file. Could someone please take a look at them and let me know what I am doing wrong? Help is much appreciated! I am a super noob and really need help! Thankyou so much everyone! @RehabMan @P1LGRIM


Attaching my full Problem Reporting .zip here, for assistance, but also some IOReg screenshots for quick reference.

Thank you!
IOReg_nvCommandQueue.pngIOReg_XHCI.png
 

Attachments

  • Problem Reporting.zip
    7.7 MB · Views: 101
Last edited:
UPDATE / EDIT TO MY POST ABOVE

I've tried other methods like the USBMap Tool Method and the Hackintool Method, and out of those, the kext injection method works, while the generated SSDTs simply won't.

I've compared my SSDTs with other people's, and I don't understand why the SSDTs don't work. :confused: :confused: :confused:

I'm starting to suspect that my SSDTs aren't being recognized by clover at all!
Is it possible that some preferences or checkboxes in Clover/ACPI are preventing SSDT's from being applied?
 
I don't understand why the SSDTs don't work
Your PR files are not as per below guide; difficult to help you without some required files...

However, USBInjectAll is messed up and was not loaded:
1- It's code signed?!?! Replace it, unless you did it personally and you know what you're doing...
2- It's getting linking errors and signature errors, see below
Code:
Invalid signature -67050 for kext <OSKext 0x7feca52041d0 [0x7fff9c4968e0]> { URL = "file:///Library/Extensions/USBInjectAll.kext/", ID = "com.rehabman.driver.USBInjectAll" }
kxld[com.rehabman.driver.USBInjectAll]: The super class vtable 'vtable for IOService' for vtable 'vtable for USBInjectAll' is out of date. Make sure your kext has been built against the correct headers.
kxld[com.rehabman.driver.USBInjectAll]: The super class vtable 'vtable for IOService' for vtable 'vtable for USBInjectAll_config' is out of date. Make sure your kext has been built against the correct headers.
Link failed (error code 5).
Prelink failed for com.rehabman.driver.USBInjectAll; omitting from prelinked kernel.

I cannot check whether you're injecting kexts with Clover or they are installed in /L/E (some PR files missing), in any case, be sure you don't get any prelinking error otherwise your USBInjectAll.kext won't be loaded even if your SSDT-UIAC is correct.
BTW, better in /L/E...

You may want to try the attached one
 

Attachments

  • USBInjectAll.kext.zip
    15.4 KB · Views: 123
Last edited:
Rehabman, Thank you so very much for your guide. It has been a great eye opener and a fantastic help.
I was having so much trouble with my USB's for such a long time.
I really started to understand using ioreg that the names in there have to be Apple.
to create SSDT's to interject into the system. My machine has never ran so smooth.

Now if I can get this to sleep and hibernate.

I have uploaded ioreg.
Please let me know what else I can do.

I found this program or app called USBMap which is fantastic and help a great deal. Created USBMap.kext which needs USBinjectAll.kext and the renames for the USB in DSDT
to EHO1 and 02.

I was never able to make this work prior. I but after installing the kext and the SSDT's they I was able to rename them via config.plist using clover renames.


With the kext created, USBmap.kext, can I remove USBInjectAll.kext and the SSDT-UIAC.aml?
how does this work? Or do I need to at least keep the SSDT-UIAC.kext?
I was hoping by installing FAKEPCIID.kext FAKEPCIMux.kext that the 3.0 USB's would speed up. But no dice
Also I found in the Laptop configs for the power which I was able to use in Devices>Properties per USB Hub device.
EHO1 EHO2 to use the power stats. Works.

Thank you so much. You really are very well in everything you do. I thank you so much.

System Specs at current: Asus K53E BBR old with iCore3 2310m, USB2.0 only, HD3000, HDMI,
Sandybridge 00000100, Mojave 10.14.6, El Capitan 10.11.6, Sierra 10.12.6, High Sierra 10.13.6 ( offline at the moment USB issues. ). several HDD's to swap out. Clover variations to see what is best 5112, 5114, 5116, (5117 had some issues so removed in favor of the back issues.)

UPDATE: Corrected with SSDT for battery
I have an issue with BatteryManager on boot low threshold delay and high threshold delay.
Several other issues. One at a time. each one is time consuming.

Ken
 

Attachments

  • ioregken.zip
    586.9 KB · Views: 166
Last edited:
Hi.. From my experience..

I updated Clover (5118) and some of the kext files and found that sleep stopped working. On further checks, I found that the SSDT-UIAC was not being loaded and this probably was one of the issues causing the sleep.

In short, I reverted to the kext from RehabMans Bitbucket release of the USBInjectAll.kext and the SSDT-UIAC was ok again. The one that did not work seems to be the one I got from Sniki USBInjectAll.kext
 
Hi

I try to patch my usb because if I try to insert my iphone on a usb3 all port usb is disable for a problem with the energy. My laptop is chuwi aerobook plus and in total I have:

1 port usb2 / usb3
2 port usb2 / usb3
1 port usbc (with I set id 9 for a non reverse plug).

All ports works, if I try to use usb2 or usb3 disk works. Also if I try to use a pen drive usbc.

The problem is when I plug the iphone, all the port went disable and the system tell to disconnect the device that take too much energy from the system.

The only port work with the iphone is the usbc.

I attach the log of the system, and here i put my SSDT

DefinitionBlock ("", "SSDT", 2, "hack", "_UIAC", 0)
{
Device(UIAC)
{
Name(_HID, "UIA00000")

Name(RMCF, Package()
{
"8086_9dxx", Package() // examples: 0x9d2f, 0x9ded
{
"port-count", Buffer() { 18, 0, 0, 0 },
"ports", Package()
{
"HS01", Package()
{
"UsbConnector", 3,
"port", Buffer() { 1, 0, 0, 0 },
},
"HS04", Package()
{
"UsbConnector", 3,
"port", Buffer() { 4, 0, 0, 0 },
},
"HS05", Package()
{
"UsbConnector", 3,
"port", Buffer() { 5, 0, 0, 0 },
},
"HS07", Package()
{
"UsbConnector", 3,
"port", Buffer() { 7, 0, 0, 0 },
},
"HS08", Package()
{
"UsbConnector", 3,
"port", Buffer() { 8, 0, 0, 0 },
},
"SS01", Package()
{
"UsbConnector", 3,
"port", Buffer() { 13, 0, 0, 0 },
},
"SS02", Package()
{
"UsbConnector", 9,
"port", Buffer() { 14, 0, 0, 0 },
},
"SS04", Package()
{
"UsbConnector", 3,
"port", Buffer() { 16, 0, 0, 0 },
},
},
},
})
}
}
//EOF
 

Attachments

  • debug_28381.zip
    12.9 MB · Views: 102
hi, boot via usb stick into mint, create a via SSDTTime the aml files. Copy the files into the corresponding folder. Done
 
Hi

I try to patch my usb because if I try to insert my iphone on a usb3 all port usb is disable for a problem with the energy. My laptop is chuwi aerobook plus and in total I have:

1 port usb2 / usb3
2 port usb2 / usb3
1 port usbc (with I set id 9 for a non reverse plug).

All ports works, if I try to use usb2 or usb3 disk works. Also if I try to use a pen drive usbc.

The problem is when I plug the iphone, all the port went disable and the system tell to disconnect the device that take too much energy from the system.

The only port work with the iphone is the usbc.

I attach the log of the system, and here i put my SSDT

DefinitionBlock ("", "SSDT", 2, "hack", "_UIAC", 0)
{
Device(UIAC)
{
Name(_HID, "UIA00000")

Name(RMCF, Package()
{
"8086_9dxx", Package() // examples: 0x9d2f, 0x9ded
{
"port-count", Buffer() { 18, 0, 0, 0 },
"ports", Package()
{
"HS01", Package()
{
"UsbConnector", 3,
"port", Buffer() { 1, 0, 0, 0 },
},
"HS04", Package()
{
"UsbConnector", 3,
"port", Buffer() { 4, 0, 0, 0 },
},
"HS05", Package()
{
"UsbConnector", 3,
"port", Buffer() { 5, 0, 0, 0 },
},
"HS07", Package()
{
"UsbConnector", 3,
"port", Buffer() { 7, 0, 0, 0 },
},
"HS08", Package()
{
"UsbConnector", 3,
"port", Buffer() { 8, 0, 0, 0 },
},
"SS01", Package()
{
"UsbConnector", 3,
"port", Buffer() { 13, 0, 0, 0 },
},
"SS02", Package()
{
"UsbConnector", 9,
"port", Buffer() { 14, 0, 0, 0 },
},
"SS04", Package()
{
"UsbConnector", 3,
"port", Buffer() { 16, 0, 0, 0 },
},
},
},
})
}
}
//EOF
Something wrong with your code. If there are 3 usb 3 ports and one usb C in your system then you should have 3 pairs of HS/SS PORTS for usb 3 and one for single sided usb C (not sure about usb c port, you can verify) you have
HS01/SS01
SS02
HS04/SS04
HS05
HS07
HS08
Use Hackintool for port mapping and auto generating files
 
Last edited:
Back
Top