Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
109.71k stars 10.54k forks source link

Mouse/Keyboard/Audio not working #4953

Open PickledFishMan opened 4 months ago

PickledFishMan commented 4 months ago

Environment

Describe the bug While I can se the screen, I cannot interact with it in any way. No audio, no mouse, no keyboard.

[server] INFO: Device: samsung SM-F936U (Android 14)
[server] ERROR: Could not invoke method
java.lang.NoSuchMethodException: android.content.IClipboard$Stub$Proxy.addPrimaryClipChangedListener [interface android.content.IOnPrimaryClipChangedListener, class java.lang.String, class java.lang.String, int]
        at java.lang.Class.getMethod(Class.java:2937)
        at java.lang.Class.getMethod(Class.java:2449)
        at com.genymobile.scrcpy.wrappers.ClipboardManager.getAddPrimaryClipChangedListener(ClipboardManager.java:129)
        at com.genymobile.scrcpy.wrappers.ClipboardManager.addPrimaryClipChangedListener(ClipboardManager.java:139)
        at com.genymobile.scrcpy.Device.<init>(Device.java:100)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:64)
        at com.genymobile.scrcpy.Server.main(Server.java:381)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:385)
[server] ERROR: Exception on thread Thread[Thread-4,5,main]
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.getDeviceId()' on a null object reference
        at android.content.ContextWrapper.getDeviceId(ContextWrapper.java:1252)
        at android.media.AudioRecord.resolveSessionId(AudioRecord.java:1175)
        at android.media.AudioRecord.<init>(AudioRecord.java:476)
        at android.media.AudioRecord.<init>(Unknown Source:0)
        at android.media.AudioRecord$Builder.build(AudioRecord.java:1062)
        at com.genymobile.scrcpy.AudioCapture.createAudioRecord(AudioCapture.java:58)
        at com.genymobile.scrcpy.AudioCapture.start(AudioCapture.java:90)
        at com.genymobile.scrcpy.AudioEncoder.encode(AudioEncoder.java:183)
        at com.genymobile.scrcpy.AudioEncoder.lambda$start$0$com-genymobile-scrcpy-AudioEncoder(AudioEncoder.java:120)
        at com.genymobile.scrcpy.AudioEncoder$$ExternalSyntheticLambda0.run(Unknown Source:2)
        at java.lang.Thread.run(Thread.java:1012)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 23.1.3 (git-87ebaf765d)
INFO: Trilinear filtering enabled
WARN: Demuxer 'audio': stream explicitly disabled by the device
INFO: Initial texture: 904x2312
[server] ERROR: Exception on thread Thread[Thread-2,5,main]
java.lang.AssertionError: java.lang.reflect.InvocationTargetException
        at com.genymobile.scrcpy.wrappers.ServiceManager.getInputManager(ServiceManager.java:72)
        at com.genymobile.scrcpy.Device.injectEvent(Device.java:192)
        at com.genymobile.scrcpy.Device.injectEvent(Device.java:196)
        at com.genymobile.scrcpy.Controller.injectTouch(Controller.java:320)
        at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:134)
        at com.genymobile.scrcpy.Controller.control(Controller.java:83)
        at com.genymobile.scrcpy.Controller.lambda$start$0$com-genymobile-scrcpy-Controller(Controller.java:90)
        at com.genymobile.scrcpy.Controller$$ExternalSyntheticLambda0.run(Unknown Source:2)
        at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.genymobile.scrcpy.wrappers.ServiceManager.getInputManager(ServiceManager.java:69)
        ... 8 more
Caused by: java.lang.NullPointerException
        at java.util.Objects.requireNonNull(Objects.java:207)
        at android.hardware.input.InputManager.getInstance(InputManager.java:401)
        ... 10 more

Is this a limitation of the version number available for Arch?

rom1v commented 4 months ago

scrcpy version: 2.0

Upgrade to the latest version (currently 2.4).

PickledFishMan commented 4 months ago

scrcpy version: 2.0

Upgrade to the latest version (currently 2.4).

I apologize if my newness to linux is the issue, but it appears only 2.0 is available via pacman. If there is another way to update this, I'd appreciate the gentle nudge in the right direction

rom1v commented 4 months ago

It seems the latest package is 2.4 (repository "extra"): https://archlinux.org/packages/extra/x86_64/scrcpy/