tolga9009 / sidewinderd

Linux support for Microsoft SideWinder X4 / X6 and Logitech G103 / G105 / G710+.

Home Page:http://cevel.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

100% CPU usage when the keyboard is unplugged

artscoop opened this issue · comments

I've just compiled and installed the driver in Ubuntu (same behaviour in 15.04 and 15.10)
The service works well until I unplug the keyboard. Then, sidewinderd hangs with 100% CPU usage. Plugging the keyboard again does not restore functionality, and the macro keys do not work anymore.

Yeah, we currently have no code for device monitoring / device handling. So, on daemon startup, sidewinderd is looking for attached keyboards and creates objects for them. If a keyboard gets disconnected, the object is not destroyed (in our current implementation). This is something we will need to take care of in future versions, especially for multi-device support - like supporting keyboard and mouse in a single instance.

Most probably, the while(isRunning) loop is run infinitely, cause we don't have checks to set isRunning to false. This most probably is the source of our 100% CPU bug. I already have some ideas on how to fix this, but I need more time. I'm still refactoring major parts of the code and trying to deliver a solid, understandable code base.

For now, if you need to replug your device, you will need to restart sidewinderd, to workaround this bug. Again, this will definitely change in future versions.

Commit a8471ec fixes the 100% CPU issue, but it doesn't include hotplug support. The driver is now aware of a disconnect event and stops the loop on disconnected devices. This will make the driver stop though, as there are no active loops.

Hotplug needs to be added, so we can have a proper daemon functionality. Working on it now. I will close this issue, once hotplug support has been added. I worked on a proposed fix, but it didn't turned out, like I imagined (in refactoring branch, DeviceManager class).

Commit 620c4dd and cf16453 (bugfix) added hotplug support. Code is a bit messy at the moment, but atleast it's working.

My internal tests with a Microsoft SideWinder X4 were successful. Please test and report.

Meanwhile, I will work on issue #6. I think we can prepare release 0.4.0 after that. Also, I was thinking about a new name and logo for this project's 0.4.0 release. If you have any suggestions, feel free to share.

Took some time to test this driver, but I can say it works wonders.
As for the name, something that makes the driver easy to find would be best.
I could try to craft an icon based on the Microsoft Sidewinder logo, but making it obvious that it's for keyboards with Macro keys, and that it's for Linux (4+ ?) systems.

It seems like I forgot to close this issue. This should be fixed, please reopen, if it's still happening.

Cheers,
Tolga