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

Desktop mode refuses to display properly or to run a launcher #16

Closed
UnsavedTrash opened this issue Jun 27, 2023 · 23 comments
Closed

Desktop mode refuses to display properly or to run a launcher #16

UnsavedTrash opened this issue Jun 27, 2023 · 23 comments

Comments

@UnsavedTrash
Copy link

Desktop OS: Arch Linux
Desktop details: RTX 3090, R7-5700x, NVIDIA driver 535.54.03
Mobile OS: GrapheneOS
Model: Pixel 7 Pro
SCRCPY Version: 2.1

Although the script does set all the right developer options and reboots the phone after the first run, it fails to actually engage a desktop environment. I have tried many configurations and a few different versions of Null keyboard1 as well as many different settings configurations of Taskbar. The secondary screen overlay does show and it gives me a slice of the view but never actually loads Taskbar.

I also get the error
Host system has incompatible settings. Sorry about that.

$ ./startscreen.sh 
Host system has incompatible settings. Sorry about that.
payload/stage1.sh: 1 file pushed, 0 skipped. 24.9 MB/s (881 bytes in 0.000s)
payload/stage2.sh: 1 file pushed, 0 skipped. 32.4 MB/s (1247 bytes in 0.000s)
scrcpy 2.1 <https://github.com/Genymobile/scrcpy>
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 700.6 MB/s (56955 bytes in 0.000s)
-----------------------------------------------------
|                                                   |
|  Please unlock the phone once the screen appears  |
|                                                   |
-----------------------------------------------------
SCRCPY PID: 82832
[server] INFO: Device: [Google] google Pixel 7 Pro (Android 13)
[server] WARN: Display doesn't have FLAG_SUPPORTS_PROTECTED_BUFFERS flag, mirroring can be restricted
INFO: USB device: 2B051FDH300DEP (18d1:4ee7) Google Pixel 7 Pro
INFO: Renderer: opengl
INFO: OpenGL version: 4.6.0 NVIDIA 535.54.03
INFO: Trilinear filtering enabled
INFO: Texture: 1080x2336
[server] INFO: Device screen turned off

The SCRCPY window opens in the standard resolution of the pixel as if I was running SCRCPY unmodified. The only difference being no ability to interact, see any apps, and the bottom third of the screen displays nothing.

image

If I attempt to expand the window it also shows no additional image to the left or right, although in the hovering overlay for the emulated second display when looking at the phone shows much more of the image. Despite the hovering 2nd display showing more of the image it still shows no Taskbar, just the wallpaper.

image

Phone POV
image

1 null keyboard is no longer available on google play so the read me may need updating.

@nikp123
Copy link
Owner

nikp123 commented Jun 28, 2023

From the preview it seems that it did load the desktop environment (albeit the stock one),
I think scrcpy may be incorrectly capturing the screen. Try to play around with scrcpy flags in order to get it to capture the screen properly.

The "The host system has incompatible settings" is the script not being able to get the native resolution of the phone. Since the code relies on shebang behavior, it is very likely something changed in the android terminal output.

Either way, thanks for the (very detailed) reporting, however I may not be available at the moment because I am studying for an exam.

@nikp123
Copy link
Owner

nikp123 commented Jun 28, 2023

Also please try launching this script with the resolution and density already set:
./startscreen.sh 1920x1080 120

@UnsavedTrash
Copy link
Author

running it like that yields identical behavior to what was initially reported.

$ ./startscreen.sh 1920x1080 120
* daemon not running; starting now at tcp:5037
* daemon started successfully
payload/stage1.sh: 1 file pushed, 0 skipped. 5.7 MB/s (881 bytes in 0.000s)
payload/stage2.sh: 1 file pushed, 0 skipped. 7.0 MB/s (1247 bytes in 0.000s)
scrcpy 2.1 <https://github.com/Genymobile/scrcpy>
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 142.1 MB/s (56955 bytes in 0.000s)
-----------------------------------------------------
|                                                   |
|  Please unlock the phone once the screen appears  |
|                                                   |
-----------------------------------------------------
SCRCPY PID: 5693
[server] INFO: Device: [Google] google Pixel 7 Pro (Android 13)
[server] WARN: Display doesn't have FLAG_SUPPORTS_PROTECTED_BUFFERS flag, mirroring can be restricted
INFO: USB device: 2B051FDH300DEP (18d1:4ee7) Google Pixel 7 Pro
INFO: Renderer: opengl
INFO: OpenGL version: 4.6.0 NVIDIA 535.54.03
INFO: Trilinear filtering enabled
INFO: Texture: 1080x2336
[server] INFO: Device screen turned off


@kinostl
Copy link

kinostl commented Jul 13, 2023

    ~/scrcpy-desktop    main    ./startscreen.sh     ✔ 
scrcpy 2.1 <https://github.com/Genymobile/scrcpy>
payload/stage1.sh: 1 file push...5.8 MB/s (881 bytes in 0.000s)
payload/stage2.sh: 1 file push....3 MB/s (1247 bytes in 0.000s)
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 212.0 MB/s (56955 bytes in 0.000s)
-----------------------------------------------------
|                                                   |
|  Please unlock the phone once the screen appears  |
|                                                   |
-----------------------------------------------------
SCRCPY PID: 43660
[server] INFO: Device: [Google] google Pixel 6a (Android 13)
INFO: USB device: 26101JEGR01982 (18d1:4ee7) Google Pixel 6a
[server] WARN: Display doesn't have FLAG_SUPPORTS_PROTECTED_BUFFERS flag, mirroring can be restricted
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 23.0.4
INFO: Trilinear filtering enabled
INFO: Texture: 1080x2400
[server] INFO: Device screen turned off

I am also experiencing this issue. It was working the day before yesterday, before I did my weekly computer updates, if that provides any hints.

Mobile OS: Stock
Linux OS: Manjaro 6.2.16-2

@nikp123
Copy link
Owner

nikp123 commented Jul 13, 2023

can you give me your /var/log/pacman.log i may find what might be the offending package @kinostl

@kinostl
Copy link

kinostl commented Jul 13, 2023

@nikp123 Sure thing. It includes a lot, it was a kernel update.

pacman.log

@nikp123
Copy link
Owner

nikp123 commented Jul 13, 2023

you upgraded scrcpy 2.0 -> 2.1, that may be our clue

@nikp123
Copy link
Owner

nikp123 commented Jul 13, 2023

Yep confirmed on scrcpy 2.1, we have the EXACT same issue.

@nikp123
Copy link
Owner

nikp123 commented Jul 13, 2023

It's weird though, sometimes it works and sometimes it doesn't.

@nikp123
Copy link
Owner

nikp123 commented Jul 13, 2023

Ok, narrowing it down a bit. It seems that scrcpy grabs the (wrong?) display. However if you launch a second instance it grabs the correct one.

@kinostl
Copy link

kinostl commented Jul 13, 2023

Activating a second instance does not fix it for me.
image

@nikp123
Copy link
Owner

nikp123 commented Jul 13, 2023

This is an upstream regression, since Android is reporting the correct "virtual resolution" via dumpsys display. Might have to file this over at scrcpy.

@nikp123
Copy link
Owner

nikp123 commented Jul 13, 2023

If you do adb shell 'dumpsys display | grep mDisplayId=' you'll get the active display IDs of your android device.
0 is always your primary, your phone's screen. The other ID is the virtual display, setting it via scrcpy --display $num, it recognizes the screen properly, but it fails to grab its resolution. This may be a bug on scrcpy's part as suggested by my previous comment.

@nikp123
Copy link
Owner

nikp123 commented Jul 13, 2023

There isn't much I can do apart from getting this fixed in upstream?

@kinostl
Copy link

kinostl commented Jul 13, 2023

For right now the advice to downgrade was useful enough for me. I just confirmed that downgrading fixes it on my end.

@nikp123
Copy link
Owner

nikp123 commented Jul 13, 2023

@kinostl can you try invoking scrcpy manually just to make sure that my behaviour of it fixing itself when running a second instance isn't a fluke. ie:

  • close all scrcpy instances
  • launch the script
  • then manually using adb shell 'dumpsys display | grep mDisplayId=' to grab the display ID
  • launch a second scrcpy with scrcpy --display $num

@nikp123
Copy link
Owner

nikp123 commented Jul 13, 2023

Already filed at Genymobile/scrcpy#4157
Seems that their crop thing is not up to snuff. I'll try making it work with the --crop parameter.

@kinostl
Copy link

kinostl commented Jul 13, 2023

@nikp123 I don't think I can replicate on my end.
image

@nikp123
Copy link
Owner

nikp123 commented Jul 13, 2023

Weird, I guess its a per machine behaviour.

@nikp123
Copy link
Owner

nikp123 commented Jul 13, 2023

Already filed at Genymobile/scrcpy#4157 Seems that their crop thing is not up to snuff. I'll try making it work with the --crop parameter.

--crop doesn't really help, it's still the wrong display resolution. We'll have to wait for an update from upstream.

@nikp123
Copy link
Owner

nikp123 commented Jul 14, 2023

Seems to be fixed in a future release, we just need to wait for it to get released.

@UnsavedTrash
Copy link
Author

I can also confirm that the downgrade to scrcpy 2.0.1 fixed the issue for me.

@nikp123
Copy link
Owner

nikp123 commented Jul 21, 2023

Scrcpy 2.1.1 fixes this. Closing.

@nikp123 nikp123 closed this as completed Jul 21, 2023
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

3 participants