AbhinavDS / 0xdroid

Automatically exported from code.google.com/p/0xdroid
0 stars 1 forks source link

ZXing (a barcode scanner application) can't work #24

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

1. Enable USB Camera support by following Jim's mail,
http://groups.google.com/group/0xlab-devel/browse_thread/thread/e9316dc1b60b5700
2. Build and install ZXing from
http://zxing.googlecode.com/files/ZXing-1.3.zip 
3. Launch ZXing and sooner enough the application would stop due to an
ArrayIndexOutOfBoundsException.

The logcat log is as below:
E/CameraService(  709): Failed to load CameraService sounds.
D/CameraService(  709): Client X constructor
D/CameraService(  709): Connect X
D/CameraService(  709): setPreviewDisplay(0x47ff0)
D/CameraService(  709): getParameters
E/Camera  ( 1836): _getParameters:
picture-format=jpeg;picture-size=640x480;preview-format=yuv422sp;preview-frame-r
ate=15;preview-size=640x480
E/Camera  ( 1836): setParameters()
D/CameraService(  709):
setParameters(picture-size=640x480;preview-frame-rate=15;preview-size=1024x768;p
icture-format=jpeg;preview-format=yuv422sp)
D/CameraHardware(  709): PREVIEW SIZE: w=1024 h=768 framerate=15
V/CameraManager( 1836): Setting params for preview: width 1024 height 768
D/CameraService(  709): startCameraMode(0)
V/CameraManager( 1836): Calculated framing rect: Rect(224, 96 - 800, 672)
I/ActivityManager( 1043): Displayed activity
com.google.zxing.client.android/.CaptureActivity: 642 ms
D/dalvikvm( 1836): GC freed 1490 objects / 115128 bytes in 130ms
I/dalvikvm-heap( 1836): Grow heap (frag case) to 3.773MB for 614416-byte
allocation
D/dalvikvm( 1836): GC freed 35 objects / 9504 bytes in 153ms
W/dalvikvm( 1836): threadid=23: thread exiting with uncaught exception
(group=0x40010390)
E/AndroidRuntime( 1836): Uncaught handler: thread Thread-12 exiting due to
uncaught exception
E/AndroidRuntime( 1836): java.lang.ArrayIndexOutOfBoundsException
E/AndroidRuntime( 1836):    at
com.google.zxing.client.android.YUVMonochromeBitmapSource.getLuminance(Unknown
Source)
E/AndroidRuntime( 1836):    at
com.google.zxing.common.BaseMonochromeBitmapSource.estimateBlackPoint(Unknown
Source)
E/AndroidRuntime( 1836):    at
com.google.zxing.qrcode.detector.Detector.detect$2365e3e5(Unknown Source)
E/AndroidRuntime( 1836):    at
com.google.zxing.qrcode.QRCodeReader.decode(Unknown Source)
E/AndroidRuntime( 1836):    at
com.google.zxing.MultiFormatReader.decodeInternal(Unknown Source)
E/AndroidRuntime( 1836):    at
com.google.zxing.MultiFormatReader.decodeWithState(Unknown Source)
E/AndroidRuntime( 1836):    at
com.google.zxing.client.android.DecodeThread.access$000(Unknown Source)
E/AndroidRuntime( 1836):    at
com.google.zxing.client.android.DecodeThread$1.handleMessage(Unknown Source)
E/AndroidRuntime( 1836):    at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1836):    at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 1836):    at
com.google.zxing.client.android.DecodeThread.run(Unknown Source)
I/Process ( 1043): Sending signal. PID: 1836 SIG: 3
I/dalvikvm( 1836): threadid=7: reacting to signal 3
I/dalvikvm( 1836): Wrote stack trace to '/data/anr/traces.txt'

Original issue reported on code.google.com by ShunYu.C...@gmail.com on 14 Sep 2009 at 9:33

GoogleCodeExporter commented 8 years ago
Reference material: Android Issue 823 :
    http://code.google.com/p/android/issues/detail?id=823

Original comment by jserv.tw@gmail.com on 23 Sep 2009 at 5:33

GoogleCodeExporter commented 8 years ago
Thanks jserv's hint, The java application can only takes the frame as the same 
format
as the Camera HAL layer posts.
As Android Issue 823 points, this is still an unreolved issue in cupcake.

Right now on our device, Camere service posts frames in RGB format for showing 
on the
framebuffer, that's why zxing can't decode in any way. If changing to post 
frames in
yuv420 format, the barcode decoding can function but the preview showing on the
screen is yuv420 format data. 

So it looks like we can say this issue depends on hardware or depends on Android
Issue 823.

Original comment by ShunYu.C...@gmail.com on 24 Sep 2009 at 6:23

GoogleCodeExporter commented 8 years ago
0xdroid has a modified copy of ZXing:
    http://gitorious.org/0xdroid/packages_apps_barcodescanner

It is expected to resolve the issue.  Confirmed?

Original comment by jserv.tw@gmail.com on 7 Oct 2009 at 12:11

GoogleCodeExporter commented 8 years ago
Yes, more than that ZXing should work by the commit
http://gitorious.org/0xdroid/hardware_omap3_camera/commit/bb4a2a3abbe2bbc1886e8b
74a32c7af41f585c12

Change to Fixed.

Original comment by ShunYu.C...@gmail.com on 7 Oct 2009 at 3:36