Project

General

Profile

Actions

Emulator Issues #13406

open

IOS USB_KBD: ioctl is incorrectly non-blocking

Added by Rairii 6 months ago. Updated 5 months ago.

Status:
Fix pending
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

What's the problem? Describe what went wrong.

IOS USB_KBD ioctl is supposed to block until a keyboard event is received, according to the wiibrew page. Testing on real hardware confirms this.

In dolphin, the ioctl just returns (not writing to memory at all) if the keyboard event buffer is empty, or if USB keyboard emulation is disabled (etc).

Thus, any application using usb_kbd will spend much (emulated) CPU time handling spurious IPC responses.

What steps will reproduce the problem?

A small test case (source and dol) is attached.

It loads IOS80, opens /dev/usb/kbd and starts an async ioctl loop, printing the buffer on each response.

On Dolphin, the screen fills up with repeated zerofilled buffers.

On real hardware, without a USB keyboard attached, no ioctl response occurs. If a USB keyboard was already attached, or a keyboard is attached at this point, it will send the single response for keyboard attach, and only when pressing keys on the keyboard will additional ioctl responses happen.

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

Yes, 5.0-20368

Is the issue present in the latest stable version?

Yes.


Files

usbkbd_test.zip (141 KB) usbkbd_test.zip Rairii, 11/25/2023 05:10 PM
Actions

Also available in: Atom PDF