Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
110.97k stars 10.63k forks source link

No screen, Encoding error on SDMC android box #5408

Closed aggo1036 closed 2 hours ago

aggo1036 commented 3 hours ago

Environment

BUG. Screen is not rendering. [server] ERROR: Encoding error: java.lang.IllegalStateException: null

Description. Wireless debugging is hidden from the supplier. So instead ADB WiFi 3.3.160 was installed through USB and set as autostart on boot. I can now seemingly connect as if wireless debugging was installed/enabled. When accept adb connection the screen is shown as "USB Debugging" if that is of any interest.

Terminal output in a code block.

C:\Users\.....\Desktop\scrcpy-win64-v2.7>scrcpy --video-codec=h265 --max-size=1920 --max-fps=60 --no-audio --keyboard=uhid
scrcpy 2.7 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     --> (tcpip)  192.168.50.97:5555              device  Telia_Nordic_STB
C:\Users\.....\Desktop\scrcpy-win64-v2.7\scrcpy-server: 1 file pushed, 0 skipped. 82.7 MB/s (71200 bytes in 0.001s)
[server] INFO: Device: [SDMC] Telia Telia Nordic STB (Android 12)
INFO: Renderer: direct3d
INFO: Texture: 1920x1080
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] INFO: Retrying with -m1600...
[server] INFO: Retrying...
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] INFO: Retrying with -m1280...
[server] INFO: Retrying...

If I just go "scrcpy -m640" everything comes to a halt at INFO: Texture: 640x360 same as before. Any ideas of where to go from here?

rom1v commented 3 hours ago

You can try with another encoder: https://github.com/Genymobile/scrcpy/blob/master/doc/video.md#encoder

aggo1036 commented 3 hours ago

You can try with another encoder: https://github.com/Genymobile/scrcpy/blob/master/doc/video.md#encoder

This is what I got

C:\Users\.....\Desktop\scrcpy-win64-v2.7\scrcpy-server: 1 file pushed, 0 skipped. 46.4 MB/s (71200 bytes in 0.001s)
[server] INFO: Device: [SDMC] Telia Telia Nordic STB (Android 12)
[server] INFO: List of video encoders:
    --video-codec=h264 --video-encoder='OMX.amlogic.video.encoder.avc'
    --video-codec=h264 --video-encoder='c2.android.avc.encoder'
    --video-codec=h264 --video-encoder='OMX.google.h264.encoder'
    --video-codec=h265 --video-encoder='OMX.amlogic.video.encoder.hevc'
[server] INFO: List of audio encoders:
    --audio-codec=opus --audio-encoder='c2.android.opus.encoder'
    --audio-codec=aac --audio-encoder='c2.android.aac.encoder'
    --audio-codec=aac --audio-encoder='OMX.google.aac.encoder'
    --audio-codec=flac --audio-encoder='c2.android.flac.encoder'
    --audio-codec=flac --audio-encoder='OMX.google.flac.encoder'
aggo1036 commented 3 hours ago

Thanks it worked now! Lower fps and size for better experience over low bandwidth.

scrcpy --video-codec=h264 --video-encoder=c2.android.avc.encoder --max-size=860 --max-fps=30 --no-audio --keyboard=uhid
scrcpy --video-codec=h264 --video-encoder=OMX.google.h264.encoder --max-size=860 --max-fps=30 --no-audio --keyboard=uhid
aggo1036 commented 2 hours ago

Solved.