Contribute
Register

USB Devices Eject on Sleep

Joined
Apr 5, 2018
Messages
92
Motherboard
Z390 Phan ITX/ac
CPU
i9-9900k
Graphics
RX 5600 XT
Mac
MacBook Pro
Hello,

Problem: Randomly after waking from Sleep, USB storage devices are improperly ejected. Only USB 3.0 storage devices re-connect automatically, with USB 2.0 storage devices requiring the device to be physically unplugged and replugged. Duration of sleep does not appear to matter: Testing has been done at 10 second, 1 minute, 5 minute, 15 minute, and 1 hour intervals. Each have resulted in passes and fails.

Current hardware:
  • Intel i9-9900k (stock speed)
  • ASRock Z390 Phantom Gaming ITX/ac
  • 64GB 3200MHz RAM (XMP Profile 1)
  • 2TB Samsung Pro 960 M.2
  • Sapphire Pulse RX 5600 XT 6GB
BIOS + Install Method:
  • macOS Catalina 10.15.4 clean install
  • Opencore 0.5.7
  • BIOS: XHCI-Handoff -> Enabled
  • BIOS: 4G Decoding -> Enabled
Devices Used to test:
  • 8GB USB 2.0 HP thumb drive
  • 64GB USB 3.0 SanDisk thumb drive
  • 1TB Samsung T1
  • 1TB Samsung T5
  • 1TB SanDisk SATA -> USB 3.0 enclosure

Attempted Solutions:
  1. USBInjectAll.kext + SSDT-UIAC.aml (tried with USB 2.0 HSxx ports set to both 0x00 and 0x03 for UsbConnector)
  2. Disabled all C-states except C0 and C1E in the BIOS
  3. Enabled/Disabled Energy Saver -> "Put Hard Drives To Sleep When Possible"
  4. Enabled/Disabled Energy Saver ->"Power Nap"
  5. Enabled/Disabled Energy Saver ->"Wake for Ethernet Network Access"
  6. Set "pmset hibernatemode" to 0, 3, and 25
  7. Set "pmset gpuswitch" to 1 and 2
  8. Set "pmset proximitywake" to 0 and 1
  9. Set "pmset standby" to 0 and 1
Each of the above solutions has been tried in a reset (original) environment, and in combination with each other. No dice.

------------------------

Anybody have any ideas what I can try from here?
I am quite stumped. Searching these forums and r/Hackintosh has yet to uncover anything new that I haven't tried. Thanks all!!!
 

Attachments

UtterDisbelief

Moderator
Joined
Feb 13, 2012
Messages
4,480
Motherboard
Gigabyte Z390M Gaming
CPU
i5-9600K
Graphics
RX 570
Mac
iMac, Mac mini
Classic Mac
eMac, iBook
Mobile Phone
iOS
Hello,

Problem: Randomly after waking from Sleep, USB storage devices are improperly ejected. Only USB 3.0 storage devices re-connect automatically, with USB 2.0 storage devices requiring the device to be physically unplugged and replugged. Duration of sleep does not appear to matter: Testing has been done at 10 second, 1 minute, 5 minute, 15 minute, and 1 hour intervals. Each have resulted in passes and fails.

Current hardware:
  • Intel i9-9900k (stock speed)
  • ASRock Z390 Phantom Gaming ITX/ac
  • 64GB 3200MHz RAM (XMP Profile 1)
  • 2TB Samsung Pro 960 M.2
  • Sapphire Pulse RX 5600 XT 6GB
BIOS + Install Method:
  • macOS Catalina 10.15.4 clean install
  • Opencore 0.5.7
  • BIOS: XHCI-Handoff -> Enabled
  • BIOS: 4G Decoding -> Enabled
Devices Used to test:
  • 8GB USB 2.0 HP thumb drive
  • 64GB USB 3.0 SanDisk thumb drive
  • 1TB Samsung T1
  • 1TB Samsung T5
  • 1TB SanDisk SATA -> USB 3.0 enclosure

Attempted Solutions:
  1. USBInjectAll.kext + SSDT-UIAC.aml (tried with USB 2.0 HSxx ports set to both 0x00 and 0x03 for UsbConnector)
  2. Disabled all C-states except C0 and C1E in the BIOS
  3. Enabled/Disabled Energy Saver -> "Put Hard Drives To Sleep When Possible"
  4. Enabled/Disabled Energy Saver ->"Power Nap"
  5. Enabled/Disabled Energy Saver ->"Wake for Ethernet Network Access"
  6. Set "pmset hibernatemode" to 0, 3, and 25
  7. Set "pmset gpuswitch" to 1 and 2
  8. Set "pmset proximitywake" to 0 and 1
  9. Set "pmset standby" to 0 and 1
Each of the above solutions has been tried in a reset (original) environment, and in combination with each other. No dice.

------------------------

Anybody have any ideas what I can try from here?
I am quite stumped. Searching these forums and r/Hackintosh has yet to uncover anything new that I haven't tried. Thanks all!!!

Hi there.

I don't have direct experience with your particular motherboard, so can't comment on all the other optimisations, but I do note there is an error in your SSDT-UIAC.aml.

The "port-count" value is incorrect. It is set as "0x1A" whereas it should be "0x18".

Not sure if that will help, but worth pointing-out.

:)
 
Joined
Apr 5, 2018
Messages
92
Motherboard
Z390 Phan ITX/ac
CPU
i9-9900k
Graphics
RX 5600 XT
Mac
MacBook Pro
I think I can safely rule out the XMP Profile as causing any issues. I found a way to consistently get the error:

Start the computer -> Login -> Sleep -> Wake -> Login -> Run Geekbench 5 CPU test -> Sleep -> Wake (and devices ejected improperly)

Resetting the RAM to stock frequency or any combination of settings doesn't appear to change it -- USB storage devices always eject after that specific series of events. I remember that happening on macOS High Sierra with Clover, but I fixed that by creating my SSDT-UIAC for the USB ports. I have the same SSDT-UIAC and USBInjectAll.kext but to no avail.

What else causes USB storage devices to eject? Not a Z390 issue?
 
Joined
Apr 5, 2018
Messages
92
Motherboard
Z390 Phan ITX/ac
CPU
i9-9900k
Graphics
RX 5600 XT
Mac
MacBook Pro
Hi there.

I don't have direct experience with your particular motherboard, so can't comment on all the other optimisations, but I do note there is an error in your SSDT-UIAC.aml.

The "port-count" value is incorrect. It is set as "0x1A" whereas it should be "0x18".

Not sure if that will help, but worth pointing-out.

:)
Fixed? :) Thanks for finding that! Going to test it right now!

EDIT: Tested at stock frequencies and at stock frequencies with +0.05v under both Opencore 0.5.7 and Opencore 0.5.8. No difference -- USB storage devices still eject. Just curious, why should the port count be "24" instead of either "26" (chipset maximum I think) or "15" (macOS maximum) ? Thanks for the tip anyhow!! Here's a sanity check for my Opencore 0.5.8 config by the way: https://opencore.slowgeek.com/?file=coffeelake05821wvh0&rs=coffeelake058

Here's a
 

Attachments

Last edited:

UtterDisbelief

Moderator
Joined
Feb 13, 2012
Messages
4,480
Motherboard
Gigabyte Z390M Gaming
CPU
i5-9600K
Graphics
RX 570
Mac
iMac, Mac mini
Classic Mac
eMac, iBook
Mobile Phone
iOS
Fixed? :) Thanks for finding that! Going to test it right now!

EDIT: Tested at stock frequencies and at stock frequencies with +0.05v under both Opencore 0.5.7 and Opencore 0.5.8. No difference -- USB storage devices still eject. Just curious, why should the port count be "24" instead of either "26" (chipset maximum I think) or "15" (macOS maximum) ? Thanks for the tip anyhow!! Here's a sanity check for my Opencore 0.5.8 config by the way: https://opencore.slowgeek.com/?file=coffeelake05821wvh0&rs=coffeelake058

Here's a

Ah well, worth a try :thumbup:

The "port-count" is actually the location of the highest port in the configured system, not the number of ports. I know it sounds wrong, but that's how it is. For a 15-port system you would otherwise expect the value to always be 0x0F etc.

USB devices being randomly 'dropped' before, after, during sleep, can also be power-related. Not just the value of the power but how it is patched in ACPI. Sadly not my strong point. Hopefully someone else will come along who has your motherboard. Good luck!

:)

P.S - I guess you've scoured this thread for tips:

 
Last edited:
Joined
Apr 5, 2018
Messages
92
Motherboard
Z390 Phan ITX/ac
CPU
i9-9900k
Graphics
RX 5600 XT
Mac
MacBook Pro
Only RAM setting that permits USB Devices to eject properly upon Sleep:
1600MHz @ 1.35v

XMP Profile or stock profile will both work, but the frequency must be capped at 1600MHz and voltage must be set to at least 1.35v. This results in a ~20% reduction in my CPU/RAM benchmarks, and results in the CPU running with +15% Utilization when rendering video or music projects.

