Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
104.87k stars 10.19k forks source link

Can it support another screenshot stream on android - secondary screen #397

Closed chaooe closed 4 years ago

chaooe commented 5 years ago
  1. Normaly we can capture screen 0 by 'adb shell screencap -p -d 0 /sdcard/sc.png', so if we have two or more display, we can use 'adb shell screencap -p -d ${displayid} /sdcard/sc.png', so can we have this supported?
rom1v commented 4 years ago

In your case you don't need scrcpy, the samsung app "Dex on Window", also available on Mac.

IIUC, this app allows to enable DeX without plugging the device via HDMI?

If this is the case, then it shows that it is possible to enable DeX programmatically. If someone knows how, it could be implemented in scrcpy :wink:

jvisser99 commented 4 years ago

In your case you don't need scrcpy, the samsung app "Dex on Window", also available on Mac.

IIUC, this app allows to enable DeX without plugging the device via HDMI?

If this is the case, then it shows that it is possible to enable DeX programmatically. If someone knows how, it could be implemented in scrcpy

I thought it was implemented in 1.13

rom1v commented 4 years ago

No, in scrcpy 1.13, a new option has been added to mirror a display other than the one having id 0.

It occurs that DeX creates such a secondary display when enabled, so scrcpy can mirror it.

nakele commented 4 years ago

@jvisser99 if u want to run Dex on PC you need to install Dex appliaction on your pc as well, plug the cable to phone, wait to say it's connected and you should get a window dex on your pc monitor. No needed for for anythingelse. HoWEVER scrcpy could be used to mirror dex on devices that don't support Dex on PC like the S8/Note8 line + S9/Note9 on Android 9. First you need to trigger Dex via HDMI cable or HDMI dummy plug (my case), then use scrcpy via WiFi (because your port will be used for the HDMI) In your case you don't need scrcpy, the samsung app "Dex on Window", also available on Mac.

I'm running linux on my laptop

Ah, I suspected that. I believe wine won't work with Samsung Dex on PC.

nakele commented 4 years ago

In your case you don't need scrcpy, the samsung app "Dex on Window", also available on Mac.

IIUC, this app allows to enable DeX without plugging the device via HDMI?

If this is the case, then it shows that it is possible to enable DeX programmatically. If someone knows how, it could be implemented in scrcpy 😉

It's possible, definitely. 2 things comes to mind, if not 3: Dex on PC will trigger dex programmatically, Dex on a Tab has a toggle to show DeX on the tablet itself, so no hdmi required. Lastly someone has seen Dex Wireless options (might be a thing in the future)

webian commented 4 years ago

There's also this thread in Samsung forum where a moderator says, in October 2018, that they are "working on a wireless connection for DEX but a few improvements need to be made first". If you want you can add your post to the thread so they know how much this feature is requested.

rom1v commented 4 years ago

I don't have any DeX device. Could you please check if enabling dex with "Dex on Windows" changes settings:

# with dex disabled
adb shell "settings list global | sort" > global.txt
adb shell "settings list secure | sort" > secure.txt
adb shell "settings list system | sort" > system.txt
# with dex enabled
adb shell "settings list global | sort" > global_dex.txt
adb shell "settings list secure | sort" > secure_dex.txt
adb shell "settings list system | sort" > system_dex.txt
# compare
diff -U3 global.txt global_dex.txt
diff -U3 secure.txt secure_dex.txt
diff -U3 system.txt system_dex.txt
webian commented 4 years ago

These are the diffs before/after connecting my Galaxy S10e with USB cable and starting Dex on PC:

timerickson commented 3 years ago

A couple more datapoints:

0x15f2d commented 1 year ago

I hope this method works better because I have 2 devices that either can't encode video properly (old phone) or doesn't have a codec to encode video (watch, can decode some webm).