imbushuo / mac-precision-touchpad

Windows Precision Touchpad Driver Implementation for Apple MacBook / Magic Trackpad
Other
8.77k stars 560 forks source link

Trackpad doesn't work after sleep #203

Closed vsegdacocacola closed 3 years ago

vsegdacocacola commented 5 years ago

Laptop: Macbook Pro 15 Late 2016 (A1707) OS: Windows 10 Pro 1903 (Build 18362.239) Driver version: 20.52.33.805 (20/07/2019)

After awake from sleep tochpad is irresponsible. Device manager gives an error for Apple SPI Precision Touchpad Device "Windows has stopped this device because it has reported problems. (Code 43)" and device is marked with exclamation mark.

In Windows System logs there is message:

The system has returned from a low power state.
Sleep Time: ‎2019‎-‎07‎-‎23T08:33:53.621268000Z
Wake Time: ‎2019‎-‎07‎-‎23T10:11:24.829314100Z
Wake Source: Device -Apple SPI Device

No any other errors identified related to this device.

Walkarounds:

  1. Touchpad works normally after reboot
  2. Disabling and then enabling Apple SPI Precision Touchpad Device fix the issue. Can be automated using bat script and DevCon,exe from Windowd Driver Kit.
vsegdacocacola commented 5 years ago

Regarding workaround 2:

  1. Install devcon.exe from Windows Driver Kit
  2. Find ID for your Apple SPI Precision Touchpad Device: devcon.exe find *
  3. Create batch script, which disable and then enable device
    devcon.exe disable "<your device ID before second slash>"
    devcon.exe enable "<your device ID before second slash>"
  4. Create task with task scheduler to run batch trigger by "On workstation unlock"
noyrat commented 5 years ago

add an description: This issue will happen when you wake by pressing keybord/trackpad(except power button) However,if you press power button to wake your macbook,the trackpad work still normal Laptop: Macbook pro 13' 2015

nvella commented 5 years ago

Can also confirm this issue on 2015 13" MacBook Pro MacBookPro12,1. Didn't find anything unusual in eventvwr, "Windows has stopped this device because it has reported problems. (Code 43)" under Apple SPI Precision Trackpad Device in Device Manager.

Kent-Narun commented 5 years ago

add an description: This issue will happen when you wake by pressing keybord/trackpad(except power button) However,if you press power button to wake your macbook,the trackpad work still normal Laptop: Macbook pro 13' 2015 Yes it's the same for Me Macbook Pro 13,2, Touch Bar 2016.

mau-lopez commented 5 years ago

I can also confirm this issue on 2015 13" MacBook Pro MacBookPro12,1 exactly as nvella and can also confirm that workaround from ravenxiao454 worked for me, thanks for that!

gregbell26 commented 5 years ago

This is an example of a script. What @vsegdacocacola didn't work for me.

` @echo off REM disables and reenables trackpad devcon disable "@SPI\VID_05AC&PID_0276&MI_02\5&33D07321&0&02"

devcon enable "@SPI\VID_05AC&PID_0276&MI_02\5&33D07321&0&02" `

You need to replace the "@SPI\*\*" with @ what you find with devcon list * You need the entire string

enricmarques commented 4 years ago

I can confirm this issue on two different laptops: a MacBook 12" 2017 and a MacBook Pro 13" 2017.

enricmarques commented 4 years ago

I still have this issue with the latest update, Here is an screenshot after waking the laptop:

image

image

image

The laptop has been woken up automatically as soon as I plugged the power adapter, as it seems recent Mac computers wake when they detect a change in the AC adapter. So I haven't pressed any key.

Disabling and re-enabling the device fixes the issue.

lawiparadise commented 4 years ago

I got same problem..

imbushuo commented 4 years ago

I am attempting to reproduce this on MacBook 12-inch 2016, but it seems a bit difficult for me to reproduce the issue (on latest version).

imbushuo commented 4 years ago

For anyone who encountered the issue, please follow the wiki notes to grab a copy of trace log and send it to me.

AuroraWright commented 4 years ago

@imbushuo LogSession_082819_234006.etl.zip From my 15" MBP 2016, I suspended and resumed twice before shutting down and trackpad failed to resume the first time. I used the latest driver.

imbushuo commented 4 years ago

@AuroraWright Try the driver build in https://ligstd.visualstudio.com/Apple%20PTP%20Trackpad/_build/results?buildId=3567&view=artifacts and see if the situation improves. I will not sign off an official build in Github yet.

AuroraWright commented 4 years ago

