About maximum baudrates and input lag

Need help? Ask here and someone will help
Post Reply
klarma
Posts: 3
Joined: Sun Apr 04, 2021 7:27 pm

About maximum baudrates and input lag

Post by klarma »

Hello.
I have couple of questions about baudrates.
Does anyone know whats the maximum baudrate for GIMX when using Raspberry Pi 1 GPIO UART? I have searched from the internetz, but it seems it debends on the software used.
What about the CP2102? I read from here, that the max is 500000, but to my knowlage the CP2102 is capable to 2000000 baud when configured correctly. (source)

I have old original Nokia TTL (UART) cable with CP2102 that I have converted to a DIY GIMX adapter using Teensy 2.0(Clone). I have configured the adapter to 2000000 baud by the instructions in the link above, but GIMX still only recognizes it to 500000 baud.

I wonder if this is some linux driver thing or GIMX thing?

I am currently running GIMX on Armbian(Focal, based on mainline 5.10) in Orange Pi+ with my DIY adapter. GIMX is build from source and I am using custom config file. It's same as the default LogitechG25_G29.xml, but I have edited it with the device ID's to match my Fanatec CSR. Target device is PS4.

I used to run in on Raspberry Pi 1, using GPIO UART and Teensy 2.0 (clone).It worked fine for years, but finally the SD card got corrupted (No shutdown button, so it was just question of time when it would.) and I decided to switch to new and more powerfull and more capable HW. (4 cores, 4 USB ports, NAND and build in WIFI).

Reason for asking these questions is that I have some input lag issues. Today I got my ass handed to me in Project Cars 2, by my 70 year old father, because of horrofic input lag. I honestly am not 5 seconds slower, in a lap, than him, but it's quite hard to drive, when your breaking point changes from corner to corner and from lap to lap, not to mention how hard it is to catch the oversteer.

I have had these issues with the old setup too, reboot helped with it too, but there where still some occasional moments in long races (F1 50% race lenght) that I noticed it happening and some times even crashed because of it. (Thank god for mid session save!)

Any ideas could the faster baudrate help? Other ways to troubleshoot?

Reason for edit: typos.

EDIT:
I actually run some tests with the CP2102 adapter I have and I can confirm it works in 2000000 baud. I used a STM32F103C8 (Bluepill) board and configured it's UART to 2000000 baud. I received the test string without any errors in windows with putty. So this has to be a software thing, that it does not work with GIMX in 2000000 baud.

EDIT2: I can confirm 1000000 bauds also, with windows and putty. I just had to edit the baud settings in the CP210x customization utility. I Changed the settings as in this image.

EDIT3: After doing some more testing and diging in the linux kernel source, it seems that the cuplrit is indeed CP210x driver in linux. This kind of sucks, because I am afraid that the fix is way beyond my capabilities and I doupt that any one capable has any interest to fix it. I just have to take look at the Orange Pi+ hardware UART for possible solution. For my experience though, the armbian forum is kind of pain in the behind, for getting any help or support, so I am afraid I am quite alone with this one. :(

For positive note, for those using GIMX in windows, it should be possible to use higher baudrates with CP2102. I have not tested this, because I have no interest to run GIMX from my windows machine. I wan't to intergrade the GIMX to my wheel, if possible, to make it as plug and play as possible. Or maybe it's just time to take a serious look for STM32 port, but I am somewhat intimidated for the ammount of work it's going to be.
User avatar
GoDlike
Posts: 1056
Joined: Thu Apr 28, 2016 12:47 pm
Location: Poland

Re: About maximum baudrates and input lag

Post by GoDlike »

I am not sure if this won't lead to problems. I would just recommend using CP2104. It's not expensive.
My hardware: PS3 Slim CFW 4.80 | PS4 Pro 500 Million LE | PS5 | Xbox Series X
Steam: Godlike_RU | PSN: GoDlike_RU | XBL: GoDlike
klarma
Posts: 3
Joined: Sun Apr 04, 2021 7:27 pm

Re: About maximum baudrates and input lag

Post by klarma »

GoDlike wrote:
Mon Apr 05, 2021 9:02 am
I am not sure if this won't lead to problems. I would just recommend using CP2104. It's not expensive.
Why would it? In the datasheet, there is nothing implying that this would be an issue. Why would the manufacturer make and support an utility that enables higher baudrates and not give any warning to the customes if it has "issues"? Also the windows driver, that to my understading is made by Silicon Labs, supports the higher baudrates. It makes sense to me, that when there is a limited ammount of preprogrammed baudrates available, they would program them for the most generally used ones, those happen to be on the slow end of the spectrum. That does not mean that the device is not capable for higher baudrates. It would be interesting if some one had time to test it, sadly atm. I don't.

Anyhow I found a CP2104 from my magical box of goodies and it's working fine @ 2000000 baud in linux(Armbian).

Also anyone interested, the Orange PI+ (Or any H3 board for that matter) hardware UART in Armbian is a no go, as the clock it uses for UART is too low, there might be way to use lowed divider or higher clock, but I could only find very limited information on this. Nothing concrete that my skills or the time I am willing to invest in this would suffice to solve it.

So sadly it seems that the best way forward for me, if I wan't to integrade the HW GIMX requires, to my wheel, is to use some MCU(STM32F407VG seems a good canditate) that has two USB's (Device and Host) and port the GIMX code to it.
Post Reply