Skip to content

Qualcomm Snapdragon Sensor Core support for SDM845 devices

Administrator requested to merge qcom-sdm845-sensors into master

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

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 then monitor-sensor --$SENSOR
    • Compass requires to be come the geoclue user first: su geoclue -s=/bin/sh and then monitor-sensor --compass. Be aware that this user cannot access the other sensors when using the geoclue user.
  • 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.

Edited by Administrator

Merge request reports

Loading