Skip to content

SM8750: AYN Odin 3 Snapdragon Sensor Core accel+gyro (gyro in games)#3005

Open
aanze wants to merge 4 commits into
ROCKNIX:nextfrom
aanze:odin3-ssc-gyro
Open

SM8750: AYN Odin 3 Snapdragon Sensor Core accel+gyro (gyro in games)#3005
aanze wants to merge 4 commits into
ROCKNIX:nextfrom
aanze:odin3-ssc-gyro

Conversation

@aanze

@aanze aanze commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • What is the goal of this PR? Bring up the AYN Odin 3 (SM8750) built-in IMU (QST QMI8658) so gyro works in games and Steam (motion aim, tilt, gyro-to-mouse) through the emulated DualSense.

The QMI8658 sits on the ADSP-owned Snapdragon Sensor Core (SSC) island bus — unreachable from the AP directly. Android reads it through the sensor DSP; this PR does the same:

  • odin3-sensors package (sysutils/, SM8750-gated via ADDITIONAL_PACKAGES): adsprpcd — built from qualcomm/fastrpc for glibc — spawns the ADSP sensorspd static PD (mainline fastrpc, no kernel changes) and runs the reverse-RPC listener; snsfeed reads accel+gyro over QRTR (sns_client) with gyro bias auto-calibration; ships the Hexagon sensor registry (qcom-hexagon-fs) + a boot service.
  • sns_iio kernel module (patch 0514, CONFIG_SNS_IIO=m): exposes accel+gyro as a standard IIO device, fed from userspace via /dev/sns_iio_feed.
  • InputPlumber composite gains an imu source → motion routes to the DualSense (ds5-edge) target. Works with stock InputPlumber (no fork).

Credit: the sensor registry data comes from Gio's ROCKNIX/sensor-firmware — all credit for collecting the Odin 3 SSC registry/calibration data goes there.

Note (transparency): Gio is also adding SSC support inside InputPlumber via libssc. This PR takes a different last-mile — a userspace-fed standard IIO device consumed by stock InputPlumber, so the sensors are also usable by anything reading /sys/bus/iio and there's no InputPlumber fork to maintain. Trade-off: the IIO bridge is poll-based vs Gio's event-driven path (his is better for very precise aiming). Flagging so the two efforts don't collide — happy to align/merge approaches.

Testing

  • How was this tested? Full SM8750 build, flashed on an AYN Odin 3, tested end-to-end: sensors register at boot, InputPlumber picks up the IMU, gyro works in Steam and in-game via the emulated DualSense.
  • Test results: In-game motion aim confirmed, smooth camera control. Steam Input reads the DualSense gyro from hidraw; accel reads gravity correctly; gyro bias auto-calibrated at rest.

Additional Context

  • Self-contained: on a clean upstream build ds5-edge is the default target, so gyro is active by default — no extra config needed, no dependency on other changes.
  • The IIO device is userspace-fed (a bridge, named bmi323-imu so InputPlumber's iio_imu driver binds via its glob). Suggested review focus: the fastrpc build recipe in the package, and the composite imu source.

AI Usage

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

aanze and others added 4 commits July 9, 2026 23:37
Add drivers/iio/imu/sns_iio.c (patch 0514) exposing the Snapdragon
Sensor Core accel+gyro as a standard IIO device 'bmi323-imu', fed
from userspace via /dev/sns_iio_feed. The QMI8658 sits on the
ADSP-owned SSC island bus, unreachable from the AP; a userspace
daemon reads it over QRTR and feeds the latest 6-axis sample here.
A kfifo buffer is attached only so a /dev/iio:deviceN node exists
for InputPlumber's udev discovery. CONFIG_SNS_IIO=m.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New sysutils/odin3-sensors package (SM8750 only, added via
ADDITIONAL_PACKAGES):
- adsprpcd, built from qualcomm/fastrpc for glibc (LE_ENABLE +
  USE_SYSLOG, strlcpy shim, no libyaml/libbsd): spawns the ADSP
  sensorspd static PD and runs the reverse-RPC listener;
- snsfeed: reads accel+gyro over QRTR (sns_client) with gyro bias
  auto-calibration and feeds the sns_iio bridge;
- ships the merged Hexagon sensor registry (qcom-hexagon-fs) plus a
  boot service (stage registry, modprobe sns_iio, run the daemons).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the bmi323-imu (sns_iio bridge) as an 'imu' source on the Odin 3
composite. InputPlumber routes its motion only to the DualSense
(ds5-edge) target; the Xbox profiles have no motion capability and
ignore it, so gyro is DualSense-profile-only with no extra logic.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The qcom-hexagon-fs registry/config files come from the
ROCKNIX/sensor-firmware project, which collects the AYN Odin 3 SSC
registry and calibration data. This package builds on that
foundation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@aanze
aanze force-pushed the odin3-ssc-gyro branch from 64e6906 to 1a6032d Compare July 9, 2026 21:37
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.

1 participant