git-developer / batocera-extra

Additional features for batocera
GNU General Public License v3.0
14 stars 0 forks source link

= batocera-extra :url-batocera: https://github.com/batocera-linux/batocera.linux/ Extended motion and touch control for batocera :toc: preamble :toclevels: 4

This project is a proof of concept to play games with motion and touch control in the retro gaming distribution {url-batocera}[batocera].

Project status

This project should be considered experimental. It demonstrates how motion and touch control can be added to batocera. Installation requires command line access to batocera through a SSH shell. Main goal of this project is to properly integrate the features into the core of batocera in the future.

The project is tested against the x86_64 platform. There are no hard dependencies on this architecture, so it may well run on other architectures, too, but this is currently untested.

Installation

. Open a shell on the batocera host .. either via SSH .. or by pressing F1 in the main menu to open the file manager and then F4 to open a terminal . Copy this directory to /userdata/extra to your batocera host: .. For the default version of batocera: + [source,console]

$ mkdir -p /userdata/extra && wget -O - https://github.com/git-developer/batocera-extra/tarball/main | gunzip | tar x --strip-components 1 -C /userdata/extra

.. For a specific version of batocera, replace main in the URL with the branch or tag for the target version. Example: + [source,console]

$ mkdir -p /userdata/extra && wget -O - https://github.com/git-developer/batocera-extra/tarball/batocera-38 | gunzip | tar x --strip-components 1 -C /userdata/extra

. Register the desired features as batocera service. .. (Optional) + By default, all features are registered. If you'd like to shorten the list of available services, you can exclude a feature by running: + [source,console]

$ /userdata/extra//service hide

.. Create services and activate patches (required for Cemu and Citra): + [source,console]

$ /userdata/extra/bin/extra-services register $ batocera-services enable extra_patches $ batocera-services start extra_patches

. Enable the features you're interested according to section <>.

Configuration

The configuration is applied by activating a motion service from the Main Menu / System Settings / Services:

image::services.png[Batocera Services,800]

[NOTE]

Each time a service is started (manually or on boot), it will check for updates of the provider and download it to a cache directory if required, then install it and start it as background daemon.

Each time a motion service is started or stopped, the batocera configuration is updated so that Cemu and Citra will read

Features

Motion Providers

.Supported motion providers |=== |Controller|Batocera Service|Comment|Connection|Motion Provider|UDP Port|Log file (in /userdata/system/logs)

|Devices with modern Linux drivers |MOTION_EVDEV |Recommended. Supports many devices incl. Nintendo and Sony controllers. |USB, Bluetooth |https://github.com/v1993/evdevhook2[evdevhook2] | 26766 | motion_evdev.log

|Nintendo Switch Controllers |MOTION_NINTENDO | Supports Switch Pro Controllers and Joycons. |USB, Bluetooth |https://github.com/joaorb64/joycond-cemuhook[joycond-cemuhook] | 26761 | motion_nintendo.log

|Sony Controllers |MOTION_SONY |Supports Sony DualShock 4 and DualSense 5. |USB, Bluetooth |https://github.com/lirannl/dsdrv-cemuhook[dsdrv-cemuhook] | 26762 | motion_sony.log

|Steam Controller |MOTION_STEAM_CONTROLLER |Supports touch via link:motion_steam_controller/README.adoc[button mapping profiles] |USB Dongle |https://github.com/kozec/sc-controller[sc-controller] | 26768 | motion_steam_controller.log

Steam Deck MOTION_STEAM_DECK
native
https://github.com/kmicki/SteamDeckGyroDSU[SteamDeckGyroDSU]
26767
motion_steam_deck.log

|Nintendo Wiimote |MOTION_WIIMOTE |Requires link:motion_wiimote/README.adoc[configuration] |Bluetooth |https://github.com/v1993/linuxmotehook2[linuxmotehook2] | from configuration | motion_wiimote-PROFILE.log

|Remote devices (e.g. smartphones) |MOTION_REMOTE |Requires link:motion_remote/README.adoc[configuration]. |HTTP |any | from configuration | none

|===

To use a motion provider with an emulator other than Cemu or Citra, configure the emulator to listen to localhost and the provider's UDP port. The https://github.com/joaorb64/joycond-cemuhook/wiki[joycond-cemuhook wiki] has detailed explanations for popular emulators.

Implementation details

Whenever a motion provider is started or stopped, the following settings are written to the batocera configuration file:

./userdata/system/batocera.conf

3ds.citra_motion_device=engine:cemuhookudp 3ds.citra_touch_device=engine:emu_window 3ds.citra_udp_input_address= 3ds.citra_udp_input_port=

wiiu.cemu_touchpad=1 wiiu.cemuhook_server_ip= wiiu.cemuhook_server_port=

The host is localhost unless you run a remote provider (e.g. on a smartphone). The port is read from the first enabled service.

Touch Providers

.Supported touch providers |=== |Controller|Batocera Service|Comment|Touch Provider|Log file (in /userdata/system/logs)

|Local devices (e.g. mouse) |none |No configuration required. |none |none

|Sony controllers (DS4, DS5) |none |No configuration required. |none |none

|Steam Controller |MOTION_STEAM_CONTROLLER |link:motion_steam_controller/README.adoc[Configuration] is optional. |https://github.com/kozec/sc-controller[sc-controller] | motion_steam_controller.log

|Remote devices (e.g. smartphones) |REMOTE_TOUCHPAD |Requires link:remote_touchpad/README.adoc[configuration] to support browsers via URL or QR code. |https://github.com/Unrud/remote-touchpad/[remote-touchpad] | remote_touchpad.log

|===

Scripts

Scripts are located in the bin/ directory. They are optional and not related to touch and motion control.

extra-services

on-game-condition

read-temperatures

squash-mount

system-summary

Troubleshooting

"Everything is installed and configured, but I have no motion. How can I find out what's wrong?"