I tried screencap
utility to take screen shot of hdmi display, it is working fine as expected. The command is screencap -d 1 /sdcard/print.png
The screenrecord utility is not working for non-default displays.
I tried editing and recompiling the source of screenrecord, changed display id to eDisplayIdHdmi , still it records only main display content.
Can anyone explain/point to docs, how the mediaprojection and virtualDisplay are used to duplicate main display layers/contents ?