Skip to content

fix(camera): open the main back camera and reach all three on the Jolla - #106

Open
patrickjquinn wants to merge 2 commits into
mainfrom
fix/jolla-camera-selection
Open

patrickjquinn wants to merge 2 commits into
mainfrom
fix/jolla-camera-selection

Conversation

@patrickjquinn

Copy link
Copy Markdown
Owner

Jolla e2e 2026-11-28, P1 "Camera opens on the front sensor and calls it the rear".

Root cause.

  • The sensors' device tree already says front/back and rotation (libcamera reports them: IMX766 back 90, IMX214 back 90, IMX616 front 270). The app read them from sysfs itself, and on a start it kept whatever deviceId dconf held, which was the IMX616, so it opened the front camera (mirrored, as a front camera should be).
  • The lens switch only appears with a label per back camera, and the app had no labels (Several back cameras but no labels), so the IMX214 could not be reached.
  • libcamera lists the sensors in a different order from boot to boot, so index-based labels and "the first back camera" were not stable.

Fix.

  • apps/camera: Location/Rotation/PixelArrayArea from libcamera's camera properties; back cameras first, largest sensor first; every start opens the main back camera (the flip still returns to the last back lens); the warning names the real dconf key.
  • device-jolla-jp2601-marathon r26: a compiled dconf system database (/etc/dconf/profile/user = user-db + system-db:jp2601) with /apps/camera/backCameraLabels=['1', '0.6'] (50 MP main, 13 MP ultrawide).

On the phone (app built in mshell-dev from this branch, dconf db compiled on the phone): cold start opens IMX766 (SoftwareIsp Input 4096x3072), the switch shows 1x | 0.6; tapping 0.6 moves to IMX214 (1920x1080 mode); the flip shows the mirrored IMX616 (3280x2464) with the lens switch hidden and returns to IMX214; a relaunch opens IMX766 again. No "no labels" warning.

The shell side needs nothing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BrjN1gf1Fu2w5MqXBmEowh

… one

On the Jolla Phone (2026) the Camera app opened on the front IMX616,
mirrored, from a stored deviceId; its lens switch never appeared, so
the IMX214 ultrawide could not be reached; and libcamera lists the
three sensors in a different order from boot to boot.

- Read Location, Rotation and PixelArrayArea from libcamera's camera
  properties instead of the sensor's device tree node in sysfs, which
  works on any pipeline and needs no /sys/firmware.
- List the back cameras first, largest sensor first, so the default
  is the main camera and the lens labels have a stable order.
- Open the main back camera on every start; the flip button still
  returns to the last back lens used.
- Name the dconf key the labels really live at (/apps/camera).

Tested on the Jolla: a cold start opens the IMX766 (4096x3072), the
lens switch shows 1x and 0.6 and moves to the IMX214, the flip button
reaches the mirrored IMX616 and returns to the IMX214, and a relaunch
opens the IMX766 again.
The Camera app shows its lens switch only with a label for each back
camera (dconf /apps/camera/backCameraLabels); libcamera has no focal
length to derive them from. Ship the board's dconf defaults, the
50 MP main camera at 1 and the 13 MP ultrawide at 0.6, in a compiled
system database under the user's own settings.

Tested on the Jolla with the same profile and keyfile compiled by
dconf: dconf read gives ['1', '0.6'] and the app shows both lenses.
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