xma / T480-Clover

Lenovo T480 hackintosh ThinkPad - using Clover

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wake from Sleep with Bluetooth devices

opatotto opened this issue · comments

I just noticed when I want to wake from sleep pressing my integrated Keyboard, BT keyboard or magic trackpad 2 doesn't work, the only way to wake from sleep is pressing the power button.

I'm using Broadcom WiFi card BCM94360NG that works out of the box with hackintosh, WiFi and BT working very good with this repo with some changes.

I removed some unnecessary kext related with other Broadcom WiFi cards and modified my config.plist like:

  • AirportBrcmFixup.kext/Contents

  • BrcmBluetoothInjector.kext/Contents

  • BrcmFirmwareData.kext/Contents

  • BrcmPatchRAM3.kext/Contents

Removed from config.plist:

<key>PciRoot(0x0)/Pci(0x1c,0x6)/Pci(0x0,0x0)</key>
			<dict>
				<key>AAPL, slot-name</key>
				<string>Wlan</string>
				<key>compatible</key>
				<string>pci14e4,43b1</string>
				<key>device_type</key>
				<string>Airport Extreme</string>
				<key>model</key>
				<string>DW1560 (BCM4352) 802.11ac Wireless</string>
				<key>name</key>
				<string>Airport</string>
			</dict>

I also have selected the option to wake from BT in advance config in my mac, I would like to know if you have this issue or it's only me?

It's hard for me to help
I don't have nor use bluetooth keyboard/mouse : BT is only used with an android phone for me.

I'd think it could be related to USB port going down at sleep - Bluetooth is connected on internal USB port.

You could use hackintool
https://github.com/headkaze/Hackintool
go to USB tab and find where Bluetooth is connected : for me it's HS07

hackintool

On the 'Connector' column it's seen as 'Internal' : which is correct and means macOS won't turn it off at sleep.

A last thing to check: going in System Preferences -> Bluetooth -> Advanced
make sure 'Allow Bluetooth devices to wake this computer' is ticked
bluetooh_preferences

Interesting... actually I have the card with HS07, but the device should be different because I'm using a different WiFi card BCM94360NG right? I also have all the options selected on BT advance config...

Captura de Pantalla 2020-06-28 a la(s) 0 38 41

I would like to know if you can wake from sleep pressing your integrated ThinkPad keyboard? If I can do that, I think I could be able to do it with my BT

I would like to know if you can wake from sleep pressing your integrated ThinkPad keyboard? If I can do that, I think I could be able to do it with my BT

Yes, I've tested here 'Sleep' from menu (not closing the lid)
I've then pressed keyboard ( left bottom line : Fn , option command / ... ) : it goes from sleep to wake state

I had tried pressing other keys on my built-in keyboard, but only works with Fn and left Ctrl as you mention, but with BT keyboard I still can't wake from sleep

When the computer is sleeping can you still see it in bluetooth pairing ? I'm thinking BT it disabled as soon as the computer goes sleep...

I'm sure BT devices are still paired, but I'm guessing there is only one key mapped, Fn key (left Ctrl key actually doesn't work) and the Power on/off button

wakeup by internal keyboard/trackpad isn't (easily) possible afaik because they are connected via ps2 and not via usb. For BT it's working for me and it's, as mentioned already, a question of powerstates of the BT-adapter and pmset-settings.

This is what's working for me:

❯ pmset -g
System-wide power settings:
 DestroyFVKeyOnStandby		1
Currently in use:
 standbydelaylow      10800
 standby              1
 womp                 0
 halfdim              1
 hibernatefile        /var/vm/sleepimage
 proximitywake        0
 powernap             1
 gpuswitch            0
 networkoversleep     0
 disksleep            10
 standbydelayhigh     86400
 sleep                1 
 hibernatemode        3
 ttyskeepawake        1
 displaysleep         10
 tcpkeepalive         1
 highstandbythreshold 50
 lidwake              1

I have these values:

❯ pmset -g
System-wide power settings:
Currently in use:
 lidwake              1
 autopoweroff         1
 standbydelayhigh     86400
 autopoweroffdelay    28800
 proximitywake        1
 standby              1
 standbydelaylow      10800
 ttyskeepawake        1
 hibernatemode        0
 powernap             1
 gpuswitch            2
 hibernatefile        /var/vm/sleepimage
 highstandbythreshold 50
 womp                 1
 displaysleep         10
 networkoversleep     0
 sleep                10
 tcpkeepalive         1
 halfdim              1
 autorestart          0
 disksleep            10

I don't have too much experience with this. Can you help me telling me how to change those values to perform some tests?

I think it's not possible in sleepmode 0. I'm using sleepmode 3, which is what modern macbook's are using and most of my pm-settings are as native as possible to enable those kind of native features .

While I'm thinking of it, I'm not sure if sleepmode 3 is possible with clover at all - I never tried it and I'm using the latest version of opencore.

Bottom line: It's possible, but likely relatively high effort for you with many changes. If you want to investigate, I posted my OC-Folder a few days back here: tylernguyen/x1c6-hackintosh#28 (comment)

I'm performing some tests, I read some posts with similar problems, on the config.plist there is an option:

<key>AddClockID</key>
<true/>

Acoding to the wiki: https://sourceforge.net/p/cloverefiboot/wiki/Devices/#usb-addclockid

true - Enables a good, deep sleep, which cannot be exited by keyboard or mouse input.
false - The PC will possibly sleep and it can be woken up by keyboard or mouse; or it will be automatically woken up by some attached device

Injects the property "AAPL,clock-id" with a unique identifier for each device. Set it to your liking.

Requires USBInjection to be enabled.

Default value is set to disabled.

I changed with false, but I still can't wake with BT devices

The problem lies deeper. Wakeup-Handling on Macs is quite different. More on that topic to be found here: https://github.com/osy86/HaC-Mini/blob/master/details/usb-fix.md

Thanks for the info, I'm gonna read it and keep trying :)

I'm gonna close this issue, as the only alternative to wake from sleep is using the lid or the fn key or the power button.

Something that also was facing was my computer was waking up by itself, I fixed this issue changing tcpkeepalive to 0 on pmset if somebody has this problem.