Urgent problem with Zxing and Glass

775 views
Skip to first unread message

Raffaele Castagno

unread,
Oct 28, 2013, 1:24:26 PM10/28/13
to zx...@googlegroups.com
I had a simple app working well with Google Glass XE8, but after updating to XE10 it's no longer working.

I now get a garbled preview which is not working anymore


I've tried searching on the web for a solution but I've been unable to find one so far.

Can anybody give me a workaround, as ugly as can it be, or at least an alternative?

I'm in urgent need for a demo...

Thanks anyway!

Sean Owen

unread,
Oct 28, 2013, 2:17:54 PM10/28/13
to zx...@googlegroups.com
That almost certainly means the preview image format has changed.

In Android, the preview format must be NV1 (a type of YUV planar) by default and that's what the app expects.
I don't know about Glass, but if it follows the same rules, then that would suggest that the XE10 has a bug by sending a different format.

If not then the problem remains that it's a different image format. You would have to figure out what it is and then write new code to read that format.
It's not an app problem.

Raffaele Castagno

unread,
Oct 28, 2013, 3:43:18 PM10/28/13
to zx...@googlegroups.com

Raffaele Castagno

unread,
Oct 28, 2013, 6:25:51 PM10/28/13
to zx...@googlegroups.com
For posterity, the solution described in the link, despite being a little convoluted, solves the problem.

Let's hope future versions of Glass will support zxing better.

Thanks!

Raffaele

Sean Owen

unread,
Oct 28, 2013, 6:48:04 PM10/28/13
to zx...@googlegroups.com
Is preview size the issue? the app should read the supported preview sizes and only choose one that is said to be supported. I wonder if that's not the case. Maybe you can send in the camera params reported by ZXing Test for this thing?

If so that sounds like an easy thing to fix... in the XE10.

Raffaele Castagno

unread,
Oct 30, 2013, 7:42:51 AM10/30/13
to zx...@googlegroups.com
I can confirm that the solution reported solves the problem.
From what I understand, is just a problem with the preview size.

I tried with ZXing Test, but the "get camera param" feature fails saying

10-30 12:36:03.641    1785-1785/com.google.zxing.client.android W/EncodeActivity﹕ Could not encode barcode
    com.google.zxing.WriterException: Data too big


See the logcat below, here's the IMHO relevant piece of information

V/CameraManager﹕ Default preview size: 640, 360
V/CameraManager﹕ Default preview format: 17/yuv420sp
V/CameraManager﹕ Setting preview size: 640, 360



Here's the extended logcat:

