-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Front Camera not loading in s23 ultra #1867
Comments
I think this is related to s23 ultra. I was able to run this properly in an Oppo v27 pro. I ran the example project disabling frame processors.
Not sure if this will help. Adding for clarity |
Might be related: #1801 (comment) I will check removing lines |
@mrousavy hope this helps Thing are working after removing those lines of code. I tried adding them one by one. Device: S23 Ultra Switching from back camera to front camera crashed when i added zoom related piece of code. react-native-vision-camera/package/android/src/main/java/com/mrousavy/camera/core/CameraSession.kt
One of the errors i got was java.lang.IllegalArgumentException: getCameraCharacteristics:1043: Unable to retrieve camera characteristics for unknown device 1: No such file or directory (-2) |
Thanks for trying the other approach though, I think we can pinpoint this to the zoom here - maybe Samsung can't handle non-clamped zoom values? What if you pass something like |
Sorry for the multiple number of messages/tags. I have attached what i could salvage from android studio. (Not able to get the entire logcat) not sure, I will check and get back. Im using same code as the example folder. App crashes when switching the camera, not when zooming happens. will pass the prop and get back |
Hi, i tried to log the zoom.value.
neutral zoom value is 1 for both back and front camera I trying to see if there is a way to reset zoom to preferred value when camera position changes. Not sure if this is a reanimated issue that's causing the camera to have an unsupported value |
Update Fix 1 with reanimated zoom I passed zoom={1} as a prop. And i think issues got fixed. App is not breaking when user zooms in/out. I think without zoom prop app crashes when cameras are switched PS: Max zoom/min zoom is not proper. Think max zoom is 10 but it should be 100 Fix 2: Remove reanimated zoom gesture and use enableZoomGesture={true} Zoom gesture is not great, but u can zoom 100x |
Okay so we need to clamp zoom |
Do we need to add any permissions for flash. I tried 3 different devices , flash is not working on any of them. HDR is also crashing for me. |
Flash is not yet implemented in V3. there is a feature request for that. HDR is crashing; please create a separate bug report and share the logs. |
i also get this issue in Samsung devices, just a black screen on Camera view |
@xts-bit try const devices = useCameraDevices() and check if any cameras are detected. |
@victorkvarghese It didn't work black screen on V3.1 |
Same issue... any fixes? |
Hey! Quick update: I think there could be four problems here:
|
@mrousavy Make sense I am using "fps={60}" prop in my Camera. However, V2 works fine. |
Hey! Can anyone try with VisionCamera 3.4.1. and see if the issue still persists? Thanks! |
@xts-bit does it work if you remove those lines in |
I just checked in S23 Ultra. v3.4.1
|
|
Hey! Did #2049 (released in 3.6.0) fix the HDR issue? Thanks! |
Hi @mrousavy front camera is kind of stretched out , weird aspect ratio. I tried commenting all aspect ratio related code, but same results I had same issue with back camera. But it got resolved when i commented everything in format Camera hangs up when HDR is turned on with the exception
I tested with another vivo device. Front and back camera is working alright without providing aspect ratio |
Update: things are fine if i downgrade to 3.4.1 , Front camera is not stretched out |
Okay so there is some wrong stretching going on in the preview? cc @blancham is that something you noticed as well? |
I think this is also related: #2123 Have the same issue. front camera photos are horizontal oriented, while back camera is working okay. |
I'm still facing the same issue. I opened the example app and repeated flipping the direction. logs: https://gist.github.com/bglgwyng/4b287419ff61a02d7c09efb9a53e8cad |
Lol that is a weird error. This has been reported by a few people on the internet and seems to be a device manifacturer error, e.g.: https://www.reddit.com/r/Xiaomi/comments/wtytkp/my_camera_keeps_on_crashing/ |
I had an issue with I tried to replicate the issue and got the log
So the problem is I can fix the problem by setting the |
@ben-qiu does your |
Okay yea makes sense. |
I've occasionally observed this behavior with VisionCamera 3.8.2 on Galaxy S21. |
@bglgwyng wow - weird. Can you show me how you're using the |
If you are using a Frame Processor, maybe it's this change? v3.8.2...v3.9.0-beta.0#diff-2335891be153a7966add00cea63f840e8c3c5597af11fb9f7156dac0d1fb57b1R84-R87 Could you try to disable a Frame Processor and see if that works? Also, maybe try explicitly passing a different format? Either |
What's happening?
@mrousavy I tried the latest v3 example code. By default front camera is loading in s23 ultra.
Then i removed everything and made it
const devices = useCameraDevices();
now back camera loads, but switching to front crashes the app.
now if i use
const device = useCameraDevice(cameraPosition, {
physicalDevices: [
'ultra-wide-angle-camera',
'telephoto-camera',
'wide-angle-camera',
],
});
i can see front camera. but unable to switch back to Back Camera
now if i go back to the old code and refresh the app. Then both cameras work.
But if i close the app open it again, back camera will work, but front camera will fail
Reproduceable Code
Relevant log output
{ [session/camera-has-been-disconnected: [session/camera-has-been-disconnected] The given Camera device (id: 1) has been disconnected! Error: UNKNOWN_CAMERA_DEVICE_ERROR]
name: 'session/camera-has-been-disconnected',
Device
S23 Ultra Android
VisionCamera Version
3.1.0
Can you reproduce this issue in the VisionCamera Example app?
Yes I can
Additional information
The text was updated successfully, but these errors were encountered: