Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
111.82k stars 10.7k forks source link

Not all cameras are showing up on the Samsung Galaxy S24 Ultra #5304

Closed ImAtWork420 closed 1 month ago

ImAtWork420 commented 1 month ago

Environment

Describe the bug

when i use scrcpy --list-cameras i only get 4 camras (2 in front, 2 in back), but the phone has 4 in back. 0 to 3 works fine, and i can iven use id 4.

scrcpy --list-cameras
scrcpy 2.7 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     --> (tcpip)  192.168.1.240:5555              device  SM_S928B
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 89.4 MB/s (71200 bytes in 0.001s)
[server] INFO: Device: [samsung] samsung SM-S928B (Android 14)
[server] INFO: List of cameras:
    --camera-id=0    (back, 4080x3060, fps=[10, 11, 15, 24, 30, 60])
    --camera-id=1    (front, 4000x3000, fps=[10, 15, 24, 30, 60])
    --camera-id=2    (back, 4000x3000, fps=[10, 15, 24, 30, 60])
    --camera-id=3    (front, 3392x2544, fps=[10, 15, 24, 30, 60])
rom1v commented 1 month ago

See discussions in #4392 about logical cameras.

ImAtWork420 commented 1 month ago

I think there’s a misunderstanding. The four cameras that show up are working fine, including camera ID=4. However, the phone has four cameras on the back, not just two. Sorry for not being clear about that.

scrcpy --video-source=camera --camera-id=0 --no-audio --camera-fps=60 --camera-size=1920x1080
scrcpy 2.7 <https://github.com/Genymobile/scrcpy>
INFO: Camera video source: control disabled
INFO: ADB device found:
INFO:     --> (tcpip)  192.168.1.240:5555              device  SM_S928B
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 163.8 MB/s (71200 bytes in 0.000s)
[server] INFO: Device: [samsung] samsung SM-S928B (Android 14)
[server] INFO: Using camera '0'
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 24.0.9-0ubuntu0.1
INFO: Trilinear filtering enabled
INFO: Texture: 1920x1080
scrcpy --video-source=camera --camera-id=4 --no-audio
scrcpy 2.7 <https://github.com/Genymobile/scrcpy>
INFO: Camera video source: control disabled
INFO: ADB device found:
INFO:     --> (tcpip)  192.168.1.240:5555              device  SM_S928B
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 150.3 MB/s (71200 bytes in 0.000s)
[server] INFO: Device: [samsung] samsung SM-S928B (Android 14)
[server] INFO: Using camera '4'
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 24.0.9-0ubuntu0.1
INFO: Trilinear filtering enabled
INFO: Texture: 640x480
ImAtWork420 commented 1 month ago

I managed to get it to work by replacing CameraCapture.java and LogUtils.java with the same files from https://github.com/chenxiaolong/scrcpy/commits/phys. Then, I fixed a few errors, mostly by deleting if statements. I will attach the two modified files; I had to change the extension to .txt to be able to upload them. CameraCapture.txt LogUtils.txt

ImAtWork420 commented 1 month ago

By the way, rom1v, sorry for not reading your comment well enough.