Qualcomm Snapdragon Sensor Core support for SDM845 devices
Newer Qualcomm SoCs do not expose their sensors directly, instead they use a DSP which is called Snapdragon Sensor Core.
The latter uses QMI to transfer messages where the content of these messages is encoded as Protobuf.
These sensors are supported by the newly created libssc
library which uses libqmi
and protobuf-c
libraries.
This library is integrated with iio-sensor-proxy
to expose these sensors to Phosh and other UIs which use iio-sensor-proxy
.
This MR allows:
- Auto-rotate screen
- Auto-brightness screen
- Screen turning OFF during a call when you hold the phone against your ear
- Compass functionality. However, it seems to be a bit off still on my SHIFT6mq, testing appreciated as it could be the firmware.
Dependencies
-
libqmi
: support for QRTR-only services, sent upstream: https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/merge_requests/346 -
iio-sensor-proxy
:libssc
integration. Will send upstream once the rest is merged as everything comes together here. -
linux
: FastRPC and SLPI patches for SDM845, sent upstream. Upstream patches required to revert several ones in downstream SDM845 mainline Linux tree since they supersede the downstream patches. Downstream pulled in the patches already.-
SLPI remoteproc support (pending): https://lore.kernel.org/linux-remoteproc/20230330164633.117335-1-me@dylanvanassche.be/ -
FastRPC SDM845 for SLPI (pending): https://lore.kernel.org/linux-arm-msm/20230511141146.30465-1-me@dylanvanassche.be/ -
DTS patches (applied): https://lore.kernel.org/linux-devicetree/20230406173148.28309-1-me@dylanvanassche.be/
-
-
firmware-shift-sdm845
: sensor calibration and registry files, sent upstream and merged: https://gitlab.com/sdm845-mainline/firmware-shift-sdm845/-/merge_requests/1 -
hexagonrpcd
: DSP filesystem access daemon, SDM845 support accepted upstream: https://gitlab.com/flamingradian/sensh/-/merge_requests/1 Will send to Alpine once a release is made.
Status
Do not ship this yet, this MR is aimed at testing on more devices than the SHIFT6mq. Seems to be working great, moving things upstream now.
Some issues remain with the orientation matrixes of the sensors, but might be solved soon.
Testing welcome on all kinds of Qualcomm devices such as SDM670/SDM845/SMxxx but requires changes to your device packages such as firmware which you need to figure out yourself
12/12/2023: safe to be merged, still needs some parts upstreamed, see dependencies. Planned to do that soon.
Testing
-
Pull the firmware from your device and add it to the firmware package. See the SHIFT6mq one for paths and as example.
-
Sensors can be tested with
monitor-sensor
:- Accelerometer, light, proximity with
root
and thenmonitor-sensor --$SENSOR
- Compass requires to be come the
geoclue
user first:su geoclue -s=/bin/sh
and thenmonitor-sensor --compass
. Be aware that this user cannot access the other sensors when using thegeoclue
user.
- Accelerometer, light, proximity with
-
SHIFT6mq -
OP6 -
OP6T. Multiple reports that portrait orientation is wrong. Some user needs to find the correct mount matrix to fix it --> Turns out to be a glibc vs musl thing. On musl it was fine according to the reports. TODO: figure out why glibc behaves differently.
Merge request reports
Activity
added device-shift-axolotl type::feature labels
added 7 commits
- 28ba8b7f - temp/libssc: new aport
- ae6371c4 - temp/iio-sensor-proxy: fork from Alpine
- 886a6fdd - firmware-shift-sdm845: install sensor firmware files
- 77b2c197 - device-shift-axolotl: add accelerometer mount matrix
- c3444785 - linux-postmarketos-qcom-sdm845: add sensor support
- 4b9ca3df - device-shift-axolotl: start hexagonrpcd on boot
- b8a72c91 - temp/libqmi: fork from Alpine
By Dylan Van Assche on 2023-05-01T18:49:22
Toggle commit listadded 10 commits
-
b8a72c91...d40db11c - 2 commits from branch
postmarketOS:master
- 425eb210 - temp/hexagonrpcd: new aport
- db4f0f53 - temp/libssc: new aport
- 8c9b76bc - temp/iio-sensor-proxy: fork from Alpine
- 144fd088 - firmware-shift-sdm845: install sensor firmware files
- 91e328f6 - device-shift-axolotl: add accelerometer mount matrix
- cfdb244a - linux-postmarketos-qcom-sdm845: add sensor support
- e410fed1 - device-shift-axolotl: start hexagonrpcd on boot
- c51a29bd - temp/libqmi: fork from Alpine
By Dylan Van Assche on 2023-05-01T18:52:49
Toggle commit list-
b8a72c91...d40db11c - 2 commits from branch
added 2 commits
By Dylan Van Assche on 2023-05-01T18:56:48
added 4 commits
- e2d7364b - device-shift-axolotl: add accelerometer mount matrix
- ad63a031 - linux-postmarketos-qcom-sdm845: add sensor support
- 01e087eb - device-shift-axolotl: start hexagonrpcd on boot
- d514eaa1 - temp/libqmi: fork from Alpine
By Dylan Van Assche on 2023-05-01T19:12:37
Toggle commit list- Resolved by Administrator
Awesome! Thanks for your work on this! Can't wait to get these working in my OP6 and Poco F1!
By Joel Selvaraj on 2023-05-20T03:31:41
Edited by Ghost User
added request-for-test label
- Resolved by Administrator
I can test this on a oneplus-enchilada. Do you think just building the affected packages from this branch is enough, or do I need additional considerations?
By WhyNotHugo on 2023-05-02T12:39:14
Edited by Ghost User
added 7 commits
- 3180b236 - temp/libqmi: fork from Alpine
- 7ec445c5 - temp/libssc: new aport
- 99bf811c - temp/iio-sensor-proxy: fork from Alpine
- 655e71aa - firmware-shift-sdm845: install sensor firmware files
- afa0d25e - device-shift-axolotl: add accelerometer mount matrix
- 4caa18ca - linux-postmarketos-qcom-sdm845: add sensor support
- 080db4b4 - device-shift-axolotl: start hexagonrpcd on boot
By Dylan Van Assche on 2023-05-02T13:36:20
Toggle commit listadded 5 commits
- d9f19cd1 - temp/iio-sensor-proxy: fork from Alpine
- be7eb70b - firmware-shift-sdm845: install sensor firmware files
- 953f81a8 - device-shift-axolotl: add accelerometer mount matrix
- 34899cc9 - linux-postmarketos-qcom-sdm845: add sensor support
- f39764b8 - device-shift-axolotl: start hexagonrpcd on boot
By Dylan Van Assche on 2023-05-02T13:47:45
Toggle commit listadded 6 commits
- 657a01a7 - temp/iio-sensor-proxy: fork from Alpine
- da6b5115 - firmware-shift-sdm845: install sensor firmware files
- 67c90eb9 - device-shift-axolotl: add accelerometer mount matrix
- 95ae561d - linux-postmarketos-qcom-sdm845: add sensor support
- b817912d - device-shift-axolotl: start hexagonrpcd on boot
- 1c95312d - main/postmarketos-ui-phosh: drop !pipewire-pulse
By Dylan Van Assche on 2023-05-02T14:25:20
Toggle commit list