Hello Miriam,
thank you for the reply.
For reproducing the issue, there's no need to install RetroPie or even have a
controller attached. The behavior can be reproduced with only a few steps.
Here's a rundown of steps necessary for reproducing it:
1. Install `python3-sdl2` and `python3-uinput` packages with:
sudo apt install -y python3-sdl2 python3-uinput
2. Download the script used by RetroPie, which uses SDL2 and uinput to simulate
a keyboard with
curl -o joy2key_sdl.py
https://raw.githubusercontent.com/RetroPie/RetroPie-
Setup/refs/heads/master/scriptmodules/admin/joy2key/joy2key_sdl.py
3. Run the script by executing:
sudo python3 joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x09 kpp
knp -d
Note the time it takes from the first debug statement to the debug
statement that prints the SDL2 version:
sudo python3 joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x09 kpp
knp -d
2024-10-22 16:24:01,978 DEBUG Debugging enabled, running in foreground
2024-10-22 16:24:01,978 DEBUG Joy map:
{'left': 105, 'right': 106, 'up': 103, 'down': 108, 'a': 28, 'b': 57, 'x': 1,
'y': 15, 'pageup': 104, 'pagedown': 109}
2024-10-22 16:24:05,184 DEBUG Using SDL Version 2.30.0, PySDL2 version 0.9.16
2024-10-22 16:24:05,184 DEBUG No available joystick devices found on startup
2024-10-22 16:24:05,184 DEBUG Creating uinput keyboard devices with events:
[(1, 105), (1, 106), (1, 103), (1, 108), (1, 28), (1, 57), (1, 1), (1, 15), (1,
104), (1, 109)]
In the case above, I'm running this on a laptop with a mouse connected and a
touchpad and there are about 5-6 real input devices present and there's about
4.5 seconds between the 1st debug statement (at the beginning of the script)
until the SDL version is printed, which follows immediately after
'SDL_Init(SDL_INIT_JOYSTICK)'.
If I upgrade the package to the 2.30.8 (latest stable version in the SDL2
branch), then this delay is totally different and it's in the order of
milliseconds:
sudo python3 joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x09 kpp
knp -d
2024-10-22 16:29:00,329 DEBUG Debugging enabled, running in foreground
2024-10-22 16:29:00,330 DEBUG Joy map:
{'left': 105, 'right': 106, 'up': 103, 'down': 108, 'a': 28, 'b': 57, 'x': 1,
'y': 15, 'pageup': 104, 'pagedown': 109}
2024-10-22 16:29:00,679 DEBUG Using SDL Version 2.30.8, PySDL2 version 0.9.16
2024-10-22 16:29:00,679 DEBUG No available joystick devices found on startup
2024-10-22 16:29:00,679 DEBUG Creating uinput keyboard devices with events:
[(1, 105), (1, 106), (1, 103), (1, 108), (1, 28), (1, 57), (1, 1), (1, 15), (1,
104), (1, 109)]
NB: instead of the RetroPie 'joy2key_sdl.py' utility, you can use a much
simplified version of the script which initializes just SDL from
https://pastebin.ubuntu.com/p/7SZ4Z7X9Sb/.
If you save the paste's contents to a 'test.py' file, you can just execute it
with `sudo python3 test.py` it should be logging something before and aftert
'SDL_Init' is run so you can measure the delay.
thank you again for the reply and let me know if you need further info in
order to reproduce the issue.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2085140
Title:
Patch Joystick subsystem regression
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libsdl2/+bug/2085140/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs