aBUGSworstnightmare
Posts: 1498
Joined: Tue Jun 30, 2015 1:35 pm

Dual display support in legacy driver (HDMI + DSI on RPi3)

Sun Jul 21, 2019 8:25 am

Legacy display driver in latest Raspian BUSTER release has support for dual display. If you want to use it you will need to make a few addtional steps though because it doesn't run 'out-of-the-box'.

Here's a small how-to for DSI + HDMI.
1) prepare a fresh uSD, boot and configure (initial setting for WiFi,Keyboard, etc) using DSI display only
2) add below to your 'config.txt'

Code: Select all

dtparam=audio=off
disable_overscan=1

enable_uart=off
start_x=1

max_framebuffers=2

#  desktop display will default to the LCD (fb0)
# This will force the specified display to be the first in the list, i.e. /dev/fb0
# Actually this is the full set:
# MAIN_LCD  0
# AUX_LCD   1
# HDMI0     2
# SDTV      3
# HDMI1 is only availabe on RPi4
# HDMI1     7
framebuffer_priority=0

# increase GPU memory
gpu_mem=112
3) replace the /usr/share/X11/xorg.conf.d/99-fbturbo.conf contents with the contents below

Code: Select all

sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf

Code: Select all

# This is a minimal sample config file, which can be copied to
# /etc/X11/xorg.conf in order to make the Xorg server pick up
# and load xf86-video-fbturbo driver installed in the system.
# When troubleshooting, check /var/log/Xorg.0.log for the debugging
# output and error messages.
#
# Run "man fbturbo" to get additional information about the extra
# configuration options for tuning the driver.

#Section "Device"
#        Identifier      "Allwinner A10/A13 FBDEV"
#        Driver          "fbturbo"
#        Option          "fbdev" "/dev/fb1"
#        Option          "SwapbuffersWait" "true"
#EndSection


Section "Device"
        Identifier      "fbturbo0"
        Driver          "fbturbo"
        Option          "fbdev" "/dev/fb0"

        Option          "SwapbuffersWait" "true"
        Option          "debug" "true"
EndSection

Section "Device"
        Identifier      "fbturbo1"
        Driver          "fbturbo"
        Option          "fbdev" "/dev/fb1"

        Option          "SwapbuffersWait" "true"
        Option          "debug" "true"
EndSection

Section "Device"
        Identifier      "fbdev0"
        Driver          "fbdev"
        Option          "fbdev" "/dev/fb0"
EndSection

Section "Device"
        Identifier      "fbdev1"
        Driver          "fbdev"
        Option          "fbdev" "/dev/fb1"
EndSection

Section "Monitor"
    Identifier "Monitor0"
    Option "Primary" "False"
EndSection

Section "Monitor"
    Identifier "Monitor1"
    Option "RightOf" "Monitor0"
    Option "Primary" "False"
EndSection

Section "Screen"
    Identifier "ScreenTurbo0"
    Monitor "Monitor0"
    Device "fbturbo0"
    Subsection "Display"
    EndSubSection
EndSection

Section "Screen"
    Identifier "ScreenTurbo1"
    Monitor "Monitor1"
    Device "fbturbo1"
    Subsection "Display"
    EndSubSection
EndSection

Section "Screen"
    Identifier "ScreenDev0"
    Monitor "Monitor0"
    Device "fbdev0"
    Subsection "Display"
    EndSubSection
EndSection

Section "Screen"
    Identifier "ScreenDev1"
    Monitor "Monitor1"
    Device "fbdev1"
    Subsection "Display"
    EndSubSection
EndSection

Section "ServerLayout"
    Identifier "Multihead"
    Screen  0 "ScreenTurbo0"
    Screen  1 "ScreenTurbo1" rightof "ScreenTurbo0"
    Option  "Xinerama" "true"
EndSection

Section "ServerLayout"
    Identifier "Singlehead0"
    Screen  0 "ScreenTurbo0"
EndSection

Section "ServerLayout"
    Identifier "Singlehead1"
    Screen  0 "ScreenTurbo1"
EndSection

Section "ServerFlags"
    Option "BlankTime"  "0"
    Option "StandbyTime"  "0"
    Option "SuspendTime"  "0"
    Option "OffTime"  "0"
    Option "DefaultServerLayout" "Singlehead0"
EndSection
4.) reboot
5.) check if two framebuffer devices were created

Code: Select all