I really wanted to find a .kext or .aml solution, but came up empty-handed. I have since installed Jettison which does eject USB storage devices properly upon Sleep and remounts them upon Wake:
 

UtterDisbelief

Moderator
Joined
Feb 13, 2012
Messages
4,480
Motherboard
Gigabyte Z390M Gaming
CPU
i5-9600K
Graphics
RX 570
Mac
iMac, Mac mini
Classic Mac
eMac, iBook
Mobile Phone
iOS
Only RAM setting that permits USB Devices to eject properly upon Sleep:
1600MHz @ 1.35v

XMP Profile or stock profile will both work, but the frequency must be capped at 1600MHz and voltage must be set to at least 1.35v. This results in a ~20% reduction in my CPU/RAM benchmarks, and results in the CPU running with +15% Utilization when rendering video or music projects.

I really wanted to find a .kext or .aml solution, but came up empty-handed. I have since installed Jettison which does eject USB storage devices properly upon Sleep and remounts them upon Wake:

Yes, overclocking memory and XMP settings do indeed cause this issue. See how easy it is to go down one route like USB configuration, when all along it is something else entirely? :crazy:

For what it is worth I discovered that sticking with base 2133MHz memory and no XMP profiles prevented this issue.

People often wonder why memory in even Apple's high-end computers tops-out at, say, 2666MHz. Well, there seems to be good reasons. Most builders don't realise that running memory at 3000MHz might indeed be within design parameters for the RAM sticks, but is actually overclocking as far as the system is concerned.

:)
 
Last edited:
Joined
Apr 5, 2018
Messages
92
Motherboard
Z390 Phan ITX/ac
CPU
i9-9900k
Graphics
RX 5600 XT
Mac
MacBook Pro
Yes, overclocking memory and XMP settings do indeed cause this issue. [...]

For what it is worth I discovered that sticking with base 2133MHz memory and no XMP profiles prevented this issue.
Yes absolutely crazy! The i9-9900k is supposed to be able to run with 2666MHz RAM, and as you said Apple does make a computer with both that processor and that RAM speed. Nonetheless loading stock ot looser timings alongside 2666MHz, 2133MHz, or 1800MHz frequency all exhibited the USB ejection problem. Even if XMP is the culprit in most cases, that’s not true here since I also tested with it disabled; the issue lies in a more foundational RAM<->USB compatability issue, whether that’s this particular mobo, this particular RAM, or both!

I’ve had this same issue on many Macs before too, including my Late 2013 Macbook Pro. All I know about that one is it’s not hibernate/deep sleep as I tried disabling that to no avail. It’s also not the Logic Board since that was replaced three times!

Considering all of the evidence though, the fact that real Macs have this issue as well, and that the Jettison app fixes the issue, that leads me to think Apple could certainly find a way to implement Ejection upon Sleep at the OS-level prior to any system power or frequency shift. Maybe even make the option a toggle in System Preferences.

Any thoughts on why they haven’t? :idea:
 

UtterDisbelief

Moderator
Joined
Feb 13, 2012
Messages
4,480
Motherboard
Gigabyte Z390M Gaming
CPU
i5-9600K
Graphics
RX 570
Mac
iMac, Mac mini
Classic Mac
eMac, iBook
Mobile Phone
iOS
Yes absolutely crazy! The i9-9900k is supposed to be able to run with 2666MHz RAM, and as you said Apple does make a computer with both that processor and that RAM speed. Nonetheless loading stock ot looser timings alongside 2666MHz, 2133MHz, or 1800MHz frequency all exhibited the USB ejection problem. Even if XMP is the culprit in most cases, that’s not true here since I also tested with it disabled; the issue lies in a more foundational RAM<->USB compatability issue, whether that’s this particular mobo, this particular RAM, or both!

I’ve had this same issue on many Macs before too, including my Late 2013 Macbook Pro. All I know about that one is it’s not hibernate/deep sleep as I tried disabling that to no avail. It’s also not the Logic Board since that was replaced three times!

Considering all of the evidence though, the fact that real Macs have this issue as well, and that the Jettison app fixes the issue, that leads me to think Apple could certainly find a way to implement Ejection upon Sleep at the OS-level prior to any system power or frequency shift. Maybe even make the option a toggle in System Preferences.

Any thoughts on why they haven’t? :idea:
Good points :thumbup:

Must admit that none of my real Macs had the problem, but then again I wasn't a Pro using high-end stuff, only iMac and Mac Mini.

It is really interesting to examine Apple's hardware specs though. There's a reason for everything...

:)
 
Top