enioka-Haute-Couture / enioka_scan

Integration library for all your Android hardware barcode scanner integration needs
Apache License 2.0
52 stars 4 forks source link

Blocage de la caméra lors de la numérisation et impossibilité de lire les codes à barres #99

Closed abelatar closed 1 year ago

abelatar commented 1 year ago

Hello @marcanpilami Je rencontre encore un souci lors de la numérisation de codes à barres sur les Xcover 4S. Parfois, la caméra se bloque et je ne parviens pas à lire les codes à barres.

Voici la situation : lors de la numérisation, il arrive que la caméra se bloque et ne réponde plus. Cela se produit de manière aléatoire et je ne parviens pas à lire les codes à barres dans ces cas-là.

J'ai observé que l'erreur suivante est souvent présente dans les logs lors de ce blocage :


BARCODE                D  Preview surface created, camera will be initialized soon
                       D  INFO_SUPPORTED_HARDWARE_LEVEL LIMITED
                       I  Camera supports flash: true
                       I  Using memory limit (MB): 192
                       I  Looking for the ideal preview resolution. View ratio is 1.0916667. (view is 786*720)
                       D    supports preview resolution 4608*3456 - 1.3333334
                       D    supports preview resolution 4608*2592 - 1.7777778
                       D    supports preview resolution 3840*2160 - 1.7777778
                       D    supports preview resolution 3456*3456 - 1.0
                       D    supports preview resolution 2576*1932 - 1.3333334
                       D    supports preview resolution 2560*1440 - 1.7777778
                       D    supports preview resolution 1920*1080 - 1.7777778
                       D    supports preview resolution 1440*1080 - 1.3333334
                       D    supports preview resolution 1280*720 - 1.7777778
                       D    supports preview resolution 1152*864 - 1.3333334
                       D    supports preview resolution 1088*1088 - 1.0
                       D    supports preview resolution 1056*704 - 1.5
                       D    supports preview resolution 1024*768 - 1.3333334
                       D    supports preview resolution 960*720 - 1.3333334
                       D    supports preview resolution 880*720 - 1.2222222
                       D    supports preview resolution 800*450 - 1.7777778
                       D    supports preview resolution 720*720 - 1.0
                       D    supports preview resolution 720*480 - 1.5
                       D    supports preview resolution 640*480 - 1.3333334
                       D    supports preview resolution 480*320 - 1.5
                       D    supports preview resolution 352*288 - 1.2222222
                       D    supports preview resolution 320*240 - 1.3333334
                       D    supports preview resolution 256*144 - 1.7777778
                       D    supports preview resolution 176*144 - 1.2222222
                       V  Allowed preview sizes (acceptable ratio): 
                       V    176*144 - 1.2222222
                       V    320*240 - 1.3333334
                       V    352*288 - 1.2222222
                       V    640*480 - 1.3333334
                       V    720*720 - 1.0
                       V    880*720 - 1.2222222
                       V    960*720 - 1.3333334
                       V    1024*768 - 1.3333334
                       V    1152*864 - 1.3333334
                       V    1088*1088 - 1.0
                       V    1440*1080 - 1.3333334
                       V    2576*1932 - 1.3333334
                       V    3456*3456 - 1.0
                       V    4608*3456 - 1.3333334
                       I  Loaded preferred preview resolution Point(2576, 1932)
                       I  Camera uses preview resolution: 2576*1932
                       I  Camera uses FPS range: [8, 30]
                       I  Using AF mode: CONTROL_AF_MODE_CONTINUOUS_PICTURE
                       I  Supported autofocus zones: 1
                       I  Using AB mode: CONTROL_AE_ANTIBANDING_MODE_AUTO
CameraManagerGlobal    I  postSingleTorchUpdate device: camera id 0 status 1
BARCODE                D  Trying to open camera from CameraManager
CameraManagerGlobal    I  postSingleTorchUpdate device: camera id 0 status 0
                       I  Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_OPEN for client com.geodis.mobiprep API Level 2
