RetroPie-Setup icon indicating copy to clipboard operation
RetroPie-Setup copied to clipboard

Optimize native video detection

Open gizmo98 opened this issue 2 years ago • 2 comments

If a device platform is unknown platform "native" will be used. Platform native assumes there is a x11 session which supports gl and vulkan. If you want to run from console you can set "force_kms" in retropie.cfg. There is no auto detection. You can not use gles. Add some logic which analyzes the system and sets platform flags according to it.

system.sh

  • add function get_native_video(): tries to set appropriate platform flags for current video backend (kms, x11, wayland) and supported OpenGL versions.
  • add helper function get_graphics_platform(): checks enviroment and sets platform flags for video backend.
  • add helper function get_opengl_target_platform(): tries to get GL and GLES versions from system and sets platform flags for GL or GLES.
  • add helper function get_opengl_platform_flags(): compares GL version with GLES versions and decides which platform flags are set.
  • add helper function has_render_device(): checks if there is a kmsdrm render note.
  • add helper function has_video_output_device(): checks if there is a kmsdrm video output device.
  • add helper function is_graphical_target(): check if we run a graphical desktop session.
  • add helper function is_multi_user_target(): check if we run a command line session.

emulationstation.sh

  • remove deprecated GL version detection. GL version is now detected in system.sh.

gizmo98 avatar Mar 16 '23 22:03 gizmo98

I should add a check for mesa driver and softgl in get_opengl_target_platform(). if glxinfo or kmscube return string contains MESA, platform flag mesa can be added. If return string contains LLVM, platform flag softpipe can be added. If softpipe was detected with a kms device retroarch should be build with video driver drm „—enable-plain-drm“. This driver should be fast enough for older 2d platforms.

gizmo98 avatar Mar 19 '23 12:03 gizmo98

I think a large core change like this would have been best started as a discussion first. I am not against the overall concept of better automatic setting of flags to support additional platforms but the implementation needs work imho. I don't think we need so many additional flags also (When nothing is using them and other auto detected systems don't use them). The use of kmscube and the logic for setting flags needs a rethink.

I made some comments on the code, but even with those changes I can't say I would accept this currently sorry.

joolswills avatar Mar 23 '23 19:03 joolswills