Skip to content

Avoid unchanged USB keyboard reports at idle - #23

Open
0xdaniell wants to merge 1 commit into
mainfrom
fix/usb-keyboard-idle
Open

0xdaniell wants to merge 1 commit into
mainfrom
fix/usb-keyboard-idle

Conversation

@0xdaniell

Copy link
Copy Markdown
Owner

macOS requests periodic USB keyboard reports even when no key changes. Add QEMU's usb-kbd.x-ignore-idle property and enable it in the generated VM configuration, so an idle keyboard sends reports only when its state changes. Document the flag and the removal required before rolling back to an older QEMU build.

A prior measurement found 41.4 idle reports/s with the property off and 0 with it on. Holding a for 2 seconds produced 19 characters in both cases, and hello world. typed correctly in both. AppleUserHIDDrivers dropped out of the guest's busy list; it previously used 1.2–1.4% of a core.

What was tested

  • Applied all 15 QEMU patches in order to the pinned QEMU revision with git am --committer-date-is-author-date, as used by the build script.
  • bash -n macbox.
  • The keyboard measurements above were made previously; they were not repeated for this branch.

Not verified

  • A full QEMU build and runtime behavior of this branch were not tested. The running VM was not changed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T09:46:22.238416Z 329a5b6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 329a5b6bab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread macbox
out+=("$(printf '%q' "$a")")
done
# QEMU 0015: do not send unchanged keyboard reports at idle.
out+=(-global usb-kbd.x-ignore-idle=on)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate the keyboard property on QEMU support

When using macbox build --upstream or switching qemu/current to a pre-0015 build, this unconditional argument prevents the VM from starting: as the added docs/setup.md warning states, “older builds cannot start with that flag.” The upstream branch of src/container/build-reims.sh explicitly skips the patches, while cmd_up() rewrites --extra-args using qemu_extra() before every stopped-VM start, so removing the argument from vm.toml does not resolve it. This also breaks the documented rollback-by-symlink procedure unless users edit the launcher itself. Check the selected QEMU's capabilities before adding the property so upstream builds and rollback remain usable.

AGENTS.md reference: AGENTS.md:L108-L110

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant