Open Themaister opened 9 months ago
Tried updating submodule to 649556befa156201116a4f25089597463d0efd44 and still happens.
Does it happen with the SDL testcontroller test program?
I don't have arch Linux, but it's working here on Ubuntu 22.04:
[INFO]: Targeting VK_KHR_present_wait latency to 1 frames.
INFO: SDL EVENT: SDL_EVENT_JOYSTICK_ADDED (timestamp=1000000000 which=2)
INFO: SDL EVENT: SDL_EVENT_GAMEPAD_ADDED (timestamp=1000000000 which=2)
[ERROR]: Failed to load Vulkan library.
INFO: SDL EVENT: SDL_EVENT_JOYSTICK_REMOVED (timestamp=1000000000 which=2)
Can you debug and find out why you're not getting any response from the controller?
Also, I'm assuming you're testing wired here, not Bluetooth?
Does it happen with the SDL testcontroller test program?
What is that and how do I build it?
Also, I'm assuming you're testing wired here, not Bluetooth?
Wired, yes.
Configure SDL with -DSDL_TESTS=ON, and then run tests/testcontroller
It seems to work in the testcontroller, but it takes over 10 seconds to scan udev devices it seems. Wonder if that's what I was seeing. I can get past the hang in Granite now as well, and the controller worked, but takes 20+ seconds. It seems to also happen without controller plugged in, so it might be something pathological happening on my system in particular.
I observed more hangs, but only in Granite so far ... I'll have to test this on more systems.
This could be tied to kernel version. I'll try seeing if I can reproduce on different kernels.
In the meantime, can you check which kernel driver is in use for the hid device that's opened?
Edit: Works normally on 6.1.69-1-lts.
I'm able to reproduce on 6.6.10-arch1-1
I'm not entirely sure what's going on here, but it looks like the reply ack from a command gets eaten by something (possibly the kernel module, but even rmmodding it doesn't fix it), and the SDL_GetTicks failsafe breaks--SDL_GetTicks() always returns 1000 no matter how long it's been running for. This might be a kernel bug compounded by an SDL bug.
The SDL_GetTicks issue seems to be caused by SDL_TIMERS_DISABLED being set by the Granite config. However, the SDL codepath should bail out if enough iterations are hit anyway.
In the meantime, can you check which kernel driver is in use for the hid device that's opened?
hid_nintendo
The SDL_GetTicks issue seems to be caused by SDL_TIMERS_DISABLED being set by the Granite config.
I tried enabling that, and while I don't get a full hang anymore, the controller doesn't work either. Probably due to some timeout that caused it to not be added.
To repro:
Connect a Switch Pro Controller on Arch Linux.
Kernel:
Linux ryzen 6.6.10-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 05 Jan 2024 16:20:41 +0000 x86_64 GNU/Linux