alanorth / android_device_huawei_u8150

Huawei IDEOS U8150 build configuration for CyanogenMod 7
9 stars 6 forks source link

Barcode Scanner doesn't work #3

Open alanorth opened 13 years ago

alanorth commented 13 years ago

The CyanogenMod camera works, but various barcode scanning apps don't work. I've tested Barcode Scanner and Neo Reader. I'm wondering if they ever worked in CM7.x...? I know I've used them on stock ROMs, but can't really remember if I've ever tried in CM.

psyke83 commented 13 years ago

The problem is not barcode scanners per se - it is all kinds of applications that interface with the camera device. In my experience, the camera preview always works with third-party apps, but taking a snapshot causes the application to crash, and the camera device will become unavailable until the next reboot. Another example is the "retro camera" app on the Market.

It seems to me that Huawei's libcamera implementation is not fully compatible with CM7. I can't compile libcamera for the Huawei kernel as the camera kernel drivers seem to be a lot different to most msm722x kernels.

P.S. I suspect that this can also be a cause of battery drain for some people (i.e., if they try to use a third-party camera app, it crashes, and then the camera could be left constantly initialized).

alanorth commented 13 years ago

Yep I see the same symptoms with various camera apps, it's a pain in the ass to test because every time it doesn't work, you have to reboot :). What I'm trying to remember is if this ever worked in CM7... I actually don't think I've tried.

Re: libcamera. Open-source libcamera, from CM or like the hero tree or what?

LalitMaganti commented 13 years ago

There is a piece of code which can be disabled in frameworks/base which sorts this. However it is a completely hacky fix and not really something which should be used in a official CM device.

psyke83 commented 13 years ago

Can you give more detail of the exact code to be modified?

LalitMaganti commented 13 years ago

https://github.com/CyanogenMod/android_frameworks_base/blob/gingerbread/core/java/android/hardware/Camera.java

Disable / Comment out:

    mAutoFocusCallback = cb;
    native_autoFocus();

and

    mAutoFocusCallback = null;
    native_cancelAutoFocus();
psyke83 commented 13 years ago

Thanks. I commented that code and recompiled, and while it does prevent the camera device from becoming unavailable, it doesn't completely solve the erratic 3rd-party camera app behaviour.

As an example, install and run "Retro Camera" from Market. Previously it would crash on taking snapshots, but now, when you try to take a snapshot it will stay stuck on "busy" status, but the snapshot never completes properly.

alanorth commented 13 years ago

I can confirm that this fixes the Barcode Scanner for me on U8150... I want to look at the code now to see why. We can publish builds with this fix but we need to understand the bug in order to patch upstream CM to behave properly. Also, I confirmed that this used to work in tilal's "Gingerman 6.5" (tagged in git on July 19th).