samdudley
Posts: 2
Joined: Tue Jul 02, 2019 1:13 pm

Pi 4 Duplicating/Mirroring Displays

Tue Jul 02, 2019 2:15 pm

Hi All,

I've been using a Pi 4 and was looking into duplicating a display onto a projector. I couldn't find any information on here how to achieve this, so I thought I would create this post to help others.

Here's how I managed it:

Check the following line is in /boot/config.txt to allow two monitors:

Code: Select all

max_framebuffers=2
Mirror displays using:

Code: Select all

xrandr --output <projector> --same-as <desktop>
In my case <projector> was HDMI-2, and <desktop> was HDMI-1
To check the display names run

Code: Select all

xrandr --current
when both displays are attached.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27412
Joined: Sat Jul 30, 2011 7:41 pm

Re: Pi 4 Duplicating/Mirroring Displays

Tue Jul 02, 2019 2:18 pm

Another route is using the graphic screen setup tool, and put one display on top of the other. It's not obvious you can do that...but you can look on the two displays as one really big display, with the monitors being windows on to that huge display. You can overlap for example, or have a gap if space allows.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

samdudley
Posts: 2
Joined: Tue Jul 02, 2019 1:13 pm

Re: Pi 4 Duplicating/Mirroring Displays

Tue Jul 02, 2019 2:31 pm

Thanks that's a much simpler solution, I never tried overlapping the displays. It's also persistent over a reboot

NobleTotem
Posts: 1
Joined: Wed Feb 19, 2020 12:14 am

Re: Pi 4 Duplicating/Mirroring Displays

Wed Feb 19, 2020 12:20 am

Samdudley-- Thanks for your post. It's exactly what I've been trying to do. I cannot use the method Jamesh mentions, since I need a rasbian lite install without the graphical interface. The problem I have, though, is that either of the xrandr commands you list result in "Can't open display". Do you have any idea how to get around this? Been searching all afternoon and can't find the answer.
Thanks!

anthortic
Posts: 1
Joined: Mon Sep 30, 2013 4:47 pm

Re: Pi 4 Duplicating/Mirroring Displays

Mon May 11, 2020 10:43 am

Thank you for this really helpful tip!
I also am not running full raspbian

AbdullahSaei
Posts: 1
Joined: Sat Jul 04, 2020 2:28 pm

Re: Pi 4 Duplicating/Mirroring Displays

Sat Jul 04, 2020 2:40 pm

NobleTotem wrote:
Wed Feb 19, 2020 12:20 am
Samdudley-- Thanks for your post. It's exactly what I've been trying to do. I cannot use the method Jamesh mentions, since I need a rasbian lite install without the graphical interface. The problem I have, though, is that either of the xrandr commands you list result in "Can't open display". Do you have any idea how to get around this? Been searching all afternoon and can't find the answer.
Thanks!
If you are sshing your RPi you need to

Code: Select all

ssh <username>@<ip address> -X 
Don't forget the -X parameter. This will enable x11 forwarding and you should see results on xrandr instead of "Can't open display" error.

Return to “Beginners”