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

Unable to connect.[server] ERROR: Exception on thread Thread[main,5,main] #4349

Open
moxi000 opened this issue Oct 12, 2023 · 13 comments
Open

Comments

@moxi000
Copy link

moxi000 commented Oct 12, 2023

moxi@MacBook-Pro ~ % scrcpy
scrcpy 2.1.1 https://github.com/Genymobile/scrcpy
INFO: ADB device found:
INFO: --> (usb) EC2199C9 device Tab10C
/opt/homebrew/Cellar/scrcpy/2.1.1/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 52.1 MB/s (56995 bytes in 0.001s)
[server] INFO: Device: [ONYX] ONYX Tab10C (Android 11)
[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.ContentResolver android.content.Context.getContentResolver()' on a null object reference
at android.content.ContextWrapper.getContentResolver(ContextWrapper.java:107)
at android.content.ContextWrapper.getContentResolver(ContextWrapper.java:107)
at android.hardware.input.InputManager.setupPointerNaturalRolling(InputManager.java:295)
at android.hardware.input.InputManager.registerPointerSettingObserver(InputManager.java:261)
at android.hardware.input.InputManager.(InputManager.java:255)
at android.hardware.input.InputManager.getInstance(InputManager.java:326)
at android.view.KeyCharacterMap.load(KeyCharacterMap.java:334)
at com.genymobile.scrcpy.Controller.(Controller.java:35)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:113)
at com.genymobile.scrcpy.Server.main(Server.java:199)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399)
INFO: Renderer: metal
ERROR: Demuxer 'video': stream disabled due to connection error
ERROR: Demuxer 'audio': stream disabled due to connection error
ERROR: Demuxer error
moxi@MacBook-Pro ~ %

@rom1v
Copy link
Collaborator

rom1v commented Oct 12, 2023

Something has been changed in your rom by the vendor.

Please post your framework.jar. Download it from your device with the following command:

adb pull /system/framework/framework.jar

@l-leroux
Copy link

l-leroux commented Nov 5, 2023

I had the same message on mint 20.2 with a Fairphone 3 :
INFO: scrcpy 1.12.1 <https://github.com/Genymobile/scrcpy> /usr/share/scrcpy/scrcpy-server: 1 file pushed. 3.2 MB/s (24773 bytes in 0.007s) INFO: Initial texture: 1080x2160 [server] ERROR: Exception on thread Thread[main,5,main] WARN: Device disconnected
The framework.jar is here : https://nuage03.apps.education.fr/index.php/s/YKqqoDby24g36o7

Thanks !

@rom1v
Copy link
Collaborator

rom1v commented Nov 5, 2023

scrcpy 1.12.1

Too old. Install the latest version manually.

@l-leroux
Copy link

l-leroux commented Nov 5, 2023

Thanks ! That's it !

@DanSyor
Copy link

DanSyor commented Nov 6, 2023

Got very similar issue after an update.
framework.jar

scrcpy v2.2 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)              2E8861A9            device  NoteAir2P
C:\Utils\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 130.2 MB/s (64363 bytes in 0.000s)
[server] INFO: Device: [ONYX] ONYX NoteAir2P (Android 11)
[server] ERROR: Attempt to invoke virtual method 'android.content.ContentResolver android.content.Context.getContentResolver()' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.ContentResolver android.content.Context.getContentResolver()' on a null object reference
        at android.content.ContextWrapper.getContentResolver(ContextWrapper.java:107)
        at android.content.ContextWrapper.getContentResolver(ContextWrapper.java:107)
        at android.hardware.input.InputManager.setupPointerNaturalRolling(InputManager.java:321)
        at android.hardware.input.InputManager.registerPointerSettingObserver(InputManager.java:291)
        at android.hardware.input.InputManager.<init>(InputManager.java:283)
        at android.hardware.input.InputManager.getInstance(InputManager.java:357)
        at android.view.KeyCharacterMap.load(KeyCharacterMap.java:334)
        at com.genymobile.scrcpy.Controller.<init>(Controller.java:35)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:118)
        at com.genymobile.scrcpy.Server.internalMain(Server.java:235)
        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:399)
INFO: Renderer: direct3d
ERROR: Demuxer 'video': stream disabled due to connection error
ERROR: Demuxer 'audio': stream disabled due to connection error
ERROR: Demuxer error

EDIT: works with --no-audio but pretty sure it used to work without that option.

@rom1v
Copy link
Collaborator

rom1v commented Nov 6, 2023

Could you please test with the scrcpy-server posted in #4392?

@DanSyor
Copy link

DanSyor commented Nov 6, 2023

OK, tested with file from this post, got this:

scrcpy v2.2 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)              2E8861A9            device  NoteAir2P
C:\Utils\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 11.8 MB/s (154598 bytes in 0.012s)
[server] INFO: Device: [ONYX] ONYX NoteAir2P (Android 11)
[server] ERROR: Given calling package android does not match caller's uid 2000
java.lang.SecurityException: Given calling package android does not match caller's uid 2000
        at android.os.Parcel.createExceptionOrNull(Parcel.java:2374)
        at android.os.Parcel.createException(Parcel.java:2358)
        at android.os.Parcel.readException(Parcel.java:2341)
        at android.os.Parcel.readException(Parcel.java:2283)
        at android.app.IActivityManager$Stub$Proxy.getContentProvider(IActivityManager.java:5808)
        at android.app.ActivityThread.acquireProvider(ActivityThread.java:6936)
        at android.app.ContextImpl$ApplicationContentResolver.acquireProvider(ContextImpl.java:2912)
        at android.content.ContentResolver.acquireProvider(ContentResolver.java:2470)
        at android.provider.Settings$ContentProviderHolder.getProvider(Settings.java:2596)
        at android.provider.Settings$NameValueCache.getStringForUser(Settings.java:2725)
        at android.provider.Settings$Global.getStringForUser(Settings.java:13469)
        at android.provider.Settings$Global.getString(Settings.java:13457)
        at android.provider.Settings$Global.getInt(Settings.java:13662)
        at android.hardware.input.InputManager.setupPointerNaturalRolling(InputManager.java:321)
        at android.hardware.input.InputManager.registerPointerSettingObserver(InputManager.java:291)
        at android.hardware.input.InputManager.<init>(InputManager.java:283)
        at android.hardware.input.InputManager.getInstance(InputManager.java:357)
        at android.view.KeyCharacterMap.load(KeyCharacterMap.java:334)
        at com.genymobile.scrcpy.Controller.<init>(Controller.java:35)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:118)
        at com.genymobile.scrcpy.Server.internalMain(Server.java:235)
        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:399)
Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.server.am.ActivityManagerService.getContentProvider(ActivityManagerService.java:7715)
        at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2425)
        at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2926)
        at android.os.Binder.execTransactInternal(Binder.java:1154)
        at android.os.Binder.execTransact(Binder.java:1123)

INFO: Renderer: direct3d
ERROR: Demuxer 'video': stream disabled due to connection error
ERROR: Demuxer 'audio': stream disabled due to connection error
ERROR: Demuxer error

Still works with --no-audio.

@rom1v
Copy link
Collaborator

rom1v commented Nov 6, 2023

OK, some parts require ActivityThread.currentApplication() to return a non-null Application (for audio and camera for example), but if it is not null, some other parts (InputManager in your ROM) perform more actions, some of them which could not work. :/

@BeInspired85
Copy link

Got similar error:
[server] ERROR: Exception on thread Thread[Thread-2,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.(AudioRecord.java:476)
at android.media.AudioRecord.(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: direct3d
WARN: Demuxer 'audio': stream explicitly disabled by the device

@rom1v
Copy link
Collaborator

rom1v commented Feb 22, 2024

Which device? Which Android version? Which scrcpy version?

@BeInspired85
Copy link

BeInspired85 commented Feb 23, 2024 via email

@AJolly
Copy link

AJolly commented May 13, 2024

I'm having the opposite issue: older versions of scrcpy work fine, newer do not.
scrcpy 1.25 https://github.com/Genymobile/scrcpy
C:\ccdc\PortableApps\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 164.6 MB/s (42151 bytes in 0.000s)
[server] INFO: Device: ONYX Page (Android 11)
INFO: Renderer: direct3d
INFO: Initial texture: 1264x1680
[server] ERROR: Encoding error: android.media.MediaCodec$CodecException: Error 0xfffffff4
[server] INFO: Retrying with -m1600...
INFO: New texture: 1200x1600
INFO: FPS counter started
INFO: 9 fps (+1 frames skipped)
INFO: 1 fps
INFO: 0 fps
INFO: 0 fps
INFO: 0 fps
INFO: 0 fps
INFO: 2 fps
INFO: 10 fps
INFO: 0 fps
INFO: 0 fps
INFO: 0 fps
INFO: 0 fps
INFO: 0 fps
INFO: 0 fps
INFO: 0 fps
INFO: 3 fps
INFO: 9 fps
Terminate batch job (Y/N)?
^C

vs

c:\ccdc\PortableApps\scrcpy>scrcpy --stay-awake --shortcut-mod=lctrl --serial 192.168.40.191:5555 --print-fps
scrcpy 2.4 https://github.com/Genymobile/scrcpy
INFO: ADB device found:
INFO: (tcpip) 192.168.40.121:5555 device LE2125
INFO: --> (tcpip) 192.168.40.191:5555 device Page
c:\ccdc\PortableApps\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 75.9 MB/s (69007 bytes in 0.001s)
[server] INFO: Device: [ONYX] ONYX Page (Android 11)
[server] ERROR: Given calling package android does not match caller's uid 2000
java.lang.SecurityException: Given calling package android does not match caller's uid 2000
at android.os.Parcel.createExceptionOrNull(Parcel.java:2374)
at android.os.Parcel.createException(Parcel.java:2358)
at android.os.Parcel.readException(Parcel.java:2341)
at android.os.Parcel.readException(Parcel.java:2283)
at android.app.IActivityManager$Stub$Proxy.getContentProvider(IActivityManager.java:5808)
at android.app.ActivityThread.acquireProvider(ActivityThread.java:6937)
at android.app.ContextImpl$ApplicationContentResolver.acquireProvider(ContextImpl.java:2912)
at android.content.ContentResolver.acquireProvider(ContentResolver.java:2470)
at android.provider.Settings$ContentProviderHolder.getProvider(Settings.java:2596)
at android.provider.Settings$NameValueCache.getStringForUser(Settings.java:2725)
at android.provider.Settings$Global.getStringForUser(Settings.java:13469)
at android.provider.Settings$Global.getString(Settings.java:13457)
at android.provider.Settings$Global.getInt(Settings.java:13662)
at android.hardware.input.InputManager.setupPointerNaturalRolling(InputManager.java:321)
at android.hardware.input.InputManager.registerPointerSettingObserver(InputManager.java:291)
at android.hardware.input.InputManager.(InputManager.java:283)
at android.hardware.input.InputManager.getInstance(InputManager.java:357)
at android.view.KeyCharacterMap.load(KeyCharacterMap.java:334)
at com.genymobile.scrcpy.Controller.(Controller.java:40)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:135)
at com.genymobile.scrcpy.Server.internalMain(Server.java:259)
at com.genymobile.scrcpy.Server.main(Server.java:214)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.am.ActivityManagerService.getContentProvider(ActivityManagerService.java:7715)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2425)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2926)
at android.os.Binder.execTransactInternal(Binder.java:1154)
at android.os.Binder.execTransact(Binder.java:1123)

INFO: Renderer: direct3d
ERROR: Demuxer 'video': stream disabled due to connection error
ERROR: Demuxer 'audio': stream disabled due to connection error
ERROR: Demuxer error

@AJolly
Copy link

AJolly commented May 13, 2024

Also its interesting: Almost everyone here is commenting about an Onyx ebook reader device.

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

6 participants