New camera feature issues on some devices (original) (raw)

Environment

Describe the bug
I'm attempting to use the new camera feature on my OnePlus. I used the pre-built server and then manually built the client. The main phone screen display works fine, but I get the following message when I attempt to use the camera mirroring feature:

scrcpy  --video-source=camera --camera-id=0           ──(Wed,Nov01)─┘
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)  953a9722                        device  KB2005
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 5.1 MB/s (64363 bytes in 0.012s)
[server] INFO: Device: [OnePlus] OnePlus KB2005 (Android 13)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 23.0.4-0ubuntu1~22.04.1
INFO: Trilinear filtering enabled
[server] INFO: Using camera '0'
[server] ERROR: Exception on thread Thread[camera,5,main]
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.app.Application.getApplicationContext()' on a null object reference
    at android.hardware.camera2.OplusCamera2StatisticsManager.addInfo(OplusCamera2StatisticsManager.java:69)
    at android.hardware.camera2.impl.CameraDeviceImplExtImpl.extendsetInfo(CameraDeviceImplExtImpl.java:47)
    at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:190)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:240)
    at android.os.Looper.loop(Looper.java:351)
    at android.os.HandlerThread.run(HandlerThread.java:67)
INFO: Texture: 4000x3000

Attempting to use other camera id's presents similar console messages.


EDIT by @rom1v: it is now fixed, upgrade to version 2.3.

oldEDIT by @rom1v: the problem will be fixed in the next release.

Meanwhile, you can download this file and replace it in the release of scrcpy v2.2:

(built from branch camerafix)

Please tell us if it fixes your problem or not (or if it creates other issues).