10-30 12:36:01.703      222-255/? D/PowerManagerService﹕ setTimeoutLocked now=13865895 when=13871895 currentTimeoutOverride=-1 nextTimeoutOverride=-1 currentState=1 nextState=3
10-30 12:36:01.766     222-1062/? I/ActivityManager﹕ START {act=android.intent.action.VIEW cmp=com.google.zxing.client.androidtest/.CameraTestActivity (has extras)} from pid 5633
10-30 12:36:01.789      109-197/? D/audio_hw_primary﹕ select_output_device: output_type: 1, base_headset_volume: 1
10-30 12:36:01.922      222-256/? I/InputReader﹕ Reconfiguring input devices.  changes=0x00000004
10-30 12:36:01.922      222-256/? I/InputReader﹕ Device reconfigured: id=1, name='sensor00fn11', surface size is now 1367x188, mode is 2
10-30 12:36:01.922      222-256/? I/InputReader﹕ Device reconfigured: id=10, name='virtual_touchpad', surface size is now 1601x201, mode is 2
10-30 12:36:01.969     222-1049/? I/ActivityManager﹕ Config changed: {1.0 0mcc0mnc en_US layoutdir=0 sw240dp w426dp h214dp smll land -touch -keyb/v/h -nav/h s.11}
10-30 12:36:01.985      287-287/? D/OpenGLRenderer﹕ Flushing caches (mode 0)
10-30 12:36:01.985      287-287/? D/OpenGLRenderer﹕ Flushing caches (mode 0)
10-30 12:36:02.133     420-3922/? I/EnvelopeSender﹕ Envelope was sent.
10-30 12:36:02.282      109-906/? I/CameraService-GoogleCamera﹕ Acquire hardware jpeg encoder lock took: 0 mS
10-30 12:36:02.282      109-906/? D/libgcam﹕ [gcam.cc:2041]: Gcam::Pause
10-30 12:36:02.282      109-906/? I/CameraService﹕ Opening camera 0
10-30 12:36:02.282      109-906/? I/CameraHal﹕ (427e20)   hardware/ti/omap4xxx/camera/CameraHal_Module.cpp:613 camera_device_open - camera_device open
10-30 12:36:02.328      287-287/? V/PhoneStatusBar﹕ setLightsOn(true)
10-30 12:36:02.407      109-906/? I/CameraHal﹕ (427e20)   hardware/ti/omap4xxx/camera/CameraHal.cpp:4020 readALS - LIGHT read as 0
10-30 12:36:02.407      109-906/? I/CameraHal﹕ (427e20)   hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXAlgo.cpp:1008 setInitialValue_AE - Setting LightSensor value 0
10-30 12:36:02.407      109-906/? D/CameraService-GoogleCamera-Utils﹕ getSystemPropertyBool: (persist.lab.gcam): default=true : result=true
10-30 12:36:02.407      109-906/? I/CameraService-GoogleCamera﹕ Skipping Gcam initialization (already done)
10-30 12:36:02.407    5633-5633/com.google.zxing.client.androidtest D/Camera-JNI﹕ Saving AndroidRuntime::getJNIEnv()=0x7466a8
10-30 12:36:02.430    5633-5633/com.google.zxing.client.androidtest V/CameraManager﹕ Default preview size: 640, 360
10-30 12:36:02.430    5633-5633/com.google.zxing.client.androidtest V/CameraManager﹕ Default preview format: 17/yuv420sp
10-30 12:36:02.430    5633-5633/com.google.zxing.client.androidtest V/CameraManager﹕ Setting preview size: 640, 360
10-30 12:36:02.430      109-674/? I/CameraService-Moments﹕ Moments is not enabled.
10-30 12:36:02.430      109-674/? D/CameraService-GoogleCamera﹕ android_gcam_Camera_setParameters
10-30 12:36:02.430      109-674/? D/CameraService-GoogleCamera﹕ Gcam was enabled from the Java app  = false
10-30 12:36:02.430      109-674/? D/CameraService-GoogleCamera﹕ Gcam active for this shot = false
10-30 12:36:02.430      109-674/? D/CameraService-GoogleCamera﹕ gcam mode is set to false
10-30 12:36:02.500      109-109/? D/CameraService﹕ a = 0x45eb98
10-30 12:36:02.735      222-434/? I/ActivityManager﹕ START {act=android.intent.action.SEND typ=text/plain cmp=com.google.zxing.client.android/.encode.EncodeActivity (has extras)} from pid 5633
10-30 12:36:02.805      222-251/? I/ActivityManager﹕ Displayed com.google.zxing.client.androidtest/.CameraTestActivity: +922ms
10-30 12:36:02.836     109-5692/? I/CameraHal﹕ (4ce080)   hardware/ti/omap4xxx/camera/CameraHalCommon.cpp:113 PPM - PPM: Standby to first shot: Sensor Change completed -  :398.377 ms :  1383132962843 ms
10-30 12:36:02.930    5633-5633/com.google.zxing.client.androidtest D/Camera-JNI﹕ android_hardware_Camera_release - release camera
10-30 12:36:02.930    5633-5633/com.google.zxing.client.androidtest D/Camera-JNI﹕ android_hardware_Camera_release - native_release: context=0x8a70f8 camera=0x874218
10-30 12:36:02.930    5633-5633/com.google.zxing.client.androidtest D/Camera-JNI﹕ android_hardware_Camera_release - camera->setPreviewCallbackFlags(CAMERA_FRAME_CALLBACK_FLAG_NOOP)
10-30 12:36:02.930    5633-5633/com.google.zxing.client.androidtest D/Camera-JNI﹕ android_hardware_Camera_release - camera->disconnect()
10-30 12:36:02.938      109-675/? D/CameraService-GoogleCamera﹕ Metered = 0
10-30 12:36:02.938      109-675/? D/libgcam﹕ [gcam.cc:3232]: gcam_status:
10-30 12:36:02.938      109-675/? D/libgcam﹕ [gcam.cc:3235]:   state ready  idle? 1  merge_count 0  postmerge_count 0
10-30 12:36:02.938      109-675/? D/libgcam﹕ [gcam.cc:3238]:   mem ESTIMATE (MB): merge 0.0 postmerge 0.0 overhead 2.0 capture 75.6 net 77.6
10-30 12:36:02.938      109-675/? D/libgcam﹕ [gcam.cc:3240]:   actual *image* mem usage (MB):   current 0   peak 143138952
10-30 12:36:02.938      109-675/? I/CameraService﹕ Destroying camera 0
10-30 12:36:02.961      109-675/? D/libgcam﹕ [gcam.cc:2046]: Gcam::Unpause
10-30 12:36:02.961    5633-5633/com.google.zxing.client.androidtest D/Camera-JNI﹕ android_hardware_Camera_release - context->decStrong(thiz)
10-30 12:36:03.094    1785-1787/com.google.zxing.client.android D/dalvikvm﹕ GC_CONCURRENT freed 496K, 17% free 9431K/11271K, paused 3ms+3ms
10-30 12:36:03.133    1785-1785/com.google.zxing.client.android D/dalvikvm﹕ GC_FOR_ALLOC freed 554K, 17% free 9387K/11271K, paused 33ms
10-30 12:36:03.203    1785-1785/com.google.zxing.client.android D/dalvikvm﹕ GC_FOR_ALLOC freed 511K, 17% free 9388K/11271K, paused 59ms
10-30 12:36:03.266     420-3922/? I/EnvelopeSender﹕ Envelope was sent.
10-30 12:36:03.313    1785-1787/com.google.zxing.client.android D/dalvikvm﹕ GC_CONCURRENT freed 504K, 17% free 9395K/11271K, paused 3ms+3ms
10-30 12:36:03.321     420-3922/? I/EnvelopeSender﹕ Envelope was sent.
10-30 12:36:03.383     420-3922/? I/EnvelopeSender﹕ Envelope was sent.
10-30 12:36:03.407    1785-1785/com.google.zxing.client.android D/dalvikvm﹕ GC_FOR_ALLOC freed 516K, 17% free 9389K/11271K, paused 85ms
10-30 12:36:03.461     420-3922/? I/EnvelopeSender﹕ Envelope was sent.
10-30 12:36:03.555    1785-1787/com.google.zxing.client.android D/dalvikvm﹕ GC_CONCURRENT freed 501K, 17% free 9399K/11271K, paused 7ms+7ms
10-30 12:36:03.625    1785-1785/com.google.zxing.client.android D/dalvikvm﹕ GC_FOR_ALLOC freed 519K, 17% free 9390K/11271K, paused 65ms
10-30 12:36:03.641    1785-1785/com.google.zxing.client.android W/EncodeActivity﹕ Could not encode barcode
    com.google.zxing.WriterException: Data too big
            at com.google.zxing.qrcode.encoder.Encoder.chooseVersion(Encoder.java:268)
            at com.google.zxing.qrcode.encoder.Encoder.encode(Encoder.java:120)
            at com.google.zxing.qrcode.QRCodeWriter.encode(QRCodeWriter.java:80)
            at com.google.zxing.MultiFormatWriter.encode(MultiFormatWriter.java:94)
            at com.google.zxing.client.android.encode.QRCodeEncoder.encodeAsBitmap(QRCodeEncoder.java:331)
            at com.google.zxing.client.android.encode.EncodeActivity.onResume(EncodeActivity.java:202)
            at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1154)
            at android.app.Activity.performResume(Activity.java:4544)
            at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2434)
            at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2472)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1986)
            at android.app.ActivityThread.access$600(ActivityThread.java:123)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4424)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
10-30 12:36:03.703    1785-1787/com.google.zxing.client.android D/dalvikvm﹕ GC_CONCURRENT freed 368K, 17% free 9416K/11271K, paused 2ms+7ms
10-30 12:36:03.735      287-287/? V/PhoneStatusBar﹕ setLightsOn(true)
10-30 12:36:04.047      222-251/? I/ActivityManager﹕ Displayed com.google.zxing.client.android/.encode.EncodeActivity: +1s86ms
10-30 12:36:04.196     420-3922/? I/EnvelopeSender﹕ Envelope was sent.
10-30 12:36:04.305     420-3922/? I/EnvelopeSender﹕ Envelope was sent.
10-30 12:36:04.992      222-251/? D/dalvikvm﹕ GC_EXPLICIT freed 508K, 38% free 12649K/20231K, paused 5ms+9ms
10-30 12:36:05.063     420-5650/? D/dalvikvm﹕ GC_FOR_ALLOC freed 1133K, 12% free 13265K/15047K, paused 32ms
10-30 12:36:05.305     420-3922/? I/EnvelopeSender﹕ Envelope was sent.
10-30 12:36:05.414     420-3922/? I/EnvelopeSender﹕ Envelope was sent.



Raffaele
Reply all
Reply to author
Forward
0 new messages