BARCODE                V  CameraDevice.StateCallback.onOpened
                       I  Initializing or reinitializing preview analysis loop
                       D  Capture session creation begins
                       I  Setting targeting rect at Rect(72, 257 - 648, 377)
                       I  Targeting overlay added
SurfaceView            D  surfaceChanged (720,786) 1 #8 android.view.SurfaceView{7212561 V.E...... ......ID 0,0-720,786}
BARCODE                I  surface changed
                       D  Image reader already created
SurfaceView            D  surfaceChanged (2576,1932) 1 #7 android.view.SurfaceView{7212561 V.E...... ......ID 0,0-720,786}
BARCODE                I  surface changed
                       D  Image reader already created
                       D  Configuration request sent
                       D  Preview analysis loop start method done
                       I  Capture session is now configured and will start the capture request loop 210501440
                       D  Using metering zone (1238,916) (1338,1016)
                       D  Setting AF mode to 4
ViewRootI...Activity]  D  Relayout returned: old=(0,0,720,1280) new=(0,0,720,1280) req=(720,1280)0 dur=12 res=0x1 s={true 498571567104} ch=false
BARCODE                I  Left: 0 - Top : 257 - Right: 720 - bottom: 377
                       I  target was laid out
                       D  Capture session is ready 210501440
                       D  Capture session is getting active 210501440
ViewRootI...Activity]  D  MSG_WINDOW_FOCUS_CHANGED 1 1
InputMethodManager     D  prepareNavigationBarInfo() DecorView@bb38ff4[ParcelLoadingActivity]
                       D  getNavigationBarColor() -855310
                       D  prepareNavigationBarInfo() DecorView@bb38ff4[ParcelLoadingActivity]
                       D  getNavigationBarColor() -855310
                       V  Starting input: tba=com.geodis.mobiprep ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
                       D  startInputInner - Id : 0
                       I  startInputInner - mService.startInputOrWindowGainedFocus
InputTransport         D  Input channel destroyed: 'ClientS', fd=71
CameraManagerGlobal    I  onTorchModeChanged
BARCODE                D  Torch status has changed to: false
CameraManagerGlobal    I  onTorchModeUnavailable
ViewRootI...Activity]  D  MSG_RESIZED: frame=(0,0,720,1280) ci=(0,48,0,0) vi=(0,48,0,0) or=1
Gralloc3               W  allocator 3.x is not supported
libEGL                 W  EGLNativeWindowType 0x75227da990 disconnect failed
ViewRootI...Activity]  D  Relayout returned: old=(0,0,720,1280) new=(0,0,720,1280) req=(720,1280)8 dur=10 res=0x5 s={false 0} ch=true
                       D  stopped(true) old=false
ScannerActivity        I  Scanner activity is being stopped
ViewRootI...Activity]  D  Relayout returned: old=(0,0,720,1280) new=(0,0,720,1280) req=(720,1280)8 dur=7 res=0x5 s={false 0} ch=false
CameraManagerGlobal    I  Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_ACTIVE for client com.geodis.mobiprep API Level 2
BARCODE                D  FPS: 1.2238664E-4 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {}
geodis.mobipre         I  Background concurrent copying GC freed 1662(200KB) AllocSpace objects, 0(0B) LOS objects, 31% free, 52MB/76MB, paused 977us total 291.210ms
BARCODE                D  FPS: 19.356644 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {}
geodis.mobipre         I  Background concurrent copying GC freed 669(191KB) AllocSpace objects, 13(36MB) LOS objects, 26% free, 67MB/91MB, paused 104us total 103.374ms
BARCODE                D  FPS: 23.01215 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {}
geodis.mobipre         I  Background concurrent copying GC freed 725(190KB) AllocSpace objects, 15(42MB) LOS objects, 27% free, 63MB/87MB, paused 110us total 104.192ms
BARCODE                D  FPS: 23.757826 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {}
                       D  FPS: 16.774971 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {}
                       D  FPS: 16.945246 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {}
                       I  Persisting default preview resolution: 2576*1932
