Project

General

Profile

Actions

Emulator Issues #13284

closed

On Linux, sleep-wake with GC adapter enabled causes Dolphin and journalctl to burn a full CPU core

Added by nyanpasu64 11 months ago. Updated 10 months ago.

Status:
Fixed
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:
5.0-19815

Description

  • Enable "GameCube Adapter for Wii U" input, with a GC adapter plugged in (I have a Mayflash).
  • Sleep and wake Linux.

journalctl will be flooded with "usb 1-7: usbfs: process 216494 (GCAdapter Read ) did not claim interface 0 before use" messages, and Dolphin's ReadThreadFunc() thread will spin burning a full CPU core.

I think this is because the thread loops forever on libusb_interrupt_transfer(), and after a sleep-wake cycle this function returns immediately, and we try again right away (after ProcessInputPayload(input_buffer.data(), payload_size) and Common::YieldCPU()), rather than checking for a broken connection to the GC controller adapter (invalid s_handle or s_endpoint_in) and restarting the thread.

I don't know USB well enough to know how to fix the error handling. Perhaps I could research it if necessary.

I'm running Dolphin dadbeb4bae7e7fa23af2b46e0add4143094dc107 with some unrelated build/feature patches on top (D-Bus sleep inhibition when emulation is started, whereas this bug can occur without even starting a game).

Operating System: Arch Linux
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.10
Kernel Version: 6.3.7-zen1-1-zen (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: AMD Radeon RX 570 Series
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B550M DS3H

Actions

Also available in: Atom PDF