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

New camera feature issue on Motorola G6 Plus Android 13 📷 #4397

Closed
2 tasks done
miguetronic opened this issue Nov 2, 2023 · 2 comments
Closed
2 tasks done

New camera feature issue on Motorola G6 Plus Android 13 📷 #4397

miguetronic opened this issue Nov 2, 2023 · 2 comments

Comments

@miguetronic
Copy link

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

Environment

  • OS: [e.g. Debian, Windows, macOS...] Windows
  • scrcpy version: [e.g. 1.12.1] v2.2
  • installation method: [e.g. manual build, apt, snap, brew, Windows release...] Windows release
  • device model: Motorola G6 Plus
  • Android version: [e.g. 10] Android 13

Describe the bug
When using the new feature of camera with the command scrcpy --video-source=camera I got the following output error:

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
INFO: ADB device found:
INFO:     -->   (usb)            ZY323D9H3V            device  moto_g_6__plus
C:\Users\Miguel\Downloads\scrcpy-win64-v2.2\scrcpy-server:... file pushed, 0 skipped. 42.8 MB/s (64363 bytes in 0.001s)
[server] INFO: Device: [motorola] motorola moto g(6) plus (Android 13)
INFO: Renderer: direct3d
[server] ERROR: Exception on thread Thread[video,5,main]
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.app.Application.getResources()' on a null object reference
        at android.hardware.Camera.shouldExposeAuxCamera(Camera.java:282)
ERR     at android.hardware.camera2.CameraManager$CameraManagerGlobal.onStatusChangedLocked(CameraManager.java:2298)
        at android.hardware.camera2.CameraManager$CameraManagerGlobal.connectCameraServiceLocked(CameraManager.java:1713)
        at android.hardware.camera2.CameraManager$CameraManagerGlobal.getCameraIdList(CameraManager.java:1931)
        at android.hardware.camera2.CameraManager.getCameraIdList(CameraManager.java:246)
        at com.genymobile.scrcpy.CameraCapture.selectCamera(CameraCapture.java:99)O
        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)R
:       at java.lang.Thread.run(Thread.java:1012)
 Demuxer 'video': stream disabled due to connection error
ERROR: Demuxer 'audio': stream disabled due to connection error
ERROR: Demuxer error

A similar error appear when using other camera commands:

scrcpy --list-cameras

scrcpy --list-cameras
scrcpy v2.2 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)            ZY323D9H3V            device  moto_g_6__plus
C:\Users\Miguel\Downloads\scrcpy-win64-v2.2\scrcpy-server:... file pushed, 0 skipped. 42.7 MB/s (64363 bytes in 0.001s)
[server] INFO: Device: [motorola] motorola moto g(6) plus (Android 13)
[server] ERROR: Attempt to invoke virtual method 'android.content.res.Resources android.app.Application.getResources()' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.app.Application.getResources()' on a null object reference
        at android.hardware.Camera.shouldExposeAuxCamera(Camera.java:282)
        at android.hardware.camera2.CameraManager$CameraManagerGlobal.onStatusChangedLocked(CameraManager.java:2298)
        at android.hardware.camera2.CameraManager$CameraManagerGlobal.connectCameraServiceLocked(CameraManager.java:1713)
        at android.hardware.camera2.CameraManager$CameraManagerGlobal.getCameraIdList(CameraManager.java:1931)
        at android.hardware.camera2.CameraManager.getCameraIdList(CameraManager.java:246)
        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)
@rom1v
Copy link
Collaborator

rom1v commented Nov 2, 2023

Thank you for your report.

I'm closing as duplicate of #4392 (which will regroup all these internal exceptions on specific devices).

@rom1v
Copy link
Collaborator

rom1v commented Nov 3, 2023

Does this work: #4392 (comment) ?

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