[URGENT] Camerax preview is black only with back camera on mentioned devices

89 views
Skip to first unread message

Astha Garg

unread,
Aug 14, 2024, 9:22:24 AMAug 14
to Android CameraX Discussion Group
Hi Team,

I have implemented camera using Camerax libraray (version 1.3.4) in my Application in which a customer is seeing preview as black but only when back camera is selected.
Preview with the front camera works well. 

Below are the devices on which the issue is happening.

vivo 1935 Android 10.0 

ASUS_X00QD Android 9.0

Let me know if you need more information from my side.

Looking forward to your quick reply.


Thanks,

Astha

Android CameraX Discussion Group

unread,
Aug 14, 2024, 9:59:45 AMAug 14
to Android CameraX Discussion Group, aashi...@gmail.com
Which application are you using? Please share any logs, steps to reproduce the issue, or code fragments to help us investigate. You can also file a detailed bug report in our issue tracker for faster assistance. Thanks!

Astha Garg

unread,
Aug 14, 2024, 11:22:34 AMAug 14
to Android CameraX Discussion Group
Thanks for your quick reply.

About Application - I have an enterprise Application in which I have our custom camera (using camerax)

Steps- 
- Open CameraFragment/Activity which has camerx preview
- By default in my app, back camera is selected using CameraSelector.DEFAULT_BACK_CAMERA
- Notice that the preview appears as black
- Toggle the camera to the front, preview is visible now
- Toggle back camera, it's black again.

Logs-
I don't see anything in my Application logs

Code-
Attaching part of code which I'm using (since can't share the entire class)

NOTE: This is only happening on vivo 1935 Android 10.0  and ASUS_X00QD Android 9.0



camera code.docx

Android CameraX Discussion Group

unread,
Aug 14, 2024, 8:39:07 PMAug 14
to Android CameraX Discussion Group, aashi...@gmail.com
Thank you for reporting the issue on our issue tracker. Our team has already responded there and we'll continue the discussion via that channel: https://issuetracker.google.com/issues/359729269.

Astha Garg

unread,
Aug 22, 2024, 2:38:44 AMAug 22
to Android CameraX Discussion Group, Android CameraX Discussion Group, Astha Garg
Hi Team,


Attaching query from the above ticket -

We have narrowed down the problem and found that on the 2 affected devices, the below code is creating the problem -

     // CODE ----   ImageCapture.Builder().setJpegQuality(100)       //---- CODE

OR

// CODE ----  
val recorder = Recorder.Builder()
            .setQualitySelector(QualitySelector.from(Quality.HIGHEST))
            .build()
return VideoCapture.withOutput(recorder)
--- CODE //

It works fine when I change the jpeg quality to 70 or 30 and video quality to HD or LOWEST based on some user settings.
Devices : DEVICE NAME: vivo 1935 Android 10.0
                           ASUS_X00QD Android 9.0

I'm waiting for your quick reply on this.

Reply all
Reply to author
Forward
0 new messages