sonik-br / lgff_wheel_adapter

Adapter for Logitech force feedback wheels
GNU General Public License v3.0
15 stars 1 forks source link

G923 input support? #8

Closed sepisp4 closed 1 month ago

sepisp4 commented 1 month ago

Is it possible to add support for Logitech G923 input? I have the Playstation version of the wheel and the adapter. Emulated wheels show up in Windows but no inputs are recognized

sonik-br commented 1 month ago

I can try but I don't have access to a G932 device. Are you willing to run some tests and debug?

sepisp4 commented 1 month ago

Yeah sure just let me know what I need to do

sonik-br commented 1 month ago

You will need something to open a usb com port. Putty can do this. Also Arduino IDE's Serial Monitor. Are you familiar with this?

sepisp4 commented 1 month ago

Not at all. I'll look into it but if you have any links with instructions that would certainly speed up the process

sonik-br commented 1 month ago

Download and Install "Legacy IDE (1.8.X)" from Arduino If you are on windows, grab the "Windows Win 7 and newer" version. Stay awa from the windows store version.

Flash this firmware to the pico.

Open the arduino ide. Go to Tools > Port. Select a com port there. Then go to Tools > Serial Monitor

On the serial monitor window Select "115200 baud"

Connect the wheel to pico. Copy the text from the log window and past here.

sepisp4 commented 1 month ago

Done serial_monitor_output.txt

sonik-br commented 1 month ago

That was fast :) So it can be detected. Now try this. Btw: close the serial monitor screen before flashing the pico. g923.zip

sepisp4 commented 1 month ago

Nothing shows up with this one. The board's LED and the wheel remain off

sonik-br commented 1 month ago

Ok. I think I know the problem. Try this. g923.zip

sepisp4 commented 1 month ago

serial_monitor_output_2.txt

sonik-br commented 1 month ago

Nothing shows after "tuh_hid_umount_cb"?

sepisp4 commented 1 month ago

Tried again and it gave me this serial_monitor_output_3.txt

sonik-br commented 1 month ago

Nice! Device changed from PS mode to Classic mode. Now, everythig that changes on the device (rotating the wheel, pressing pedals, buttons..) will show something like 08, 00, 00, 00, 00, 80, ff, ff, ff, 80, 80, 90, Those are bytes. You will need to identify each byte function so I can map it.

Here a breakdown from what I guess.

08, 4 buttons and DPAD
00, 8 buttons
00, 8 buttons
00, 5 buttons
00, wheel rotation
80, wheel rotation
ff, pedal
ff, pedal
ff, pedal
80, no idea
80, no idea
90, no idea

Start with the analog stuff. Check if the wheel rotation maps to the bytes above. Also check the pedals and take note of each one (gas/brake/clutch).

Then check the dpad. It should change from 08 to 0n (n being 0, to 7). No need to take note of each position. Just check if UP is 0 and UPRIGHT is 1.

With that info you can start to check each individual button and the value that it changes.

EDIT: Looks like it output in almost the way as a G29 when in classic(ps3) mode. Before you try to guess each button, first let me try something on my end. So you don't waste any time.

sepisp4 commented 1 month ago

Tried it a few more times and got the inputs to update as well. Might be a loose wire in my adapter But the inputs are the way you stated. And the wheel should indeed be identical to G29

sonik-br commented 1 month ago

Please try the two firmwares.

g923.zip

Analog will output wheel, pedals and H shifter stick (do you happen to have i?)

Digital will output buttons and shifter position. the "u_" bits are unknown. I would see if any f them also changes and take note. They can identify if pedal, shifter and power supply are connected.

sepisp4 commented 1 month ago

I do not have the shifter unfortunately, but all analog and digital inputs seem to work. The only unusual thing I noticed is the plus button being mapped to PS, and the PS button itself is mapped to S_1. Other S and U outputs in the log remained the same. analog_output.txt digital_output.txt

sonik-br commented 1 month ago

Ok. Check if this fixes the buttons. Also please test if connecting the wheel without the pedals and power connected changes anything on the "U_" info. Try connecting the power, then the pedal. And see if it changes anything. g923_digital_fix.zip

sepisp4 commented 1 month ago

Yes the buttons are mapped correctly now. U_5 changes to 1 when pedals are unplugged, and 0 when plugged in. Tried every button but could not change other U values Edit: Just noticed the wheel still works without power plugged in. Unplugging power changes U_6 value from 1 to 0

sonik-br commented 1 month ago

Thanks. I will implement this into the main firmware.

The logitech wheels have this cool feature. They won't report the wheel rotation until it calibrates itself, and calibration requires the external power. If you connect just the usb, the wheel wont report, but buttons will! And after calibration if you disconnect the power, it will still work, just missing the FFB.

sonik-br commented 1 month ago

Please try this. Let's see if the G923 have any other compatibility mode as the G29 does. This will try to put it into G27 mode. g923_g27.zip

sepisp4 commented 1 month ago

Doesn't look like it. The wheel repeatedly turns on and off serial_monitor_output_g27.txt

sonik-br commented 1 month ago

That was expected.

Please try the firmwares:

Test the features, forcefeedback and rpm leds if possible.

pico_lgff_wheel_adapter.zip

sepisp4 commented 1 month ago

DF: The wheel shows up in Logitech software but no inputs are recognized DFGT and G27: Wheel turns on but nothing shows up in Windows

sonik-br commented 1 month ago

Try this pico_lgff_wheel_adapter.ino.rpipico.zip

sepisp4 commented 1 month ago

Once again, wheel turns on but still not detected. Board's LED is off

sonik-br commented 1 month ago

This one will output logs to serial. Let's see what's going on. pico_lgff_wheel_adapter_debug.zip

sepisp4 commented 1 month ago

This is all that shows up: MOUNT: 046d:c267 CMD: 01

sonik-br commented 1 month ago

Ok. Found a bug. Try this. Should appear as a Driving Force. pico_lgff_wheel_adapter_DF.zip

sepisp4 commented 1 month ago

It does, but no inputs show up still

sonik-br commented 1 month ago

Let's see the serial log again.

pico_lgff_wheel_adapter_df_debug.zip

sepisp4 commented 1 month ago

MOUNT: 046d:c267 BEGIN RECEIVING REPORTS RECEIVED

Every time I make an input a new RECEIVED line appears

sonik-br commented 1 month ago

It does not show "CMD" ?

sepisp4 commented 1 month ago

Tried again and no CMD. That's all

sonik-br commented 1 month ago

Check the serial log. If it shows up as MOUNT 046d:c266, check if appear on windows (it will not show on logitech profiler due to the serial debug) pico_lgff_wheel_adapter_df_debug.zip

sepisp4 commented 1 month ago

It shows up in Windows and inputs are working. Log: MOUNT: 046d:c267 CMD 01 UMOUNTUMOUNTUMOUNTMOUNT: 046d:c266 BEGIN RECEIVING REPORTS RECEIVED

sonik-br commented 1 month ago

I'm curious why it does so much "umount". Please try this and grab the "MOUNT" and "UMOUNT" lines.

pico_lgff_wheel_adapter_debug_mount.zip

sepisp4 commented 1 month ago

Wheel and inputs are still showing up in Windows. Log: MOUNT: 046d:c267. 01, 00 CMD 01 UMOUNT 01, 00 UMOUNT 01, 01 UMOUNT 01, 02 MOUNT: 046d:c266. 01, 00 BEGIN RECEIVING REPORTS RECEIVED

sonik-br commented 1 month ago

Try the 3 firmwares. They're all Driving Force without serial log. pico_lgff_wheel_adapter_test_df.zip

sepisp4 commented 1 month ago

I did not notice any difference between all firmwares. They all seem to work:

Wheel is picked up by Windows, Logitech software, and Project Cars 2 (with DF set as the wheel in the settings).

Wheel and pedal inputs are picked up fine. Force feedback also works without any problems (or at least, I didn't notice any) The wheel needs to be calibrated either in game or software since the maximum rotation is different between wheels. I'm assuming you can also adjust this in the adapter as well?

I tried to test the buttons but for some reason, pressing most buttons in Windows causes the wheel to spaz out, randomly rotating to left and right, sometimes even trying to push past the rotation limit. The buttons work fine in game and even in browser using gamepad tester without spazing out, but the mapping seems to be off a bit. For example the game had L2 and R2 as default shift buttons (same in Asseto Corsa) I can send you the current mapping based on what it shows in https://hardwaretester.com/gamepad or any method you prefer. Just let me know

sonik-br commented 1 month ago

I assume the wheel starts with 900º rotation? All other wheels starts with lower rotation as they're in DF compatibility mode.

When testing on windows, buttons will activate some FFB effects. For just testing input you can enter settings and disable FFB (or just unplug the power cable from the wheel). See if all button presses shows up on windows.

Shift buttons should be L1 and R1 (the paddles). Could this be that the game does not have a default mapping for the Driving Force?

sepisp4 commented 1 month ago

Yes the wheel rotates all 900 degrees when it turns on.

I disabled force feedback and can confirm all the buttons show up in Windows and are mapped correctly. It must be a problem with modern games then

sonik-br commented 1 month ago

Cool. May I ask what's going to be your main usage for the adapter? To use it on a PS2 or PS3?

sepisp4 commented 1 month ago

Older PC games that modern Logitech drivers no longer support. Just tested it in the 2002 Mafia (yes, a game called mafia supports force feedback wheels) and the force feedback seems to work flawlessly. I tried other methods and could not get the force feedback to work, but your adapter finally did it, so thanks a lot! Can't wait for this to be implemented in the full release

sonik-br commented 1 month ago

Oh I did not knew that the newer wheels and drivers does not work with older games! In this case I think that emulating a Driving Force Pro or a Driving Force GT will be the best option. Both have 900º of rotation and that can be adjusted on the driver.

I will have to think on how to set the wheel rotation range. It will benefit anyone that wants to use the wheel on a PS2 console. Going to do this later.

I'm going to ask you to do a few more tests with those firmwares. Check if all buttons works. And You can also check if the rotation limit on the driver works.

I believe that the G27 driver will set the RPM leds when you press the gas pedal (when in the input test window). Not sure.

pico_lgff_wheel_adapter.zip

sepisp4 commented 1 month ago

You're right. Max rotation is adjustable with these wheels and works fine. All wheels are identified by Windows, Logitech software, and Project Cars 2 with no problem. Buttons are mapped correctly. Only G27 had L3 and R3 mapped to the shifter buttons and I could not press 4 out of the 6 red buttons on the wheel. Force feedback felt a bit different with each wheel (DFGT felt lighter for example) but they all work in the game and react to grip, bumps, etc RPM lights work on G27 (it did not work with original drivers lol) Everything seems in order except for those G27 buttons.

sonik-br commented 1 month ago

I believe that the button map on the G27 is that way to be compatible with the G25 mode. G25 only have the L/R1 and L/R2 on the wheel. L/R3 is on the shifter buttons (along with Select and Start). image

The other red buttons on the wheel are maped as L/R4 and L/R5. No other wheel is going to trigger those buttons with the adapter.