scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

Suddenly terminating with error "Exception on thread.."

Open doncorso opened this issue 3 years ago • 2 comments

Hello, at first: thank you for this great tool. I have a Xiaomi Mi A1 with LineAge on Android 11 connected to a Dell-Notebook with Windows 11

I am connecting with these command:

scrcpy.exe -m 1366 --window-borderless -f --encoder OMX.google.h264.encoder

with default encoder connections doesnt work, with this encoder mentioned above, it works, when I start the command twice.

running it, shows

C:\scrcpy-win64-v1.24>scrcpy.exe` -m 1366 --window-borderless -f --encoder OMX.google.h264.encoder
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
C:\scrcpy-win64-v1.24\scrcpy-server: 1 file pushed, 0 skipped. 25.7 MB/s (41159 bytes in 0.002s)
[server] INFO: Device: Xiaomi Mi A1 (Android 11)
INFO: Renderer: direct3d
INFO: Initial texture: 1360x768

then, I open a new cms-windows running the same command brings up the android-Screen perfectly printing this:

C:\scrcpy-win64-v1.24>scrcpy.exe -m 1366 --window-borderless -f --encoder OMX.google.h264.encoder scrcpy 1.24 <https://github.com/Genymobile/scrcpy> C:\scrcpy-win64-v1.24\scrcpy-server: 1 file pushed, 0 skipped. 27.3 MB/s (41159 bytes in 0.001s) [server] INFO: Device: Xiaomi Mi A1 (Android 11) INFO: Renderer: direct3d INFO: Initial texture: 1360x768

Then it works flawless ten minutes, sometimes 30, sometimes an hour or more, but suddenly the mirrored screen closes and cmd is printing `[server] ERROR: Encoding error: java.lang.IllegalStateException: null [server] ERROR: Exception on thread Thread[main,5,main]WARN: Device disconnected

java.lang.IllegalStateException at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method) at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:3452) at com.genymobile.scrcpy.ScreenEncoder.encode(ScreenEncoder.java:152) at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:102) at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:74) at com.genymobile.scrcpy.Server.scrcpy(Server.java:101) at com.genymobile.scrcpy.Server.main(Server.java:335) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399) ` Maybe, someone can help me, or point me to the right direction

Thanks in advance

Don

doncorso avatar Nov 17 '22 16:11 doncorso

Looks like #3051.

rom1v avatar Nov 17 '22 16:11 rom1v

Looks like #3051.

yes, seems to be the same. But I can´t see a solution for my Mi A1. I am using lineage 19.1 because there are no updates from xiaomi.

Thanks in advance

Don

doncorso avatar Nov 18 '22 07:11 doncorso