Skip to content

Initial packages for gyroscope / accelerometer#2692

Open
giodotblue wants to merge 10 commits into
ROCKNIX:nextfrom
giodotblue:dev/gio/odin3-gyro
Open

Initial packages for gyroscope / accelerometer#2692
giodotblue wants to merge 10 commits into
ROCKNIX:nextfrom
giodotblue:dev/gio/odin3-gyro

Conversation

@giodotblue

@giodotblue giodotblue commented May 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for the SSC sensors used for IMU data on some modern Qualcomm devices

Uses qcom-fastrpc, libssc and dependencies

Sensor data is fetched from https://github.com/ROCKNIX/sensor-firmware, and a virtual "hexagon file system" is created at /tmp/qcom-hexagon-fs (overlayfs for /usr/share/qcom/ and /storage/.config/qcom-hexagon-fs)

A basic guide on sourcing this sensor data can be found at: https://github.com/ROCKNIX/sensor-firmware/blob/main/README.md

Calibration note

The sensor firmware contains calibration data for my specific unit. If the gyroscope bias isn't that different between units, then we should be OK (especially in Steam which has its own calibration)

This must be looked into though. Some sort of gyroscope calibration tool would be good

Old PR description

open here

To finish this and get these sensors actually working, we need to:

  • Change the xbox-series InputPlumber target to something that supports gyro
  • Add the IMU to the InputPlumber device configs
  • Add the Hexagon / sensor data files to /usr/share/qcom

If a device has the ssc-uinput additional package and has the data files in /usr/share/qcom, the input device should show up in evtest

Virtual IMU

The virtual IMU shows up as "Sunshine gamepad (virtual) motion sensors", as InputPlumber has a whitelist for virtual input devices (see InputPlumber manager.rs)

The IMU values are scaled 100x (with SSCU_IMU_OUTPUT_SCALE) so InputPlumber works (see InputPlumber translator.rs)

Sensor data in /usr/share/qcom

The sensor data can be found downstream in /vendor/etc/sensors and /vendor/etc/acdbdata (see hexagonrpc README)

On this Odin 3, the /usr/share/qcom folder looks like this: message.txt

AI Usage

While ROCKNIX doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? NO

@giodotblue

Copy link
Copy Markdown
Contributor Author

@spycat88 where would you like to put the sensor data?

I'm not sure if it's fully device specific or not, so I'm a bit torn on putting it in extra-firmware

maybe extra-firmware/sensors/SM8750/Ayn Odin 3? that looks a bit confusing
maybe a new repo? like sensor-firmware/SM8750/Ayn Odin 3/

take a look at the sensor file structure when you get a chance: https://github.com/user-attachments/files/27588824/message.txt

@spycat88

Copy link
Copy Markdown
Contributor

@spycat88 where would you like to put the sensor data?

I'm not sure if it's fully device specific or not, so I'm a bit torn on putting it in extra-firmware

maybe extra-firmware/sensors/SM8750/Ayn Odin 3? that looks a bit confusing maybe a new repo? like sensor-firmware/SM8750/Ayn Odin 3/

take a look at the sensor file structure when you get a chance: https://github.com/user-attachments/files/27588824/message.txt

What would you like to do? I'm fine with either.

@giodotblue

Copy link
Copy Markdown
Contributor Author

