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

Blank screen on WSL 2 #2124

Closed
2 tasks done
khazidhea opened this issue Feb 16, 2021 · 10 comments
Closed
2 tasks done

Blank screen on WSL 2 #2124

khazidhea opened this issue Feb 16, 2021 · 10 comments

Comments

@khazidhea
Copy link

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

Environment

  • OS: Windows 10 with Ubuntu 20 under WSL 2 and VcXsrv
  • scrcpy version: 1.12.1
  • installation method: apt
  • device model: custom built tablet
  • Android version: 7.1.2

Describe the bug

First of all your product is amazing, thanks for making this.

My setup might be a bit unusual but it works for me. I'm running WSL with Ubuntu and I'm running VcXsrv natively on windows, any GUI that's supposed to render on Linux is rendered on VcXsrv.

After I successfully connect to the device using adb and I launch scrcpy I get a blank screen like this:

image

But my clicks go through - I'm able to open menu, launch apps and "go back" using right click, it all happens on the device, I just cant see it on my PC.

I also tried adb shell screenrecord, downloaded the video and it was just fine - I can see the screen in recording.

I'm wondering how I can further debug this issue.

Attaching a small long of what happens when I run scrcpy.

INFO: scrcpy 1.12.1 <https://github.com/Genymobile/scrcpy>
/usr/share/scrcpy/scrcpy-server: 1 file pushed. 0.2 MB/s (24773 bytes in 0.133s)
error: more than one device/emulator
ERROR: "adb reverse" returned with value 1
WARN: 'adb reverse' failed, fallback to 'adb forward'
INFO: Initial texture: 800x1280
@gaussandhisgun
Copy link

gaussandhisgun commented Feb 16, 2021

but why? scrcpy has native release on windows: https://github.com/Genymobile/scrcpy/releases/tag/v1.17

@svmmvsjs
Copy link

@khazidhea experiencing exactly the same bug, did you solve it?
@gaussandhisgun because we like to use a proper terminal 😬

@tf2cm
Copy link

tf2cm commented May 25, 2021

i saw same issue and i can detour this issue. if you have any solution, please tell me how.

android device connected by USB to linux desktop PC : A
but i can use only windows note PC : B
so i connect with ssh + X11 forwarding from B to A and trying to use scrcpy with X11 forwarding.
but this issue happens. i can control device with click but i can see only white screen.

help me how can i use scrcpy in my case.

@stefan-sherwood
Copy link

I see the same thing (WSL 2, scrcpy compiled in WSL, everything works except the picture is all white). It's also worth noting that the phone's screen sometimes shows in the scrcpy window for a brief instant on scrcpy startup before it is replaced with all white.

@Genymobile Genymobile deleted a comment from DanEdens Nov 22, 2021
@epiciskandar
Copy link
Contributor

why does this being closed? currently with usbipd, one can develop Android under WSL2 as same as native Linux environment (yes, we need linux environment, for business feature coding & QA systems), so scrcpy is quite normal running in WSL environment. @khazidhea

@stefan-sherwood
Copy link

This presently works for me in WSL2 w/VcXsrv. I'm not sure what changed since June.

  • Windows 10 v10.0.19044
  • Scrcpy 1.17
  • WSL2 running Ubuntu 20.04
  • adb connect 10.0.0.120:5555 (the IP address of my Android device)
  • export DISPLAY=$(ip route list default | awk '{print $3}'):0
  • Run VcXsrv, choose "Disable access control" in settings (otherwise I get "Connection refused" error)
  • Run scrcpy from WSL2 bash prompt

@stefan-sherwood
Copy link

Also works with Scrcpy 1.21 (everything else the same)

@epiciskandar
Copy link
Contributor

epiciskandar commented Jan 21, 2022

Thanks @stefan-sherwood , you let me know it is possible and mostly like it's WSL2 problem, not scrcpy.
after long time googleing and invesgating, finally found the real problem and works solution (just disable vcxsrv's native opengl).

@abubakarutar
Copy link

but why? scrcpy has native release on windows: https://github.com/Genymobile/scrcpy/releases/tag/v1.17

That is true, but some scrcpy features (such as OTG mode without USB debugging enabled) only work on the Linux version, and not the Windows version, due to platform limitations.

@nagyszabi
Copy link

nagyszabi commented Sep 3, 2023

I had the same problem, but I got a black screen with working controls.
After a lot of trial and error, what works for me is using scrcpy --force-adb-forward from Windows, while adb runs inside WSL2

EDIT: after some more tinkering, it seems that I need to start adb inside WSL2 with adb tcpip 5555

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

8 participants