libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.18k stars 1.82k forks source link

"Mapped port" input discarded while corresponding controller is disconnected #12741

Open blackwind opened 3 years ago

blackwind commented 3 years ago

Description

Given two controllers connected with the "dinput" input driver and "xinput" controller driver, both mapped to core port 1, when the primary controller (player 1) is disconnected, the secondary controller (player 2) is no longer functional until primary is reconnected. RetroArch confirms via OSD that secondary has been remapped as controller 1, but core receives no input data for port 1 until the original controller 1 is reconnected.

Using the dinput controller driver instead of xinput produces the expected result but precludes usage of the Guide button for RetroArch hotkeys, so I'm filing this issue to petition for a solution on xinput's side.

Expected behavior

With two controllers mapped to port 1, each should continue controlling port 1 even if the other is disconnected.

Actual behavior

Secondary controller no longer controls port 1 when primary controller is disconnected.

Steps to reproduce the bug

  1. Set dinput input driver and xinput controller driver
  2. Set player 2's "mapped port" to 1
  3. Turn on two controllers
  4. Launch a game
  5. Disconnect the controller that was connected first
  6. Observe that the controller connected second no longer works

Version/Commit

Environment information

markwkidd commented 3 years ago

Please post a log to help debug: https://docs.libretro.com/guides/generating-retroarch-logs/

blackwind commented 3 years ago

Log doesn't appear to contain anything of interest as expected, but attaching as requested.

[INFO] RetroArch 1.9.7 (Git 5c2f79a)
[INFO] === Build =======================================
[INFO] CPU Model Name: Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz
[INFO] Capabilities:  MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4 SSE4.2 AES AVX AVX2
[INFO] Built: Jul 25 2021
[INFO] Version: 1.9.7
[INFO] Git: 5c2f79a
[INFO] =================================================
[INFO] [Input]: Found input driver: "dinput".
[INFO] [Environ]: SET_PIXEL_FORMAT: RGB565.
[INFO] Version of libretro API: 1
[INFO] Compiled against API: 1
[INFO] [Audio]: Set audio input rate to: 48000.00 Hz.
[INFO] [Video]: Video @ fullscreen
[INFO] [Vulkan]: Vulkan dynamic library loaded.
[INFO] [Vulkan]: Found vulkan context: vk_w
[INFO] [Vulkan]: Detecting screen resolution 1920x1080.
[INFO] [Vulkan]: Found GPU at index 0: NVIDIA GeForce GTX 1650 Ti
[INFO] [Vulkan]: Using GPU index 0.
[INFO] [Vulkan]: Using GPU: NVIDIA GeForce GTX 1650 Ti
[INFO] [Vulkan]: Queue family 0 supports 16 sub-queues.
[INFO] [Vulkan]: Using resolution 1920x1080
[INFO] [Vulkan]: Using RGB565 format.
[INFO] [Vulkan]: Loading stock shader.
[INFO] [XInput]: Found XInput v1.4.
[INFO] [Joypad]: Found joypad driver: "xinput".
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Video]: Found display server: win32
[INFO] [DirectSound]: Setting buffer size of 12288 bytes
[INFO] [DirectSound]: Latency = 64 ms
[INFO] [Display]: Found display driver: "vulkan".
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [MIDI]: Output device "Microsoft GS Wavetable Synth".
[ERROR] Implementation uses threaded audio. Cannot use rewind..
[INFO] [SRAM]: SRAM will not be saved.
[INFO] [DISCORD]: Registering startup command: C:\Emulation\RetroArch\retroarch.exe
[INFO] [Playlist]: Loading history file: [C:\Emulation\RetroArch\content_history.lpl].
[INFO] [Playlist]: Loading history file: [C:\Emulation\RetroArch\content_music_history.lpl].
[INFO] [Playlist]: Loading history file: [C:\Emulation\RetroArch\content_video_history.lpl].
[INFO] [Playlist]: Loading history file: [C:\Emulation\RetroArch\content_image_history.lpl].
[INFO] [Playlist]: Loading favorites file: [C:\Emulation\RetroArch\content_favorites.lpl].
[INFO] [CORE]: Using content: C:\Emulation\[Temp]\New Super Mario Bros. DS.nds.
[INFO] [Core]: Content ran for a total of: 00 hours, 00 minutes, 00 seconds.
[INFO] [Core]: Unloading core..
[INFO] [Core]: Unloading core symbols..
[INFO] [Video]: Does not have enough samples for monitor refresh rate estimation. Requires to run for at least 4096 frames.
[INFO] RetroArch 1.9.7 (Git 5c2f79a)
[INFO] === Build =======================================
[INFO] CPU Model Name: Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz
[INFO] Capabilities:  MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4 SSE4.2 AES AVX AVX2
[INFO] Built: Jul 25 2021
[INFO] Version: 1.9.7
[INFO] Git: 5c2f79a
[INFO] =================================================
[INFO] [Input]: Found input driver: "dinput".
[INFO] [Core]: Loading dynamic libretro core from: "C:\Users\Public\Saved Games\RetroArch\cores\melonds_libretro.dll"
[INFO] [Overrides]: No core-specific overrides found at "C:\Users\Public\Saved Games\RetroArch\config\melonDS\melonDS.cfg".
[INFO] [Overrides]: No content-dir-specific overrides found at "C:\Users\Public\Saved Games\RetroArch\config\melonDS\[Temp].cfg".
[INFO] [Overrides]: No game-specific overrides found at "C:\Users\Public\Saved Games\RetroArch\config\melonDS\New Super Mario Bros. DS.cfg".
[INFO] [Environ]: SET_VARIABLES.
[INFO] [Environ]: GET_LOG_INTERFACE.
[INFO] [Environ]: SET_CONTROLLER_INFO.
[INFO] Controller port: 1
[INFO]    Nintendo DS (ID: 1)
[INFO] Core requested VFS version >= v2, providing v3
[INFO] [Remaps]: Remap directory: "C:\Users\Public\Saved Games\RetroArch\config\remap".
[INFO] [Remaps]: Core-specific remap found at "C:\Users\Public\Saved Games\RetroArch\config\remap\melonDS\melonDS.rmp".
[INFO] [Overrides]: Redirecting save file to "C:\Users\Public\Saved Games\RetroArch\saves\New Super Mario Bros. DS.srm".
[INFO] [Overrides]: Redirecting save state to "C:\Users\Public\Saved Games\RetroArch\states\New Super Mario Bros. DS.state".
[INFO] [Environ]: SYSTEM_DIRECTORY: "C:\Users\Public\Saved Games\RetroArch\system".
[INFO] [Environ]: GET_SAVE_DIRECTORY.
[INFO] [CONTENT LOAD]: Content loading skipped. Implementation will load it on its own.
[INFO] [Environ]: SET_INPUT_DESCRIPTORS:
[INFO]  RetroPad, Port 1, Button "B (bottom)" => "B"
[INFO]  RetroPad, Port 1, Button "Y (left)" => "Y"
[INFO]  RetroPad, Port 1, Button "Select" => "Select"
[INFO]  RetroPad, Port 1, Button "Start" => "Start"
[INFO]  RetroPad, Port 1, Button "D-Pad Up" => "Up"
[INFO]  RetroPad, Port 1, Button "D-Pad Down" => "Down"
[INFO]  RetroPad, Port 1, Button "D-Pad Left" => "Left"
[INFO]  RetroPad, Port 1, Button "D-Pad Right" => "Right"
[INFO]  RetroPad, Port 1, Button "A (right)" => "A"
[INFO]  RetroPad, Port 1, Button "X (up)" => "X"
[INFO]  RetroPad, Port 1, Button "L" => "L"
[INFO]  RetroPad, Port 1, Button "R" => "R"
[INFO]  RetroPad, Port 1, Button "L2" => "Make microphone noise"
[INFO]  RetroPad, Port 1, Button "R2" => "Swap screens"
[INFO]  RetroPad, Port 1, Button "L3" => "Close lid"
[INFO]  RetroPad, Port 1, Button "R3" => "Touch joystick"
[INFO]  RetroPad, Port 2, Button "B (bottom)" => "B"
[INFO]  RetroPad, Port 2, Button "Y (left)" => "Y"
[INFO]  RetroPad, Port 2, Button "Select" => "Select"
[INFO]  RetroPad, Port 2, Button "Start" => "Start"
[INFO]  RetroPad, Port 2, Button "D-Pad Up" => "Up"
[INFO]  RetroPad, Port 2, Button "D-Pad Down" => "Down"
[INFO]  RetroPad, Port 2, Button "D-Pad Left" => "Left"
[INFO]  RetroPad, Port 2, Button "D-Pad Right" => "Right"
[INFO]  RetroPad, Port 2, Button "A (right)" => "A"
[INFO]  RetroPad, Port 2, Button "X (up)" => "X"
[INFO]  RetroPad, Port 2, Button "L" => "L"
[INFO]  RetroPad, Port 2, Button "R" => "R"
[INFO]  RetroPad, Port 2, Button "L2" => "Make microphone noise"
[INFO]  RetroPad, Port 2, Button "R2" => "Swap screens"
[INFO]  RetroPad, Port 2, Button "L3" => "Close lid"
[INFO]  RetroPad, Port 2, Button "R3" => "Touch joystick"
[INFO]  RetroPad, Port 3, Button "B (bottom)" => "B"
[INFO]  RetroPad, Port 3, Button "Y (left)" => "Y"
[INFO]  RetroPad, Port 3, Button "Select" => "Select"
[INFO]  RetroPad, Port 3, Button "Start" => "Start"
[INFO]  RetroPad, Port 3, Button "D-Pad Up" => "Up"
[INFO]  RetroPad, Port 3, Button "D-Pad Down" => "Down"
[INFO]  RetroPad, Port 3, Button "D-Pad Left" => "Left"
[INFO]  RetroPad, Port 3, Button "D-Pad Right" => "Right"
[INFO]  RetroPad, Port 3, Button "A (right)" => "A"
[INFO]  RetroPad, Port 3, Button "X (up)" => "X"
[INFO]  RetroPad, Port 3, Button "L" => "L"
[INFO]  RetroPad, Port 3, Button "R" => "R"
[INFO]  RetroPad, Port 3, Button "L2" => "Make microphone noise"
[INFO]  RetroPad, Port 3, Button "R2" => "Swap screens"
[INFO]  RetroPad, Port 3, Button "L3" => "Close lid"
[INFO]  RetroPad, Port 3, Button "R3" => "Touch joystick"
[INFO]  RetroPad, Port 4, Button "B (bottom)" => "B"
[INFO]  RetroPad, Port 4, Button "Y (left)" => "Y"
[INFO]  RetroPad, Port 4, Button "Select" => "Select"
[INFO]  RetroPad, Port 4, Button "Start" => "Start"
[INFO]  RetroPad, Port 4, Button "D-Pad Up" => "Up"
[INFO]  RetroPad, Port 4, Button "D-Pad Down" => "Down"
[INFO]  RetroPad, Port 4, Button "D-Pad Left" => "Left"
[INFO]  RetroPad, Port 4, Button "D-Pad Right" => "Right"
[INFO]  RetroPad, Port 4, Button "A (right)" => "A"
[INFO]  RetroPad, Port 4, Button "X (up)" => "X"
[INFO]  RetroPad, Port 4, Button "L" => "L"
[INFO]  RetroPad, Port 4, Button "R" => "R"
[INFO]  RetroPad, Port 4, Button "L2" => "Make microphone noise"
[INFO]  RetroPad, Port 4, Button "R2" => "Swap screens"
[INFO]  RetroPad, Port 4, Button "L3" => "Close lid"
[INFO]  RetroPad, Port 4, Button "R3" => "Touch joystick"
[INFO] [Environ]: SET_PIXEL_FORMAT: XRGB8888.
[INFO] [Environ]: GET_LANGUAGE: "0".
[INFO] [Environ]: GET_VARIABLE melonds_boot_directly:
    enabled
[INFO] [Environ]: GET_VARIABLE melonds_screen_layout:
    Hybrid Top
[INFO] [Environ]: GET_VARIABLE melonds_hybrid_ratio:
    3
[INFO] [Environ]: GET_VARIABLE melonds_swapscreen_mode:
    Toggle
[INFO] [Environ]: GET_VARIABLE melonds_threaded_renderer:
    enabled
[INFO] [Environ]: GET_VARIABLE melonds_touch_mode:
    Joystick
[INFO] [Environ]: GET_VARIABLE melonds_opengl_renderer:
    enabled
[INFO] [Environ]: GET_VARIABLE melonds_opengl_resolution:
    7x native (1792x1344)
[INFO] [Environ]: GET_VARIABLE melonds_opengl_better_polygons:
    enabled
[INFO] [Environ]: GET_VARIABLE melonds_opengl_filtering:
    linear
[INFO] [Environ]: GET_VARIABLE melonds_jit_enable:
    enabled
[INFO] [Environ]: GET_VARIABLE melonds_jit_block_size:
    32
[INFO] [Environ]: GET_VARIABLE melonds_jit_branch_optimisations:
    enabled
[INFO] [Environ]: GET_VARIABLE melonds_jit_literal_optimisations:
    enabled
[INFO] [Environ]: GET_VARIABLE melonds_jit_fast_memory:
    enabled
[INFO] [Environ]: SET_HW_RENDER, context type: glcore.
[INFO] Requesting core OpenGL context (3.1).
[INFO] Reached end of SET_HW_RENDER.
[INFO] found_last_state_slot: #0
[INFO] [SRAM]: Skipping SRAM load..
[INFO] Version of libretro API: 1
[INFO] Compiled against API: 1
[INFO] [Audio]: Set audio input rate to: 32823.63 Hz.
[INFO] [Video]: Video @ fullscreen
[INFO] [Video]: Using HW render, glcore driver forced.
[INFO] [Video]: "vulkan" saved as cached driver.
[INFO] [GLCore]: Found GL context: wgl
[INFO] [GLCore]: Detecting screen resolution 1920x1080.
[INFO] [RCHEEVOS]: checking 46e614880c985b2bd662965cd7464c9e
[INFO] [WGL] extensions: WGL_ARB_buffer_region WGL_ARB_create_context WGL_ARB_create_context_no_error WGL_ARB_create_context_profile WGL_ARB_create_context_robustness WGL_ARB_context_flush_control WGL_ARB_extensions_string WGL_ARB_make_current_read WGL_ARB_multi[INFO] [WGL]: Adaptive VSync supported.
[INFO] [GLCore]: Initializing HW render (8192 x 8192).
[INFO] [GLCore]: Max texture size: 32768 px, renderbuffer size: 32768 px.
[INFO] [GLCore]: Vendor: NVIDIA Corporation, Renderer: NVIDIA GeForce GTX 1650 Ti/PCIe/SSE2.
[INFO] [GLCore]: Version: 4.6.0 NVIDIA 471.11.
[INFO] [GLCore]: Using resolution 1920x1080
[INFO] [XInput]: Found XInput v1.4.
[INFO] [Joypad]: Found joypad driver: "xinput".
[INFO] [GLCore]: Loading stock shader.
[INFO] [slang]: Building pass #0 (N/A)
[INFO] [GLCore]: Not using frame history.
[INFO] [GLCore]: Not using framebuffer feedback.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Video]: Found display server: win32
[INFO] [DirectSound]: Setting buffer size of 12288 bytes
[INFO] [DirectSound]: Latency = 64 ms
[INFO] [Display]: Found display driver: "glcore".
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [MIDI]: Output device "Microsoft GS Wavetable Synth".
[INFO] Initializing rewind buffer with size: 20 MB
[INFO] [Playlist]: Loading history file: [C:\Emulation\RetroArch\content_history.lpl].
[INFO] [Playlist]: Loading history file: [C:\Emulation\RetroArch\content_music_history.lpl].
[INFO] [Playlist]: Loading history file: [C:\Emulation\RetroArch\content_video_history.lpl].
[INFO] [Playlist]: Loading history file: [C:\Emulation\RetroArch\content_image_history.lpl].
[INFO] [Playlist]: Loading favorites file: [C:\Emulation\RetroArch\content_favorites.lpl].
[INFO] [Environ]: SET_HW_RENDER, context type: glcore.
[INFO] Requesting core OpenGL context (3.1).
[INFO] Reached end of SET_HW_RENDER.
[INFO] [RCHEEVOS]: got game id 0
[INFO] [RCHEEVOS]: this game doesn't feature achievements
[INFO] [RCHEEVOS]: Load task finished
[INFO] [XInput]: Found XInput v1.4.
[INFO] [Joypad]: Found joypad driver: "xinput".
[INFO] [XInput]: Found XInput v1.4.
[INFO] [Joypad]: Found joypad driver: "xinput".
[INFO] [Video]: Restored video driver to "vulkan".
[INFO] [Config]: Saved new config to "C:\Emulation\RetroArch\retroarch.cfg".
[INFO] [Core]: Content ran for a total of: 00 hours, 02 minutes, 37 seconds.
[INFO] [Core]: Unloading game..
[INFO] [Core]: Unloading core..
[INFO] [Core]: Unloading core symbols..
[INFO] [Core Options]: Saved core options file to "C:\Emulation\RetroArch\retroarch-core-options.cfg"
[INFO] [Video]: Average monitor Hz: 59.995200 Hz. (16.883 % frame time deviation, based on 2048 last samples).
[INFO] [Video]: Average monitor Hz: 59.995200 Hz. (16.883 % frame time deviation, based on 2048 last samples).