-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ckb does not connect to devices after sleep #58
Comments
@viggy96 I cannot confirm this. I just had done a lot of testing with switching keyboards on and off. Reconnecting when waking up from standby is essential to me. |
System: Lenovo ThinkPad W540, Ubuntu 16.04.1 LTS Corsair devices: K70 keyboard & M65 PRO RGB mouse By sleep, I mean standby/suspended, not hibernate. I have tried adding the USB quirks to the boot flags, but that does not help. |
@viggy96, what sort of K70? I have the K70 LUX and cannot reproduce this. I have a desktop computer though, with a lot of power saving features turned off... But nonetheless, I can standby/suspend (go into 'sleep mode') and come back out with no problems. I too run Ubuntu 16.04.1. However, I only have one such Corsair product. Perhaps it's the fact that you have both a keyboard and a mouse? Or perhaps it's working for me because of various hardware settings in BIOS that I've switched to not even attempt to save power. Or just because I'm on a desktop. I'll try turning on various power saving mechanisms (some of which warn that some devices may not wake from sleep as reliably if I enable them). |
Its the K70 RGB. I don't believe that its the fact that I have multiple Corsair devices, since this problem occurs even when I only have one device connected (usually the M65 PRO RGB). |
I apologize, BIOS' way of phrasing the L1 power saving mode was that it could cause 'incorrect data transmission', not that things would fail to wake back up. At any rate, still works fine going into sleep mode and back. Had also enabled 'aggressive' power saving, and disabled letting the OS determine what hardware could be put to sleep or not. Overall, I'm feeling doubtful that this is the CKB-Next driver's fault alone. Maybe something else to look at is the boot flags for the Linux kernel? I remember having to edit |
@viggy96 what can you find in the journal? There should be lines like
When you (re) start your daemon, you should get two lines, indicating the setup status. Do you get new lines when waking up your system? Or do you get new USB Channels after waking up? If we don't get new hints with this, please wait until the patch #64 is published (or install that patch on your system). With this patch, you get more debug info and a longer delay when starting the usb communication. It belongs to #48. |
This is what I get when I restart the daemon in the terminal (with only the mouse):
However, the ckb UI does not show the mouse as connected, and my lighting profile does not load. |
OK, the daemon has detected it well.
Do you get the same (please have a look at the file permission also)?
Now disconnect either your KB or mouse. you should see the correspondig line disappearing and - if replugging the device - the line reappears. you may try this several times, it is reproducable. If this all works for you with your two devices, then the daemon is OK and we must have a look at the client. |
@frickler24 , Yes I can confirm that all that does work. Sorry for the late reply. |
@viggy96 just that I understand it correctly:
Please excuse my annoying questions, but the error seems to be difficult to reproduce on my system. |
|
Thanks. Now I am completely at a loss. I have to think about that, especially about the last statement. |
@frickler24 No, after quitting the client and stopping the daemon, no /dev/input/ckb* directories remain. |
The usb handling in the daemon robbes me fo the sleep.
So I suggest to investigate the usb handling more closely. Who would like to support me? |
Hey @frickler24. I'm Interested. What needs to be done? What do you need assistance with? I might be in chat tomorrow again, but for replicability I would appreciate a short summary of necessary tasks. 😄 |
@frickler24 I've uncovered some weirdness, that may be related to my system
or maybe it's a rare bug. It's certainly related to how usb is handled,
though. Haven't had much time here lately, but after this week I'll have
some more time that I an dedicate to investigating. I'll hop on IRC
tomorrow, late morning or early afternoon for Europe.
…On Tue, Feb 14, 2017 at 5:35 PM, Karl Fleischmann ***@***.***> wrote:
Hey @frickler24 <https://github.com/frickler24>. I'm Interested. What
needs to be done? What do you need assistance with? I might be in chat
tomorrow again, but for replicability I would appreciate a short summary of
necessary tasks. 😄
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#58 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFM7GsPe_0ymzZu07QdOpGikynOESSxYks5rcixHgaJpZM4L2swJ>
.
|
@fleischie and @mattanger I agree that this discussion should be writte here in github, so I will start: Last weekend I had a short discussion in the irc about libusb. That's a library to cover the system specifics for Linux, MaxOS (and Windows) and it looks interesting for me. The question was: Should we rewrite the usb handling and if - based on what library?
That are the first questions I have. |
My two cents: documentation
libusb or re-implemented
testability
P.S.: What do you mean with overthrow anything? |
|
@fleischie I ment "do not hurry" with this decision. We all have a lot to do, but maybe clearing these usb bugs would give us some more time.
@fleischie @mattanger I believe we can do a lot testing and debugging with scripting. But especially these connection oriented issues (different usb protocols depending on hardware and firmware versions, connecting / disconnecting devices, resuming from special OS modes, reaction on combination of keys): For these I have currently no idea how to automate this. |
OK, thanks for clarification. I see, what I can do in regards to the mac-specific implementation details of the usb-interface. Regarding the testing: When I think about it really hard abstraction-wise, we would have to record a stream of binary data, that we pipe into the daemon/OS (thus, producing a keyboard-emulator). My personal knowledge is very limited about this, but I think we would need a lot of understanding how libusb/our own re-implementation works for the piping to work correctly. Linus Torvalds once said:
|
@fleischie I agree on your point but Linus Torvalds has a big community of very bright minds behind him that are working on the kernel full-time. And the code requirements before the patch is merged are rather high. But I also cannot think of the way different hardware-dependent cases could be automatically tested (of course it doesn't mean it's not possible). |
On the testing note, @fleischie, as cool as capturing a binary stream from corsair* devices and piping it to the daemon sounds, I think that may not the best use of our time. That said, if you or someone else thinks that sounds neat and wants to do it, by all means. I think a better approach may be to document and automate a testing and data/packet capture procedure that testers can use to send us data for devices that none of us have access to. |
@fleischie and @light2yellow here is the first documentation from testing branch (no additional comments done up to now).
Hope it helps a bit. In the next days I will start documenting the usb / usb-linux files and push a new version of the doxy files |
I've updated the HTML info and the pdf file as mentioned in the last post. |
@frickler24 Thank you for your effort. 😄 I will check out the docs in detail in the following weeks, as I only had time to skim them shallowly. Your English is sufficient, I would say. The important part is, that you put all this effort in setting up this documentation. If there are grammatical or orthographical issues, a more proficient users can amend the docs. So, thank you again for your work. 😊 |
usb.c, usb.h and most of usb_linux.c are done now. The links above show the new content. In the pdf at page 331 usb.c starts, at 353 usb.h and at 397 usb_linux begins. |
@frickler24 I've just set up a host for ckb-next.org. If you'd like, I get you access and we can host the docs on that or I can point something like docs.ckb-next.org to your server. Shoot me an email and we can figure it out. |
Maybe there is a new hint for the devices not reconnecting properly after wakeup (the original thread :-))
So why is the kernel resetting the usb device at 18:47:19 (wakeup-time)? |
If the kernel is resetting the keyboard, then it most likely sounds
like a firmware implementation issue on the keyboard itself, possibly
not responding when the computer wakes up.
I think the problem is that the daemon sees this reset, and tries to
send all the initialisation packets all over, but I assume the keyboard
is already in some specific mode from before the computer went to sleep
and doesn't respond well to the packets/usb commands it receives.
Perharps we should make a list with what devices are affected by this?
I tried my K70 RGB in different computers with different USB host
controllers and I was unable to reproduce.
|
I have this issue with my K95RGB. |
Here is some more output with debugging info.IN this case today the keyboard worked, but no macros-keays and no key-lighting on pressure was active.
Interesting are the following aspects:
I will collect more log files in the coming days. Unfortunately, one can obviously not provoke the error by manually setting the computer into standby. Perhaps we are still on the trail with patience. |
Any update on this issue? It seems that the daemon properly detects the device (M65 Pro RGB), but the mouse settings are not applied, and the ui does not show the tab for the device when connecting the mouse after the computer has been on for some time and has been cycling between sleep and awake. |
1 similar comment
Any update on this issue? It seems that the daemon properly detects the device (M65 Pro RGB), but the mouse settings are not applied, and the ui does not show the tab for the device when connecting the mouse after the computer has been on for some time and has been cycling between sleep and awake. |
I have the same issue here on Mac OS 10.13.1 with K70 RGB. System detects keyboard fine but ckb cannot connect to keyboard. Happens often after device sleeps. |
I have this issue as well with the K70RGB on Ubuntu Budgie 17.10. It immediately wakes on shutdown and the keyboard is no longer responsive. Also for some reason, on reboot the keyboard will not load and system doesn't boot. A hard reset will always fix this. |
For anyone having the same issue in 2021 (like me with K70 LUX RGB).
|
ckb does not connect to devices after waking up from sleep, and fails to connect to devices that have been plugged in some time after Linux has finished booting.
The text was updated successfully, but these errors were encountered: