Skip to content

[Android] Sticky AlprSdk error 20004 after long lock/screen-off — init OK but process never recovers without process kill #3

Description

@sid-metiz

Summary

After a long live-scanning session (especially device lock / screen-off for ~25–50+ minutes), UltALPR (org.buyun.alpr.sdk.AlprSdk) enters a sticky failure state:

  • AlprSdk.process(...)isOK() == false
  • code() == 20004
  • phrase()Internal processing failed

Camera frames still flow. Preview can still work.
AlprSdk.deInit() + AlprSdk.init(...) reports success, but every following process() immediately returns 20004 again.

Soft re-init, hard re-init, and Activity recreate() do not fix it.
Only killing the process that hosts the native SDK restores recognition.

This is not “no plate in view” (isOK()==true, numPlates==0).


Environment

Item Value
Platform Android (minSdk 28)
SDK org.buyun.alpr.sdk (AlprSdk / UltALPR)
Package libttvalpr.aar
Pipeline Camera YUV → AlprSdk.yuv2Bitmapprocess(RGBA32)
Frame size 1280×720
Use case Long-running patrol LPR with frequent lock/unlock

Device (please fill):

  • Model:
  • Android version:
  • Chipset/GPU:
  • Date of logs:

Steps to reproduce

  1. Open live scanner; confirm plates are recognized.
  2. Lock device / leave idle for ~25–50+ minutes.
  3. Unlock and return to scanner.
  4. Point at clear license plates.

Controls (usually OK): continuous scan; short Plate Detail trip (few minutes).


Expected

After unlock: init OK, process OK, plates detected when in view. Empty scene → OK + numPlates==0.


Actual

  1. Frames keep arriving.
  2. init succeeds.
  3. Every process() returns 20004 / Internal processing failed.
  4. Soft/hard re-init and Activity recreate still sticky 20004.
  5. Process kill (or force-stop app) restores scanning.

API usage

AlprSdk.setActivation(...)
AlprSdk.init(assets, jsonConfig, null)

// per frame (single-threaded; one process at a time)
bitmap = AlprSdk.yuv2Bitmap(yuv, w, h, exifOrientation)
copy RGBA → direct ByteBuffer
result = AlprSdk.process(
  SDK_IMAGE_TYPE.ULTALPR_SDK_IMAGE_TYPE_RGBA32,
  nativeBuffer, width, height
)

// on SCREEN_OFF / lock
AlprSdk.deInit()

// on unlock / resume
AlprSdk.init(...)

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions