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

scrcpy crashes with NullPointerException displaying screen on TCL C805 Smart TV #5140

Closed
algrimes opened this issue Jul 26, 2024 · 2 comments

Comments

@algrimes
Copy link
Contributor

algrimes commented Jul 26, 2024

Environment

  • OS: macOS
  • Scrcpy version: 2.5
  • Installation method: brew
  • Device model: TCL C805 Smart TV
  • Android version: 12

Describe the bug

Reproduces on all valid codec/encoder combinations
Framework jar attached

scrcpy --video-codec=h264 --video-encoder='OMX.google.h264.encoder' -b2M --no-audio -m1024  
scrcpy 2.5 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     --> (tcpip)  192.168.x.xxx:5555              device  Smart_TV_Pro
/usr/local/Cellar/scrcpy/2.5/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 47.6 MB/s (69624 bytes in 0.001s)
[server] INFO: Device: [TCL] TCL Smart TV Pro (Android 12)
[server] ERROR: Exception on thread Thread[video,5,main]
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
	at android.media.MediaCodec.saveSetData(MediaCodec.java:2314)
	at android.media.MediaCodec.configure(MediaCodec.java:2345)
	at android.media.MediaCodec.configure(MediaCodec.java:2268)
	at com.genymobile.scrcpy.SurfaceEncoder.streamCapture(SurfaceEncoder.java:70)
	at com.genymobile.scrcpy.SurfaceEncoder.lambda$start$0$com-genymobile-scrcpy-SurfaceEncoder(SurfaceEncoder.java:257)
	at com.genymobile.scrcpy.SurfaceEncoder$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
	at java.lang.Thread.run(Thread.java:920)
INFO: Renderer: metal
ERROR: Controller error

framework.jar.zip

Scrcpy works on TCL C745 running android 11 with different processor, so possible to be confined to Android 12 devices with the new Mediatek pentonic 700 chip.

@algrimes algrimes reopened this Jul 26, 2024
@algrimes
Copy link
Contributor Author

some adb logcat output for the encoder :
--video-codec=h264 --video-encoder='c2.mtk.avc.encoder'

adb-logcat.txt

@algrimes
Copy link
Contributor Author

algrimes commented Jul 28, 2024

framework.jar MediaCodec is trying to obtain ActivityThread.currentPackageName() which is returning null, and calling equals on it.

algrimes added a commit to algrimes/scrcpy that referenced this issue Jul 28, 2024
@rom1v rom1v closed this as completed in f691ebb Aug 1, 2024
FreedomBen pushed a commit to FreedomBen/scrcpy that referenced this issue Aug 2, 2024
Gottox pushed a commit to Gottox/scrcpy that referenced this issue Sep 29, 2024
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

Successfully merging a pull request may close this issue.

1 participant