cemu-project / Cemu

Cemu - Wii U emulator
https://cemu.info
Mozilla Public License 2.0
7.33k stars 604 forks source link

Linux: Logitech G29 Driving Force Racing Wheel is not detected #1326

Open lestcape opened 2 months ago

lestcape commented 2 months ago

Current Behavior

The Logitech G29 Driving Force Racing Wheel is recognized by the Windows version of Cemu without any problems, but on Linux this doesn't happen. The G29 is recognized by the Linux kernel and works in many places: Firefox, Chrome, some Steam games and the Dolphin emulator on Linux. I tried using it as an SDL game controller and it doesn't work either:

export SDL_GAMECONTROLLERCONFIG="0300f04c6d0400004fc2000011010000,Logitech G29 Driving Force Racing Wheel,platform:Linux,a:a2~,b:a3~,x:b0,y:b1,back:b20,guide:b23,start:b19,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:+a0,lefttrigger:b5,righttrigger:b4,crc:4cf0,"

It doesn't matter if Steam is open or closed. Steam also doesn't recognize the G29 as a controller in the settings, but some Steam games recognize the controller anyway.

Expected Behavior

Cemu should recognize the device on Linux and allow you to interact with it like on Windows. It doesn't matter if we can't use Force Feedback, but at least it should act as a SDL controller for to be customized.

Steps to Reproduce

Just connect G29 to an usb port, then the open cemu on Linux and try to use/configure the G29 controller.

System Info (Optional)

OS: Debian 12 GPU: NVIDIA GeForce GTX 1660 Ti

Emulation Settings (Optional)

Use the last version with the default settings, not matter if is the Ubuntu version or the appimage version.

Logs (Optional)

No response

lestcape commented 2 months ago

This could be relevant information: https://github.com/libsdl-org/SDL/commit/189f71efb36da8a1c4b4c581023908a4162fa56e

I have libsdl2-2.0-0 version 2.26.5+dfsg-1 installed in x64 and i386.

lestcape commented 2 months ago

The device is detected by libsdl, but is not see as a game controller. Is see as a joysticks I don't know why Cemu dose not recognized it at all. Tested with:

#include <stdio.h>
#include <SDL2/SDL.h>

int main() {

    printf("Initializing SDL...\n");

        if (SDL_Init( SDL_INIT_GAMECONTROLLER | SDL_INIT_JOYSTICK ) < 0) {
                fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
                exit(1);
        }

    printf("SDL initialized.\n");
    SDL_GameControllerAddMappingsFromFile("/home/lestcape/gamecontrollerdb.txt");

        printf("%i joysticks were found.\n\n", SDL_NumJoysticks() );
        printf("The names of the joysticks are:\n");

        SDL_GameController *controller = NULL;
        for(int i=0; i < SDL_NumJoysticks(); i++ ) {

                SDL_Joystick *joystick = SDL_JoystickOpen(i);
                printf("%s\n\n", SDL_JoystickName(joystick));
                SDL_JoystickClose(joystick);

                printf("IsGameController: %i\n",SDL_IsGameController(i));

                SDL_GameController *controller = NULL;
                controller = SDL_GameControllerOpen(i);
                if (controller) {
                        printf("GameControllerName: %s\n",SDL_GameControllerName(controller));
                        SDL_GameControllerClose(controller);
                        controller = NULL;
                } else {
                        printf("Failed to open GameController %i\n",i);
                }
        }

    printf("Quitting SDL...\n");
        SDL_Quit();

        return 0;
}

./test Initializing SDL... SDL initialized. 1 joysticks were found.

The names of the joysticks are: Logitech G29 Driving Force Racing Wheel

IsGameController: 0 Failed to open GameController 0 Quitting SDL...