
Hey Synaptics, Can You Please Stop Polling - autarch
https://randomascii.wordpress.com/2017/09/05/hey-synaptics-can-you-please-stop-polling/
======
colanderman
Pah that's nothing. My wife's old HP laptop had a driver dedicated to
controlling the LED on the speaker mute key that used an entire core.
Permanently disabling the service fixed the issue with no loss in
functionality… except the LED light!

------
justabystander
Synaptics drivers are horrendous. In addition to the terrible performance,
mine has given me 10+ bluescreens on Win10. I'd love to remove them, but
they're needed for some of the basic functionality. And they also seem to
randomly make my mouse laggy (when I'm at a desk and plugged in).

Honestly, a generic trackpad driver that suppliers 2-finger scrolling, 2/3
finger mouse button emulation, and _maybe_ pinch-to-zoom would be all I want.
If someone put in some plugin interface with an API so everyone could add the
additional magic, it would help people with more complex needs. I'd love to
kick synaptics to the curb. They've had decades to write a driver for the only
thing they're known for, and yet still can't seem to handle it.

~~~
joshschreuder
Do you have some kind of other hotkey software installed?

I had SynTP.sys bluescreens with a Clevo laptop, turns out Clevo hook the
driver with their Control Centre software and Windows reports that the
touchpad driver is causing the problem, rather than the hotkey filter from
Clevo [1].

[1] [http://forum.notebookreview.com/threads/synaptics-causes-
bso...](http://forum.notebookreview.com/threads/synaptics-causes-bsod-
on-p650se.770938/page-16#post-10235938)

~~~
justabystander
I've got something that listens to _other_ devices (ACPI buttons, etc), but
nothing that touches the touchpad. It's also a driver that's specific to the
model (the main driver won't handle 3 button devices), so it's not like it
shouldn't have undergone testing on the laptop.

I'd still suspect synaptics, as it's probably not checking its input properly.
As no other device has problems with this.

------
rubenbe
Previously I had a Thinkpad T60p as laptop, when tickless Linux kernels (iirc
2.6.21) and powertop were all new.

I made a ultra-idle setup which generated only 10-20 interrupts per second.
That was, until you even dared to touch the synaptics touchpad, then it shot
up to ~500 rendering all the other efforts useless.

~~~
mjg59
That's because it's reporting input events at high resolution. The alternative
is jerky input. And if you're moving a pointer around the screen then you're
going to be keeping the CPU and GPU powered up _anyway_ which means the
interrupts from the trackpad really aren't the problem.

~~~
verandaguys_alt
Honest question: is there any need to poll the touchpad more often than the
screen's refresh rate (usually 144Hz or below as of this post)?

~~~
rcthompson
I think there might be. If your polling is not frequent enough, then if you
observed a finger touch disappear from one spot and appear at another spot,
you have no way to know whether the finger moved there in the span of one
polling period or if the finger was lifted and a second finger placed at the
new location during that polling period. So a high polling rate might be
essential to disambiguate cases like this, especially for many-finger multi-
touch situations.

~~~
legulere
Couldn't this be processed directly in the touchpad controller, which probably
contains a microcontroller nowadays anyway?

~~~
TheAceOfHearts
Can you clarify which part you think could be handled by the touchpad's
microcontroller? In order to implement modern gestures and interactions you
need full access to all input events, otherwise you'd lose the ability to
customize or adequately handle changes to context.

~~~
khedoros1
A finger touching and leaving would be a high-priority event for the
controller to output, and it should probably internally monitor events at a
high resolution.

For position, as reported to the OS: what use would actually need a report
every 2 milliseconds? Intuitively, I'd think that motions that matter wouldn't
need that many datapoints to reliably differentiate.

~~~
mjg59
Remember that 500 interrupts per second isn't the same as a report every 2
milliseconds - reading status from a device may involve more than one
interrupt.

~~~
khedoros1
True. And for some kinds of work, input latency probably becomes noticeable on
a subconscious level quicker than one would guess.

------
lanius
I wish drivers were open source so we could fix these issues ourselves instead
of helplessly waiting for updates from manufacturers.

~~~
microcolonel
Well, there are open source synaptics touchpad drivers which are license-
compatible with Windows. In this sense, Microsoft is to blame.

~~~
thomastjeffery
License-compatible does not remotely mean Windows-compatible.

------
symlinkk
This is absurd and is why people prefer Apple computers, where one company
controls the whole software and hardware stack (that includes touchpad
drivers) and can ensure that this shit doesn't happen.

~~~
eps
Given that Windows owns 90% of the desktop market the "people prefer Apple
computers" statement would qualify as a slight exaggeration. Also the reason
this lovely %-age exists in the first place is exactly the fact that IBM let
others build for their platform.

~~~
symlinkk
Most people don't care about computers. Most people spend maybe a couple hours
a day in front of a computer and so they will buy the cheapest option they
have available. That option will be Windows every time, because they cut
corners and end up with shoddy products like this.

For the small minority of the population that spends a large amount of time in
front of computers and makes their income from computers (programmers, digital
artists) they almost all use Macs.

~~~
astura
Almost always? I don't know any programmers that use Macs.

~~~
JohnBooty
Hardly scientific, but try an image search for "developers conference" or
"developers working" or some such phrase:
[https://www.google.com/search?q=developers%20working](https://www.google.com/search?q=developers%20working)

Lots of Macs. Lots and lots of Macs.

I'm sure it varies by industry obviously. I'm sure there are industries where
you won't see a lot of Macs in developers' hands.

~~~
astura
"People who give talks at conferences" have almost zero intersection with
"people who program for a living" and "laptop I use to give presentations"
isn't the same as "computer I use to do everyday work." It's like trying to
figure out what the most popular commuting car is by watching NASCAR racing.

I'm taking issue with "almost always," that's absurd. If you look at actual
surveys [1] Windows wins by a large margin.

But hey, stock photos, soooooo.... Yeah!

LAMP wouldn't be a well know acronym and .NET wouldn't be a robust and widely
used dev environment if everyone was using Macs. I've been programming
professionally for two decades and I've (happily) either used Linux or Windows
for the entire time, never touched a Mac in my life. Of course, I am in
enterprise software, because it pays the bills, not because it's cool. I'm
_much_ too old to try to be cool.

(People giving talks at conferences are trying to impress an audience. Same
with stock images. Flashy laptops, of course, are impressive and noticeable
and give the image of "professional.")

[1]
[https://insights.stackoverflow.com/survey/2016](https://insights.stackoverflow.com/survey/2016)

~~~
JohnBooty
Thanks!

When you get a chance, check out the page you linked to. It definitely backs
up my anecdotal observation with solid numbers. Looks like about 26% of
developers (or at least Stack Overflow users) use macOS.

Given a rough estimate of ~18mil software developers in the world[1] this
gives use a rough estimate of nearly ~5mil developers using Macs.

So that's why I found it interesting to hear a developer say, "I don't know
any programmers that use Macs." There are... a lot of them.

But, as you said, you've sequestered yourself in a fairly narrow niche
throughout your career so it's not surprising. I'm sure there are web
developers out there who literally don't know anybody that uses Windows
because they've stuck to their own niches as well. Although, _I_ work in
enterprise software and my whole team is on Macs, so it's not even like you
need to look outside your niche.

    
    
        LAMP wouldn't be a well know acronym and .NET wouldn't be 
        a robust and widely used dev environment if everyone was 
        using Macs.
    

LAMP is a bit of a nightmare on Windows. Been ages since I did it, but the PHP
ecosystem made a lot of non-Windows assumptions and things like Imagemagick
and file upload handling in general were always kind of a pain. For this
reason Macs are popular with the LAMP crowd as well. If I was doing LAMP on
Windows I'd use a Linux VM or perhaps the Ubuntu compatability layer that's
been added to Win10.

    
    
        "People who give talks at conferences" have almost zero
        intersection with "people who program for a living" and 
        "laptop I use to give presentations" 
    

Not the conferences I follow. All working engineers giving talks. Not TED-
style vague pop-sci motivational stuff. Though I'm sure there are conferences
like that. Get out of your niche, hit up a conference, meet other developers
maybe? Or just check out some presentations online in your field of interest
via ConFreaks etc?

    
    
        People giving talks at conferences are trying to impress 
        an audience. Same with stock images. Flashy laptops, of 
        course, are impressive and noticeable and give the image 
        of "professional."
    

I think I'm being trolled.

__________________

[1] [https://www.computerworld.com/article/2483690/it-
careers/ind...](https://www.computerworld.com/article/2483690/it-
careers/india-to-overtake-u-s--on-number-of-developers-by-2017.html)

------
thomastjeffery
Over the past ~5-10 years, multitouch touchpads have been much more painful in
Windows than in any other modern OS. Why? These awful Synaptics drivers. There
have been free drivers in Linux that have worked painlessly for _years_ , yet
in Windows, nothing has changed.

I see this as a poignant example that closed-source drivers are just a bad
idea.

------
raverbashing
"Enhancements"

Eff those enhancements, kill that process and remove it from startup. This is
not the drive per se, it's just some stupid "helper app"

Shimming: [https://technet.microsoft.com/en-
us/library/dd837644(v=ws.10...](https://technet.microsoft.com/en-
us/library/dd837644\(v=ws.10\).aspx) (most likely making the offending
function being called repeatedly return a mock value)

~~~
throwaway613834
It makes the settings actually work though. Most people need the app for a
usable touchpad.

------
alternize
this problem has been introduced in a driver update around march. but it has
been fixed for me (lenovo x1 yoga) in the latest synaptics touchpad driver
update v19.3.4.97 [0]:

    
    
       [Problem fixes]
        - Fixed an issue where Touchpad Driver might cause high cpu usage of
       "WmiPrvSE.exe".
    

[0] [https://pcsupport.lenovo.com/ch/en/products/LAPTOPS-AND-
NETB...](https://pcsupport.lenovo.com/ch/en/products/LAPTOPS-AND-
NETBOOKS/THINKPAD-X-SERIES-LAPTOPS/THINKPAD-X1-YOGA-
TYPE-20FQ-20FR/20FR/S2M600/downloads/DS118386)

------
wslh
I appreciate the author took time to write about this but I am skeptic about
this because all Lenovo community knew about this issue. This is when you need
a hero to reverse engineering and deploy a better driver if possible.

------
daenney
Am I the only one who's a bit disappointed by MS's response? I get that
shimming would fix it but wouldn't it be more productive if they'd put some
pressure on Synaptics to fix it? They might take notice if Microsoft comes
knocking. There's a bajimillion Windows devices potentially going through life
with this bug as Synaptics trackpads are pretty pervasive. Not saying they
shouldn't do the shim, but I'd hope they would go further than that.

~~~
michaelhoffman
At Microsoft's scale, probably not. Their inability to successfully pressure
third-party software vendors to do the right thing is why they developed the
shimming infrastructure in the first place.

~~~
tinus_hn
If they removed the drivers from the installation image so people had to
manually install software for Synaptics devices to work, I think Synaptics
would notice rather quickly. They are not some obscure vendor that has gone
out of business.

It's just another excuse for shoddy quality.

~~~
breakingcups
"Installing Windows (10 + 1) broke my touchpad, it was working perfectly fine
before! Microsoft can't do anything right!"

------
wslh
There is a big gap between the hardware, the drivers, and the operating system
and "nobody" to blame or who can take responsibility for the whole system.
This happens in Windows mainly, you can buy the last notebook and replace it
before this stuff is solved. I had the synaptic issue and many others with the
X220 and Windows and now suffer other new issues with the latest XPS 13.

~~~
extr
I also have both an x220 and an XPS 13, both running Arch. x220 has always
worked/felt great with synaptics driver, XPS 13 still has issues which I
somewhat suspect are due to using libinput. Also might be a hardware issue :/

------
throwaway613834
I don't understand, isn't polling orthogonal to a memory leak? How would
fixing one fix the other?

~~~
comex
It does seem to be orthogonal in this case, so the title is a bit misleading.

~~~
pm215
The analysis suggests that the driver is polling for 'process created' events
and then leaking something every time such an event occurs, so the two issues
are somewhat related (likely the same bit of code implementing whatever
feature this is).

~~~
throwaway613834
It's not like a notification or callback mechanism would make it any better
though? It might even be worse since it wouldn't miss quick startups and
shutdowns that polling could miss...

~~~
brucedawson
While the memory leak and the polling are in the same code it is likely that
they require two different fixes - unless the notification of process creation
is totally unnecessary.

~~~
throwaway613834
AFAIK there's no way to get arbitrary process creation notifications without
either registering for ETW (which only allows one real-time consumer, hence
crippling the system, and which has a very long delay) or using kernel mode
code (which I guess could work here since the already have a driver, but might
present obstacles I'm not aware of). Another way is to use AppInit_DLLs which
might be appropriate since anything that needs the mouse should probably load
user32.dll, but otherwise it would miss something. Polling seems like the most
foolproof way to do it purely in user mode.

~~~
brucedawson
I'm no WMI expert but I was told (and said in the post):

A polling query is particularly tragic in the case of Win32_Process, since
Win32_ProcessStartTrace does the same thing without polling.

So yeah, I think you can get process creation notifications without polling.
Reference:

[https://twitter.com/kobyk/status/901561105570570242](https://twitter.com/kobyk/status/901561105570570242)

~~~
throwaway613834
This seems to have the same built-in delay as ETW. But thanks for sharing, I
wasn't aware of this one.

------
yuhong
I had to "Update Driver" after BSoDs in aps2kb2hid.sys. I never updated it
though.

------
tardo99
Wait what's shimming?

~~~
tbirrell
Redefining a thing to do a different thing to achieve the same result. You'll
see it a lot in older systems where you have a billion deprecated functions,
and instead of changing each instance to use the new version, you trick the
system by appropriating the old version to point to custom code that runs the
new version and passes back whatever the old version is expected to return.

~~~
larrik
So like monkey-patching?

~~~
tbirrell
Similar, yes.

------
leecarraher
disabled it in the bios and physically disconnected it, the day i got it.

------
gens
And _some_ Fedora developers want to bring this kind of shit to linux.

------
Animats
Firefox, just sitting there on a page with zero activity, manages to burn
about 5% of a CPU doing garbage-collection related tasks within Gecko. Maybe
this will get better with the Rust version.

~~~
dbaupp
GC is due to Javascript not C++.

~~~
Animats
Firefox has an internal GC for C++ objects managed by its XPCOM system.[1]
It's called the "cycle collector".

[1] [https://developer.mozilla.org/en-
US/docs/Mozilla/Tech/XPCOM/...](https://developer.mozilla.org/en-
US/docs/Mozilla/Tech/XPCOM/Interfacing_with_the_XPCOM_cycle_collector)

~~~
dbaupp
And Servo uses a GC deeply within its Rust code too (the JS one, in fact). I
think the benefits in Servo with respect to GC would mainly be because the
code is new/learnt from the mistakes of the old (and avoided historical
baggage), rather than because it is in Rust.

