Open haunma opened 10 months ago
Yes, the problem is on the device, it means that MediaCodec does not produce any frame for some reason.
So that is basically the end of debugging, then? It just doesn't work for reasons unknown and unknow-able? This just reinforces my prejudice of Android as a steaming pile of **** that we basically treat as non-deterministic because almost nobody understands it deeply enough to problem-solve in the traditional sense :(
This is a Wayland / Scrpy problem and has nothing to do with Android. You can work round it by calling SDL_VIDEODRIVER=x11 scrcpy
to force it back to X11.
There is already an issue about it here: https://github.com/Genymobile/scrcpy/issues/3431
This is a Wayland / Scrpy problem and has nothing to do with Android.
I usually try not to be snarky, but, wow, did you actually read the subject line on this bug report? I am using X, not Wayland. So unless there is a different bug in scrcpy, this does in fact appear to be an Android problem.
@haunma Btw, does it work with screenrecord?
adb shell screenrecord /sdcard/file.mp4
adb pull /sdcard/file.mp4
@rom1v, as mentioned in the initial bug report, it is hit or miss. I was able to get a brief recording a couple of times, but it doesn't always work, often leaving a zero-length file.
My phone is old (Moto Z Play) and running LineageOS Android 18.1. I imagine there is something odd about it. Chalk it up to Android fragmentation? Anyway, my use case for scrcpy has passed, for now. Maybe next time I need something like that I will give it another go.
If you're reasonably confident the issue is on the device, I have no objections to closing this.
Environment
After using the scrcpy --otg trick to authorize my phone with adb (the phone screen is dead), I am able to run scrcpy. The default codec fails with java.lang.IllegalStateException in MediaCodec, but the output of scrcpy --list-encoders gives
and some of these are working. Or at least, they seem to be working. I get no errors or problems indicated in the scrcpy output even at "verbose" level, but no window opens. Typical output is
I have tried
adb shell screenrecord /sdcard/file.mp4
and that works---at least sometimes. It only seems to work when I run it right after unlocking the phone (with fingerprint sensor), otherwise I get a zero length file. I try to run scrcpy the same way but still no luck. Tried all the codecs. Tried various resolutions. Same result: apparent success in every respect except no video.Also,
scrcpy --video-codec=h264 --video-encoder='OMX.google.h264.encoder' --no-audio --record=file.mkv --no-playback
seems to work when run but the video file is always zero length. I initially thought the problem could be with my tiling window manager but this seems to indicate that there really is no encoded video coming through the pipe. Correct?