geodis.mobipre         I  Background concurrent copying GC freed 592(176KB) AllocSpace objects, 14(33MB) LOS objects, 29% free, 56MB/80MB, paused 128us total 108.256ms
BARCODE                D  FPS: 20.255316 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {Point(2576, 1932)=1}
                       D  FPS: 16.68569 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {Point(2576, 1932)=2}
                       D  FPS: 16.287992 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {Point(2576, 1932)=3}
ViewRootI...Activity]  D  ViewPostIme pointer 0
                       D  ViewPostIme pointer 1
BARCODE                D  FPS: 16.56806 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {Point(2576, 1932)=4}
                       D  FPS: 21.337358 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {Point(2576, 1932)=5}
geodis.mobipre         I  Background concurrent copying GC freed 702(192KB) AllocSpace objects, 13(36MB) LOS objects, 26% free, 68MB/92MB, paused 107us total 117.442ms
BARCODE                D  FPS: 29.787386 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {Point(2576, 1932)=6}
                       D  FPS: 30.036196 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {Point(2576, 1932)=7}
geodis.mobipre         I  Background concurrent copying GC freed 687(191KB) AllocSpace objects, 14(37MB) LOS objects, 26% free, 67MB/91MB, paused 105us total 100.490ms
                       I  Background concurrent copying GC freed 762(175KB) AllocSpace objects, 14(41MB) LOS objects, 25% free, 68MB/92MB, paused 126us total 110.243ms
                       I  Background concurrent copying GC freed 779(191KB) AllocSpace objects, 16(42MB) LOS objects, 25% free, 69MB/93MB, paused 100us total 122.873ms
BARCODE                D  FPS: 29.228542 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {Point(2576, 1932)=8}
                       D  FPS: 29.38437 - Pool size: 8. Current analysis queue depth: 0. Current res: 2576*1932. Statistics are: {Point(2576, 1932)=9}
                       I  Changing preview resolution from 2576*1932 to 3456*3456
                       D  New preview resolution set
                       D  Image reader already created
geodis.mobipre         I  Background concurrent copying GC freed 599(176KB) AllocSpace objects, 16(34MB) LOS objects, 26% free, 66MB/90MB, paused 139us total 101.155ms
ImageReader_JNI        W  Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers
                       W  Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers
BARCODE                W  Discarding image as all analysers are busy
                          java.lang.IllegalStateException: maxImages (16) has already been acquired, call #close before acquiring more.
                            at android.media.ImageReader.acquireNextImage(ImageReader.java:513)
                            at android.media.ImageReader.acquireLatestImage(ImageReader.java:397)
                            at com.enioka.scanner.camera.CameraBarcodeScanViewV2.lambda$new$0$CameraBarcodeScanViewV2(CameraBarcodeScanViewV2.java:609)
                            at com.enioka.scanner.camera.-$$Lambda$CameraBarcodeScanViewV2$VMyTEjvJxZ7LD_CakOd_WrWwxVc.onImageAvailable(Unknown Source:2)
                            at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:798)
                            at android.os.Handler.dispatchMessage(Handler.java:107)
                            at android.os.Looper.loop(Looper.java:237)
                            at android.os.HandlerThread.run(HandlerThread.java:67)
ImageReader_JNI        W  Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers
BARCODE                W  Discarding image as all analysers are busy
                          java.lang.IllegalStateException: maxImages (16) has already been acquired, call #close before acquiring more.
                            at android.media.ImageReader.acquireNextImage(ImageReader.java:513)
                            at android.media.ImageReader.acquireLatestImage(ImageReader.java:397)
                            at com.enioka.scanner.camera.CameraBarcodeScanViewV2.lambda$new$0$CameraBarcodeScanViewV2(CameraBarcodeScanViewV2.java:609)
                            at com.enioka.scanner.camera.-$$Lambda$CameraBarcodeScanViewV2$VMyTEjvJxZ7LD_CakOd_WrWwxVc.onImageAvailable(Unknown Source:2)
                            at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:798)
                            at android.os.Handler.dispatchMessage(Handler.java:107)
                            at android.os.Looper.loop(Looper.java:237)
                            at android.os.HandlerThread.run(HandlerThread.java:67)
geodis.mobipre         I  Background concurrent copying GC freed 595(190KB) AllocSpace objects, 16(44MB) LOS objects, 30% free, 54MB/78MB, paused 143us total 114.667ms
ImageReader_JNI        W  Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers
BARCODE                W  Discarding image as all analysers are busy
                          java.lang.IllegalStateException: maxImages (16) has already been acquired, call #close before acquiring more.
                            at android.media.ImageReader.acquireNextImage(ImageReader.java:513)
                            at android.media.ImageReader.acquireLatestImage(ImageReader.java:397)
                            at com.enioka.scanner.camera.CameraBarcodeScanViewV2.lambda$new$0$CameraBarcodeScanViewV2(CameraBarcodeScanViewV2.java:609)
                            at com.enioka.scanner.camera.-$$Lambda$CameraBarcodeScanViewV2$VMyTEjvJxZ7LD_CakOd_WrWwxVc.onImageAvailable(Unknown Source:2)
                            at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:798)
                            at android.os.Handler.dispatchMessage(Handler.java:107)
                            at android.os.Looper.loop(Looper.java:237)
                            at android.os.HandlerThread.run(HandlerThread.java:67)
ImageReader_JNI        W  Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers
BARCODE                W  Discarding image as all analysers are busy
                          java.lang.IllegalStateException: maxImages (16) has already been acquired, call #close before acquiring more.
                            at android.media.ImageReader.acquireNextImage(ImageReader.java:513)
                            at android.media.ImageReader.acquireLatestImage(ImageReader.java:397)
                            at com.enioka.scanner.camera.CameraBarcodeScanViewV2.lambda$new$0$CameraBarcodeScanViewV2(CameraBarcodeScanViewV2.java:609)
                            at com.enioka.scanner.camera.-$$Lambda$CameraBarcodeScanViewV2$VMyTEjvJxZ7LD_CakOd_WrWwxVc.onImageAvailable(Unknown Source:2)
                            at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:798)
                            at android.os.Handler.dispatchMessage(Handler.java:107)
                            at android.os.Looper.loop(Looper.java:237)
                            at android.os.HandlerThread.run(HandlerThread.java:67)
ImageReader_JNI        W  Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers
BARCODE                W  Discarding image as all analysers are busy
                          java.lang.IllegalStateException: maxImages (16) has already been acquired, call #close before acquiring more.
                            at android.media.ImageReader.acquireNextImage(ImageReader.java:513)
                            at android.media.ImageReader.acquireLatestImage(ImageReader.java:397)
                            at com.enioka.scanner.camera.CameraBarcodeScanViewV2.lambda$new$0$CameraBarcodeScanViewV2(CameraBarcodeScanViewV2.java:609)
                            at com.enioka.scanner.camera.-$$Lambda$CameraBarcodeScanViewV2$VMyTEjvJxZ7LD_CakOd_WrWwxVc.onImageAvailable(Unknown Source:2)
                            at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:798)
                            at android.os.Handler.dispatchMessage(Handler.java:107)
                            at android.os.Looper.loop(Looper.java:237)
                            at android.os.HandlerThread.run(HandlerThread.java:67)
ImageReader_JNI        W  Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers
BARCODE                W  Discarding image as all analysers are busy
                          java.lang.IllegalStateException: maxImages (16) has already been acquired, call #close before acquiring more.
                            at android.media.ImageReader.acquireNextImage(ImageReader.java:513)
                            at android.media.ImageReader.acquireLatestImage(ImageReader.java:397)
                            at com.enioka.scanner.camera.CameraBarcodeScanViewV2.lambda$new$0$CameraBarcodeScanViewV2(CameraBarcodeScanViewV2.java:609)
                            at com.enioka.scanner.camera.-$$Lambda$CameraBarcodeScanViewV2$VMyTEjvJxZ7LD_CakOd_WrWwxVc.onImageAvailable(Unknown Source:2)
                            at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:798)
                            at android.os.Handler.dispatchMessage(Handler.java:107)
                            at android.os.Looper.loop(Looper.java:237)
                            at android.os.HandlerThread.run(HandlerThread.java:67)
ImageReader_JNI        W  Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers
BARCODE                W  Discarding image as all analysers are busy
                          java.lang.IllegalStateException: maxImages (16) has already been acquired, call #close before acquiring more.
                            at android.media.ImageReader.acquireNextImage(ImageReader.java:513)
                            at android.media.ImageReader.acquireLatestImage(ImageReader.java:397)
                            at com.enioka.scanner.camera.CameraBarcodeScanViewV2.lambda$new$0$CameraBarcodeScanViewV2(CameraBarcodeScanViewV2.java:609)
                            at com.enioka.scanner.camera.-$$Lambda$CameraBarcodeScanViewV2$VMyTEjvJxZ7LD_CakOd_WrWwxVc.onImageAvailable(Unknown Source:2)
                            at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:798)
                            at android.os.Handler.dispatchMessage(Handler.java:107)
                            at android.os.Looper.loop(Looper.java:237)
                            at android.os.HandlerThread.run(HandlerThread.java:67)
ImageReader_JNI        W  Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers
BARCODE                W  Discarding image as all analysers are busy
                          java.lang.IllegalStateException: maxImages (16) has already been acquired, call #close before acquiring more.
                            at android.media.ImageReader.acquireNextImage(ImageReader.java:513)
                            at android.media.ImageReader.acquireLatestImage(ImageReader.java:397)
                            at com.enioka.scanner.camera.CameraBarcodeScanViewV2.lambda$new$0$CameraBarcodeScanViewV2(CameraBarcodeScanViewV2.java:609)
                            at com.enioka.scanner.camera.-$$Lambda$CameraBarcodeScanViewV2$VMyTEjvJxZ7LD_CakOd_WrWwxVc.onImageAvailable(Unknown Source:2)
                            at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:798)
                            at android.os.Handler.dispatchMessage(Handler.java:107)
                            at android.os.Looper.loop(Looper.java:237)
                            at android.os.HandlerThread.run(HandlerThread.java:67)
BufferQueueProducer    E  [ImageReader-2576x1932f23m16-16419-0] cancelBuffer: BufferQueue has been abandoned
                       E  [ImageReader-2576x1932f23m16-16419-0] cancelBuffer: BufferQueue has been abandoned
                       E  [ImageReader-2576x1932f23m16-16419-1] queueBuffer: BufferQueue(0x7489257640) has been abandoned
                       E  [ImageReader-2576x1932f23m16-16419-1] cancelBuffer: BufferQueue has been abandoned
                       E  [ImageReader-2576x1932f23m16-16419-1] cancelBuffer: BufferQueue has been abandoned
                       E  [ImageReader-2576x1932f23m16-16419-1] cancelBuffer: BufferQueue has been abandoned
                       E  [ImageReader-2576x1932f23m16-16419-1] cancelBuffer: BufferQueue has been abandoned
                       E  [ImageReader-2576x1932f23m16-16419-1] cancelBuffer: BufferQueue has been abandoned
                       E  [ImageReader-2576x1932f23m16-16419-1] cancelBuffer: BufferQueue has been abandoned
                       E  [ImageReader-2576x1932f23m16-16419-1] cancelBuffer: BufferQueue has been abandoned