A new sensor-firmware repo sounds good (I can't make the repo though obv), if you create it I can PR / commit the files

@giodotblue giodotblue force-pushed the dev/gio/odin3-gyro branch 2 times, most recently from 6f1a89a to 409c72f Compare May 15, 2026 05:19
@aenertia

Copy link
Copy Markdown
Contributor

Just a bit of an aside - the rp5/flip2; needs a full dump of the android firmware as the rocketboard mbm that's upstream and currently used doesn't include its gyro sensor. So potentially this needs to include such consideration.

@r3claimer

Copy link
Copy Markdown
Contributor

Why? this is for SM8750. SM8250 can be added later if possible.

@aenertia

Copy link
Copy Markdown
Contributor

I just meant in context of 'WHERE' such things live.

@giodotblue giodotblue force-pushed the dev/gio/odin3-gyro branch from 409c72f to 4676cbd Compare May 17, 2026 10:28
@loki666

loki666 commented May 19, 2026

Copy link
Copy Markdown
Contributor

Merged InputPlumber DS5

@giodotblue

Copy link
Copy Markdown
Contributor Author

Merged InputPlumber DS5

Lovely, thanks

This PR will be modified soon - I'm working on getting libssc support directly in InputPlumber as a source device instead of going through a virtual device (which was the point of ssc-uinput)

InputPlumber has some issues with IMU support though virtual devices, so this should help out a lot

If the changes to InputPlumber get accepted, I can remove the ssc-uinput part of this PR 🙂

@giodotblue giodotblue force-pushed the dev/gio/odin3-gyro branch from 4676cbd to 8f3aeb8 Compare May 22, 2026 04:13
@giodotblue

Copy link
Copy Markdown
Contributor Author

Need to remove unused stuff from the protobuf package, install_pkg is ~40M

Comment thread projects/ROCKNIX/packages/tools/inputplumber/package.mk Outdated
@giodotblue giodotblue force-pushed the dev/gio/odin3-gyro branch 4 times, most recently from 10f92b0 to b0bac29 Compare May 26, 2026 10:45
Comment thread projects/ROCKNIX/packages/tools/hexagonrpc/package.mk Outdated
@giodotblue

giodotblue commented May 30, 2026

Copy link
Copy Markdown
Contributor Author

The chain is getting a bit cleaner as I've added Qualcomm's official fastrpc tool as a replacement for the patched hexagonrpc we were using

This also makes the sensor filesystem a bit closer to what it would be like on Android

The install_pkg footprint of this PR is a lot smaller now too:

812K    sensor-firmware-547a8edc4e00a29dc3d27830818a906f052e3917/
5.2M    libqmi-0536681a4ab46021e13c1cf8fa94b0b13b93b0c6/
128K    libqrtr-glib-1689f8b96509314d569f06a05e986a887d6d6ce5/
120K    libgudev-bd531e8622e2c98a1da3d28a0a6df59c844f25c0/
88K     libprotobuf-c-4719fdd7760624388c2c5b9d6759eb6a47490626/
208K    libyaml-0.2.5/
136K    libmd-1.2.0/
348K    libbsd-0.12.2/
2.5M    qcom-fastrpc-1.0.5/

In the next coming days I'll remove hexagonrpc & ssc-uinput and rebase this, can probably cut down these 21 commits to 6 or so

@giodotblue giodotblue force-pushed the dev/gio/odin3-gyro branch 2 times, most recently from 19c85d5 to 30f8089 Compare June 2, 2026 05:21
Adds Protobuf 33.6, a requirement for libprotobuf-c and libssc

Signed-off-by: Gianni Spadoni <me@gio.blue>
Adds libprotobuf-c, a requirement for libssc

Requires the protobuf package

Signed-off-by: Gianni Spadoni <me@gio.blue>
Adds libqmi and its dependency libqrtr-glib.

Requires the libprotobuf-c package.

Signed-off-by: Gianni Spadoni <me@gio.blue>
Adds the libssc package, which powers SSC in InputPlumber.

Depends on the libqmi package.

Signed-off-by: Gianni Spadoni <me@gio.blue>
libqmi depends on this package.

Signed-off-by: Gianni Spadoni <me@gio.blue>
@giodotblue giodotblue force-pushed the dev/gio/odin3-gyro branch from 30f8089 to f5ebd6c Compare June 2, 2026 05:27
@giodotblue giodotblue marked this pull request as ready for review June 2, 2026 06:31
We need to build InputPlumber as SSC support is still unmerged.

Pretty standard Rust build.

Signed-off-by: Gianni Spadoni <me@gio.blue>
Contains sensor data for the Qualcomm SSC

Signed-off-by: Gianni Spadoni <me@gio.blue>

gyro/sensor-firmware: use ROCKNIX/sensor-firmware

Repo was transferred to the org

Signed-off-by: Gianni Spadoni <me@gio.blue>

gyro: update sensor-firmware, use overlayfs

Easier data structuring

Signed-off-by: Gianni Spadoni <me@gio.blue>

sensor-firmware: update package

Needed for qcom-fastrpc

Signed-off-by: Gianni Spadoni <me@gio.blue>
Handles the HexagonFS

Also adds the required packages libbsd, libmd and libyaml

Signed-off-by: Gianni Spadoni <me@gio.blue>
qcom-fastrpc expects this (but it also expects /vendor)

Signed-off-by: Gianni Spadoni <me@gio.blue>
Adds the packages to SM8750/options & configures the IMU in InputPlumber

Signed-off-by: Gianni Spadoni <me@gio.blue>
@giodotblue giodotblue force-pushed the dev/gio/odin3-gyro branch from f5ebd6c to 83a2d40 Compare June 2, 2026 06:34
cp -a ${PKG_BUILD}/rootfs/* ${INSTALL}

mkdir -p ${INSTALL}/usr/bin
# TODO: change this from debug to release when this PR is ready to merge

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this in mind

@giodotblue

giodotblue commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

This PR is ready on this side, but the PR to InputPlumber isn't merged yet. It's a bit weird having my branch being used for the InputPlumber package, so maybe we should just wait for the other PR to get merged or make patch files

@loki666

loki666 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@gio3k could you check on what is blocking the InputPlumber PR to move

@giodotblue

Copy link
Copy Markdown
Contributor Author

will do tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants