Skip to content
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

Keyboard unresponsive during Mac boot #1149

Open
exiva opened this issue Mar 9, 2017 · 26 comments
Open

Keyboard unresponsive during Mac boot #1149

exiva opened this issue Mar 9, 2017 · 26 comments

Comments

@exiva
Copy link
Contributor

exiva commented Mar 9, 2017

I've noticed my Planck becomes unresponsive when my Mac is booting, or in the bootloader, thus I have to go back to the built in keyboard to unlock FileVault during the machines boot. The keyboard will start to play the chime when powering on my Mac, then it becomes a little distorted, and the keyboard's speaker just continues to make a clicking sound while the Mac is booting. I've tried turning NKRO off, and Mousekeys on/off to no avail. Other keyboards work fine (tested knockoff Mech, Apple and Microsoft)

@exiva exiva changed the title Keyboard unresponsive during OS X boot Keyboard unresponsive during Mac boot Mar 9, 2017
@exiva
Copy link
Contributor Author

exiva commented Mar 14, 2017

I poked around the olkb subreddit, and found someone commenting on another issue with the keyboard while booting their Mac 7 months ago, so I reverted to b4c7556 from 7 months ago (No particular reason I chose this commit.) and the issue was sort of resolved. Still had the clicking and distorted chime, but it worked on the bootloader (filevault) login screen. I guess I'll poke around random commits and see if I can find where it broke.

@exiva
Copy link
Contributor Author

exiva commented Mar 14, 2017

Found it. It's something in the fc80aa9 commit. I'm not sure what yet, will have to investigate it some more.

@jackhumbert
Copy link
Member

jackhumbert commented Mar 14, 2017

Awesome - thanks for digging into this! This is merge though - I believe these commits should be outside of this one. I know that my keyboards exhibited the same thing before that point as well :/

@exiva
Copy link
Contributor Author

exiva commented Mar 15, 2017

Still looking into it, but if you reset to a8e5f61 it works on the filevault unlock/bootloader... (For me anyway) then if you reset to the merge fc80aa9 it stops.

@adiabatic
Copy link
Contributor

With my Ergodox EZ, I've had similar problems off and on, depending on the iteration of my layout that I'm using. Currently, it looks like I'm going to have to get a second keyboard to hold the ALT key on bootup for booting into Windows. Re-flashing sometimes 'fixed' it about a year ago, but now, reflashing either my old .hex file or my new .hex file (with some changes) doesn't seem to fix it anymore.

zweihander-old-and-new.zip

@drashna
Copy link
Member

drashna commented Mar 25, 2018

Is this still an issue?

@exiva
Copy link
Contributor Author

exiva commented Mar 25, 2018

It's been ages since I've used my planck or qmk... I'll compile the latest and try it out.

@adiabatic
Copy link
Contributor

Just compiled the latest to swap space and return. I held down ⌥⌘R at boot and it didn't boot into any sort of recovery mode; it just booted normally.

@drashna
Copy link
Member

drashna commented Oct 21, 2018

By chance, do you have NKRO enable?

@digizer0
Copy link

I'm using a Filco Majestouch 2 Tenkeyless keyboard with latest QMK firmware and the same thing happens. I can't boot into recovery or select boot drive etc., basically any key I press during boot process will be ignored by macOS thus only a normal boot will happen.

I've tried to disable all fancy function like console, mousekey, NKRO, mediakeys, command, bootmagic etc. leaving only the very basic keyboard function on, and the problem still remains.

Hope someone can help debugging this issue. I have a working development environment setup (e.g. compiling, flashing etc.) so I can help if someone can tell me where to fix.

@yanfali
Copy link
Contributor

yanfali commented Sep 20, 2019

@digizer0 I just did a test, I am able to enter by unlock password to decrypt by macbook running a filco with a pegasushoof. I am unable to enter any hot key states, so no recovery mode or safe mode short cuts work from the QMK keyboard. I do have NKRO turned off so I can use it to get into the BIOS on a PC.

Can you test a non qmk keyboard and see what results you get? would be interesting to see if macbooks allow hot keys from anything that's not physically connected to the laptop.

@drashna you have a mac mini, can you test getting into recovery mode from a reboot?
Hold GUI + R while turning on macmini.

Thanks

@digizer0
Copy link

@yanfali I have Macmini and MBP so I tested on both. They all recognize external USB non-QMK keyboard during boot process so I can successfully use the shortcuts for recovery, single user mode etc. So the issue is not on macOS side. I think it's either a QMK issue or an even lower level issue like at the ATmega controller level.

@digizer0
Copy link

Also I tested QMK, TMK and EasyAVR firmware on my keyboard and all have the same issue.

@yanfali
Copy link
Contributor

yanfali commented Sep 23, 2019

https://qmk.fm/changes/2018-12-05-only-try-to-read-the-report-id-from-setreport-when-the-keyboard-is-part-of-the-shared-ep you could try playing with these settings. For bios mode on PC's I had to disable nkro. Mac uses uefi to boot and may have some low level needs none of the firmwares meet.

@digizer0
Copy link

@yanfali thanks for the info. I actually tried to turn KEYBOARD_SHARED_EP on and off as well because my CapsLock LED is not working so I kinda know this before. KEYBOARD_SHARED_EP has no effect on this issue, macOS will not recognize the shortcuts as always.

I think this issue has something to do with the keyboard initialization logic. For example on a non-QMK keyboard, I can press down and hold ALT/OPTION key before I restart mac and macOS will recognize the ALT/OPTION key is pressed when it reboots, thus allow me to select boot drive. But on my QMK keyboard, it seems the keyboard only accepts key press AFTER it initializes itself. So I have to press and hold ALT/OPTION after macOS restarts and the keyboard is initialized. There is no way to know exactly when the keyboard initialization is finished so the timing is very difficult to get right (I have not succeeded even a single time).

@livtanong
Copy link

I'm running into the same issues as well. I've also tried the instructions here to no avail: https://docs.qmk.fm/#/faq_debug?id=problem-on-bios-uefiresume-sleep-amp-wakepower-cycles

When I restart my mac, I always have to disconnect my kb and then reconnect it before it turns on. It's as if disconnecting it makes it remember that it has to draw power.

@livtanong
Copy link

Is there on-board memory in the dz65rgb that I can store logs in for later access? I want to try my hand at debugging this.

@livtanong
Copy link

livtanong commented Nov 7, 2019

I ran a number of tests to more concretely define the behavior.

Abstract:

I ran an experiment on my dz65rgb running QMK, combining 3 binary factors (partition, originating partition, EFI) into a total of 8 tests. The results suggest that the dz65rgb's unresponsiveness is based on a restart originating from the mac partition. A restart from the windows partition (unless a key is pressed before the machine boots) will result in a functioning dz65rgb.

My Setup:

  • I'm running Mac OS Catalina, dual booting with Windows 10.
  • dz65rgb keyboard (running QMK of course) alongside my macbook pro, So I have access to both dz65rgb and the laptop keyboard

I tried a combination of a number of factors:

  1. Default partition (Bootcamp Windows, or Mac OS)
  2. Which OS I'm coming from
  3. Whether or not I held down the mac option key during boot

The combination of 3 different binary factors = 8 tests.

Tests:

  1. Default Windows, From Windows, Held down laptop option key
  • Boots into EFI, dz65rgb functional.
  1. Default Windows, From Windows, Allowed natural restart
  • Boots into windows, dz65rgb functional.
  1. Default Windows, From Mac, Held down laptop option key
  • Boots into EFI, dz65rgb NOT functional
  1. Default Windows, From Mac, Allowed natural restart
  • Boots into windows, dz65rgb NOT functional
  1. Default Mac, From Windows, Held down laptop option key
  • Boots into EFI, dz65rgb functional.
  1. Default Mac, From Windows, Allowed natural restart
  • Boots into Mac, dz65rgb functional.
  1. Default Mac, From Mac, Held down laptop option key
  • Boots into EFI, dz65rgb NOT functional.
  1. Default Mac, From Mac, Allowed natural restart
  • Boots into Mac, dz65rgb NOT functional.

