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

Fail to remotely use scrcpy from MacOS to access the Pixel device connected with Ubuntu host #4885

Open
2 tasks
Songchunbo opened this issue Apr 24, 2024 · 2 comments

Comments

@Songchunbo
Copy link

Songchunbo commented Apr 24, 2024

  • I have read the FAQ.
  • I have searched in existing issues.

Environment

  • OS: [ubuntu, macOS...]
  • scrcpy version: 2.4
  • installation method: [manual build]
  • device model: pixel
  • Android version: [8.1.0]

Describe the bug

I have a Ubuntu host directly connected to a Pixel device via usb cable. It's normal to use scrcpy from the Ubuntu console. When connected, the console displays the following.

$ scrcpy
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)  FA68Yxxxxxxx                    device  AOSP_on_msm8996
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 1.8 MB/s (69007 bytes in 0.036s)
[server] INFO: Device: [google] Android AOSP on msm8996 (Android 8.1.0)
[server] WARN: Audio disabled: it is not supported before Android 11
INFO: Renderer: opengl
INFO: OpenGL version: 3.1 Mesa 21.2.6
INFO: Trilinear filtering enabled
WARN: Demuxer 'audio': stream explicitly disabled by the device
INFO: Texture: 1080x1920

When I SSH into the Ubuntu host from MacOS via iTerm and then try to use scrcpy, it complains with the following errors.

$ scrcpy
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
ERROR: Could not initialize SDL video: No available video device
ERROR: Could not start adb server

So, is it possible to remotely use scrcpy from MacOS to access the Pixel device connected with Ubuntu host? or some packages I missed in MacOS?

@Songchunbo Songchunbo changed the title Fail to remotely use scrcpy from MacOS to access the Pixel device connected to Ubuntu host Fail to remotely use scrcpy from MacOS to access the Pixel device connected with Ubuntu host Apr 24, 2024
@rom1v
Copy link
Collaborator

rom1v commented Apr 24, 2024

Over SSH, you won't have a display by default. Even if you forwarded display via SSH (ssh -X), this is not what you want: you want to transmit the compressed video stream, not the image to display.

For that purpose, read https://github.com/Genymobile/scrcpy/blob/master/doc/tunnels.md#ssh-tunnel

@Songchunbo
Copy link
Author

Songchunbo commented Apr 25, 2024

Thanks, rom1v. I think SSH tunnel forward is correct way in my scenario.

I followed the SSH tunnel guide and made the tests with a Pixel device. However, the connection appears to be unstable.
Initially, the device screen is displayed correctly during the first two attempts, but subsequent tries result in it being blocked. Is there any log to check the block reason?

****************************first try********************************

(base) % export ADB_SERVER_SOCKET=tcp:localhost:5038
(base)  % scrcpy
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)  FA68R0309644                    device  Pixel
/opt/homebrew/Cellar/scrcpy/2.4/share/scrcpy/scrcpy-server: 1 file pushed. 3.5 MB/s (69007 bytes in 0.019s)
[server] INFO: Device: [Google] google Pixel (Android 10)
[server] WARN: Audio disabled: it is not supported before Android 11
INFO: Renderer: metal
WARN: Demuxer 'audio': stream explicitly disabled by the device
INFO: Texture: 1080x1920
^CWARN: Device disconnected


****************************second try********************************
(base)  % scrcpy
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)  FA68R0309644                    device  Pixel
/opt/homebrew/Cellar/scrcpy/2.4/share/scrcpy/scrcpy-server: 1 file pushed. 2.3 MB/s (69007 bytes in 0.029s)
[server] INFO: Device: [Google] google Pixel (Android 10)
[server] WARN: Audio disabled: it is not supported before Android 11
INFO: Renderer: metal
WARN: Demuxer 'audio': stream explicitly disabled by the device
INFO: Texture: 1080x1920
^CWARN: Device disconnected

****************************third try********************************
(base)  % scrcpy
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)  FA68R0309644                    device  Pixel
/opt/homebrew/Cellar/scrcpy/2.4/share/scrcpy/scrcpy-server: 1 file pushed. 3.1 MB/s (69007 bytes in 0.021s)
[server] INFO: Device: [Google] google Pixel (Android 10)
[server] WARN: Audio disabled: it is not supported before Android 11

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

No branches or pull requests

2 participants