react-native-vision-camera: ๐ Camera freezes on first frame when running frameProcessors on Galaxy S8, Android 9
Whatโs happening?
So I am testing frame processors on SAMSUNG Galaxy S8, running Android 9.0. The previous version works fine (v2), but on v3 the Camera freezes on the first frame, when (and only when) running frame processors. If I comment out the frameProcessor
prop, it works fine. So in theory I am able to have the worklet initialized, itโs only when I actually try to use it and bind it to the camera, it freezes and stops the camera from working. Also the console.logs from the frame processor are not being logged, so the worklet does not seem to be running as well (or binded).
I tried running the example app and the same thing happens over there as well. Will be pasting both the example app and my app logs. Both the logs are just launching the app and it arriving on the camera preview screen. I have dealt with permissions beforehand. I open the apps up and then the camera freezes, so I wait a bit, pressing on the screen so that it doesnโt lock the phone, and then I open up the app list to close the app and end the session.
Iโm super not familiar with native development, so I might be using the wrong lingo or something and this is quite as much context as I can possibly provide.
Reproduceable Code
// this is for my app, but nothing really special here, so I would
// assume that the problem is somewhere deep down
const frameProcessor = useFrameProcessor((frame) => {
'worklet'
console.log('hello')
return null
}, [])
const device = useCameraDevice('back')
if (device == null) return <Text>No camera</Text>
return <Camera
style={{
flex: 1,
width: '100%',
}}
device={device}
isActive={true}
frameProcessor={frameProcessor}
/>
Relevant log output
It says, that my logs are too long, I've created a pastebin
https://pastebin.com/aEezEEZi
Sorry, I'm not great at native, I don't really understand what logs are relevant
There are no real faults or exceptions (nothing too read), but a few Java errors
are being logged with the INFO status
Nothing interesting on the React Native logs
Camera Device
{
"sensorOrientation": "landscape-right",
"hardwareLevel": "full",
"maxZoom": 8,
"minZoom": 1,
"maxExposure": 8,
"supportsLowLightBoost": false,
"neutralZoom": 1,
"physicalDevices": [
"wide-angle-camera"
],
"supportsFocus": true,
"supportsRawCapture": true,
"isMultiCam": false,
"minExposure": -8,
"name": "BACK (0)",
"hasFlash": true,
"hasTorch": true,
"position": "back",
"id": "0"
}
Device
SAMSUNG Galaxy S8
VisionCamera Version
3.6.16
Can you reproduce this issue in the VisionCamera Example app?
Yes, I can reproduce the same issue in the Example app here
Additional information
- I am using Expo
- I have enabled Frame Processors (react-native-worklets-core)
- I have read the Troubleshooting Guide
- I agree to follow this projectโs Code of Conduct
- I searched for similar issues in this repository and found none.
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Reactions: 9
- Comments: 26 (7 by maintainers)
Just had a very similiar issue. I fixed it by setting:
Also saw in a thread similiar that:
Also worked for some.
I had the same problem, but when I assigned the correct format, the camera worked fine
@joncys This is a different issue and has been reported before a lot - it is basically some compatibility issue in your Babel plugins (Worklets vs Reanimated). Make sure to clean cache, update your versions, and try again.
Once that is gone let me know if 3.9 works ๐
I had the same issue, but it works with
pixelFormat="yuv"
. (Galaxy S8+, Android 9)This is already the default pixel format on
main
(https://github.com/mrousavy/react-native-vision-camera/commit/11eb1f68e4912309589855ee81edea12f5261df4, https://github.com/mrousavy/react-native-vision-camera/commit/d64fc08e167a6f2787f6deccfb3ba0caf16557b0) and used by the codeScanner.Iโm experiencing the same issue with the POCO F3 Pro.
@fazzysyed Setting the format helps a little in my case because it goes straight to an
camera error instead of just hanging on a black screen.
But the camera / plugin still does not seem to be working as expected.
experiencing the same issue on a one plus nord with android 11