Genymobile / Genymobile/scrcpy

Exception on thread Thread

Open
#3,373 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
150k
Forks
13.7k
Avg merge
4d 13h
Merged PRs (30d)
2

Description

**Environment**
- OS: Ubuntu 22.04
- scrcpy version: 1.21-1
- installation method: apt
- device model:CPH2381
- Android version: 12

**Describe the bug**
I was just trying the tool, but i have having error.

```
➜ Desktop scrcpy
scrcpy 1.21
* daemon not running; starting now at tcp:5037
* daemon started successfully
/usr/share/scrcpy/scrcpy-server: 1 fil...shed. 3.5 MB/s (39473 bytes in 0.011s)
[server] INFO: Device: OnePlus CPH2381 (Android 12)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 22.0.1
INFO: Trilinear filtering enabled
INFO: Initial texture: 1080x2408
WARN: Device disconnected
[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.IllegalArgumentException
at android.media.MediaCodec.native_configure(Native Method)
at android.media.MediaCodec.configure(MediaCodec.java:2176)
at android.media.MediaCodec.configure(MediaCodec.java:2092)
at com.genymobile.scrcpy.ScreenEncoder.configure(ScreenEncoder.java:233)
at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:86)
at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:65)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:93)
at com.genymobile.scrcpy.Server.main(Server.java:309)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:391)
WARN: Killing the server...
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the failure with scrcpy 1.21 from apt on Ubuntu 22.04 and the listed OnePlus CPH2381 running Android 12. Read the server stack around ScreenEncoder.configure() and the MediaCodec.configure() call. Done means identifying why the encoder disconnects and preventing the reported exception, with a verification run showing successful mirroring.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, c, java
Domain
mobile-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.