Conclusion:

Based on those 8 tests, the dz65rgb keyboard only works when coming from Windows. Be it EFI or a natural boot, the dz65rgb keyboard will work.

Other findings:

  • If I boot into windows in a state where the keyboard doesn't work and I log in via my laptop's keyboard, when I unplug my dz65rgb, there's the sound of a device disconnecting. So windows must somehow recognize it's connected, but it's simply not working.
  • Given any of the above combinations, if I hold down the dz65rgb alt during boot, it will be unresponsive. EXCEPT for one time when I had Default Windows, From Mac, I was able to get into the EFI by holding the dz65rgb alt, but I could not reproduce it again.

Edit:
Abstract

@livtanong
Copy link

This should already be fixed via #7784

@digizer0
Copy link

Just flashed the latest qmk firmware but unfortunately the issue remains. Also on my keyboard I have never experienced the loss of response from keyboard after resume from sleep. So it seems to be a different issue than what's fixed in #7784.

My keyboard works fine when resume from sleep, but does not work during boot/reboot, e.g. no key press is recognized until the macOS login screen shows up.

Version reported by qmk:

    DESC: QMK firmware for Majestouch2 TKL
    VID: 0xFEED(Filco) PID: 0x6050(Majestouch2 TKL - The Pegasus Hoof 2015) VER: 0x0104
    BUILD: "0.7.108-33-g6eff52-dirty" (15:00:31 Jan 14 2020)
    OPTIONS: LUFA MOUSEKEY EXTRAKEY CONSOLE COMMAND 4096
    GCC: 8.3.0 AVR-LIBC: 2.0.0 AVR_ARCH: avr35

@reejosamuel
Copy link

Anyone found a solution to this? I did some digging but unsure what is the root cause

@jbgutierrez
Copy link

I was struggling to trigger Boot Mode in my Mac just after the chime with a qmk keyboard but found a workaround. I suspect that the keyboard needs power before it can register keypresses. That can be tricky if the keyboard doesn't have backlight. Just keep pressing the key repeatedly and it works!

Hope it helps,

@JonasGessner
Copy link

JonasGessner commented Mar 6, 2021

I think people are talking about different issues here. At least I ran into two distinct problems with different causes.

One is the issue of not being able to show the "bootcamp" startup disk selection screen, which is usually done by pressing alt/option during boot. I found this issue to be caused by slow startup time of my keyboard, which causes the first keypress to be sent to the OS too late. Bootmagic, for example, delays keyboard startup by a whole second. I had to make my keyboard send keypresses earlier (see here) and then I was able to make the bootcamp screen show.

The second issue is the following: I was completely unable to use my keyboard during boot, including on the password field on the macOS login screen. Debugging this with my keyboard's caps lock LED (was the best easy thing I could come up with..) I found the keyboard seems to freeze at some point. I made the LED flash every cycle of the main event loop and at some point it would simply stop flashing while my mac was booting. This indicates the keyboard either shuts off completely or freezes. Then I realized I had debugging enabled on my keyboard, causing it to print many messages to the console. Disabling debugging, and turning off any printing to the console made the issue disappear – the caps LED kept flashing and I was able to use my keyboard on the login screen.

Digging into the printing, purely based on speculation, it seems there is a buffer that fills up and starts blocking once a certain amount of characters are printed. Perhaps the buffer cannot be flushed until the mac has finished booting, and therefore it starts blocking the keyboard during boot when a bunch of messages are printed. (Edit: to clarify, the buffer part is speculation because I didn't dig into the printf internals, but what I can say for sure is that the keyboard only freezes up after a certain amount of characters printed since I tested this specifically. Hence the buffer thought)
This is on ARM. I have not noticed this issue on AVR, but I currently don't have my AVR board with me to verify.

Anyone who has the second issue, please try turning off the console feature or add #define NO_DEBUG and #define NO_PRINT in config.h and report back if it helped.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in the next 30 days unless it is tagged properly or other activity occurs.
For maintainers: Please label with bug, in progress, on hold, discussion or to do to prevent the issue from being re-flagged.

@github-actions github-actions bot added stale Issues or pull requests that have become inactive without resolution. and removed stale Issues or pull requests that have become inactive without resolution. labels Jun 16, 2022
@kurko
Copy link

kurko commented Jul 3, 2022

@github-actions ping, not stale. I'm still trying to debug it and triangulate symptoms. I get it when MacOS goes to sleep for a longer period of time (a few hours). When I turn it back on with mouse, I can't type the password. Forcing the Mac to sleep though doesn't cause any issues.

@fabiensanglard
Copy link

fabiensanglard commented Sep 23, 2022

I am also experiencing this issue.

It did not happen when my Ergodox was plugged into a Caldigit TB3/TB4 hub but now that I have plug it into my BenQ PD3220U TB3, I have to unplug the USB cable for the keyboard to work again.

@silvinor silvinor mentioned this issue Apr 30, 2023
14 tasks
mattpcaswell pushed a commit to mattpcaswell/qmk_firmware that referenced this issue Jun 7, 2023
* add default keymap: abatskeyboardclub/nayeon

* add default keymap: alfredslab/swift65/hotswap

* add default keymap: atset/at1

* add default keymap: atset/at12

* add default keymap: atset/at16

* add default keymap: atset/at3

* add default keymap: atset/at6

* add default keymap: avalanche/v4

* add default keymap: b_sides/rev41lp

* add default keymap: bbrfkr/dynamis

* add default keymap: blockboy/ac980mini

* add default keymap: cannonkeys/gentoo

* add default keymap: cannonkeys/gentoo_hs

* add default keymap: cantor

* add default keymap: checkerboards/snop60

* add default keymap: doio/kb16

* add default keymap: ducky/one2sf/1967st

* add default keymap: evyd13/nt650

* add default keymap: hhkb/yang

* add default keymap: idobao/id63

* update default keymaps: idobao/id75

v1 and v2

* add default keymap: kbdfans/baguette66/rgb

* add default keymap: kbdfans/baguette66/soldered

* add default keymap: kbdfans/bounce/75/hotswap

* add default keymap: kbdfans/bounce/75/soldered

* add default keymap: kbdfans/bounce/pad

* add default keymap: keycapsss/kimiko/rev1

* add default keymap: kprepublic/bm80v2

* add default keymap: labbe/labbeminiv1

* add default keymap: melgeek/tegic/rev1

* add default keymap: merge/um80

* update default keymap: mikeneko65

* add default keymap: ms_sculpt

* add default keymap: mwstudio/alicekk

* add default keymap: nightly_boards/alter_lite

* add default keymap: nightly_boards/conde60

* add default keymap: nightly_boards/paraluman

* add default keymap: nix_studio/n60_a

* add default keymap: pixelspace/capsule65i

* add default keymap: reviung/reviung41

* add default keymap: ryanbaekr/rb18

* add default keymap: skme/zeno

* add default keymap: spaceholdings/nebula12b

* add default keymap: tominabox1/bigboy

* add default keymaps: tzarc/djinn

revs. 1 and 2

* add default keymaps: westm/westm68

revs. 1 and 2

* add default keymaps: westm/westm9

revs. 1 and 2

* update default keymap: westm/westmergo

* add default keymap: wolf/ryujin

* add default keymap: xelus/rs108

* add default keymap: balloondogcaps/tr90

* add default keymap: balloondogcaps/tr90pm

* add default keymap: evyd13/fin_pad

* add default keymap: fjlabs/swordfish

* update default keymaps: keebio/quefrency

update rev4, add rev5

* add default keymap: peej/rosaline/ortho

* add default keymap: peej/rosaline/staggered

* add default keymap: wuque/promise87/ansi

* add default keymap: wuque/promise87/wkl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests