User avatar
HermannSW
Posts: 1780
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Pi4B dual displays

Tue Jan 14, 2020 9:38 pm

I have a Pi4B since few months, but never connected two displays to it.
After rearranging computer room, 22" HDMI0, 42" HDMI1 and 7" DPI monitors are directly connected to Pi4B:
https://twitter.com/HermannSW/status/12 ... 6467937281

I have read that there is only one framebuffer in console mode, and booting into console mode showed console mirrored on both displays.

Next I did boot into X11, with this .xsessionc (HDMI0 and HDMI1 seem to be named HDMI-1 and HDMI-2 in X11):

Code: Select all

xrandr --output HDMI-1 --mode 1360x768
xrandr --output HDMI-2 --mode 1024x768

I took a screenshot with "scrot" and got this 1920+1024=2944 × 768 image.
Left top of HDMI-1 is (0.0), left top of HDMI-2 is (1920,0):
Image


Then I used "Preferences -> Screen Configuration" and was able to modify position of HDMI-2.
This 3472x2200 screenshot shows HDMI-1 top left and HDMI-2 bottom right:
Image


Finally I did:

Code: Select all

xclock -update 1 -geometry 3455x2150+5+5
And via ssh session took screenshot:

Code: Select all

$ DISPLAY=:0 scrot
$
There are few pixels above, right, below and left of the captured 3455x2150 xclock:
Image
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

Daniel Gessel
Posts: 91
Joined: Sun Dec 03, 2017 1:47 am
Location: Boston area, MA, US
Contact: Website Twitter

Re: Pi4B dual displays

Tue Jan 14, 2020 9:55 pm

Is the second case demonstrating a huge framebuffer, much of which is not displayed on either screen?

User avatar
HermannSW
Posts: 1780
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Pi4B dual displays

Tue Jan 14, 2020 10:16 pm

Daniel Gessel wrote:
Tue Jan 14, 2020 9:55 pm
Is the second case demonstrating a huge framebuffer, much of which is not displayed on either screen?
Yes, only small top left and bottom right parts of xclock were visible on 1360x760 and 1024x768 HDMI displays.

This method basically allows to shoot arbitrary large screenshots.
I have not tested whether there are limits on X11 root window size that can be defined with moving HDMI-2 very far right and bottom with "Screen Configuration".
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

Daniel Gessel
Posts: 91
Joined: Sun Dec 03, 2017 1:47 am
Location: Boston area, MA, US
Contact: Website Twitter

Re: Pi4B dual displays

Tue Jan 14, 2020 10:25 pm

But that means, other than huge screenshots, there’s a ton of framebuffer being filled and not displayed? Or is the large framebuffer allocated and rendered only for the screenshot? Curious...

User avatar
HermannSW
Posts: 1780
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Pi4B dual displays

Tue Jan 14, 2020 10:45 pm

Daniel Gessel wrote:
Tue Jan 14, 2020 10:25 pm
But that means, other than huge screenshots, there’s a ton of framebuffer being filled and not displayed?
Yes, and "scrot" or "xwd" can capture the whole root window.

I just tested "Screen Configuration" tool, and maximal value in both directions is 7680.
I was able to capture screenshot of 7680x768 root window.
And of 1360x7680 root window.

There is a memory limit, but I was able to create a 4496x4224 root window with "Screen Configuration".
Setting "View" to "1:16" is helpful.
I determined root window size by:
  • run "xwininfo" command
  • move mouse cursor outside of both HDMI displays
  • click left
Here you can see part of 4496x4224 (18.1MP) screenshot with the details.
Taking (uncompressed) screenshot with "xwd" shows that similar to console /dev/fb0 there are 4 bytes per pixel:

Code: Select all

pi@raspberrypi4B:~ $ DISPLAY=:0 xwd -root > x.xwd
pi@raspberrypi4B:~ $ 
pi@raspberrypi4B:~ $ ls -l x.xwd 
-rw-r--r-- 1 pi pi 75967595 Jan 14 23:54 x.xwd
pi@raspberrypi4B:~ $ bc -ql
75967595/(4496*4224)
4.00016739416518386714

P.S:
No need for graphic tool, "xrandr" is sufficient to query current settings, as well as to set new values.
Even after reboot the high settings are fragile and not always recreatable.
But 5000x5000 is possible:

Code: Select all

pi@raspberrypi4B:~ $ DISPLAY=:0 xrandr | head -1
Screen 0: minimum 320 x 200, current 4496 x 4224, maximum 7680 x 7680
pi@raspberrypi4B:~ $ sudo reboot 0
Connection to 192.168.178.178 closed by remote host.
Connection to 192.168.178.178 closed.
$ ssh pi@192.168.178.178
...
pi@raspberrypi4B:~ $ DISPLAY=:0 xrandr --fb 5000x5000
pi@raspberrypi4B:~ $ DISPLAY=:0 xrandr | head -1
Screen 0: minimum 320 x 200, current 5000 x 5000, maximum 7680 x 7680
pi@raspberrypi4B:~ $ 
Attachments
4496x4224.png.jpg
4496x4224.png.jpg
4496x4224.png.jpg (164.54 KiB) Viewed 168 times
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

Return to “Graphics, sound and multimedia”