fix: sensor image flip and mirror orientation#82
Closed
henkwiedig wants to merge 2 commits into
Closed
Conversation
Collaborator
|
Hello, You need to test the code on maruko as well if your fixes include it. Otherwise exclude maruko and document as follow-up. |
Collaborator
|
PR #84 will merge this functionality, check it out! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
image.flipandimage.mirrorconfig options on star6e (Infinity6E) and maruko (SSC338Q/Infinity6C) platforms. Previously, orientation either had no effect or reverted to the default within ~1 second of stream start.This is 100% vibe coded, i have no idea what i am doing here.
Root cause
Two separate bugs:
VPE digital flip (
MI_VPE_SetChannelParamwithflip=1) caused a delayed/broken stream start on the IMX415 and possibly other sensors. It has been disabled;MI_SNR_SetOrien(sensor-level) is the only path now.ISP AE first-tick resets sensor timing registers at ~1s after stream start, and on the IMX415 this incidentally clears the sensor's orientation bits. The reset is triggered asynchronously by
MI_ISP_CUS3A_Enable({0,0,0})in the CUS3A handoff, so a single re-apply immediately after the handoff does not stick.Fix
Multi-layer re-apply targeting every point where sensor registers can be clobbered:
MI_SNR_Enableinsensor_select.c— correct ordering matching the reference majestic streamer (SetRes→SetFps→SetOrien→Enable)start_vpe/maruko_start_vpewait_isp_channel) and after ISP bin load inbind_and_finalize_pipelinecus3a_tickMI_SNR_SetFpscall (legacy_ae branch, live ISP bin reload, CUS3A fps_kick cold-boot fix) — SetFps resets sensor timing registers as a side effectstar6e_runtime.c,maruko_pipeline.c): re-apply at frames 1, fps, 2×fps…5×fps — catches the async AE first-tick reset regardless of when it firesChanges
include/sensor_select.himage_mirror/image_fliptoSensorSelectConfiginclude/star6e_cus3a.hmirror/fliptoStar6eCus3aConfiginclude/maruko_config.himage_mirror/image_fliptoMarukoBackendConfigsrc/sensor_select.cMI_SNR_SetOrienbeforeMI_SNR_Enablesrc/star6e_pipeline.csrc/star6e_cus3a.cMI_SNR_SetOrienvia dlsym; re-apply after fps_kicksrc/star6e_runtime.csrc/maruko_config.csrc/maruko_pipeline.cTested on star6e with IMX415. Maruko changes follow the same pattern; no maruko hardware available for direct test.