Skip to content

Error 10102: CaptureMode + CaptureSettings State Conflict #140

@andhikakrstn-cki

Description

@andhikakrstn-cki

Summary

Error 10102 occurs inconsistently when attempting to capture photos using startNormalCapture(). The error appears to be caused by state inconsistency between capture mode and capture settings, rather than a single clear trigger point.

Environment

  • SDK Version: 1.9.11
  • Camera Model: Insta360 ONE X2
  • Android Version: Android 12+
  • Device: Samsung Galaxy A15

Steps to Reproduce

  1. Connect to camera via BLE + WiFi
  2. Initialize preview stream with startPreviewStream(PREVIEW_TYPE_NORMAL)
  3. Set capture mode to CaptureMode.CAPTURE_NORMAL
  4. Call startNormalCapture()
  5. Result: onCaptureError(errorCode: -10102) is invoked

Intermittent: The error does NOT always occur on every attempt. Sometimes it works, sometimes it fails without clear pattern.

Current Behavior

takePhoto: camera=Insta360 ONE X2 mode=CAPTURE_NORMAL sdCard=true
takePhoto: supportedPhotoResolutions=0
performCapture: starting capture sequence...
performCapture: startNormalCapture() called
Capture: ERROR code=-10102

Even with:

  • Waiting 1000ms after mode switch
  • Re-fetching camera options
  • Checking isCameraWorking == false
  • Closing preview stream before capture
  • Using Preview Idle Gate pattern (waiting for onIdle())

Error 10102 still occurs sporadically.

Expected Behavior

startNormalCapture() should consistently succeed when called in photo mode with preview properly closed.

Additional Observations

  1. Intermittent Nature: Error does not always occur. Works sometimes, fails other times with same sequence.

  2. Timing Independent: Adding arbitrary delays (300ms, 500ms, 1000ms) does NOT prevent the error.

  3. Mode Status Unclear: According to SDK docs:

    • currentCaptureMode == CAPTURE_NORMAL ≠ guaranteed photo engine is ready
    • Mode switch is asynchronous
    • No callback to confirm mode switch completion
  4. Photo Settings Inconsistency:

    • SDK doc mentions "cross-setting dependencies" between photo properties
    • No explicit validation of setting compatibility
    • No clear method to verify all settings are in valid state
  5. Undocumented Error: Error code 10102 is not listed in official error code documentation:

    • Connection error codes documented
    • Capture failed error codes documented (-14161 to -14184)
    • Error 10102 / -10102 not mentioned anywhere

Questions for SDK Team

  1. What does error 10102 actually mean in capture context?
  2. How do we guarantee photo mode is ready after setCaptureMode()?
  3. Are there cross-setting dependencies that must be validated before capture?
  4. Should batch setting via beginSettingOptions() + commitSettingOptions() be used for all capture settings?
  5. Is there a completion callback for closePreviewStream()? (Currently only onIdle() available)

Related Resources

  • SDK Version: 1.9.11
  • Camera: Insta360 ONE X2
  • Platform: Android 12+

Note: This error appears to be undocumented in the SDK README and error code reference documentation, yet occurs in real-world usage. Clear documentation of error 10102 and proper state validation APIs would help developers resolve this issue.

LOG :
=== Insta360 MVP Capture Log ===
Mon Feb 09 19:06:49 GMT+07:00 2026

[19:06:49.152] CaptureActivity started
[19:06:49.154] Log file: /storage/emulated/0/Android/data/com.example.insta360mvp/files/capture_log.txt
[19:06:49.158] Step 1: Lock screen OK
[19:06:49.161] Step 2: Fetching camera options...
[19:06:49.643] Step 2: fetchCameraOptions = true
[19:06:49.651] Step 3: isDualSensor = true
[19:06:49.655] Step 3: checkSensorMode = true
[19:06:49.677] Step 4: Network bound OK
[19:06:49.680] Step 5: initCameraSupportConfig...
[19:06:49.688] Step 5: initConfig = true
[19:06:49.693] Step 5b: isOldFlow = true (ONE X2 = old flow)
[19:06:49.698] Step 6: Opening preview stream...
[19:06:49.715] Preview: onOpening
[19:06:51.365] Preview: onOpened
[19:06:51.394] Step 6: openPreviewStream = true
[19:06:51.400] Step 7: isOldFlow=true (ONE X2 uses old flow)
[19:06:52.004] Step 8: mode after re-fetch = TIMELAPSE
[19:06:52.016] Step 8b: Switching to CAPTURE_NORMAL...
[19:06:52.126] setCaptureMode callback code=0
[19:06:52.147] Step 8b: setCaptureMode result = true
[19:06:52.154] Step 8c: [Old Flow] Setting offline capture params...
[19:06:52.174] Step 8c: [Old Flow] Set 6 settings OK
[19:06:52.180] SD card enabled: true
[19:06:52.185] Supported modes: [HDR_CAPTURE, CAPTURE_NORMAL, RECORD_NORMAL, TIMELAPSE, LIVE, LIVE_ANIMATION]
[19:06:52.190] Step 9: Displaying preview...
[19:06:52.385] PlayerView: onLoadingFinish
[19:06:52.394] Ready! Tap 'Take Photo'.
[19:06:53.301] PlayerView: onFirstFrameRender
[19:07:41.018] takePhoto: currentMode=CAPTURE_NORMAL sdCard=true isOldFlow=true
[19:07:41.027] takePhoto: [Old Flow] Restarting preview stream...
[19:07:41.032] Restarting preview stream...
[19:07:41.043] Preview: onIdle
[19:07:41.051] Preview: onOpening
[19:07:43.980] Preview: onOpened
[19:07:44.007] takePhoto: [Old Flow] Reopen=true
[19:07:44.583] takePhoto: modeAfterReopen=CAPTURE_NORMAL
[19:07:44.598] takePhoto: Re-setting CAPTURE_NORMAL...
[19:07:44.761] setCaptureMode callback code=0
[19:07:44.782] takePhoto: setCaptureMode=true
[19:07:44.791] takePhoto: Re-setting offline params...
[19:07:44.805] takePhoto: Set 6 settings
[19:07:45.457] takePhoto: mode=CAPTURE_NORMAL previewStatus=2 calling startNormalCapture()...
[19:07:45.472] Capture: ERROR code=-10102

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions