Cross posting from discussion on #linux on discord.
The version of SDL that is precompiled and bundeld with linux is definitely not using libudev. If libudev was being used then SDL would not end up polling all /lib/input/event* devices every 3 seconds. I pulled down SDL and built a stand alone example, and I happen to have libudev installed, and I get no hitching on the same hardware. Wondering if there is some reason libudev is not being used in the SDL built for linux by Epic?
I made sure that I did not init SDL_JOYSTICK | SDL_GAMEPAD | SDL_SENSORS in LinuxPlatformApplicationMisc.cpp and commented out the checks in LinuxApplication.cpp and no more hitching, at all.
I know for a fact libudev is not being used because in my profiling I can see the function MaybeAddDevice being called, and when SDL_USE_LIBUDEV is true that code will never execute.
Simply rebuilding SDL using build.sh
in the ThirdParty/SDL2
directory fixes all my htiches. When grepping the output of that script libudev is marked as found, and the better code path is now taken. Looking at the scripts in that folder, it is not apparent that libudev-dev
is being installed by the package manager in the install_ubuntu.sh
, and install-centos.sh
scripts.
TLDR;
Either use libudev with SDL or do not init SDL_Joystick and you can have a hitch free UE4 too.