Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
108.54k stars 10.45k forks source link

i just wanna try the camera mirorring feature, but it just won't work (clearly i have no idea) #4512

Open wdagda opened 9 months ago

wdagda commented 9 months ago

Environment

Describe the bug A clear and concise description of what the bug is. I was trying to use my phone as a camera input because my laptop webcam ain't that good, then i install scrcpy v2.3.1,plug my phone onto laptop, and enable the usb debugging. it says error (yeah i don't know how to prevent this so i got here)

C:\produktif\scrcpy-win64-v2.3.1>scrcpy --video-source=camera
scrcpy 2.3.1 <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)       10DD3M045P0004Q            device  V2231
C:\produktif\scrcpy-win64-v2.3.1\scrcpy-server: 1 file pushed, 0 skipped. 72.9 MB/s (66007 bytes in 0.001s)
[server] INFO: Device: [vivo] vivo V2231 (Android 13)
[server] INFO: Using camera '0'
INFO: Renderer: direct3d
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:6145)
        at android.app.ActivityThread.acquireProvider(ActivityThread.java:7689)
        at android.app.ContextImpl$ApplicationContentResolver.acquireProvider(ContextImpl.java:3503)
        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:16183)
        at android.provider.Settings$Global.getString(Settings.java:16157)
        at android.hardware.camera2.vivo_ext.VivoCameraUtils.sendStartPreviewBroadCast(VivoCameraUtils.java:199)
        at android.hardware.camera2.CameraManager.openCameraDeviceUserAsync(CameraManager.java:782)
        at android.hardware.camera2.CameraManager.openCameraForUid(CameraManager.java:1047)
        at android.hardware.camera2.CameraManager.openCameraForUid(CameraManager.java:1068)
        at android.hardware.camera2.CameraManager.openCamera(CameraManager.java:883)
        at com.genymobile.scrcpy.CameraCapture.openCamera(CameraCapture.java:241)
        at com.genymobile.scrcpy.CameraCapture.init(CameraCapture.java:86)
        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)
Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.server.am.ContentProviderHelper.getContentProvider(ContentProviderHelper.java:174)
        at com.android.server.am.ActivityManagerService.getContentProvider(ActivityManagerService.java:7408)
        at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2851)
        at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3164)
        at android.os.Binder.execTransactInternal(Binder.java:1346)
rom1v commented 9 months ago

Given calling package android does not match caller's uid 2000

By any chance, is your device rooted? If so, try to run as non-root (run adb unroot). If not, I don't know.

Does screen mirroring work?

wdagda commented 9 months ago

my device is non root,but yeah the screen mirorring work tho

rom1v commented 9 months ago
    at android.hardware.camera2.vivo_ext.VivoCameraUtils.sendStartPreviewBroadCast(VivoCameraUtils.java:199)

Again the vendor ROM of vivo devices doing its own customizations…

rom1v commented 9 months ago

Please post your framework.jar, just in case we can workaround:

adb pull /system/framework/framework.jar
BlackCat2024-01 commented 3 weeks ago

Пожалуйста, опубликуйте свой framework.jarответ, на всякий случай, если мы сможем что-то обойти:

adb pull /system/framework/framework.jar

https://drive.google.com/file/d/1ZLWT0jSFLiOXaoVE2ExnvM_HLS3bV7oe/view?usp=sharing