Git Product home page Git Product logo

Comments (10)

RetentiveGOAT avatar RetentiveGOAT commented on August 22, 2024 1

@MarcRiera It happens when the handle is at rest, and the controller is 100% functional, I've personally tested it on 3 different PlayStation 2s and an original PlayStation when I first got the controller. I also made sure to clean the contacts as well.

from openbve.

RetentiveGOAT avatar RetentiveGOAT commented on August 22, 2024 1

The problem is solved! I no longer have the issue with this new build

from openbve.

leezer3 avatar leezer3 commented on August 22, 2024

@MarcRiera will really have to look at this one.

from openbve.

MarcRiera avatar MarcRiera commented on August 22, 2024

@RetentiveGOAT Does it happen when moving the brake handle, or even with the controller at rest? Do you have a PlayStation to check that the controller works correctly? Could you please try cleaning the connector contacts for both the controller and the adapter?

Internally, for this controller model, brake notches are a combination of four buttons. The emergency brake notch is represented internally as all four buttons released, so OpenBVE is detecting that momentarily (for some reason) these buttons are released. I can't see where this could be failing in software, so maybe it's just dirt.

from openbve.

MarcRiera avatar MarcRiera commented on August 22, 2024

Thanks. I haven't recreated the issue 1:1, but I ran a couple of tests with a USB controller remapper I have that gave me problems in the past and I have an idea of what could be happening.

In my case, the adapter seems to spam the PC every few milliseconds, even when nothing changes, and I get input flickering. So, buttons that are pressed are briefly reported as released (and viceversa). The issue is not limited to OpenBVE, I can see it in other software with controller support on my PC, but it doesn't seem to occur on my Nintendo Switch. I guess certain adapters are just good enough for most situations, but behave oddly on certain OS/driver/software combinations.

I want to try to implement two solutions:

  1. Add a small delay to input processing in the Densha plugin for classic controllers. Input is checked constantly on a loop. I suppose waiting a couple of iterations to check for flickering could mitigate the problem without adding excessive lag.

  2. If 1 is not enough, allow applying emergency only above a certain brake notch (B6, for instance). This would eliminate the issue when applying power or braking moderately. Unless a faulty/altered controller is used, it's physically impossible to change from a low-medium brake notch to emergency on a single frame.

from openbve.

MarcRiera avatar MarcRiera commented on August 22, 2024

@RetentiveGOAT Could you please try this build? It includes a small delay before applying the emergency brake that I hope will mitigate the issue.

OpenBVE_DenshaDelay_v1.zip

from openbve.

RetentiveGOAT avatar RetentiveGOAT commented on August 22, 2024

Gotcha I will try this now, and report back!!

from openbve.

MarcRiera avatar MarcRiera commented on August 22, 2024

Great, thanks for testing! I'll send the pull request with the patch so the fix is included in the next release.

from openbve.

leezer3 avatar leezer3 commented on August 22, 2024

Incidentally, @MarcRiera have you seen this:
SukkoPera/PsxNewLib#9

That suggests a 50ms delay (padded with FF FF FF in between) between actual raw data byte packets recieved from the controller when plugged into an Arduino.
I'd speculate that some (most?) adapters are dropping these.

from openbve.

MarcRiera avatar MarcRiera commented on August 22, 2024

Incidentally, @MarcRiera have you seen this: SukkoPera/PsxNewLib#9

That suggests a 50ms delay (padded with FF FF FF in between) between actual raw data byte packets recieved from the controller when plugged into an Arduino. I'd speculate that some (most?) adapters are dropping these.

I wasn't aware of that, thanks for pointing out. It's totally possible, the world of adapters is diverse and quality varies a lot between products.

from openbve.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.