Open xM0DI opened 11 hours ago
Is the camera app working on that device?
Try rebooting your device.
Yes I am able to use camera app on device. Tried reboot also but it didn't work. This is working in Scrcpy 2.7.
If you know how to build, could you find the culprit commit with git bisect
?
Does it work with a lower resolution -m 1024
? (even if it works, there's a bug, it should not fail without it but retry automatically)
Yes it works with -m1024, more over if we specifically provide size (which we get using list sizes) it works. So I am guessing it is not retrying smaller resolution as it used to do in 2.7.
scrcpy-win64-v2.7
[server] INFO: Device: [samsung] samsung SM-M315F (Android 12)
[server] INFO: Using camera '0'
INFO: Renderer: direct3d
INFO: Texture: 4624x3468
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] INFO: Retrying with -m2560...
[server] INFO: Retrying...
[server] WARN: Camera capture failed: frame 10
INFO: Texture: 2336x1080
On a tablet where the encoder cannot support the camera resolution, it fails and retry:
INFO: Texture: 3264x2448
[server] ERROR: Encoding error: android.media.MediaCodec$CodecException:
[server] INFO: Retrying with -m2560...
[server] ERROR: Encoding error: android.media.MediaCodec$CodecException:
[server] INFO: Retrying with -m1920...
So it behaves differently on your device.
Do you know how to build and use git bisect
to find which change introduce the problem on your device?
Another simpler test: I disabled retry on v2.7, so I will get the stack trace which triggers the retry.
Please replace this file in scrcpy 2.7:
scrcpy-server
SHA-256: a8abf08d7d0d2725fbc9b4ea38c12c6f7bc3afc7fcb09c6a714ad929d67e1d3
Environment
Describe the bug
When using scrcpy --video-source=camera --camera-id=0, it gives error. same happens with id=2 (back). Above command is working for other ids like 1 and 3 (front camera) etc. This is only happening in device running android 12. I have tested same command on Android 14 and it works as intended.