Skip to content

Match iPhone 5 auto-brightness to its calibrated iOS curve - #237

Open
brkosebay wants to merge 18 commits into
OrchardLinux:mainfrom
brkosebay:submit/n42-ios-curve
Open

brkosebay wants to merge 18 commits into
OrchardLinux:mainfrom
brkosebay:submit/n42-ios-curve

Conversation

@brkosebay

Copy link
Copy Markdown
Contributor

Builds on #200 (the native session helper); review that first. This PR adds its last commit only.

The iPhone 5's auto-brightness was too dark and slow to rise. It now follows the iOS 8.4.1 (12H321) curve for this panel: lux to nits from the N42 backlight calibration (/backlight/milliAmps2DACTablePart{1,2}, the AppleARMBacklight mapping), with iOS's fast rise and 60-second fall. The values live in a per-board light profile (desktop/session/light-profile.c) selected by the device tree's apple,n42ap; boards without a profile keep the helper's existing behaviour.

Tested on device

iPhone 5 (iPhone5,2, Omarchy-A on NAND): the helper built from this commit followed room light up and down with iOS-like levels and speed; rotation, the on-screen keyboard and dark/wake still worked.

Not yet run: the iPad 5 with this exact head (the profile mechanism also touches the shared light path), and tests/test_auto_brightness.py on Linux.

How to test

  1. Build Omarchy-A with this branch and install it on an iPhone 5.
  2. Turn on auto-brightness, then cover and uncover the light sensor and move between a dark room and daylight.
  3. Brightness should rise within about a second and fall over about a minute, at levels close to iOS's.
  4. On another board (iPad 5, iPhone 7), check that auto-brightness behaves as with Run light, rotation and keyboard policy in one native session helper #200 alone.

🤖 Generated with Claude Code

brkosebay and others added 18 commits December 1, 2026 18:02
Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Keep IPC, gesture listeners and bar buttons alive while their panels are cold. Let the dedicated picker process own its UI, and keep the lock surface ready at login.

Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Use the same physical size for the synchronous lock image and its cache warmer. Keep the desktop still visible while its rotated size decodes, and decode the launcher backdrop off the UI thread.

Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Give initial painting two seconds before background work. Hold that timer
while the startup lock is acquiring or drawing its first secure frames.
Keep the first manifest scan, bar state, notification storage (including
Focus), idle policy, PIN authentication and lock indicators available.

Defer these initial tasks:

- AppLibrary desktop-entry subscriptions, desktop-file and icon scans,
  and icon-revision watch. Opening the launcher requests them early.
- Plugin directory setup, orphan watcher cleanup, watch and follow-up scan.
- Backlight device discovery, the locked session's desktop wallpaper
  lookup and decode, and the lock cache warmer until the lock draws.
  Skip the unused intro readlink when there is no cover.
- Load emoji data and list stock, installed and extra themes on first use.
- Menu guard shell commands and the notification stacking-mode probe.
- Monitor and auto-brightness probes, verbose network details, audio
  node enumeration and output resolution, and power-profile discovery.
- Accelerometer presence (rotation-lock state still reads immediately).
- Workspace and dock layout lookup, dock desktop entries, keyboard
  layout lookup, and the initial indicator refresh including reminders,
  recording and passwordless sudo. Defer update and custom-command polls.
- Weather, Elsewhen time-zone probes, Dropbox and Tailscale status and
  startup retries, agent usage files, provider updates and sync.
- Optional low-battery check and profile read, night light, remote
  session detection, and MPRIS/PipeWire media enumeration. Media actions
  request the players early. Queue clipboard capture on the next turn.

Change polling:

- Battery status: 1 s to 5 s with an immediate read on AC changes.
- Open power panel: poll profiles every 5 s instead of every second.
  The status reader supplies the battery sample independently.
- Elsewhen: tick at the next minute boundary instead of every second.
- Dock launch feedback: wake for the next launch deadline; window
  arrivals still settle immediately.

Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Inside sourceComponent: Launcher { shell: shell }, `shell` names the
panel's own shell property (null), not the root object, so the lazily
loaded launcher got no app library and showed no apps (TypeError:
Cannot read property 'appLibrary' of null), and the control and
notification centres got no shell.  Each loader now carries the root
as rootShell and the panels read it from there.

Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
…keyboard

Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
While the screen was dark, the playback worker ran busctl and a full
pw-dump every second: 7.3 % CPU on the iPhone 5 with nothing to do.
It now keeps one pw-dump --monitor per dark period and re-reads
BlockInhibited only on logind PropertiesChanged (and right before
suspend). Falls back to a 10 s pw-dump poll if the monitor fails.

iPhone 5, screen dark: 7.27 % -> 0.23 % CPU, 1 wakeup/s. A test tone
posts playing/not-playing at its start and end.

Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Co-Authored-By: GPT-6.2 Astra <noreply@openai.com>
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