I have developed an application, that captures image by its front camera, using a surface view. It is working fine on other phones except Sony phones.
The log cat for Sony phone says
Permission failure:com.sonyericsson.permission.CAMERA_EXTENDED
I have included this permission also, but its not working.
Thanks in advance.
This permission failure is only a warning; it may prevent using higher resolutions, though. Try 320x240 to begin with, and post more information if this attempt fails.
For those who are working with the new camera HAL introduced in API 21:
I had the same issue for my Sony Xperia Z4 Tablet. The Problem for me was, that i was configuring the flash (to light the scene) with
CaptureRequest.Builder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH);
This device has no builtin flash, so after removing this it worked fine.
I got the same logcat output as you had.
Related
Following the Camera 2 sample I've created simple camera class to capture the images. When it's okay with capturing both flash/non-flash images on any device with Android < 7.0, on mine Nexus 5X with Android 7.1 the same config fire the flash only once on the preview. Pre-sequences are the next:
for the preview I'm using CameraDevice.TEMPLATE_PREVIEW with AE mode set to CameraMetadata.CONTROL_AE_MODE_ON_ALWAYS_FLASH
the same I use for the capture still picture, but with CameraDevice.TEMPLATE_STILL_CAPTURE
If someone can help me with this case - I'll be really appreciated.
This is just additional information on the above issue. I wish to draw some attention to this problem!
My application takes a photo every 5 seconds. I (1) select the camera, (2) acquirer a session and then with each loop I (3) create a Capture request in which I set the Flash Mode and call the capture method on the session.
I have no issues with my Samsung SM-G550T (Android version 6.01), but I was having some issues with the Flash Mode on my Moto G4 (Android version 7.0). I got both phones to Flash, but only with this setting:
CaptureRequest.Builder requestBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE);
requestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_SINGLE);
I am presently having an issue with a LG device (M210N) (Android version 7.0). Using the settings I stated above I get the device to flash just once. If I completely re-initialize the camera (as described above) the device will flash again only once.
If I add the CONTROL_AE_MODE_ON_ALWAYS_FLASH setting to the above requestBuilder, then the LG does not flash at all. So I had to remove that flag.
I have tried many different additional settings and combination for settings and none of them have eliminated this issue. I wonder how many devices are affected by this issue.
Pictured above on the left is how it should look (captured using a Galaxy S6), but on the right (captured using a Galaxy S7) is what I'm getting if I use the Camera2 API on an S7. I'm doing computer vision stuff using OpenCV so this glossy effect is breaking it.
It seems the Camera2 API (the stock Samsung camera app is fine) is producing some sort of undesired glossy effect when used on the Galaxy S7. I've tried the plain Android Camera2 API and the Samsung Galaxy Camera SDK 1.1 (found on http://developer.samsung.com/galaxy#camera).
This doesn't happen if I'm using the deprecated Camera1 API, so it seems the issue is with the S7's HALv3. This also never happens on the Galaxy S6 and other devices (both Samsung and non-Samsung).
If you try any 3rd-party camera app on the Play Store that uses Camera2, you should be able to replicate this effect. Not sure if SO is the best place to post this, but Samsung doesn't seem to be active in their own developer forums.
This is controlled by various CaptureRequest settings. S7 has perhaps different default settings for Camera2 API, that's why it is different from the S6, but you should be able to get similar results just by experimenting with various settings.
You should get rid of the "glow" by disabling EDGE_MODE like this: requestBuilder.set(CaptureRequest.EDGE_MODE, CaptureRequest.EDGE_MODE_OFF);
See for more settings and description: https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.html#EDGE_MODE
Greetings StackOverflowers!
I've searched at great length, but finally have to admit I'm out of ideas.
Please find a minimalist Eclipse project at https://github.com/ppinter1/AndroidCamera.git which demonstrates the problem I'm having on a Samsung Galaxy Tab 10.1 and Android 4.1.1
In essence: the dreaded Camera Error 100 (with attendant death of ICamera/media server/Camera server) occurs whenever I call .takePicture after stopping a video recording.
What's tested and working in the code provided:
any number of photos can be captured
any number of videos can be recorded as well
even taking a photo while recording works fine (a nice side effect)
BUT, taking a photo after stopping a recording (that is, either by hitting the 'Stop Recording' button, or because the recording is automatically stopped when the maximum file size of 5MB is reached) causes the generic Camera Error 100.
I would be most appreciative if others would test this code on their Android device.
Is it a bug just with this tablet? If it fails on other devices as well, can anyone tell me
what I'm doing wrong or how to diagnose this further?
If the code works for you, please reply with your device model and Android version.
With many thanks,
Pete
UPDATE:
Couple things:
A Samsung Developer support tech reports no error running my github test code on an S3 device, but sees an Exception with Galaxy Tab and Nexus. He believes the test code uses the Camera API incorrectly, yet I don't think I can make the code any simpler... if anyone spots an API usage error, please correct me!
I've opened an issue at Google's Android tracker with additional log file detail.
As detailed on the tracker link above, it turns out one needs to Add an extra .stopPreview() after .reconnect() and before .startPreview.
Massive thanks go to developer etalv on the Android Open Handset Alliance Project for the tip.
I m new to android
i have installed BarcodeScanner3.72.apk on MY AVD for testing if it works or not
My AVD Camera is working properly i can get image with it.
But whenever i start Barcode Scanner app it shows black and white background
I am not getting whats the problem.
One more thing i have also install same app on My Samsung Galaxy but it can't read barcode.
is there anything that i should keep in mind to use barcode app on samsung Galaxy!!
Sorry for my english !!!!!
Thanks
There is no camera preview available in the AVD, so the black and white pattern you see is normal, and just the AVD's fake video stream.
Tom Gibara has posted the famous and canonical way to slip a live video feed into code that's running on the AVD. YOu would need to modify the Barcode Scanner source for this to work.
Barcode Scanner works well on the Samsung Galaxy, I'm not sure what issue you're having.
I'm developing android camera application. Tested on some devices and it work's, but on samsung galaxy i9003 setparameters didn't work.
Here how I do it:
cameraParams.setColorEffect([some supported effect]);
camera.setPrameters(cameraParams);
[some supported effect] I get with cameraParams.getSupportedColorEffects().
My code is not as simple as I wrote , but in the end it do this.
It works on many devices including samsung galaxy s i9000 ( though I must do some trick on i9000, there is known bug in params when you get params with params.flatten() there is spaces in parameters).
Please some help, it's first time I'm writing here.
Different devices will have different camera capabilities so you should check that the parameter that you wish to set is indeed supported by the device e.g. call getSupportedColorEffects() - this gives you a list of supported effects or null so you can check this before you try to set them.