ls /dev/fb*
this should give you the output '/dev/fb0 dev/fb1'
fbtest.jpg
Checking if two frame buffer devices were created
fbtest.jpg (22.85 KiB) Viewed 1040 times
6) use raspi-config and select to boot to CLI and shutdown
8) connect your HDMI display and boot
9) at command line: start desktop with

Code: Select all

startx -- -layout Multihead
If everything is fine you should see your desktop spread across both displays
IMG_1026.jpg
dual display with legacy driver on RPi3: HDMI + DSI
IMG_1026.jpg (74.46 KiB) Viewed 1040 times

aBUGSworstnightmare
Posts: 1498
Joined: Tue Jun 30, 2015 1:35 pm

Dual display support in legacy driver (HDMI + DSI on RPi3) - Problems observed

Sun Jul 21, 2019 12:11 pm

Made further tests which include a CM3L setup as well.

Findings:
- Changing desktop background image
Changing the desktop background image on the 'fb1' framebuffer device is no longer possible (was possible during beta testing). Changing background image (right-click on desktop --> Desktop Preferences -> Picture only changes background on 'fb0' device (primary).

- Mouse pointer disappears
Mouse pointer sometimes disappears when mouse is moved to 'fb1' desktop. It was obserserved as well that mouse pointer is flickering sometime. If that happens mouse isn't displayed on 'fb1' desktop too. Quite frequent noted when connected from VNC viewer. Closing VNC viewer will not solve the problem; solvable only by reboot.

- mouse movement on 'fb1' device sometimes erratic
Moving the mouse between 'fb0' and 'fb1' results sometimes in erratic mouse movements on 'fb1' device (i.e. moving right to left all the time let's the mouse suddenly move up/down on 'fb1'

- 'hdmi_edid_file=1' command in config.txt fails
Extracted the EDID data of the monitor into a file. Added command above and rebooted the OS. Display on HDMI monitor ('fb'1 in this test) is incorrect (wrong resolution selected'). Legacy driver used standard (XGA) and not detailed timing from edit-file.
IMG_1027.jpg
EDID data from 'edit.dat' file is parsed incorrectly
IMG_1027.jpg (98.25 KiB) Viewed 1009 times
IMG_1028.jpg
detail view of the HDMI display; OS configured it to XGA resolution
IMG_1028.jpg (73.17 KiB) Viewed 1009 times
Note: EDID is parsed correctly when using this command in config.txt with new driver enabled (but HDMI as only display!).

Question: how to force a specfic timing to be used from EDID.dat file (as there can be several)?

KaraokeAmerica
Posts: 4
Joined: Wed Jul 10, 2019 2:52 pm

Re: Dual display support in legacy driver (HDMI + DSI on RPi3)

Tue Aug 27, 2019 6:20 pm

aBUGSworstnightmare wrote:
Sun Jul 21, 2019 8:25 am
Legacy display driver in latest Raspian BUSTER release has support for dual display. If you want to use it you will need to make a few addtional steps though because it doesn't run 'out-of-the-box'.
.
.
.
If everything is fine you should see your desktop spread across both displays
So........this worked for me on a Pi3B+! Awesome!

Since it doesn't specify what happens after the first boot, though, will this adjustment stick? Can I switch it back to booting to the GUI and will it simply "work" going forward if the second screen is plugged in?

aBUGSworstnightmare
Posts: 1498
Joined: Tue Jun 30, 2015 1:35 pm

Re: Dual display support in legacy driver (HDMI + DSI on RPi3)

Wed Aug 28, 2019 4:23 am

Your primary screen should be DSI 7in display.
The driver will create frame buffer device for both of your screens, even when HDMI monitor is not connected.
If you always use the same HDMI screen you can add options for its resolution (hdmi_mode and hdmi_group) together with 'hdmi_force_hotplug=1'to your config.txt. This will allow you to connect the display at any time.

bs_pi
Posts: 24
Joined: Tue May 16, 2017 9:26 am

Re: Dual display support in legacy driver (HDMI + DSI on RPi3)

Fri Oct 04, 2019 4:37 pm

Hi,
This thread is HDMI + DSI for RPi3, but does it also work for RPi4? I was expecting that the RPi 4 would support HDMI + DSI out of the box but it does not. If I connect monitor to one of the HDMI ports and I have an DSI touchscreen, only the DSI shows on the Screen layout editor. Is this normal? Is the configuration changes suggested here the only way to support both outputs also on the RPi 4?
Thank you for your help!

User avatar
pi-tastic
Posts: 166
Joined: Mon Jul 29, 2019 6:34 pm

Re: Dual display support in legacy driver (HDMI + DSI on RPi3)

Fri Oct 04, 2019 4:55 pm

maybe they could add an option in the Raspberry Pi config application?

eg. DSI + Dual Screen ENABLE / DISABLE

why lines and lines of code?

maybe add swap file option as well.

eg. Swap File - 100m 1024m 2048m with radio buttons.
maccaps.com - bringing life to dead electronics.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7431
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Dual display support in legacy driver (HDMI + DSI on RPi3)

Fri Oct 04, 2019 4:56 pm

bs_pi wrote:
Fri Oct 04, 2019 4:37 pm
Hi,
This thread is HDMI + DSI for RPi3, but does it also work for RPi4? I was expecting that the RPi 4 would support HDMI + DSI out of the box but it does not. If I connect monitor to one of the HDMI ports and I have an DSI touchscreen, only the DSI shows on the Screen layout editor. Is this normal? Is the configuration changes suggested here the only way to support both outputs also on the RPi 4?
Thank you for your help!
The Pi4 does support HDMI0 + DSI out of the box, but not HDMI1 + DSI due to internal plumbing within the SoC. Please ensure you use the right HDMI connector.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7431
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Dual display support in legacy driver (HDMI + DSI on RPi3)

Fri Oct 04, 2019 5:00 pm

pi-tastic wrote:
Fri Oct 04, 2019 4:55 pm
maybe they could add an option in the Raspberry Pi config application?

eg. DSI + Dual Screen ENABLE / DISABLE

why lines and lines of code?

maybe add swap file option as well.

eg. Swap File - 100m 1024m 2048m with radio buttons.
The described way of doing this is only applicable to the legacy drivers, and is hideously inefficient in the way it splits the screen drawing between the two frame buffer devices.

The better way to achieve this is to use DRM/KMS, as is the default on Pi4. DRM/KMS renders a single framebuffer for the combined desktop, and then tells each display which bit to show. The one gotcha with this on Pi3 or below is that the 3D hardware is limited to a target frame buffer of a maximum 2048x2048. If your HDMI screen is 1920x1080, then you can't do side by side displays when extending your desktop as you run out of width :( One above the other will work.
(The Pi4 can render to up to 8192x8192, so dual 4k side by side still fits).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

aBUGSworstnightmare
Posts: 1498
Joined: Tue Jun 30, 2015 1:35 pm

Re: Dual display support in legacy driver (HDMI + DSI on RPi3)

Sat Oct 05, 2019 7:08 am

A FHD monitor (1920x1080pixels) in portrait mode with a DSi (SVGA. = 800x480pixels) in landscape should not brake the HW limit of a RPi3 3D framebuffer size (also valid for 2WXGA in portrait i.e.).

As the first post was resulting from tests wirh an earlier Buster release I still have to repeat it on latest.

So far I was unable to get dual display on RPI3 running FMKS driver (I think mainly caused by EDID issues).

bs_pi
Posts: 24
Joined: Tue May 16, 2017 9:26 am

Re: Dual display support in legacy driver (HDMI + DSI on RPi3)

Mon Oct 07, 2019 8:46 am

Thank you @6by8, you are right, connecting the HDMI cable to the other port did the trick. However on the 'Screen Layout Editor' there is no option to have cloned screen, the only option is an extended desktop. Is there any way in which I could have both screens (HDMI and DSI) a cloned screen?
Thank you for your help.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7431
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Dual display support in legacy driver (HDMI + DSI on RPi3)

Mon Oct 07, 2019 9:07 am

bs_pi wrote:
Mon Oct 07, 2019 8:46 am
Thank you @6by8, you are right, connecting the HDMI cable to the other port did the trick. However on the 'Screen Layout Editor' there is no option to have cloned screen, the only option is an extended desktop. Is there any way in which I could have both screens (HDMI and DSI) a cloned screen?
Thank you for your help.
That's mainly a limitation of the screen config tool. It's only a wrapper on top of xrandr.
The hardware can't send exactly the same composition to multiple destinations, but xrandr allows you to overlay the displays, and scale.

Dragging the two displays on top of each other which will clone them if they are the same resolution (this is generally the default).
If they are different resolutions then you need to resort to manual xrandr commands. There is the --scale XxY option, but xrandr doesn't allow the hardware to scale it, and uses GL to instead. This can lead to the system feeling a bit laggy depending on resolution. The HVS (composition hardware) would happily take the same source desktop framebuffer and render it fullscreen down each pipeline.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “General discussion”