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

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Reactions: 2
  • Comments: 19 (8 by maintainers)

Most upvoted comments

How about you guys change the title to โ€œ[V3][Android]โ€ ? Putting iOS in the title of an Android-only problem gives me headaches.

same problem, pr fix of https://github.com/mrousavy/react-native-vision-camera/commit/915ef331d3b3f3630f4b8d5a8cdd7f5fcf30c335 didnโ€™t fixed it on android. tested on 2 diffrent androids

@celik75 how did you test that?

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