mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.35k stars 1.07k forks source link

Black Screen on POCO X4🐛 #2716

Closed PedroGabrielCB closed 5 months ago

PedroGabrielCB commented 5 months ago

What's happening?

The Camera is working fine on most devices. However, there are a few on which it just won't work. The camera will simply try to load and stay black.

i tried add -> const device = useCameraDevices() but does work....

Reproduceable Code

<SafeAreaView style={StyleSheet.absoluteFill}>
                                <Camera
                                    style={{ flex: 1 }}
                                    torch='off'
                                    device={device}
                                    isActive={true}
                                    zoom={0}
                                    photo={true}
                                    exposure={0}
                                    ref={camera}
                                    orientation='portrait'
                                />

                            </SafeAreaView>

Relevant log output

none

Camera Device

{
  "formats": [],
  "sensorOrientation": "landscape-right",
  "hardwareLevel": "full",
  "maxZoom": 10,
  "minZoom": 1,
  "maxExposure": 24,
  "supportsLowLightBoost": false,
  "neutralZoom": 1,
  "physicalDevices": [
    "wide-angle-camera"
  ],
  "supportsFocus": true,
  "supportsRawCapture": false,
  "isMultiCam": false,
  "minFocusDistance": 0,
  "minExposure": -24,
  "name": "1 (FRONT) androidx.camera.camera2",
  "hasFlash": false,
  "hasTorch": false,
  "position": "front",
  "id": "1"
}

Device

Poco X4 Pro

VisionCamera Version

4.0.0-beta.10

Can you reproduce this issue in the VisionCamera Example app?

No, I cannot reproduce the issue in the Example app

Additional information

versusvoid commented 5 months ago

POCO M3 reports isZslSupported() = true, but initializing ImageCapture with CAPTURE_MODE_ZERO_SHUTTER_LAG (default behavior on 4.0.0-beta.14) will fail (results in black screen and "recoverable" error)

likely camerax bug, but maybe it's worth to workaround it

PedroGabrielCB commented 5 months ago

Redmi note 14 pro also has the same problem

PedroGabrielCB commented 5 months ago

@mrousavy do you have any suggestions on how I can fix it? I have an app in production with this problem... @

mrousavy commented 5 months ago

If you have issues you cannot solve yourself, feel free to contact me for consultancy so I can fix them for you.

PedroGabrielCB commented 5 months ago

If you have issues you cannot solve yourself, feel free to contact me for consultancy so I can fix them for you.

But isn't this a library bug as versusvoid put it above?

mrousavy commented 5 months ago

Yea, might be. I didn't investigate it yet.

mrousavy commented 5 months ago

Hey - I think this issue has been fixed in VisionCamera 4.0.0. 🥳

Please try V4 and let me know if you still experience this issue;