Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZTE A2022 (Android 13) can't use camera mirroring #4709

Closed
2 tasks done
TheBug233 opened this issue Feb 28, 2024 · 5 comments
Closed
2 tasks done

ZTE A2022 (Android 13) can't use camera mirroring #4709

TheBug233 opened this issue Feb 28, 2024 · 5 comments

Comments

@TheBug233
Copy link

  • I have read the FAQ.
  • I have searched in existing issues.

Environment

  • OS: [Windows]
  • scrcpy version: [2.3.1]
  • installation method: [Windows release]
  • device model: ZTE A2022
  • Android version: [13]

Describe the bug
Hello, I have a ZTE A2022 Android phone, but I am unable to mirror the camera using the scrcpy --video-source=camera command. It returns this error:

PS C:\n\scrcpy2.2> ./scrcpy --video-source=camera
scrcpy v2.2 <https://github.com/Genymobile/scrcpy>
INFO: Camera video source: control disabled
INFO: Camera video source: microphone audio source selected
* daemon not running; starting now at tcp:5037
* daemon started successfully
INFO: ADB device found:
INFO:     -->   (usb)          321116254339            device  ZTE_A2022
C:\n\scrcpy2.2\scrcpy-server: 1 file pushed, 0 skipped. 149.6 MB/s (64363 bytes in 0.000s)
[server] INFO: Device: [ZTE] ZTE ZTE A2022 (Android 13)
[server] ERROR: Exception on thread Thread[video,5,main]
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
        at android.hardware.camera2.CameraManager$CameraManagerGlobal.onStatusChangedLocked(CameraManager.java:2344)
        at android.hardware.camera2.CameraManager$CameraManagerGlobal.connectCameraServiceLocked(CameraManager.java:1695)
        at android.hardware.camera2.CameraManager$CameraManagerGlobal.getCameraIdList(CameraManager.java:1932)
        at android.hardware.camera2.CameraManager.getCameraIdList(CameraManager.java:256)
        at com.genymobile.scrcpy.CameraCapture.selectCamera(CameraCapture.java:99)
        at com.genymobile.scrcpy.CameraCapture.init(CameraCapture.java:75)
        at com.genymobile.scrcpy.SurfaceEncoder.streamScreen(SurfaceEncoder.java:55)
        at com.genymobile.scrcpy.SurfaceEncoder.lambda$start$0$com-genymobile-scrcpy-SurfaceEncoder(SurfaceEncoder.java:253)
        at com.genymobile.scrcpy.SurfaceEncoder$$ExternalSyntheticLambda0.run(Unknown Source:4)
        at java.lang.Thread.run(Thread.java:1012)
INFO: Renderer: direct3d
ERROR: Demuxer 'video': stream disabled due to connection error
ERROR: Demuxer 'audio': stream disabled due to connection error
ERROR: Demuxer error

Afterward, I used the command 'scrcpy --list-cameras'
It returned this error:

PS C:\n\scrcpy2.2> ./scrcpy --list-cameras
scrcpy v2.2 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)          321116254339            device  ZTE_A2022
C:\n\scrcpy2.2\scrcpy-server: 1 file pushed, 0 skipped. 206.1 MB/s (64363 bytes in 0.000s)
[server] INFO: Device: [ZTE] ZTE ZTE A2022 (Android 13)
[server] ERROR: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
        at android.hardware.camera2.CameraManager$CameraManagerGlobal.onStatusChangedLocked(CameraManager.java:2344)
        at android.hardware.camera2.CameraManager$CameraManagerGlobal.connectCameraServiceLocked(CameraManager.java:1695)
        at android.hardware.camera2.CameraManager$CameraManagerGlobal.getCameraIdList(CameraManager.java:1932)
        at android.hardware.camera2.CameraManager.getCameraIdList(CameraManager.java:256)
        at com.genymobile.scrcpy.LogUtils.buildCameraListMessage(LogUtils.java:91)
        at com.genymobile.scrcpy.Server.internalMain(Server.java:228)
        at com.genymobile.scrcpy.Server.main(Server.java:190)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)

I have root permissions. If this is a system limitation, can it be modified?

@rom1v
Copy link
Collaborator

rom1v commented Feb 28, 2024

scrcpy v2.2 https://github.com/Genymobile/scrcpy

Try with the latest version.

@TheBug233
Copy link
Author

TheBug233 commented Feb 28, 2024

scrcpy v2.2 https://github.com/Genymobile/scrcpy

Try with the latest version.

Oh, thank you. I forgot that after renaming the folder, I messed up the updated files. The latest version perfectly fixes this issue.

@TheBug233
Copy link
Author

scrcpy v2.2 https://github.com/Genymobile/scrcpy

Try with the latest version.

Strange thing is, I was using this old version and it worked fine on the DSU Loader system and other phones... but never mind, the issue is resolved now. Thanks again.

@rom1v
Copy link
Collaborator

rom1v commented Feb 28, 2024

Strange thing is, I was using this old version and it worked fine on the DSU Loader system and other phones

Sure, some issues occur only on some devices (typically on custom vendor ROMs), and only one some versions…

That's one of the reasons why scrcpy is updated regularly (in addition to new features) 😉

@rom1v
Copy link
Collaborator

rom1v commented Feb 28, 2024

Your issue is #4392.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants