Archos 80 G9 - Android camera encountered a problem

886 views
Skip to first unread message

JonBoy

unread,
Jan 2, 2012, 5:12:52 AM1/2/12
to zxing
Hi,
I've installed Barcode Scanner however when I attempt to use it on my
Archos 80 G9 Android Tablet I get the message

"Sorry, the Android camera encountered a problem. You may need to
restart the device."

I have rebooted the machine but consistently get the same error.

Has anyone else come across this problem or know of a resolution.

Many thanks
regards Jon

Sean Owen

unread,
Jan 2, 2012, 11:31:14 AM1/2/12
to zx...@googlegroups.com
This means the driver failed for some reason: it was unable to fulfill the request to open the camera. You can check the output of 'adb logcat' to search for error messages that may be useful in identifying the issue. But, this is a problem to report to Archos, most likely.

IByte

unread,
Feb 17, 2012, 6:49:45 PM2/17/12
to zxing
I also encountered this problem on my Archos 80 G9, and did report it
to Archos. Their (not so) helpful reply was that they don't support
third party apps and they point right back here at the zxing devs. At
least I was able to grab the exception from adb logcat. Here it is
(using Barcode Scanner 4.1 beta 1 for Android):

W/CaptureActivity(10461): java.io.IOException
W/CaptureActivity(10461): at
com.google.zxing.client.android.camera.CameraManager.openDriver(CameraManager.java:
85)
W/CaptureActivity(10461): at
com.google.zxing.client.android.CaptureActivity.initCamera(CaptureActivity.java:
720)
W/CaptureActivity(10461): at
com.google.zxing.client.android.CaptureActivity.surfaceCreated(CaptureActivity.java:
419)
W/CaptureActivity(10461): at
android.view.SurfaceView.updateWindow(SurfaceView.java:563)
W/CaptureActivity(10461): at android.view.SurfaceView.access
$000(SurfaceView.java:83)
W/CaptureActivity(10461): at android.view.SurfaceView
$3.onPreDraw(SurfaceView.java:172)
W/CaptureActivity(10461): at
android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:
590)
W/CaptureActivity(10461): at
android.view.ViewRoot.performTraversals(ViewRoot.java:1408)
W/CaptureActivity(10461): at
android.view.ViewRoot.handleMessage(ViewRoot.java:2042)
W/CaptureActivity(10461): at
android.os.Handler.dispatchMessage(Handler.java:99)
W/CaptureActivity(10461): at android.os.Looper.loop(Looper.java:
132)
W/CaptureActivity(10461): at
android.app.ActivityThread.main(ActivityThread.java:4123)
W/CaptureActivity(10461): at
java.lang.reflect.Method.invokeNative(NativeMethod)
W/CaptureActivity(10461): at
java.lang.reflect.Method.invoke(Method.java:491)
W/CaptureActivity(10461): at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:841)
W/CaptureActivity(10461): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
W/CaptureActivity(10461): at
dalvik.system.NativeStart.main(Native Method)

So the IOException is thrown in line 85 of CameraManager.java. Here's
that bit (the line starting with 'throw' is 85):

/**
* Opens the camera driver and initializes the hardware parameters.
*
* @param holder The surface object which the camera will draw
preview frames into.
* @throws IOException Indicates the camera driver failed to open.
*/
public void openDriver(SurfaceHolder holder) throws IOException {
Camera theCamera = camera;
if (theCamera == null) {
theCamera = Camera.open();
if (theCamera == null) {
throw new IOException();
}
camera = theCamera;
}
theCamera.setPreviewDisplay(holder);

So, Camera.open() returns null, very odd... I should point out that
the pre-installed camera app and Skype are able to use the camera just
fine. Does anyone have any ideas?

Sean Owen

unread,
Feb 18, 2012, 5:47:55 AM2/18/12
to zx...@googlegroups.com
I'm sure the front-line support just sees mention of a third-party app and hits an auto-reply. I would report just the pure bug in their implementation, since it's quite plain. Here's my FAQ entry explaining the bug:

The app is landscape-orientation only, and specifies this in AndroidManifest.xml with <uses-feature> tag forandroid.hardware.screen.landscape. All Android 3.0 devices and earlier must allow apps requiring either orientation, and any device supporting landscape orientation should allow such an app. However, some Archos tablets reject such apps, even though they run Android 2.x and do support landscape apps. They show themselves as compatible in Market, which is correct. It is an Archos bug affecting any landscape-only app and there is no workaround available.

However... the stack trace you show is something else. The Archos issue above happens at startup. Camera.open() can only return null if there is no rear-facing camera. (Is that true?) And indeed, the app declares in its Manifest that it requires a camera (which means it requires a rear-facing one). If the device has no rear-facing camera, but advertised itself as compatible with apps that need a rear camera, it's another bug. (I have a sense they didn't implement market filtering correctly here... because that's the issue above.)

If it's running Android 2.3+, then yes there is definitely an API for accessing the front-facing camera with Camera.open(int). This isn't available in 2.1, which is what the app supports.

The 'good news' is that you're not missing anything if you have only a front camera. The app doesn't support it. Barcode Scanner+ does at the moment.

IByte

unread,
Feb 19, 2012, 10:03:33 AM2/19/12
to zxing
Thank you for your reply, Sean, it certainly clears up a few things.
Here are the things I figured out.

Firstly, the orientation bug applies only to older Archos devices
(generation 8/G8, such as the Archos 70 and 43 Internet Tablets). The
G9 line runs Android 3.2.1 with full support for landscape and
portrait apps. (An OTA update to Android 4.0 is rumoured to be
imminent.)

You are correct in assuming that the G9 line does not feature a rear-
facing camera. This appears to be the reason for it not to work. Oddly
enough, the app is reported to work on the front-facing camera of the
Archos 70 (G8), after addition of the fix that flips the image the
right way.
(see http://forum.archosfans.com/viewtopic.php?f=73&t=40080 )

Although I share your concern about the implementation of the
mandatory compatibility check in Android Market, I must admit that it
was not the issue in this case. I side-loaded the app in order to
figure out exactly why it wouldn’t work. I just happen to be one of
those pesky geeks who won’t take no for an answer ;).

Oh well, I suppose I could tinker with the code in case I get bored.
Thanks for the info.

Sean Owen

unread,
Feb 19, 2012, 10:59:46 AM2/19/12
to zx...@googlegroups.com
OK that all makes sense. Yes I understand, you side-loaded it and that's why Camera.open() won't return anything. At least that's not a device issue, yes.

Now, I can tell you that the image from the front-facing camera is not supposed to be flipped when it is presented an application. That is, the app should see what the camera sees, from its perspective looking at you. Now it will flip the frames horizontally when it gets sent to a SurfaceView, so that when the image is shown on screen it acts like a mirror (which is flipped) which is more intuitive.

(Off-topic but related question that I have always found entertaining: why do mirrors seem to flip right/left but not top/bottom? harder than it sounds to explain)

That is to say, there should be no need for a 'flip image' setting. We added one a long time ago for devices like this, but, I have reports that someone somewhere has pre-installed the app (?) with the setting on, which makes scanning fail for all those devices. So I'm taking out the setting for a next version.

if you're willing, you might try the Barcode Scanner+ app since I'd like to know if that version, which should fully implement support for front cameras correctly, does or doesn't work on these guys. Up to you.

IByte

unread,
Feb 19, 2012, 12:31:30 PM2/19/12
to zxing
Yes, I noticed there's something funny going on with the image
orientation. The stock camera app (and most of its kind, I suppose)
shows a mirror-like preview (I guess that's a SurfaceView), but has
camera-like orientation when you take a picture, i.e. if you take a
picture of a document, the photo is legible. What you see is not what
you get.

(On the topic of your mirror question, my first thought was that it
has something to do with the fact that your eyes are on a horizontal
line. I tilted my head and immediately ran into definition problems
with up/down, left/right etc. Like you said, harder than it sounds.)

The reason that I haven't installed Barcode Scanner+ yet isn't the
price, it's the payment method. I'm not so fond of on-line credit card
payments for security reasons, but Google Wallet does not currently
accept anything else.
Reply all
Reply to author
Forward
0 new messages