= 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].
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.
/userdata/extra
to your batocera host:
.. For the default version of batocera:
+
[source,console]main
in the URL with the branch or tag for the target version. Example:
+
[source,console]. Enable the features you're interested according to section <
The configuration is applied by activating a motion service from the Main Menu / System Settings / Services:
image::services.png[Batocera Services,800]
The configuration has to be performed once only, it will be persisted across boots and batocera updates.
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
.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.
Whenever a motion provider is started or stopped, the following settings are written to the batocera configuration file:
3ds.citra_motion_device=engine:cemuhookudp
3ds.citra_touch_device=engine:emu_window
3ds.citra_udp_input_address=
The host is localhost
unless you run a remote provider (e.g. on a smartphone). The port is read from the first enabled service.
.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 are located in the bin/
directory. They are optional and not related to touch and motion control.
extra-services
on-game-condition
/userdata/system/scripts
directory.read-temperatures
squash-mount
/var/run/squashfs
.system-summary
"Everything is installed and configured, but I have no motion. How can I find out what's wrong?"
If something went wrong, you can reset the motion configuration:
.. Enter the Services menu (Main Menu / System Settings / Services) .. Disable all motion services .. Leave the Services menu .. Enter the Services menu .. Enable the motion service of your choice .. Leave the Services menu
If motion control still doesn't work after reset, try one of the following commands in a terminal (via SSH or File Manager).
batocera-services list
lists each Batocera service and shows whether it's enabled.
extra-services status
lists all running batocera-extra services.
Each batocera-extra service has its own log file, possibly containing error messages.
extra_patches
motion_evdev
The Batocera configuration should contain the port of the enabled motion service.
When motion is enabled and Cemu was started at least once, the Cemu controller config should contain the motion port:
<?xml version='1.0' encoding='UTF-8'?>