Open MaksymKuzmych opened 5 days ago
Guten Tag, Hans here! 🍻
This looks like a valid issue and you provided relevant logs, Danke! It seems you have detailed the behaviour on your Samsung Galaxy A23 with Android 14 after updating. However, not being able to reproduce the issue in the Example app suggests that it could be device-specific or related to your specific configuration. I recommend double-checking all your camera permissions and settings.
If the issue persists, please monitor for updates from mrousavy. Feel free to sponsor the project here to support further development!
Note: If you think I made a mistake, please ping
@mrousavy
to take a look.
Guten Tag, Hans here! 🍻
This looks like a valid issue and you provided relevant logs, Danke! It seems you have detailed the behaviour on your Samsung Galaxy A23 with Android 14 after updating. However, not being able to reproduce the issue in the Example app suggests that it could be device-specific or related to your specific configuration. I recommend double-checking all your camera permissions and settings.
If the issue persists, please monitor for updates from mrousavy. Feel free to sponsor the project here to support further development!
Note: If you think I made a mistake, please ping
@mrousavy
to take a look.
But it's working with version 3.8.2 of the same model, so it shouldn't be a problem with permissions or settings.
Hi guys,
Thanks for a great work on react-native-vision-camera
I'm also experiencing same issue with Samsung A23 5G
(SM-A236B
)
I haven't opened ticket yet, trying to dig for some details first, but I don't have the A23
device.
I upgraded from 2.16.1
to 4.5.2
recently and my users with A23
complain that built-in QR-scanning not works.
Users with other phones have QR-scanning working.
I'm using now:
react-native-vision-camera 4.5.2
codeScanner
format
prop not passed in my case
<Camera
isActive
enableZoomGesture
ref={cameraRef}
device={device}
lowLightBoost={device.supportsLowLightBoost && nightModeEnabled}
codeScanner={codeScanner}
torch={isCameraMounted && supportsFlash && flash ? 'on' : 'off'}
onError={onError}
onInitialized={onInitialized}
style={StyleSheet.absoluteFill}
/>
@MaksymKuzmych do you have A23
phone on your side to debug this?
Could you maybe try to:
const format = useCameraFormat(device, [{ videoResolution: { width: 640, height: 480 } }])
frameProcessor
instead of codeScanner
codeScanner
ignores format
propframeProcessor
and 640x480
:
Some details from my users:
I found this topic on flutter camera library:
YUV_420_888
to NV21
, that it could helpI'm digging in this direction now:
frame-processor
to mlkit
yuv
to rgb
and ouput to skia
@MaksymKuzmych
And here is a sample with debug output of frame to skia: https://gist.github.com/zwerg44/2284ce92160f7c93184f2b2b899b0da1
But on my phone and also my emulator:
pixelFormat: 'abgr'
'rgba'
pixelFormat
combination - output colour not correctNot sure why? is it issue with resize-plugin? or 4.5.2 produces corrupted frames? I can imagine MLkit can digest sometimes even corrupted frames like this.
My phone output from sample:
pixelFormat='abgr'
, skia rendered as 'rgba'
Same sample with pixelFormat='rgba':
pixelFormat='rgba'
, skia rendered as 'rgba'
Updated my gist sample with debug output to skia:
scale
(I think I understood scale param usage wrong)
https://gist.github.com/zwerg44/2284ce92160f7c93184f2b2b899b0da1Updated my gist sample with debug output to skia:
- to not use
scale
(I think I understood scale param usage wrong) https://gist.github.com/zwerg44/2284ce92160f7c93184f2b2b899b0da1
Hi, @zwerg44 Thanks for the answer. The first thing I tried to do was just replace my
const format = useCameraFormat(device, [{videoResolution: 'max'}]);
with the format in your suggestion
const format = useCameraFormat(device, [{videoResolution: {width: 640, height: 480}}]);
and for now it works and I don't receive the Error
[session/recoverable-error: An unknown error occurred while creating the Camera Session, but the Camera can recover from it.]
Yes, the quality is worse than before, but it scanning QR codes really good without any problems, so I just did the helper function just for this model:
export const getVideoResolution = () => {
const deviceName = DeviceInfo.getDeviceNameSync();
return deviceName === 'Galaxy A23 5G' ? {width: 640, height: 480} : 'max';
};
I also confirm that just passing 640x480
format
helped all my users with A23 5G
I used workaround like this:
// constants
const MODEL = DeviceInfo.getModel();
const MODELS_HAS_CAMERA_ISSUE = [
'SM-A235F',
'SM-A235M',
'SM-A235N',
'SM-A233C',
'SM-A2360',
'SM-A236B', // my users
'SM-A236E',
'SM-A236M',
'SM-A236U',
'SM-A236U1',
'SM-S236DL',
'SM-S237VL',
'SM-A236V',
];
const HAS_CAMERA_ISSUE = MODELS_HAS_CAMERA_ISSUE.includes(MODEL);
...
// and then passed format like this to camera
const selectedFormat = useCameraFormat(device, [{ videoResolution: { width: 640, height: 480 } }]);
const format = HAS_CAMERA_ISSUE ? selectedFormat : undefined;
What's happening?
Issue: QR Code Scanner Fails on Samsung A23 (Android 14)
After updating from version 3.8.2 to 4.5.3, I've encountered an issue on the Samsung A23 running Android 14. The QR code scanner doesn't appear, and I'm receiving the following error:
[session/recoverable-error: An unknown error occurred while creating the Camera Session, but the Camera can recover from it.]
If I remove either the "codeScanner" or "format" prop, the camera will mount, but it won't scan any QR codes.
Code Sample (CodeScannerPipeline.kt)
Issue Details:
Has anyone encountered this issue or found a workaround? Any assistance would be appreciated!
Reproduceable Code
Relevant log output
Camera Device
Device
Samsung Galaxy A23 (Android 14)
VisionCamera Version
4.5.3
Can you reproduce this issue in the VisionCamera Example app?
No, I cannot reproduce the issue in the Example app
Additional information