Git Product home page Git Product logo

ffsds4's Introduction

ffsds4

Crappy DoubleShock4 simulator.

plz let me on PSXHAX again.

Usage

Make sure the UDC driver module for your board and libcomposite module are loaded. If testing on PC, use dummy_hcd as the UDC driver. Also, make sure libaio is installed on both your target and development systems since python-functionfs requires it.

To start ffsds4 using pipenv, run:

pipenv install # after checkout
pipenv run start-with-sudo -k <path to a DS4Key> --username=$USER

To create an executable for easy transport and faster startup, use:

pipenv install --dev # after checkout

# Make a standalone package
pipenv run package

# Make a single file executable
pipenv run package-onefile

Note that targeting Arm-based hardware requires the use of emulators and like (such as QEMU) or a real Arm-based hardware that runs a Linux distro similar enough to the target board (in terms of libc version).

If ffsds4 fails with -EBUSY, try unloading the kernel module g_ffs. If the module is built-in (e.g. on Manjaro ARM for Pinephone), blacklist gfs_init function by adding initcall_blacklist=gfs_init to the kernel cmdline and reboot the system.

Profiling

Run ffsds4 with parameter --profile path/to/result.profile to enable profiler.

Result is saved as standard Python profile/cProfile dump file. This file can be decoded using Python's profile or cProfile module.

To visualize the result using snakeviz, make sure you installed the development dependencies, then run

pipenv run snakeviz path/to/result.profile

Alternatively you could use tuna, which sometimes produces better graph than snakeviz but has less features:

pipenv run tuna path/to/result.profile

ffsds4's People

Contributors

dependabot[bot] avatar dogtopus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

pmarkive

ffsds4's Issues

Move "non-binary" event processing to its own thread

Turns out RescheduleableAlarm.reschedule is so heavy that it's not suitable for hot loops like tween scheduling. We should probably move it to its own thread instead.

(This might cause one-shot events to fall off sync with "non-binary" events but it should be fine since timing critical events like IMU will still be synchronized.)

PyPy

So far ffsds4 runs under PyPy but with some caveats:

  1. New typing features (e.g. Protocols) are not supported in PyPy due to the lower targeted API level (3.7). This can be resolved once they releases a new version that supports API level 3.8 (which should be the actual minimum required version for ffsds4).
  2. The performance is really bad, with the DS4Function thread @ 250 FPS using 20% of CPU on not-so-bad-and-still-better-than-most-maker-grade-ARM x86 processor (!) and Sequencer thread running hotter than CPython most of the time. Profiling might be required once 1 is resolved.
  3. No PyInstaller support (for obvious reasons). Just live with it I guess.

If 2 can be resolved, maybe it' possible to list PyPy as supported.

Deprecate high level API and only convert evdev events

Turns out it's way too complicated and slow to do all the high level event emission ourselves. Plus that there's better, more battle-tested event sequencers like evemu, it makes having our own event sequencer an even worse idea.

Maybe we should pivot from making a fully featured gamepad emulator to just a simple event converter for evdev devices. This way it would also make ffsds4 more useful as a gamepad converter which will be more useful to an end-user for example.

Advanced animation

It would be better to unify all animation-related features (from pressing buttons to multi-segmented IMU operations) into a single animation codebase. This could simplify the sequencer codebase and make implementing new commands easier.

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.