Contribute
Register

[Guide] 10.11+ USB changes and solutions

Status
Not open for further replies.
I am still not getting it.
Lets look from a different angle, what must I do/change in the code to emulate a different Windows ver.

This comment answers your question:
// Note: According to ACPI spec, _OSI("Windows") must also return true
// Also, it should return true for all previous versions of Windows.
 
You spelled uia_exclude incorrectly. It is 'uia_exclude' not '-uia_exclude'.

Renaming to use EH01/EH02/XHC is not optional.

Your profile must have hardware details as per FAQ.
All problem reports require "Problem Reporting" files.
No "Problem Reporting" files attached.
Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/

Thank you RehabMan - fast and to the point. My apologies concerning my missing profile.

To successfully use SSDT-UIAC (USBInjectAll.kext) I followed your point: "Renaming XHC1 to XHC in DSDT".
Since XHCI, XHC, XHC1, XHCB were already in used, I renamed manually XHC to XXHC.
Then I was able to rename XHC1 to XHC and become compliant with USBInject.kext [Edit: This was not the right approach. See later post]

In IOREG HSPx appeared but I noticed SSPx ports were not present
I went back to DSDT editing and renamed SSP1 to SSP5, SSP2 to SSP6 and so on.
At the same time I renamed HSP1 into HS01, HSP2 into HS02 and so on.
8 devices renamed total.

As explained in your guide, "FakePCIID_XHCIMux.kext has the effect of moving all HSxx ports to EHCI (to the internal hub on EH01.PR11)". I was then able to remove remove those two kexts once and only used USBInjectAll.kext + SSDT-UIAC.aml
I excluded EH02 since it was only used for the internal card reader (EH02 HP22: Card Reader) which I don't have a High Sierra compatible kext for.

Last issue remaining: Instant wake after sleep.
-I tried with an optical mouse plugged in. The light goes off. Computer goes to sleep. Wakes up. Screen, Mouse, and all go back on.
-I tried without any USB devices plugged-in. Instant wake after sleep
- When I don't load USBInjectAll.kext at boot, sleep works perfectly.
- I think I'll try to load the kext at boot with an almost empty SSDT-UIAC file.
 
Last edited:
In IOREG HSPx appeared but I noticed SSPx ports were not present

It means you made a mistake.
Attach "Problem Reporting" files as per FAQ.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/


I went back to DSDT editing and renamed SSP1 to SSP5, SSP2 to SSP6 and so on.

Unnecessary/wrong.

At the same time I renamed HSP1 into HS01, HSP2 into HS02 and so on.
8 devices renamed total.

Also unnecessary/wrong.

Last issue remaining: Instant wake after sleep.
-I tried with an optical mouse plugged in. The light goes off. Computer goes to sleep. Wakes up. Screen, Mouse, and all go back on.
-I tried without any USB devices plugged-in. Instant wake after sleep
- When I don't load USBInjectAll.kext at boot, sleep works perfectly.
- I think I'll try to load the kext at boot with an almost empty SSDT-UIAC file.

Read above regarding "Problem Reporting" files.
 
Issue: Instant Wake once USBInject works perfectly (High Sierra)

-I have done minimal DSDT edit and got an UX31a (MacBook Air 7-Series Chipset) -working.
-I had sleep working but no external USB2/USB3.

-Following RehabMan's guides and advice I got USBInject working with XHC1->XHC edit in the DSDT + EH01/EH02 Clover patches
-I tried without any USB ports plugged in, I tried excluding internal USB ports as well e.g. uia_exclude=H16 but still no sleep.

-I patched _PWR to return zero instead of 0x03 + USB3 0x0D patch since my DSDT has (GPRW (0x0D, 0x03)) -I tried different Clover options such as -gux_defer_usb2 again but I still get Instant Wake after sleep.
-In IOReg, devices are stricken out after sleep which looks like they were disconnected. The light on my external mouse turns off when sleep starts and is back on wake.

Please find attached the problem reporting files.
 

Attachments

  • UX31a USBIjectOK NoSleep reporting.zip
    2.4 MB · Views: 98
Issue: Instant Wake once USBInject works perfectly (High Sierra)

-I have done minimal DSDT edit and got an UX31a (MacBook Air 7-Series Chipset) -working.
-I had sleep working but no external USB2/USB3.

-Following RehabMan's guides and advice I got USBInject working with XHC1->XHC edit in the DSDT + EH01/EH02 Clover patches
-I tried without any USB ports plugged in, I tried excluding internal USB ports as well e.g. uia_exclude=H16 but still no sleep.

-I patched _PWR to return zero instead of 0x03 + USB3 0x0D patch since my DSDT has (GPRW (0x0D, 0x03)) -I tried different Clover options such as -gux_defer_usb2 again but I still get Instant Wake after sleep.
-In IOReg, devices are stricken out after sleep which looks like they were disconnected. The light on my external mouse turns off when sleep starts and is back on wake.

Please find attached the problem reporting files.

Your ACPI patching is a mess.
First, I reduced your ACPI/patched folder to this:
DSDT.aml
SSDT-UIAC-UX31A.aml
SSDT-XOSI.aml
SSDT-IGPU.aml
ssdt-c2.aml

Because otherwise, it is impossible to look at.

Your patching for XHC are wrong.
From native, correct would be to simply remove this code:
Code:
            Device (XHC1)
            {
                Name (_ADR, 0x00140000)  // _ADR: Address
                Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
                {
                    Return (GPRW (0x0D, 0x03))
                }
            }

Then leave native XHC and patch from there. eg. rename EHC1->EH01...
Don't apply patches that are not necessary (eg. don't rename _T_x -> T_x, etc, don't change NotSerialized to Serialized, etc).

Instant wake is covered in the guide:
https://www.tonymacx86.com/threads/guide-patching-laptop-dsdt-ssdts.152573/
 
[SOLVED] Instant Wake with USBInject (High Sierra)

First, a warm thanks for your help, RehabMan. Your advice is to the point as always.

A mini guide from the experience I gathered fine tuning USBInject.kext
* EH01/EH02/XHC mandatory naming
(see ReHabMan’s USBInject Guide)
Previously, I had XHC and XHC1 in DSDT and USBInject did not attach itself to the right XHC.

-I tried renaming XHC-> to XXHC and then XHC1-> XHC. USBInject worked but I got Instant wake after sleep.
Then, a better solution, given by ReHabMan after looking at my ‘problem reporting files,’ was simply to comment out: Device (XHC1) in DSDT and [edit: change the line referring to XHC1 -> XHC].

Without any other modification to the DSDT, USBInject got the right XHC Device.
Note: EHC0/EHC1 are renamed EH01/EH02 with Clover

An additional point:
How to debug which USB Port was responsible for the instant wake?

I used SSDT-UIAC-ALL, configured to get:
- EH01 (PRT1 HP15 Camera HP16 Bluetooth),​
- EH02 (PRT1 HP22 Card Reader)
- 8086_1e31 (HSP1 HPS2 SSP1 SSP2 for the 2 USB ports)

Since I had ‘sleep’ working before using USBInject, I wanted to understand which device(s) was causing it.
-In SSDT-UIA-ALL, I changed the port-count to zero for EH01, EH02 and 8086_1e31.
-After reboot, all USB devices were off and sleep was working.
-I then changed the port-count of 8086_1e31 back to 0x08 and external USB2/3 ports were working with sleep.
-The origin of instant wake was with EH01 (probably Bluetooth).

I applied the first part of ReHabMan’s usb_prw_0x0d_xhc.txt patch: if _PRW is present, returns 0 (original was 3) for sleep state.
-As a result sleep is working. The lid is working and it sleeps and wakes the computer. Keyboard or track pack can also be used.

-The external USB mouse can no longer wake (due to the patch I chose to apply). Which is better for this laptop.
-External USB Wifi (and mouse) turn back on once computer is awake (just as they are supposed to).

My next step is to revisit DSDT editing since RehabMan recommended not to fix MacIASL warnings.

A big thanks to the community with its hard work, particularly around CLOVER. It makes running High Sierra the best experience I ever had with this computer. Thank you ReHabMan. Could not have gone this far without your detailed guides and help.
 
Last edited:
-I tried renaming XHC-> to XXHC and then XHC1-> XHC. USBInject worked but I got Instant wake after sleep.
Then, a better solution, given by ReHabMan after looking at my ‘problem reporting files,’ was simply to remove Device (XHC1) in DSDT and one line referring to it.

For the "one line referring to it" you want to change it to refer to XHC instead of removing it.
 
Deleted.
 
Last edited:
I have a desktop system (ASUS Sabertooth Z170 S). I am sorry if this is off-topic for this thread, I couldn't find a similar thread in the Desktop section. If there is such a thread please let me know.

I spent about a day reading through all the information provided by RehabMan. Thank you for all your efforts, the level of detail you provide is amazing!

At the end I settled on a very simple solution: I installed USBInjectAll.kext and used the uia_exclude kernel flag to disable the ports I am not using. I didn't rename anything (EHCx -> EH0x or such), didn't edit the DSDT or create new SSDTs, didn't change anything in the BIOS, etc. I did temporarily install the port limit patch but I removed it at the end as I understand it is not safe to use for long.

As a result, I ended up with 4 USB2 and 4 USB3 ports as shown by IORegistryExplorer:

View attachment 293632

Everything works pretty well, except that the USB3 ports sometimes only function as USB2. I test this by plugging in a USB3 device, a Transcend card reader. Right now this USB3 device is recognized in all USB3 ports, but this changes after every reboot. Sometimes it works in only one of the USB3 ports, sometimes it works in there out of four, etc. I don't see any pattern, seems pretty random.

The fact that I don't always get USB3 speeds doesn't bother me too much, but I don't like the randomness. I wonder if it's a sign of a more serious issue that I am not aware of.

One interesting thing I noticed is that the USB3.1 port (which I haven't used in the past, I don't think it worked under Sierra but I could be wrong) now works -- but in IORegistryExplorer it shows up under a different node than all the other USB ports:

View attachment 293638

I am curious if this is expected or a sign of trouble.

No "Problem Reporting" files attached.
Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
 
Status
Not open for further replies.
Back
Top