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
usb_usb stops working when (1) switching on a KVM switch and (2) computer start from sleep #703
Comments
|
What is model number of the Unifying redeiver and KVM switch? Let's forget the KVM and focus (2) sleep problem here. Connect converter directly to macbook. Can you share debug log with hid_listen when you sleep and resume? |
|
Use this debug firmware attached in this post. |
|
Thank you for helping! I am providing the answers below:
The model number of the unifying receiver is C-U0007
I need to replug the converter. Replugging the unifying dongle doesn't help -- replugging the unifying dongle makes the connection light on the keyboard blinks, which means it cannot connect the receiver. However, before replugging, although the keyboard has no input, light shows it is able to connect to the receiver.
Here is the log after a long sleep. (After a short time of sleep for example 5 min, the receiver is able to connect back with no problem: pressing the keyboard cannot wake up the computer, and the connection light shows it cannot connect the receiver, but after clicking the mouse to wake up, pressing the keyboard can make it connect the receiver. However, after a long sleep, for example over night, it cannot connect back. The log below is the one after a long sleep over night.) |
|
I don't own any mac to test, but I just confirm on Windows 10 that the converter works through sleep/resume and wakeup by pressing a key. With other normal wired keyboard, can the converter wake up mac? and resume normally after long sleep? |
|
I tested using a normal wired keyboard. The converter cannot wake up mac, and it did not work after waking up. I tried using my window PC as well: The keyboard connected to the converter cannot wake up from hibernation, but after waking up, it works without replugging. |
|
So the problem seems to be not specific to Unifying receiver but specific to Mac. Can you agree to this? In general, you can't wake up by key press(or mouse click) from hibernation or deep sleep mode. This is expected behaviour, not problem. Becase those modes shut down power completely for the converter. Meanwhile, you can wake up Windows by key press in suspend or sleep mode. On your Windows PC does the covnerter work with both wired keyboard and Unifying as expected above? |
|
I agree with you that the problem is more like to be specific to Mac. My windows pc does not have the option to sleep ( probably due to lack of C3 state), but the converter under hibernation works as expected. |
|
Thanks for the confirmation. A few more questions to ask: I read some articles about Mac sleep, interesting TIL :D Mac power state may be changed from normal sleep after some hours(3 and 8?). Can you share your Mac power setting using https://mackeeper.com/blog/mac-sleep-modes-explained/ This attached firmware should display some more debug info on USB suspend and resume. Can you try this on short sleep? Test procedure should be like below.
https://gist.github.com/tmk/0dbd10c69ed4c52d707710a1016845a5 |
|
Thank you for helping to debug.
Yes
Yes Here is the output of here is the log following the steps you provided |
|
Seeing the debug log the converter seems to work well after short sleep. Let's see what the same test procedure displays after resuming from 'standby' mode now. When plugging the wired keyboard(or Unifying keyboard) directly into Mac it works well after resuming from standby without any issue? Also it can wake Mac by pressing a key when it stays in standby mode? |
|
Here is the log under the same procedure after resuming form standby. Interestingly, although the converter cannot wake up mac from standby, it has no problem after waking up using mouse. I tried again with the firmware I built, it does not work after waking up. I am building at and the Is there anything I am doing wrong? How is your test firmware built? |
|
It is promising result somewhat. Recent changes on 'USB_Host_Shield_2.0-tmk' submodule may cause this problem. According to the log Mac seems to USB-reset(or power cycle) the converter twice, that is indicated by ' Device disconnected.' lines. It is not what I expected for standby behaviour, but it seems more like deep sleep(hibernation/poweroff). Without the converter, the wired or Unifying keyboard can wake Mac from standby? As for firmware build, |
Yes the wired/unifying keyboard can wake Mac from standby. Thank you for sharing your temporary branch, I'll give it a try later. |
|
I don't know what happened, but the converter stopped working again after waking up. I tried replug several times but it still does not work. I changed back to the debug firmware and recorded the following log here is another log that replugging solves the problem |
|
You used Unifying receiver this time while wired keyboard in the last test. With wired keyboard does the converter still work as the last test? Do you think Unifying receiver causes this problem? In the log the converer failed to initialize Unifying receiver for some reason, How do you turn your Mac into standby mode? I assume that you have to wait for 3 hours using less 50% battery without AC power adapter unless you change power configuration with It there a way to know current power state of Mac or discriminate between standby and normal sleep? LED indicator, I guess? |
The wired keyboard does not work with the converter as well. Here is the log after sleep over night. I have to replug:
I followed your suggestion by changing the
I don't think I can see the different without powering on the mac.
|
|
I still can't get good clue out of debug prints so far. I wildly guess that debug print USB interface can cause somehow. Does MacOS have system logs under directory like /var/log and don't the logs have something informational when the problem occurs? Also trying command |
|
Thanks for the suggestion. I tried to disable the debug interface but the problem is still there. I tried to search system logs using console with the keyword of "usb" and "hid", but I could not find anything. I also tried to search in the log from |
|
@lightingghost Updated firmware. |
I have a usb2usb converter (pre-assembled, not the pro micro one), I am using it by attaching a unifying receiver to it.
I found the keyboard lost connection when
(1) switching to another computer with a KVM switch
(2) computer start from sleep. (macbook pro)
I also tried to connect the usb_usb converter directly to my computer using a type-c -> type-a convertor, it still stops working when starts from sleep.
I found this PR to address the similar issue (if not the same), but I built the firmware from the master brach, so it should already been merged.
I would be happy to provide more details or follow your instructions to help debug this issue. Any help will be appreciated.
The text was updated successfully, but these errors were encountered: