-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Added display-id option to mirror displays that are not displayId=0 #1223
Conversation
This allows the correct geometry to be grabbed and the layout stack to be derived from the display info itself.
Replace layout stack option with better device id option.
Just realised that there's a very similar PR happening that's doing pretty much exactly the same thing as this one. If there's still ongoing work on that PR I'll just shelve this for now. |
Yes, and there is work to correctly handle input events with another display-id. Could you review/test #1177, please? (I have no device with several ids, I can only review the code without testing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get it to work on a device I have here unfortunately.
./run x --display 1
java.lang.AssertionError: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
at com.genymobile.scrcpy.wrappers.DisplayManager.getDisplayInfo(DisplayManager.java:26)
at com.genymobile.scrcpy.Device.computeScreenInfo(Device.java:52)
at com.genymobile.scrcpy.Device.<init>(Device.java:31)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:19)
at com.genymobile.scrcpy.Server.main(Server.java:166)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:338)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
at com.genymobile.scrcpy.wrappers.DisplayManager.getDisplayInfo(DisplayManager.java:18)
... 6 more
I believe this PR, similar to the other PR, needs the display to have the |
Is it possible to "simulate" is some way a secondary display-id? |
Both Displays have the FLAG_SUPPORTS_PROTECTED_BUFFERS :( |
Hello @mmbossoni . What API level do you have on your device? If it is 29, then could you please test #1177 for input events on primary and secondary display? |
@peanutwolf EDIT: Although my device has 2 screens, only one is being listed on the android API. Bad luck. :( |
@mmbossoni thank you for your test. |
@peanutwolf, when I run it with display 1 scrcpy give me the AssertionError (NPE) and suggest the use of display 0. (For this PR #1223 (review)) I made a small android app that just list the displays, but DisplayManager only return 1 display, so that must be the problem. Display info:
|
Hey @peanutwolf, just passing by to tell that after restarting my adb as root I got both, screen and input working on display 1. |
#1238 has been merged. |
Added display-id option so devices with multiple displays can be mirrored.