8000 iio-sensor-proxy: allow selecting the display accelerometer · Issue #23 · fstanis/chuwi-minibook · GitHub
[go: up one dir, main page]

Skip to content

iio-sensor-proxy: allow selecting the display accelerometer #23

Closed

Description

@4leite

Problem

The current driver always uses the first sensor for screen orientation. On this device, that is the base sensor, so screen rotation does not follow the display reliably.

Basic information

  • Laptop model: CHUWI MiniBook X N150
  • Linux distro: NixOS 26.05 (Yarara), build 26.05.20260914.c3eea5b
  • uname -a output: Linux chewbacca 6.18.51 #1-NixOS SMP PREEMPT_DYNAMIC Fri Sep 11 09:49:46 UTC 2026 x86_64 GNU/Linux

The repository diagnostic scripts are not NixOS-aware. check-status.sh assumes DKMS and traditional /usr, /lib, and /etc package paths, so it reports working NixOS packages as missing. The equivalent information below was collected from the running kernel, the NixOS system closure, systemd, sysfs, and the configured VBT.

Equivalent to tools/check-status.sh

--- device ---

dmi vendor              CHUWI Innovation And Technology(ShenZhen)co.,Ltd
dmi product             MiniBook X
cpu                     Intel(R) N150
microcode               0x21
bios                    DNN20A V2.51 04/16/2025
display                 card1-DSI-1 1200x1920
sleep mode              S0ix (software)

--- kernel cmdline ---

i915.vbt_firmware       vbt
i915.enable_psr         0 (disabled)

--- configured VBT ---

refresh                 90.00 Hz (clock=246385 kHz, htotal=1268, vtotal=2159)
rotation                90 degrees (1)

--- NixOS kernel modules ---

goodix_ts               installed, loaded
minibook_ec             installed, loaded
dptf_enabler            installed, loaded
i2c_designware_spklen   installed, loaded
goodix firmware         present in the active system closure

--- services ---

thermald                2.5.11.minibook1, enabled, running
iio-sensor-proxy        3.9.minibook1, linked, running
                        sensor polling active
                        MINIBOOK_PANEL_ORIENTATION=normal
                        MINIBOOK_LAPTOP_ORIENTATION=right-up
                        MINIBOOK_ORIENTATION_SENSOR=display

Equivalent to tools/detect-hardware.sh

ID                         DRIVER            NAME
dmi:vendor                 <empty>           CHUWI Innovation And Technology(ShenZhen)co.,Ltd
dmi:product                <empty>           MiniBook X
dmi:bios                   <empty>           DNN20A V2.51 04/16/2025
cpu:0                      <empty>           Intel(R) N150
pci:8086:46d4              i915              Intel Corporation Alder Lake-N [Intel Graphics]
pci:8086:461d              proc_thermal_pci  Intel Corporation Alder Lake Innovation Platform Framework Processor Participant
pci:8086:54ed              xhci_hcd          Intel Corporation Alder Lake-N PCH USB 3.2 Gen 2x1 (10 Gb/s) xHCI Host Controller
pci:8086:54f0              iwlwifi           Intel Corporation Alder Lake-N PCH CNVi WiFi
pci:8086:54c4              sdhci-pci         Intel Corporation Alder Lake-N eMMC Controller
pci:8086:54c8              snd_hda_intel     Intel Corporation Alder Lake-N PCH High Definition Audio Controller
pci:1d97:1202              nvme              Shenzhen Longsys Electronics Co., Ltd. Lexar NM610 PRO NVME SSD (DRAM-less) (rev 01)
usb:8087:0026              usb               <empty>
usb:1b0a:2bc9              usb               Hy-Usb2.0-1*MIC
i2c:GDIX1002               Goodix-TS         Goodix Capacitive TouchScreen
i2c:MDA6655                mxc4005           <empty>
i2c:XXXX0000               i2c_hid_acpi      XXXX0000:05 0911:5288 Touchpad
acpi:ACPI0003              <empty>           <empty>
acpi:ACPI000C              <empty>           <empty>
acpi:ACPI000E              <empty>           <empty>
acpi:GDIX1002
7544
              <empty>           <empty>
acpi:INT33A1               <empty>           <empty>
acpi:INT33D3               <empty>           <empty>
acpi:INT340E               <empty>           <empty>
acpi:INTC1041              <empty>           <empty>
acpi:INTC1046              <empty>           Thermistor Ambient
acpi:INTC1049              <empty>           Intel PCH FIVR Participant
acpi:INTC1057              <empty>           <empty>
acpi:INTC1060              <empty>           Platform Power
acpi:INTC1061              <empty>           Battery 1 Participant
acpi:INTC1070              <empty>           <empty>
acpi:INTC1099              <empty>           <empty>
acpi:MDA6655               <empty>           <empty>
acpi:MSFT0001              <empty>           <empty>
acpi:MSFT0101              tpm_crb           TPM 2.0 Device
acpi:PNP0103               <empty>           <empty>
acpi:PNP0C02               <empty>           <empty>
acpi:PNP0C02               <empty>           <empty>
acpi:PNP0C02               <empty>           <empty>
acpi:PNP0C09               ec                <empty>
acpi:PNP0C0A               battery           <empty>
acpi:PNP0C0C               button            <empty>
acpi:PNP0C0D               button            <empty>
acpi:PNP0C0E               button            <empty>
acpi:PRP00001              <empty>           <empty>
acpi:PRP00001              <empty>           <empty>
acpi:XXXX0000              <empty>           <empty>
blk:nvme0n1                driver            AirDisk 512GB SSD (476 GB)
drm:card1-DSI-1            <empty>           Internal panel 1200x1920
backlight:intel_backlight  <empty>           raw
hwmon:hwmon0               <empty>           nvme
hwmon:hwmon1               <empty>           minibook_soc
hwmon:hwmon2               <empty>           minibook_charger
hwmon:hwmon3               <empty>           minibook_fan
hwmon:hwmon4               <empty>           acpitz
hwmon:hwmon5               <empty>           ADP1
hwmon:hwmon6               <empty>           BAT0
hwmon:hwmon7               <empty>           coretemp
hwmon:hwmon8               <empty>           iwlwifi_1
tpm:tpm0                   <empty>           v2

Evidence

I moved each half of the laptop separately while recording both sensors. This showed:

  • I2C0 / raw1 = base sensor
  • I2C1 / raw2 = display sensor
  • cal1 is identity
  • cal2 changes (x, y, z) to (x, -y, -z)

For screen orientation, the working input is the raw display reading with X reversed:

raw2 -> (-x, y, z) -> existing orientation filter

Using calibrated a2 instead adds a 180 degree rotation around X and gives the wrong orientation. Hinge-angle calculation still needs both calibrated sensors and should not change. Note that previously we were using cal1, which is equivalent to raw1 on this machine as it uses the identity matrix. So switching to raw for both should leave the old setting effectively the same,

Requested change

Add an optional setting:

MINIBOOK_ORIENTATION_SENSOR=base|display

It should select only the raw input to the existing orientation filter. Sensor discovery, calibration, and hinge calculation should stay unchanged. The default should remain base.

I have tested display on this hardware. Auto-rotation follows the display correctly.

We could consider making the display the default value if testing on other devices correlates with this result.

Activity

  1. fstanis commented on Sep 17, 2026

    @fstanis
    Owner

    Finally, some of those odd bugs make so much sense...

    We could consider making the display the default value if testing on other devices correlates with this result.

    Absolutely, it makes no sense to ever use base, unless the sensors can be opposite on some devices. I'll test this on my device and see if there's some other way we can detect this.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0