react-native-vision-camera: ๐ [V3][Android][CodeScanner] CodeScanner very slow on Android
Whatโs happening?
On a Moto G Stylus 2022 Android device, when codeScanner
is used, the displayed view drops to about 5 fps and any codeScanner
functionality is slow & delayed.
When codeScanner is disabled (or on iOS at all times), the framerate is excellent.
This is occurring on react-native-vision-camera@3.3.1
.
Reproduceable Code
Tested in the Example App, with photo/video/audio/frameProcessor all disabled and this codeScanner function:
const onCodeScanned = useCallback((codes: Code[]) => {
console.log(codes.length)
}, [])
### Relevant log output
```shell
N/A
Camera Device
{
"sensorOrientation": "landscape-right",
"hardwareLevel": "full",
"maxZoom": 8,
"minZoom": 1,
"supportsLowLightBoost": false,
"neutralZoom": 1,
"physicalDevices": [
"wide-angle-camera"
],
"supportsFocus": true,
"supportsRawCapture": true,
"isMultiCam": false,
"name": "BACK (0)",
"hasFlash": true,
"hasTorch": true,
"position": "back",
"id": "0"
}
Device
Moto G Stylus 2022
VisionCamera Version
3.3.1
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 9 months ago
- Reactions: 2
- Comments: 19 (8 by maintainers)
How about you guys change the title to โ[V3][Android]โ ? Putting iOS in the title of an Android-only problem gives me headaches.
Also just tested using the latest commit on main and the issue remains I tested by using gitpkg and setting my dependency to
https://gitpkg.now.sh/mrousavy/react-native-vision-camera/package?e8df7148fa50214f47ff1a41dfa40e7255bc3f8d
Iโm using an Xperia XZ Premium with Android 9 The behavior I noticed using this commit is that the camera is fluid at first but becomes progressively laggy (during the first ~2 seconds) & it stabilizes with the same level of slowness as v3.3.1. On v3.3.1 however it was slow from the start