dreamwhite / bugtracker

Bugtracker repository
GNU General Public License v3.0
1 stars 0 forks source link

How to find the corresponding values for "kUSBSleepPortCurrentLimit" and "kUSBWakePortCurrentLimit" in SSDT-EC-USBX #41

Closed xuanhung1509 closed 1 month ago

xuanhung1509 commented 9 months ago

Hi, it seems interesting to me that your SSDT-EC-USBX discards 2 desktop properties in the USBX. However, comparing your two values of "kUSBSleepPortCurrentLimit" and "kUSBWakePortCurrentLimit" to the original code by acidanthera, they are different.

Your version:

Return (Package (0x04)
{
    "kUSBSleepPortCurrentLimit", 
    0x0BB8, 
    "kUSBWakePortCurrentLimit", 
    0x0BB8
})

acidanthera's version:

Return (Package (0x04)
{
    "kUSBSleepPortCurrentLimit",
    0x0834,
    "kUSBWakePortCurrentLimit",
    0x0834
})

I wonder how to get the appropriate values for those two keys. There's not much info on this topic. The only one I found seems to suggest I need an ioreg or an ACPI dump from the real mac model with the same SMBIOS version.

dreamwhite commented 9 months ago

Good morning and thank you so much for creating this issue. Actually, as far as I'm aware, the values proposed in my SSDT-EC-USBX under USBX device were calculated by the following:

Hope I clarified your doubts

xuanhung1509 commented 9 months ago

Could you give me the link to the post discussing the two discarded values? I'm surprised that Dortania does not distinguish the SSDT between laptop and desktop or even mention this matter.

Regarding the two other values, are those only meaningful if I connect an iPad to the laptop (or is it irrelevant if I only use an iPhone or Android phone)?

dreamwhite commented 9 months ago

Could you give me the link to the post discussing the two discarded values? I'm surprised that Dortania does not distinguish the SSDT between laptop and desktop or even mention this matter.

I'm still looking for it. I think I have saved it somewhere. Will let you know

Regarding the two other values, are those only meaningful if I connect an iPad to the laptop (or is it irrelevant if I only use an iPhone or Android phone)?

As far as I'm aware it's meaningful if you connect an iPad. Still looking for documentation :/

UPDATE

I found this: https://github.com/acidanthera/bugtracker/issues/1001#issuecomment-650047317

Apparently you can test other devices also which have greater power consumption

xuanhung1509 commented 9 months ago

I tried loading two versions to see the differences. In IOReg, both cases only show kUSBSleepPortCurrentLimit and kUSBWakePortCurrentLimit. Screen Shot 2023-11-29 at 11 54 38

It also seems like on MacbookPro, only the two properties are present. The MacbookPro14,3 in this example proves that (the same as the post you referred to).

Regarding the value, I started with 3000 and it's been working stable for days. Today, I switched to 2100 and it also seems to work fine. Actually, I don't see any different in About This Mac > System Report > USB. For example:

It seems like with different devices, macOS will adjust Current available accordingly. (I don't own an iPhone so cannot test that tho) I even tried with 800mA (0x0320), and the above results stay the same. However, I encountered sleep issue due to the improper USB power. So I will stick with either 2100 or 3000 for now.

Edit: add image