Still doesn't work. Not sure if this can be useful to you but I traced both cases. If you wake up using the power button, it wakes up correctly. If you wake up using keyboard/trackpad it doesn't work. Logsessions.zip

imbushuo commented 4 years ago

My assumption would be that the device and driver are "racing" during the power state transition. I do wonder why I cannot reproduce this on MacBook 12-inch.

cor commented 4 years ago

I'm having the same issue on my 15" MacBook Pro 2017.

For those looking for a good temporary solution, @vsegdacocacola workaround worked for me!

JohnnySun commented 4 years ago

I‘m having the same issue on my 13 MacBook Pro 2017

imbushuo commented 4 years ago

Might resolve with https://github.com/imbushuo/mac-precision-touchpad/commit/795e788be9a26354519e41bb4841dc6e2d5543e6 and https://github.com/imbushuo/mac-precision-touchpad/commit/600518f3a7e7b009cfb33bfa94489750f38c9435; I am testing it locally for a while. Weirdly enough, it is hard to reproduce this on MacBook 12-inch.

Build artifacts: https://ligstd.visualstudio.com/Apple%20PTP%20Trackpad/_build/results?buildId=3570

imbushuo commented 4 years ago

Update: if you encountered BSoD with https://ligstd.visualstudio.com/Apple%20PTP%20Trackpad/_build/results?buildId=3570, I would like to know your Boot Camp's driver version. It seems like an Apple upstream driver problem now :\

Kent-Narun commented 4 years ago

Update: if you encountered BSoD with https://ligstd.visualstudio.com/Apple%20PTP%20Trackpad/_build/results?buildId=3570, I would like to know your Boot Camp's driver version. It seems like an Apple upstream driver problem now :\

I encountered BSoD while using build id 3570. BootCamp Version 6.1.

JohnnySun commented 4 years ago

Update: if you encountered BSoD with https://ligstd.visualstudio.com/Apple%20PTP%20Trackpad/_build/results?buildId=3570, I would like to know your Boot Camp's driver version. It seems like an Apple upstream driver problem now :\

use this driver, sometime when open my mac, windows will crash. just got blue screen

xeijin commented 4 years ago

Same thing for me, no mouse on wake from sleep.

Except I can’t even disable and re-enable the device — it says ‘the driver is not installed’. When I try and either disable/re-enable, or manually point it to the drivers again it tells me I need to restart :(

The workaround mentioned to wake the laptop with the power button does not work for me.

Late 2016, 13” MacBook Pro with Touch Bar

Goyadoy commented 4 years ago

I have noticet another interesting behaviour on my MacBook Pro 15 2017.

  1. Go to sleep mode, then touch the touchpad, then press Enter to wake up - I have no pointer in windows, driver needs to be reenabled.
  2. Go to sleep mode, do not touch the touchpad, press Enter - drivers works just fine.
  3. And if I press the touchpad when macbook is in the sleep mode - I fell responce from the taptic engine, so it looks like touchpad is never fully sleeping.
orelh commented 4 years ago

I'm experiencing the same issue. 2016 15" MBP with SPI drivers.

kalatehbali commented 4 years ago

Same problem on: MBP 2017 - 15"

imbushuo commented 4 years ago

Need someone to test https://ligstd.visualstudio.com/7694e0d0-94e3-4fd2-b39a-ecd261e1ba2e/_build/results?buildId=3662. I will monitor my MacBook 12-inch for a while.

imbushuo commented 4 years ago

I've tried randomly wake the laptop up and put it into sleep (also hibernate) for a few times throughout the day. So far my trackpad doesn't die. However, I need more test data since the reproduce rate on MacBook8,1 / MacBook9,1 is significantly lower than other models.

kalatehbali commented 4 years ago

I still have this problem whenever I wake up the MBP from sleep with trackpad. Need to mention that haptic of trackpad will work even in Hibernate or Sleep modes!

MBP 15'-2017

imbushuo commented 4 years ago

@kalatehbali The current situation is a bit confusing to me, can I confirm that you are on the latest release (or simply try the latest release in Github release page)?

kalatehbali commented 4 years ago

@kalatehbali The current situation is a bit confusing to me, can I confirm that you are on the latest release (or simply try the latest release in Github release page)?

Ok, I was sure that I installed the latest version, but I did it again with Build: 3665. Meanwhile, I found another bug, which I think it's related to this.

So first, I still have this sleep issue whenever I wake up the MBP with the trackpad. Recently when I want to log in into windows after a reset or sleep sometimes, my keyboard freeze, and nothing works except touch-bar. So in this situation, I only can shut-down the MBP by holding the touch-id button to make a hard reset. If I try to quickly log-in into windows after seeing the welcome windows, all I can do is write the password and hit the enter to log-in, but after I see the desktop, my cursor becomes a blue circle and everything freeze.

Update1: I just checked this new bug in SAFE mode and everything was fine and no freeze, so I think maybe this is related to something else.

imbushuo commented 4 years ago

@kalatehbali The Apple SPI device is a bit weird as the stall of a single child device can affect others. What currently certain is that the problem is mitigated for a few other models, and I currently have no idea about the MBP’s case. Maybe I can get a device for test, but the lead time remains unpredictable.

Kent-Narun commented 4 years ago

I hope this BSD related files for Macbook Pro 2016 512GB be helpful.

Kernel_9f_cd257dae1ff721a157529411b5ae814c7cb4366_00000000_cab_32a32b3a-dac5-4069-8d52-25d972900859.zip Kernel_9f_6455579375eb6653d7f61794867f9954efbdee_00000000_cab_7c91ac2c-7fab-449a-a3ee-3cb9e4d643ef.zip

rdvm commented 4 years ago

I have a MacBookPro 13,3 and was experiencing this issue with previous releases. But I've been using the driver version 4.4.30.422 for about a week and haven't had an unresponsive trackpad after sleep in that time.

I have encountered the same thing as @kalatehbali, though, with there being times when only the touchbar works on the lockscreen, and I have to power off the laptop.

Let me know if there is any information I can provide that would be helpful.

xeijin commented 4 years ago

@rdvm as a workaround you might be able to kill bootcamp.exe in task manager, then run it again from the start menu instead of re-starting the computr (I dont have this specific issue, but I've had to force-restart the touchbar before)

ghost commented 4 years ago

Using some of the ideas above, I finally found an easy solution:

  1. Open Windows PowerShell ISE as administrator
  2. Run the following command to find the InstanceId of your Touchpad

Get-PnpDevice -FriendlyName "Apple SPI Precision Touchpad Device" | ft -wrap -AutoSize instanceid

  1. Copy the value returned to you
  2. Create a batch script that will disable and re-enable the Touchpad
  3. Paste the following into the script replacing "INSTANCEID" with the value you copied

Disable-PnpDevice -InstanceId "INSTANCEID" -Confirm:$false Enable-PnpDevice -InstanceId "INSTANCEID" -Confirm:$false

  1. Create a task with Task Scheduler to run the script you just made
  2. Create a trigger for the task using "on workstation unlock"

You're all set. Enjoy!

TP328 commented 4 years ago

Hello I am having troubles doing this step. Can someone take a screenshot on how to do step (5,6&7). Thank you.

  1. Copy the value returned to you
  2. Create a batch script that will disable and re-enable the Touchpad
  3. Paste the following into the script replacing "INSTANCEID" with the value you copied

Disable-PnpDevice -InstanceId "INSTANCEID" -Confirm:$false Enable-PnpDevice -InstanceId "INSTANCEID" -Confirm:$false

  1. Create a task with Task Scheduler to run the script you just made
  2. Create a trigger for the task using "on workstation unlock"
Leeable commented 4 years ago

1.make sure you already install visual studio、Microsoft Framework、Microsoft visual c++

  1. search ‘devcon.installer’ in the github and download it, run it with admin and "Add DevCon to environment path" (inside verson is devcon 1709,but it works in 1909)
  2. Device Manager--Apple SPI Precision Touchpad Device---check the hardware ID (like SPI\VID_05ac&PID_0276&MI_02 ) 4.open .txt and write this and cover your Hardware id with it

@echo off REM disables and reenables trackpad devcon disable "SPI\VID_05ac&PID_0276&MI_02"

devcon enable "SPI\VID_05ac&PID_0276&MI_02"

  1. rename it with .bat 6.Create a task with Task Scheduler to run the script you just made 7.Create a trigger for the task using "on workstation unlock"
Goyadoy commented 4 years ago

Also I had issues with MacBook unable to wake from sleep (it crashed with BSOD about 1 of 5 times after I wake it). I solved it by adding bat file with following line in task scheduler with "on workstation lock" trigger. I think it can be very useful for a lot of people.

devcon.exe disable "SPI\VID_05AC&PID_0278&MI_02"

RDomak commented 4 years ago

Can somebody explain for an amateur, how to solve this problem? Leeable wrote a nice instruction but I have no idea what are the steps to take exactly :) I am stuck at installing devcon, I guess.

Additionally I managed to find the hardware ID, created the .bat file also but it doesn't do anything as probably devcon is still not running.

RDomak commented 4 years ago

Alright, I managed to install Devcon with the help of an excellent Github program: https://github.com/Drawbackz/DevCon-Installer/releases

I confirm that devcon.exe works now.

BUT I still have a problem with disabling / enabling the device ID.

When I run the devcon.exe with the correct ID number then I still get this kind of error:

C:\Windows\system32>devcon disable "@SPI\VID_05ac&PID_0279&MI_02\5&33d07321&0&02" SPI\VID_05AC&PID_0279&MI_02\5&33D07321&0&02 : Disable failed No matching devices found.

As you can see, the ID number is correct, I took it from the device properties. Also the syntax seems right for me. What can be the issue?

Touchpad Devcon issue

kalatehbali commented 4 years ago

Alright, I managed to install Devcon with the help of an excellent Github program: https://github.com/Drawbackz/DevCon-Installer/releases

I confirm that devcon.exe works now.

BUT I still have a problem with disabling / enabling the device ID.

When I run the devcon.exe with the correct ID number then I still get this kind of error:

C:\Windows\system32>devcon disable "@SPI\VID_05ac&PID_0279&MI_02\5&33d07321&0&02" SPI\VID_05AC&PID_0279&MI_02\5&33D07321&0&02 : Disable failed No matching devices found.

As you can see, the ID number is correct, I took it from the device properties. Also the syntax seems right for me. What can be the issue?

Touchpad Devcon issue

Try to copy paste this below code and let me know if you can disable it or not:

C:\Windows\system32>devcon disable @SPI\VID_05ac&PID_0279&MI_02\5&33d07321&0&02

RDomak commented 4 years ago

Thank you very much, Kalatehibali, I tried but apparently it's not the right syntax. I tried both by adding the path and also without the path and just starting with devcon but I got this below error:

Touchpad Devcon issue 2

kalatehbali commented 4 years ago

Thank you very much, Kalatehibali, I tried but apparently it's not the right syntax. I tried both by adding the path and also without the path and just starting with devcon but I got this below error:

Touchpad Devcon issue 2 Copy/Paset this please:

devcon.exe disable "SPI\VID_05ac&PID_0279&MI_02"

RDomak commented 4 years ago

Thank you, it didn't work this way as well :(

FInally I gave up and installed back the original Bootcamp driver. I also found a nice program called XMouse Button Control for Windows and it can manage the control quite nicely over the original touchpad too.

https://www.highrez.co.uk/downloads/XMouseButtonControl.htm

Also I wanted to have the external mouse to scroll one way, and the touchpad the other way so the scroll reverse function by itself didn't help at this program.

I had to change the scroll direction of the touchpad in the Windows Registry - just find the touchpad device and change the FlipFlopWheel value from 0 to 1.

RDomak commented 4 years ago

Alright, back to square one: the original Bootcamp touchpad driver still sucks. It's just awful. It doesn't have a decent palm rejection so often when I type, it just suddenly deletes a chunk of my text.

So I put back again the MS Precision driver yesterday and today I faced a new problem: after sleep when I turned on the computer it was frozen for a while (before login) and then I got a blue screen of death with the error code "Driver Power State Failure"

Any good ideas?

ikappas commented 4 years ago

This issue with the BSOD occurs on my Mac Book Pro 2016 w/ touchbar

tigersfa8 commented 3 years ago

I'm not sure if this would need it's own issue log or not, but I'm using a KVM switch for two computers, and I have to unplug and plug the usb connection back in for the touchpad to be activated. I've tested this with a regular mouse, and no such issue exists.

jamesy0ung commented 3 years ago

Stops working on wakeup. Windows 10 Enterprise 2004 and MacBookPro 14,3

Arcitec commented 3 years ago

I don't use a bootcamp mac but I read this whole thread out of interest. It sounds to me like Apple's bootcamp touchpad communication driver is buggy. And since imbushuo's hooks into Apple's driver to read the touchpad, and "transform it into a precision touchpad", it seems like the problems are in Apple's code. He said that Apple's bootcamp driver is very inconsistent and unreliable when returning from sleep.

Keep this in mind when talking here. Maybe he can find a workaround but it's not his fault if it's impossible.

bxff commented 3 years ago

I am having the same issue but my keyboard also freezes, so the only way to get back control is to force reboot. Is there any fix for this yet? Also I don't get any problem if I boot with just taping the power button.