Jump to content
22 posts in this topic

Recommended Posts

It's good that I have successfully fixed this error by Map USB again in window, first, download this tool to discover usb https://github.com/USBToolBox/tool/releases/tag/0.0.9 and https://github.com/USBToolBox/kext/releases/tag/1.1.0 (a kext)


things to do before mapping: 

Enable EHCI hand-off:

download modGRUBShell.efi (put it to tools folder: OC/Tools and snapshot), after reboot and slect modGRUBShell.efi.

For usb to function as good as possible we need to enable handing off EHCx ports to the XHCI controller. We accomplish that by entering the following commands; setup_var 0x2 0x1 and setup_var 0x144 0x1 the first enables EHCI hand-off itself and the second one sets XHCI in normal enabled mode. It's needed because the default value called Smart Auto isn't so smart after all. So we simply enable it.

Lastly we enable routing of the EHCx ports to XHCI ones and disable EHCx all together. Only legacy OS would need it. Enter setup_var 0x15A 0x2 to enable the routing then enter setup_var 0x146 0x0 and setup_var 0x147 0x0 to disable the EHCx ports

We're done. Exit the shell by running therebootcommand.

MAPPING:

 

1 : Open usbmap tool (in windows it's called window.exe)

2: discover usb ports
3: use usb2.0 and usb3.0 and detect one by one all usb ports
4: disable all empty ports
5: build USBmap.kext (it will create where you open the tool)


When you done, put USBmap.kext and USBToolbox.kext to OC/kext and snapshot.


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hi everyone, recently, i have successfully installed MacOS Big Sur on my computer Optiplex 9020M, everything works great but only sleep/awake not working.

MY PC

Mainboard : Dell OptiPlex 9020M
CPU : Intel i5-4590T
GPU : Intel HD 4600
RAM : 8GB DDR3
Sound : Realtek ALC255
Disk Drive : NT-256-TI 238GB Network
Ethernet: - Connection I217-LM
Wifi: Dual Band Wireless-AC 7260

When i try sleep my computer, my pc just turn off the screen, it went to sleep but after a few seconds it came back on (the screen already off). i was wait some minutes (30minutes) and then i can't wake up my computer (need press power button to shutdown).

I was use this command to see log:

pmset -g log | grep -e "Sleep.*due to" -e "Wake.*due to"
hoang@Hoang ~ % pmset -g log | grep -e "Sleep.*due to" -e "Wake.*due to"
2021-09-12 13:40:09 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=148': Using AC (Charge:0%) 7 secs    
2021-09-12 13:40:16 +0700 DarkWake            DarkWake from Normal Sleep [CDN] : due to GLAN EH01 EH02 XHC HDEF/Network Using AC (Charge:0%) 5 secs    
2021-09-12 13:40:21 +0700 Wake                DarkWake to FullWake from Normal Sleep [CDNVA] : due to UserActivity Assertion Using AC (Charge:0%)           
2021-09-12 14:09:57 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=152': Using AC (Charge:0%) 8 secs    
2021-09-12 14:10:05 +0700 DarkWake            DarkWake from Normal Sleep [CDN] : due to EH01 EH02 XHC/ Using AC (Charge:0%) 46 secs   
2021-09-12 14:10:51 +0700 Sleep               Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 6 secs    
2021-09-12 14:10:57 +0700 DarkWake            DarkWake from Normal Sleep [CDN] : due to EH01 EH02 XHC/ Using AC (Charge:0%) 46 secs   
2021-09-12 14:11:43 +0700 Sleep               Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 6 secs    
2021-09-12 14:11:49 +0700 DarkWake            DarkWake from Normal Sleep [CDN] : due to EH01 EH02 XHC/UserActivity Assertion Using AC (Charge:0%) 2 secs    
2021-09-12 14:11:51 +0700 Wake                DarkWake to FullWake from Normal Sleep [CDNVA] : due to UserActivity Assertion Using AC (Charge:0%) 798 secs
2021-09-12 14:25:09 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=152': Using AC (Charge:0%) 10 secs   
2021-09-12 14:25:19 +0700 Wake                Wake from Safe Sleep [CDNVA] : due to EH01 EH02 XHC/UserActivity Assertion Using AC (Charge:0%)           
2021-09-12 14:26:35 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=164': Using AC (Charge:0%) 8 secs    
2021-09-12 14:26:43 +0700 DarkWake            DarkWake from Safe Sleep [CDN] : due to EH01 EH02 XHC/ Using AC (Charge:0%) 12 secs   
2021-09-12 14:26:55 +0700 Wake                DarkWake to FullWake from Safe Sleep [CDNVA] : due to UserActivity Assertion Using AC (Charge:0%)           
2021-09-12 14:35:11 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=159': Using AC (Charge:0%) 6 secs    
2021-09-12 14:35:17 +0700 DarkWake            DarkWake from Normal Sleep [CDN] : due to EH01 EH02 XHC/ Using AC (Charge:0%) 44 secs   
2021-09-12 14:36:01 +0700 Sleep               Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 6 secs    
2021-09-12 14:36:07 +0700 DarkWake            DarkWake from Normal Sleep [CDN] : due to EH01 EH02 XHC/ Using AC (Charge:0%)           
2021-09-12 19:10:06 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=151': Using AC (Charge:0%) 8 secs    
2021-09-12 19:10:14 +0700 DarkWake            DarkWake from Normal Sleep [CDN] : due to EHC1 EHC2/ Using AC (Charge:0%) 4 secs    
2021-09-12 19:10:18 +0700 Wake                DarkWake to FullWake from Normal Sleep [CDNVA] : due to UserActivity Assertion Using AC (Charge:0%)           
2021-09-12 19:59:00 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=1161': Using AC (Charge:0%) 8 secs    
2021-09-12 19:59:08 +0700 Wake                Wake from Normal Sleep [CDNVA] : due to GLAN EH01 EH02 XHC HDEF/UserActivity Assertion Using AC (Charge:0%)           
2021-09-12 20:55:32 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=153': Using AC (Charge:0%) 8 secs    
2021-09-12 20:55:40 +0700 Wake                Wake from Normal Sleep [CDNVA] : due to GLAN HDEF/UserActivity Assertion Using AC (Charge:0%)           
2021-09-12 22:21:41 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=149': Using AC (Charge:0%) 9 secs    
2021-09-12 22:21:50 +0700 Wake                Wake from Normal Sleep [CDNVA] : due to GLAN HDEF/UserActivity Assertion Using AC (Charge:0%)           
2021-09-12 23:27:54 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=151': Using AC (Charge:0%) 7 secs    
2021-09-12 23:28:01 +0700 DarkWake            DarkWake from Normal Sleep [CDN] : due to GLAN HDEF/Network Using AC (Charge:0%) 4 secs    
2021-09-12 23:28:05 +0700 Wake                DarkWake to FullWake from Normal Sleep [CDNVA] : due to UserActivity Assertion Using AC (Charge:0%)           
2021-09-12 23:58:58 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=161': Using AC (Charge:0%) 7 secs    
2021-09-12 23:59:05 +0700 DarkWake            DarkWake from Normal Sleep [CDN] : due to EH01 EH02/ Using AC (Charge:0%) 8 secs    
2021-09-12 23:59:13 +0700 Wake                DarkWake to FullWake from Normal Sleep [CDNVA] : due to UserActivity Assertion Using AC (Charge:0%)           
2021-09-13 00:23:39 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=150': Using AC (Charge:0%)           
2021-09-13 00:28:10 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=150': Using AC (Charge:0%) 7 secs    
2021-09-13 00:28:17 +0700 DarkWake            DarkWake from Normal Sleep [CDN] : due to EHC1 EHC2/ Using AC (Charge:0%) 46 secs   
2021-09-13 00:29:03 +0700 Wake                DarkWake to FullWake from Normal Sleep [CDNVA] : due to UserActivity Assertion Using AC (Charge:0%)           
2021-09-13 02:43:47 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=150': Using AC (Charge:0%) 9 secs    
2021-09-13 02:43:56 +0700 Wake                Wake from Safe Sleep [CDNVA] : due to EHC1 EHC2/UserActivity Assertion Using AC (Charge:0%) 235 secs
2021-09-13 02:47:51 +0700 Sleep               Entering Sleep state due to 'Software Sleep pid=150': Using AC (Charge:0%) 7 secs    
2021-09-13 02:47:58 +0700 DarkWake            DarkWake from Normal Sleep [CDNP] : due to EHC1 EHC2/ Using AC (Charge:0%) 7 secs    
2021-09-13 02:48:05 +0700 Wake                DarkWake to FullWake from Normal Sleep [CDNVA] : due to UserActivity Assertion Using AC (Charge:0%)

And this is my this is my pmset settings :
 

standby              0
Sleep On Power Button 1
womp                 0
hibernatefile        /var/vm/sleepimage
gpuswitch            2
powernap             0
networkoversleep     0
disksleep            10
standbydelayhigh     86400
sleep                15 (sleep prevented by UserEventAgent, coreaudiod)
autopoweroffdelay    259200
hibernatemode        0
autopoweroff         0
ttyskeepawake        1
displaysleep         15
highstandbythreshold 50
standbydelaylow      86400


I tried fix follow guide opencore, darkwake = 0, 8, 10, mapped usb + rename port EHC1 to EHC01, EHC2 to EHC02 but still can't sleep, anyone know please help me fix this, thank you very much. 


My Config file:

Edited by kinhhoang161
fix successful

I have exactly the same problem, the screen will wake up after going to sleep every 30 seconds, then go back to sleep.  Read many posts, but nothing worked.  Uninstalled things like Chrome etc, tried a clean install, without any added programs.  The problem persists.   In the end I just allow the screen to switch off, but keep the computer awake.  I hope someone shares a fix

Edited by slam
7 minutes ago, slam said:

I have exactly the same problem, sleep never worked.  Read many posts, but nothing worked.  In the end I just allow the screen to switch off, but keep the computer awake.  I hope someone shares a fix

yeah, i hope so  : (((

15 minutes ago, slam said:

did you try the fixes proposed by OpenCore Dortania guide?  Is in the "OpenCore Post-Install" / Universal / Fixing Sleep.  I never tried it before, coz I couldn't get USB mapping to work, but now that is working, I might give it a try

i was try fix something like guide opencore but not working at all :(

ok, tried it just now, and sleep is working well for me.  I suspect the problem was my Bios setting: "Wake up by LAN".  I'm not sure if Dell locks it's Bios, there may be bios settings that you can't change.  I know this is idiotic, but did you un-check the System Preferences / Energy Saver / Prevent computer from sleeping automatically when the display is off

Edited by slam
4 hours ago, slam said:

ok, tried it just now, and sleep is working well for me.  I suspect the problem was my Bios setting: "Wake up by LAN".  I'm not sure if Dell locks it's Bios, there may be bios settings that you can't change.  I know this is idiotic, but did you un-check the System Preferences / Energy Saver / Prevent computer from sleeping automatically when the display is off

haizz, im sure i disabled wake up on lan, and un-check automatically display off :(

 

Screen Shot 2021-09-16 at 23.21.58.png

Edited by kinhhoang161

did you try:

sudo pmset autopoweroff 0

sudo pmset powernap 0

sudo pmset standby 0

sudo pmset proximitywake 0

sudo pmset tcpkeepalive 0

 

config.plist

Misc > Boot > HibernateMode > None

NVRAM Add boot-args: keepsyms=1, and swd_panic=1

 

Bios:

disable: Wake on LAN, Trusted Platform Module, Wake on USB

Enable: Wake on Bluetooth

 

But I suspect your USB Map is the problem.  Is so tricky to get right, there are a few mysterious ports on every motherboards, that seem useless, but can't be missed out.

 

10 hours ago, slam said:

did you try:

sudo pmset autopoweroff 0

sudo pmset powernap 0

sudo pmset standby 0

sudo pmset proximitywake 0

sudo pmset tcpkeepalive 0

 

config.plist

Misc > Boot > HibernateMode > None

NVRAM Add boot-args: keepsyms=1, and swd_panic=1

 

Bios:

disable: Wake on LAN, Trusted Platform Module, Wake on USB

Enable: Wake on Bluetooth

 

But I suspect your USB Map is the problem.  Is so tricky to get right, there are a few mysterious ports on every motherboards, that seem useless, but can't be missed out.

 

yes, i was try it (opencore guide right?)

 

10 hours ago, slam said:

came across this page, only the first part is in Chinese, most of it is in English

https://github.com/ismethr/9020mHack#mapping-the-internal-usb-header-for-mt-models

i was map usb like that, i think i successful map usb @@

Screen Shot 2021-09-17 at 11.04.37.png

could it be the USB item attached to EH01/02 drawing power or charging, causing the system to be awake all the time?

 

The trouble with USB Mapping needs to be done under USBInjectAll and in Big Sur ver 11.1 or 11.2, the newer version all need a mapped kext, once you are running that mapped map, the unmapped ports won't show anymore.  I had many problems with Hackintool, for some reason not all the ports were listed, and some were listed with the wrong names.  I had to use USBMap.command, to get the full list of ports with the correct names.  But I kept having problems making the kext using USBMap.  Ended up using Hackintool to make the kext.  Inside Hackintool I had to rename some of the ports following the USBMap names.

Edited by slam
1 hour ago, slam said:

could it be the USB item attached to EH01/02 drawing power or charging, causing the system to be awake all the time?

 

The trouble with USB Mapping needs to be done under USBInjectAll and in Big Sur ver 11.1 or 11.2, the newer version all need a mapped kext, once you are running that mapped map, the unmapped ports won't show anymore.  I had many problems with Hackintool, for some reason not all the ports were listed, and some were listed with the wrong names.  I had to use USBMap.command, to get the full list of ports with the correct names.  But I kept having problems making the kext using USBMap.  Ended up using Hackintool to make the kext.  Inside Hackintool I had to rename some of the ports following the USBMap names.

do u have discord or another social network?, please teach me more about map usb, I appreciate it, thank you

no I don't

but the first problem is do you have a backup of Catalina or Big Sur ver 11.0/11.1/11.2 that you can run USBInjectAll on?

if you screenshot the USBMap.command output and the Hackintool output, we can try to work out the internal ports/hubs that you might not have included

Otherwise, you can wait until your next clean install to try figure it out.

Edited by slam
19 minutes ago, slam said:

no I don't

but the first problem is do you have a backup of Catalina or Big Sur ver 11.0/11.1/11.2 that you can run USBInjectAll on?

if you screenshot the USBMap.command output and the Hackintool output, we can try to work out the internal ports/hubs that you might not have included

Otherwise, you can wait until your next clean install to try figure it out.


here is screenshot of the USBMap.command, pls check it (i was remove EHC1 and EHC0, now it just have XHC), did i need usbtoolbox.kext ? or uiac.aml ?

 

Screen Shot 2021-09-17 at 15.04.04.png

Screen Shot 2021-09-17 at 15.10.09.png

Edited by kinhhoang161
5 minutes ago, slam said:

which version of MacOS is this on? And is this using USBInjectAll?

And did you press Q already? Because your USB3 ports the SS01, SS02 etc etc are all missing

i don't have USB 3.0 so i can't map this, i just have 2.0 usb (device), i was press Q to create kext, and i already have USBInjectedAll, i am using Big Sur version (11.5.2)

 

 

7 minutes ago, slam said:

which version of MacOS is this on? And is this using USBInjectAll?

And did you press Q already? Because your USB3 ports the SS01, SS02 etc etc are all missing

that is all my kext and ssdt

Screen Shot 2021-09-17 at 15.24.00.png

Screen Shot 2021-09-17 at 15.24.14.png

Edited by kinhhoang161

how many times did you let it run?  I think when you press D, it will run and run and run many times, until you stop it.  I remember I let it run for awhile, before stopping it.  The port names changed after the first few runs.  The naming on the screen looks a bit different, it should have similar names like HS01, HS02 similar to the hackintool screenshot you had at the top

I'm not familiar with OC configurator, use ProperTree only.  But are you running both USBInjectAll and USBKext at the same time?  Is it possible to remove USBMap.kext? or will your system crash?

I found a youtube video on it, not sure if it is helpful

not  

Edited by slam

Anyway it seems, looking at your USBMap output: that your ports should be HS01, HS02 .... to  HS15 (15 ports)

But the Hackintool output is showing PRT1, PRT1, HS01 ... to HS10.  Try to clear it using the "brush" icon, then refresh again, see if it'll show all 15 ports

And another thing that I found useful, was to remove as many kexts as possible, the more kexts it has, the easier it breaks.  The essential ones are Lilu, VirtualSMC, WhateverGreen, AppleALC, USBPorts, IntelMausi.

For bluetooth, did you try running without those kext? IntelBluetoothFirmware etc

And does your system run without the CPUFriend etc?

I'm afraid is a bit of trial and error, I'll try remove as much as possible, until sleep works, then add the kext back on, one by one, and see if sleep still works, to find which one is the one breaking it.

 

Edited by slam
1 hour ago, slam said:

Anyway it seems, looking at your USBMap output: that your ports should be HS01, HS02 .... to  HS15 (15 ports)

But the Hackintool output is showing PRT1, PRT1, HS01 ... to HS10.  Try to clear it using the "brush" icon, then refresh again, see if it'll show all 15 ports

And another thing that I found useful, was to remove as many kexts as possible, the more kexts it has, the easier it breaks.  The essential ones are Lilu, VirtualSMC, WhateverGreen, AppleALC, USBPorts, IntelMausi.

For bluetooth, did you try running without those kext? IntelBluetoothFirmware etc

And does your system run without the CPUFriend etc?

I'm afraid is a bit of trial and error, I'll try remove as much as possible, until sleep works, then add the kext back on, one by one, and see if sleep still works, to find which one is the one breaking it.

 

hey, thanks you with your help, i was sleep successful, i was try map usb map most accurately using USBMap at window 10  and it work (and unplug the speaker uses power from the usb port, add more " XHC1 to SHCI" patch)

  • Like 1

I didn't think of windows 10, you are so smart! 👍  I suspect there will be more people trying to get sleep to work on this dell model, if you can write a few notes on how you got it, and list out the ports, I'm sure many people will appreciate your work! 😀  And if you change the title to something like "Fixing sleep for Dell OptiPlex 9020M [Solved]"

Edited by slam
28 minutes ago, slam said:

I didn't think of windows 10, you are so smart! 👍  I suspect there will be more people trying to get sleep to work on this dell model, if you can write a few notes on how you got it, and list out the ports, I'm sure many people will appreciate your work! 😀  And if you change the title to something like "Fixing sleep for Dell OptiPlex 9020M [Solved]"

yeahhaa, thank for your help xD

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...