https://bugs.kde.org/show_bug.cgi?id=524082

            Bug ID: 524082
           Summary: System Settings startup blocks 12+ seconds in SDL_Init
                    from GameControllerModuleData when no gamepad is
                    connected (regression in 6.7)
    Classification: Applications
           Product: systemsettings
      Version First 6.7.4
       Reported In:
          Platform: CachyOS
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: kcm_gamecontroller
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
  Target Milestone: ---

SUMMARY
Since Plasma 6.7, every cold start of System Settings blocks for 12-14 seconds
on the main thread before any page loads (including unrelated ones like Display
Configuration). The stall is in SDL_Init, called at startup by the Game
Controller KCM's module-data class.

The eager SDL_Init was introduced by commit "kcm/gamecontroller: Hide when no
game controllers are connected" (2026-01-04, re bug 513567): to decide page
relevance, GameControllerModuleData constructs DeviceModel, whose poll calls
SDL_Init on the main thread. Before 6.7, SDL was only initialized when actually
opening the Game Controller page.

The magnitude is hardware-dependent, which is probably why it hasn't been
reported: SDL's joystick init pays ~100 ms per input device in udev
product-info lookups (libsdl-org/SDL issue #9092) and additionally probes
hidraw devices. My system exposes 26 input event devices (multi-interface
mouse, headset dongle, receiver, HDA jack/HDMI plug-detect nodes) plus three
wireless HID receivers (Razer, SteelSeries, Logitech) that stall probing. No
gamepad is connected - the 12 s are spent determining that the Game Controller
page should be hidden.

STEPS TO REPRODUCE
1. Machine with many input devices / wireless HID receiver dongles, no gamepad
2. Ensure no systemsettings instance is running
3. Launch e.g. "systemsettings kcm_kscreen"

OBSERVED RESULT
Window is frozen/blank for 12-14 s before the requested page loads. Journal
with debug logging (QT_LOGGING_RULES="*.debug=true"):

  [2563.508] systemsettings[25128]: Calling SDL_Init
  [2575.808] systemsettings[25128]: Reading in config now.   <- 12.30 s later

Control: the same cold start with SDL probing disabled (SDL_JOYSTICK_HIDAPI=0
SDL_JOYSTICK_DISABLE_UDEV=1) reaches the same point in 0.06 s. kcmshell6
kcm_kscreen (no systemsettings shell) is also fast.

EXPECTED RESULT
System Settings should not block its main thread on controller enumeration -
SDL_Init should run asynchronously / off the main thread, or the relevance
check should be deferred until after the requested page is shown.

SOFTWARE/OS VERSIONS
Operating System: CachyOS (Arch-based, rolling)
KDE Plasma Version: 6.7.4
KDE Frameworks Version: 6.28.0
Qt Version: 6.11.1
SDL: sdl3 3.4.14, sdl2-compat 2.32.70
Graphics: AMD RX 7800 XT + Raphael iGPU, Wayland session

ADDITIONAL INFORMATION
- Regression window confirmed: gamecontrollermoduledata.cpp exists in the
Plasma/6.7 branch but not Plasma/6.6; the freeze appeared for me exactly when
upgrading 6.6.5 -> 6.7.0.
- Related but distinct: bug 511859 ("Guard SDL init", crash fix) and bug 516410
(freeze/crash in DeviceModel::poll when opening the page). This report is about
startup latency for ALL of System Settings.
- The SDL-side per-device udev cost was SDL issue #9092 (fixed for SDL2
2.32.0), but the cost persists via sdl2-compat/SDL3 on this system, and dongle
hidraw probing is a second contributor. Regardless of SDL improvements, a
blocking init on the System Settings main thread amplifies any such cost.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to