Skip to content

[camera] Image stream data is corrupt on some Android devices (Vivo, Xiaomi, Motorola) #118350

@acoutts

Description

@acoutts

Steps to Reproduce

  1. Run the example app here: https://github.com/acoutts/camera_stream_bug - it will start the image stream, convert the first frame to a color image, and then display the frame.
  2. Observe the corrupted image frame if the device is prone to the issue.

I've noticed issues from some users with our app features that rely on the image stream (we use MLKit). I got my hands on some of them to test and found the image stream is producing corrupted frames on these devices, which prevents MLKit from being functional.

So far we've seen the issue on the following devices:

  • Vivo V2135
  • Xiaomi M2010J19CG
  • Motorola moto g(50)

Expected results:
The image stream should produce valid images on all devices. Here is how the sample app looks when run from a Pixel 6:
IMG_0330

Actual results:
It produces a corrupted image like this on the Vivo:
IMG_0329

This happens irrespective of the camera resolution setting.

Code sample

https://github.com/acoutts/camera_stream_bug

Logs
[✓] Flutter (Channel stable, 3.3.9, on macOS 13.0.1 22A400 darwin-arm, locale en-US)
    • Flutter version 3.3.9 on channel stable at /Users/andrew.coutts/Projects/flutter
    • Upstream repository git@github.com:flutter/flutter.git
    • Framework revision b8f7f1f986 (7 weeks ago), 2022-11-23 06:43:51 +0900
    • Engine revision 8f2221fbef
    • Dart version 2.18.5
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2)
    • Android SDK at /Users/andrew.coutts/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0-rc2
    • ANDROID_HOME = /Users/andrew.coutts/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.70.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.46.0

[✓] VS Code (version 1.75.0-insider)
    • VS Code at /Applications/Visual Studio Code - Insiders.app/Contents
    • Flutter extension version 3.56.0

[✓] Connected device (3 available)
    • Pixel 6 (mobile) • 1A051FDF6004H7 • android-arm64  • Android 12 (API 32)
    • macOS (desktop)  • macos          • darwin-arm64   • macOS 13.0.1 22A400 darwin-arm
    • Chrome (web)     • chrome         • web-javascript • Google Chrome 108.0.5359.124

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: qualityA truly polished experiencee: device-specificOnly manifests on certain devicesp: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions