Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
109.92k stars 10.56k forks source link

issue about camera as video source #5063

Open EpiclyRaspberry opened 3 months ago

EpiclyRaspberry commented 3 months ago

Environment

Describe the bug

running scrcpy --video-source=camera gives this error

C:\Users\user>scrcpy --video-source=camera
scrcpy 2.5 <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)  10AD7Q0G99001B6                 device  V2249
C:\Program Files\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 37.6 MB/s (69624 bytes in 0.002s)
[server] INFO: Device: [vivo] vivo V2249 (Android 13)
INFO: Renderer: direct3d
[server] INFO: Using camera '0'
ERROR: Demuxer 'video': stream disabled due to connection error
ERROR: Demuxer error
[server] ERROR: Exception on thread Thread[video,5,main]
java.lang.SecurityException: Given calling package android does not match caller's uid 2000
        at android.os.Parcel.createExceptionOrNull(Parcel.java:3025)
        at android.os.Parcel.createException(Parcel.java:3009)
        at android.os.Parcel.readException(Parcel.java:2992)
        at android.os.Parcel.readException(Parcel.java:2934)
        at android.app.IActivityManager$Stub$Proxy.getContentProvider(IActivityManager.java:6154)
        at android.app.ActivityThread.acquireProvider(ActivityThread.java:7765)
        at android.app.ContextImpl$ApplicationContentResolver.acquireProvider(ContextImpl.java:3510)
        at android.content.ContentResolver.acquireProvider(ContentResolver.java:2542)
        at android.provider.Settings$ContentProviderHolder.getProvider(Settings.java:2955)
        at android.provider.Settings$NameValueCache.getStringForUser(Settings.java:3182)
        at android.provider.Settings$Global.getStringForUser(Settings.java:16184)
        at android.provider.Settings$Global.getString(Settings.java:16158)
        at android.hardware.camera2.vivo_ext.VivoCameraUtils.sendStartPreviewBroadCast(VivoCameraUtils.java:213)
        at android.hardware.camera2.CameraManager.openCameraDeviceUserAsync(CameraManager.java:786)
        at android.hardware.camera2.CameraManager.openCameraForUid(CameraManager.java:1051)
        at android.hardware.camera2.CameraManager.openCameraForUid(CameraManager.java:1072)
        at android.hardware.camera2.CameraManager.openCamera(CameraManager.java:887)
        at com.genymobile.scrcpy.CameraCapture.openCamera(CameraCapture.java:245)
        at com.genymobile.scrcpy.CameraCapture.init(CameraCapture.java:86)
        at com.genymobile.scrcpy.SurfaceEncoder.streamCapture(SurfaceEncoder.java:56)
        at com.genymobile.scrcpy.SurfaceEncoder.lambda$start$0$com-genymobile-scrcpy-SurfaceEncoder(SurfaceEncoder.java:257)
        at com.genymobile.scrcpy.SurfaceEncoder$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
        at java.lang.Thread.run(Thread.java:1012)

C:\Users\user>

here's the logcat i captured when i ran the command logcat.txt

rom1v commented 3 months ago

Is your device rooted? If so, try adb unroot.

EpiclyRaspberry commented 3 months ago

no, my phone is not rooted and i have no plans on rooting it

rom1v commented 3 months ago

See #4639.