RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.82k stars 407 forks source link

Can't make a photo on an Acer Iconia A1-830 #332

Open wolf81 opened 5 years ago

wolf81 commented 5 years ago

What are you trying to achieve or the steps to reproduce?

I'm trying to take a picture on an Acer Iconia A1-830 device. I don't own the device myself, but I make use of Microsoft AppCenter, which allows me to run UITests on many different devices. I believe people can use a limited amount of hours for free every month, so one should be able to reproduce in AppCenter if one doesn't own this device.

By the way on most devices I test with -using the same configuration- Fotoapparat works fine, so great work in that regard!

How did you initialize FA?

this.camera = Fotoapparat
        .with(this)
        .into(cameraView)
        .lensPosition(LensPositionSelectorsKt.back())
        .photoResolution(ResolutionSelectorsKt.lowestResolution())
        .previewResolution(ResolutionSelectorsKt.lowestResolution())
        .previewScaleType(ScaleType.CenterCrop)
        .flash(off())
        .focusMode(SelectorsKt.firstAvailable(
                FocusModeSelectorsKt.continuousFocusPicture(),
                FocusModeSelectorsKt.autoFocus(),
                FocusModeSelectorsKt.fixed(),
                FocusModeSelectorsKt.infinity()
        ))
        .logger(LoggersKt.logcat())
        .cameraErrorCallback((exception) -> {
            Log.e(TamperSecure.TAG, exception.toString());
        })
        .build();

What was the result you received?

The following is shown in the logs when trying to take a photo:

D/Fotoapparat( 5129): CameraDevice: open
D/Camera_HAL(  140): ATOM_GetCameraInfo
D/Camera_HAL(  140): ATOM_GetCameraInfo
I/AwesomePlayer(  140): setDataSource_l(URL suppressed)
W/MediaPlayer(  140): info/warning (1, 1130153408)
I/AwesomePlayer(  140): initAudioDecoder: creating OMX decoder
I/cip_VorbisDec(  140): UMC Decoder plugin created, Media Codecs version: 1.0.2098
I/AwesomePlayer(  140): setDataSource_l(URL suppressed)
W/MediaPlayer(  140): info/warning (1, 1130252528)
I/AwesomePlayer(  140): initAudioDecoder: creating OMX decoder
I/cip_VorbisDec(  140): UMC Decoder plugin created, Media Codecs version: 1.0.2098
I/AudioPolicyManagerBase(  140): APM: getOutput
I/AudioPolicyManagerBase(  140): APM: getOutput
I/AudioPolicyManagerBase(  140): APM: getOutput
I/CameraClient(  140): Opening camera 0
D/Camera_HAL(  140): ATOM_OpenCameraHardware
E/Camera_Conf(  140): ERROR no sensor driver registered in media controller!
D/Camera_ISP(  140): Kernel with separate preview device node detected
W/Camera_ISP(  140): Open device 0 with fd 35
D/hwcomposer(  392): isRGBOverlayLayer: got an RGB overlay layer
D/hwcomposer(  392): isRGBOverlayLayer: got an RGB overlay layer
I/ActivityManager(  392): Displayed com.peir.tampersecure_example/com.peir.tampersecure.CameraActivity: +205ms
D/hwcomposer(  392): isRGBOverlayLayer: got an RGB overlay layer
I/WAKELOCK_RELEASE(  392): TIMESTAMP=1401376269648, TAG=ActivityManager-Launch, TYPE=PARTIAL_WAKE_LOCK             , COUNT=0, PID=392, UID=1000, FLAGS=
D/hwcomposer(  392): isRGBOverlayLayer: got an RGB overlay layer
D/LifecycleMonitor( 5129): Lifecycle status change: com.peir.tampersecure_example.EventsActivity@210002d8 in: STOPPED
D/LifecycleMonitor( 5129): running callback: androidx.test.rule.ActivityTestRule$LifecycleCallback@20fe8878
D/LifecycleMonitor( 5129): callback completes: androidx.test.rule.ActivityTestRule$LifecycleCallback@20fe8878
D/hwcomposer(  392): isRGBOverlayLayer: got an RGB overlay layer
I/libva   (  140): VA-API version 0.34.0
I/libva   (  140): va_getDriverName() returns 0
I/libva   (  140): Trying to open /system/lib/pvr_drv_video.so
I/libva   (  140): Found init function __vaDriverInit_0_32
D/pvr_drv_video(  140): hw_get_module returned
I/libva   (  140): va_openDriver() returns 0
I/ia_face (  140): [ia_face_init:111] engine build info [ name ] : ia_face
I/ia_face (  140): [ia_face_init:114] engine build info [ date ] : 2013-07-16 16:26:36
I/ia_face (  140): [ia_face_init:117] engine build info [ version ] : __bulid_revision_1166__  build_number(0)
D/Camera_ControlThread(  140): test ****m3AControls = 0 ,supportsSocAf = 1
E/Camera_ISP(  140): Failed to set value 3 for control light frequency (9963800) on device '35', Invalid argument
E/Camera_ISP(  140): setting light frequency failed
D/Camera_HAL(  140): atom_set_callbacks
D/Camera_HAL(  140): atom_enable_msg_type msg_type=0x00000c0d
D/Camera_HAL(  140): atom_get_parameters
D/Camera_HAL(  140): atom_put_parameters
D/Fotoapparat( 5129): CameraDevice: getCapabilities$suspendImpl
D/Fotoapparat( 5129): CameraDevice: updateParameters$suspendImpl
D/Fotoapparat( 5129): New camera parameters are: CameraParameters
D/Fotoapparat( 5129): flashMode:        io.fotoapparat.parameter.Flash$Off@20ef2b40
D/Fotoapparat( 5129): focusMode:        io.fotoapparat.parameter.FocusMode$Auto@20f792b8
D/Fotoapparat( 5129): jpegQuality:      90
D/Fotoapparat( 5129): exposureCompensation:     0
D/Fotoapparat( 5129): previewFpsRange:      FpsRange(min=2500, max=30304)
D/Fotoapparat( 5129): antiBandingMode:      io.fotoapparat.parameter.AntiBandingMode$Auto@20ea5b38
D/Fotoapparat( 5129): sensorSensitivity:        null
D/Fotoapparat( 5129): pictureResolution:        Resolution(width=640, height=480)
D/Fotoapparat( 5129): previewResolution:        Resolution(width=320, height=240)
D/Camera_HAL(  140): atom_get_parameters
D/Camera_HAL(  140): atom_put_parameters
D/Camera_HAL(  140): atom_set_parameters
D/Camera_ControlThread(  140): test ****m3AControls = 0 ,supportsSocAf = 1
E/Camera_ISP(  140): Failed to get value for control (10225921) on device '35', Invalid argument
E/Camera_ISP(  140): Error getting Flash mode from the driver
E/Camera_ISP(  140): Failed to set value 0 for control Flash mode (10225921) on device '35', Invalid argument
E/Camera_ISP(  140): Error setting Flash mode (0) in the driver
E/Camera_ControlThread(  140): Error handling message: 18
D/Fotoapparat( 5129): CameraDevice: getCapabilities$suspendImpl
I/TamperSecure( 5129): Capabilities
I/TamperSecure( 5129): zoom:        VariableZoom(maxZoom=150, zoomRatios=[100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, 294, 296, 298, 300, 302, 304, 306, 308, 310, 312, 314, 316, 318, 320, 322, 324, 326, 328, 330, 332, 334, 336, 338, 340, 342, 344, 346, 348, 350, 352, 354, 356, 358, 360, 362, 364, 366, 368, 370, 372, 374, 376, 378, 380, 382, 384, 386, 388, 390, 392, 394, 396, 398, 400])
I/TamperSecure( 5129): flashModes:[
I/TamperSecure( 5129):      io.fotoapparat.parameter.Flash$Off@20ef2b40]
I/TamperSecure( 5129): focusModes:[
I/TamperSecure( 5129):      io.fotoapparat.parameter.FocusMode$Auto@20f792b8]
I/TamperSecure( 5129): canSmoothZoom:       false
I/TamperSecure( 5129): maxFocusAreas:       2
I/TamperSecure( 5129): maxMeteringAreas:        0
I/TamperSecure( 5129): jpegQualityRange:        0..100
I/TamperSecure( 5129): exposureCompensationRange:       -3..3
I/TamperSecure( 5129): antiBandingModes:[
I/TamperSecure( 5129):      io.fotoapparat.parameter.AntiBandingMode$None@20f82c20,
I/TamperSecure( 5129):      io.fotoapparat.parameter.AntiBandingMode$HZ50@20ed2680,
I/TamperSecure( 5129):      io.fotoapparat.parameter.AntiBandingMode$HZ60@20f2f5f0,
I/TamperSecure( 5129):      io.fotoapparat.parameter.AntiBandingMode$Auto@20ea5b38]
I/TamperSecure( 5129): previewFpsRanges:[
I/TamperSecure( 5129):      FpsRange(min=1500, max=30304),
I/TamperSecure( 5129):      FpsRange(min=2000, max=30304),
I/TamperSecure( 5129):      FpsRange(min=2500, max=30304)]
I/TamperSecure( 5129): pictureResolutions:[
I/TamperSecure( 5129):      Resolution(width=640, height=480),
I/TamperSecure( 5129):      Resolution(width=1280, height=720),
I/TamperSecure( 5129):      Resolution(width=1920, height=1080),
I/TamperSecure( 5129):      Resolution(width=2048, height=1536),
I/TamperSecure( 5129):      Resolution(width=2560, height=1920)]
I/TamperSecure( 5129): previewResolutions:[
I/TamperSecure( 5129):      Resolution(width=1024, height=576),
I/TamperSecure( 5129):      Resolution(width=720, height=480),
I/TamperSecure( 5129):      Resolution(width=640, height=480),
I/TamperSecure( 5129):      Resolution(width=640, height=360),
I/TamperSecure( 5129):      Resolution(width=352, height=288),
I/TamperSecure( 5129):      Resolution(width=320, height=240),
I/TamperSecure( 5129):      Resolution(width=176, height=144)]
I/TamperSecure( 5129): sensorSensitivities:[]
I/TamperSecureTests( 5129): ... sleep for 4000 milliseconds ...
I/ActivityManager(  392): No longer want com.google.android.deskclock (pid 4424): empty #17
I/TamperSecureTests( 5129): check if button container is hidden
I/ViewInteraction( 5129): Checking 'MatchesViewAssertion{viewMatcher=view has effective visibility=INVISIBLE}' assertion on view with id: com.peir.tampersecure_example:id/button_container
I/TamperSecureTests( 5129): take photo
I/ViewInteraction( 5129): Checking 'MatchesViewAssertion{viewMatcher=is displayed on the screen to the user}' assertion on view with id: com.peir.tampersecure_example:id/camera_view
I/ViewInteraction( 5129): Performing 'single click' action on view with id: com.peir.tampersecure_example:id/camera_view
D/Fotoapparat( 5129): Fotoapparat: takePicture
D/Fotoapparat( 5129): CameraDevice: takePhoto
D/Camera_HAL(  140): atom_enable_msg_type msg_type=0x00000100
D/Camera_HAL(  140): atom_take_picture
E/Camera_ISP(  140): Failed to get value for control (10225921) on device '35', Invalid argument
E/Camera_ISP(  140): Error getting Flash mode from the driver
W/Camera_ControlThread(  140): Unexpected state (0) to select the shooting mode
E/Camera_ControlThread(  140): Taking picture when recording is not supported!
E/Camera_ControlThread(  140): Error handling message: 7
I/dalvikvm(  392): JIT_INFO: Code cache full after Scheduler::generateAssembly (trace uses 19B)
I/dalvikvm(  392): JIT_INFO: Code cache full while lowering bytecode check-cast
I/dalvikvm(  392): Could not compile trace for Lcom/android/server/pm/Settings;writePackageRestrictionsLPr, offset 267
I/dalvikvm(  392): ++++++++++++++++++++++++++++++++++++++++++++
I/dalvikvm(  392): JIT_INFO: Issues in trace  Lcom/android/server/pm/Settings;writePackageRestrictionsLPr, offset 267
E/dalvikvm(  392): The following issues were seen:
I/dalvikvm(  392):  Issue: Jit code cache is full while trace compilation
I/dalvikvm(  392): JIT_WARNING: Current trace has been rejected
I/dalvikvm(  392): ++++++++++++++++++++++++++++++++++++++++++++

I believe the issue has something to do with Flash, but I believe I configured Flash correctly (it's set to off and that seems to be the only possible config). This part of the log could (in my opinion) point to the issue:

...
D/Fotoapparat( 5129): Fotoapparat: takePicture
D/Fotoapparat( 5129): CameraDevice: takePhoto
D/Camera_HAL(  140): atom_enable_msg_type msg_type=0x00000100
D/Camera_HAL(  140): atom_take_picture
E/Camera_ISP(  140): Failed to get value for control (10225921) on device '35', Invalid argument
E/Camera_ISP(  140): Error getting Flash mode from the driver
W/Camera_ControlThread(  140): Unexpected state (0) to select the shooting mode
E/Camera_ControlThread(  140): Taking picture when recording is not supported!
E/Camera_ControlThread(  140): Error handling message: 7
...

What did you expect?

To be able to make a successful photo :)

Context:

dmitry-zaitsev commented 5 years ago

Sorry for the late reply.

It does indeed look like you are setting the flash correctly. However, just for the sake of experiment, could you try setting flash to some other values and see if that helps? If it does, it would give me an idea on where to start looking for the issue.

wolf81 commented 5 years ago

@dmitry-zaitsev I've been looking a bit deeper into this issue today and I believe another tablet (Kobo Arc 7HD) likely has the same issue.

I believe flash mode may not be set to off for both devices, instead the flash mode shouldn't exist at all or perhaps the value for flash should be set to nothing() / null. Both devices likely not have flash hardware anyway, since they're both tablets. I wanted to verify my assumptions, but I don't know how I would be able to set the value of flash to null (or nothing()), seems to be not allowed in fotoapparat.