trustno1
Posts: 3
Joined: Fri Feb 05, 2016 11:07 am

How to run HDMI and Official Raspberry Pi Display (DSI) simu

Fri Feb 05, 2016 11:24 am

Hallo to all RPi lovers,

I've been trying for a while to clone the video from Official Raspberry Pi Display (connects through DSI) to the HDMI display. Both work fine when alone but not together.

I am pretty much sure, that it is possible from hardware side, as the omxplayer can play video, on HDMI display, while DSI Display is on and functioning.

Looking deeper in the problem I am able to state following:

1. Raspberry Pi doesn't create a framebuffer for second device, there is only /dev/fb0, no matter how many monitors are plugged
2. As the consequence of first, fbcp and other tools, that can play with framebuffer around, won't work.
3. As far as I understood the module bcm2708_fb is in charge of HDMI framebuffer however here is the lsmod:

Code: Select all

    Module             	Size  Used by
    cfg80211         	419759  0
    rfkill            	16659  2 cfg80211
    bcm2835_gpiomem    	3023  0
    evdev             	10226  6
    joydev             	9047  0
    snd_bcm2835       	19739  3
    snd_pcm           	74833  1 snd_bcm2835
    r8712u           	167991  0
    snd_timer         	18164  1 snd_pcm
    snd               	52116  9 snd_bcm2835,snd_timer,snd_pcm
    uio_pdrv_genirq    	2966  0
    rpi_ft5406         	2826  0
    uio                	8228  1 uio_pdrv_genirq
    rpi_backlight      	1988  0
    i2c_dev            	6040  0
    fuse              	81721  3
    ipv6             	341380  30
and modprobe bcm2708_fb gives in dmsg following error:

Code: Select all

[ 3597.206111] bcm2708_fb soc:fb: Unknown ioctl 0x40187a22
    [ 3721.217242] bcm2708_fb soc:fb: Unknown ioctl 0x40187a22
    [ 3757.719256] bcm2708_fb soc:fb: Unknown ioctl 0x40187a22
    [ 3881.152850] bcm2708_fb soc:fb: Unknown ioctl 0x40187a22
Just to imagine here is a part of config that defines the device:

Code: Select all

    Section "Device"
            Identifier      "Allwinner A10/A13 FBDEV"
            Driver          "fbturbo"
            Option          "fbdev" "/dev/fb0"
     
            Option          "SwapbuffersWait" "true"
    EndSection
But Xorg configuration is the least of the problem.

Would be happy to get any advices or questions and thanking for them in advance.

PS. To use built-in RCA, GPIO-VGA adapter, USB external graphic cards is not an option. Aim is stable and clear - to clone HDMI and DSI or to be able to control both, just not omxplayer but let say console python script

User avatar
topguy
Posts: 5007
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Fri Feb 05, 2016 11:56 am

I would (of the top of my head) suggest a modified fbcp where the output is not another framebuffer but an openmax display on HDMI.

User avatar
AndyD
Posts: 2327
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Fri Feb 05, 2016 12:02 pm

It would be simple enough to write a program similar to fbcp that would copy the output of one display to another using the DispmanX api. If I have a chance over the weekend I will give it a go.

trustno1
Posts: 3
Joined: Fri Feb 05, 2016 11:07 am

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Fri Feb 05, 2016 4:51 pm

Thank you very much for your response... All of suggestions are really reasonable.
AndyD, if you would rewrite fbcp - you would be not just hero for me, but for many others... As I understood, the problem is not that seldom and till now no solution. That would be a huge contribution to the community as it would open even more possibilities to use this beautifull little thing.
Thank you guys for your guidelines and tips)

User avatar
AndyD
Posts: 2327
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Sat Feb 06, 2016 1:08 pm

Hi, I hope that I have understood what you want to do. I have created a program called raspi2raspi. It works in a similar fashion to fbcp. It will copy the output from one display on the Raspberry Pi to another. So it can be used on a Raspberry Pi with the Official Display or Gert's VGA666 adapter attached to copy the output from/to the Official Display/VGA666 to/from a display attached to the Raspberry Pi via HDMI or AV outputs.

I have developed and tested the software on a Raspberry Pi B+ with a VGA666 adapter attached.

trustno1
Posts: 3
Joined: Fri Feb 05, 2016 11:07 am

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Mon Feb 08, 2016 1:15 pm

AndyD, you are fantastic! It works just great! I am trully having lots of respect (and a little fear to be honest) to the people who are able in several hours write almost half of a thousend lines of C-code and even daemons for init.d and systemd to it. By the way the problem seems to be very crucial even for Raspi developers now. As mentioner on Element14 regarding the topic:
Raspberry PI org has recognized this feature requirement and is indicating they are working on it for a later release of OS
Source:
https://www.element14.com/community/mes ... sly#173584

Thank you once again)

User avatar
AndyD
Posts: 2327
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Mon Feb 08, 2016 8:05 pm

trustno1 wrote:I am trully having lots of respect (and a little fear to be honest) to the people who are able in several hours write almost half of a thousend lines of C-code and even daemons for init.d and systemd to it.
The majority of the code, the daemon specific code and the the init.d/systemd service files were copied from another project of mine to create an more optimal version of fbcp. I am glad it is useful to you. This program was one of many items on a TODO list that keeps growing longer.

ghans
Posts: 7819
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Sat Feb 20, 2016 6:23 pm

How hard would it be to write fb2raspi , the opposite
of raspi2fb ?

The idea is to create a virtual framebuffer (there is a
vfb kernel module) and copy it periodically to a dispmanx
surface , enabling Xorg dual-head and lots of other
fun stuff.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
AndyD
Posts: 2327
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Sat Feb 20, 2016 9:34 pm

Hi Ghans,

Not very hard at all. I will have a look when I have some time.

User avatar
AndyD
Posts: 2327
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Sun Feb 21, 2016 12:29 pm

ghans wrote:The idea is to create a virtual framebuffer (there is a vfb kernel module) and copy it periodically to a dispmanx surface , enabling Xorg dual-head and lots of other fun stuff.
The vfb modules isn't built with the Raspbian kernel. So the first thing I will need to do is build my own kernel with CONFIG_FB_VIRTUAL enabled ...

User avatar
elkberry
Posts: 167
Joined: Wed Dec 28, 2016 9:21 pm

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Sun Jan 01, 2017 2:22 pm

AndyD, thank you very, very much for raspi2raspi! It took me some time to find this nugget, but it worked immediately right out-of-the-box on my RasPi 3 with official 7" Touch LCD on most recent Raspbian Jessie. I don't get it why raspi2raspi isn't a sticky post in the official Touch Display sub forum?!

Whatever, I'm using raspi2raspi to copy the LCD to the HDMI output, to which I've hooked an HDMI stand-alone recorder. This works quite beautifully and helps me recording raw LCD footage in good quality for later inclusion in tutorial videos.

Edit: what I really like about raspi2raspi is that it's so efficient: no visible CPU load, seems to mainly keep the GPU part spinning. This makes it the perfect candidate to always run in the background as a systm service. Sweet!
From ZX81 to Raspberry Pi, but wait ... where's the 7805 gone?

Goudriaan
Posts: 1
Joined: Sun Feb 05, 2017 5:37 pm

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Sun Feb 05, 2017 5:57 pm

Hi Andy,

I followed the steps to install raspi2raspi from https://github.com/AndrewFromMelbourne/raspi2raspi .
I get stuck in the step BUILD with the command "cmake.." and got a Cmake Error: The source directory "/home/pi'does not appear to contain Cmakelists.txt.
I'm a newbie with the RPI and cannot find that file on the SD-card.
So I first update && upgrade and tried to install cmake again: no errors
But again the same results with "cmake .."

What am I missing here?

With regards

Axel

User avatar
topguy
Posts: 5007
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Mon Feb 06, 2017 11:14 am

You have to be in the directory of the sourcecode before you can do the 3 "build" steps.
So add a "cd raspi2raspi" after "git clone...."

Prochnow
Posts: 3
Joined: Fri Jul 14, 2017 10:48 am

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Fri Jul 14, 2017 10:50 am

Can someone please explain to this mere mortal how to change the FPS value? Thanks.

User avatar
elkberry
Posts: 167
Joined: Wed Dec 28, 2016 9:21 pm

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Fri Jul 14, 2017 6:50 pm

Running:

Code: Select all

raspi2raspi --fps 25
From ZX81 to Raspberry Pi, but wait ... where's the 7805 gone?

Prochnow
Posts: 3
Joined: Fri Jul 14, 2017 10:48 am

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Mon Jul 17, 2017 10:34 am

elkberry wrote:Running:

Code: Select all

raspi2raspi --fps 25
Thanks elkberry. I had tried this but I get the response below, the command prompt disappears and the window becomes unusable.
"raspi2raspi[1545]:info:copying from [0] 800x480 to [5] 1920x1080"
Any ideas?
Thanks in advance.

User avatar
elkberry
Posts: 167
Joined: Wed Dec 28, 2016 9:21 pm

Re: How to run HDMI and Official Raspberry Pi Display (DSI)

Wed Jul 19, 2017 8:39 pm

The message you get looks fine to me: raspi2raspi has started and is now copying from display 0 (which is the LCD) to display 5 (the HDMI). Did you make sure to run raspi2raspi in the background? Raspi2raspi needs to run constantly, it's not a one-shot tool that immediately finishes. The program works by triggering the video core to copy one display to another, but it needs to do this for as long as you want the copy, at the frame rate you've specified.
From ZX81 to Raspberry Pi, but wait ... where's the 7805 gone?

Prochnow
Posts: 3
Joined: Fri Jul 14, 2017 10:48 am

Re: How to run HDMI and Official Raspberry Pi Display (DSI) simu

Tue Jul 25, 2017 1:57 pm

Can anyone answer if it is possible to swap the display adaptors so the HDMI would copy to DSI? Reason being is for when viewing video on HDMI it's a bit jumpy. I'm only using the 7" display as a control panel. Thanks,
Matt

User avatar
elkberry
Posts: 167
Joined: Wed Dec 28, 2016 9:21 pm

Re: How to run HDMI and Official Raspberry Pi Display (DSI) simu

Tue Jul 25, 2017 4:37 pm

Prochnow, the problem is that when a DSI display gets detected by the firmware, then it becomes the "primary" display where Linux frame buffer writes to.

You may try to add "ignore_lcd=1" to /boot/config.txt, see https://www.raspberrypi.org/documentati ... e/display/.

You can then try to swap the display parameters to raspi2raspi.
From ZX81 to Raspberry Pi, but wait ... where's the 7805 gone?

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

Re: How to run HDMI and Official Raspberry Pi Display (DSI) simu

Tue Jul 25, 2017 4:53 pm

elkberry wrote:
Tue Jul 25, 2017 4:37 pm
You may try to add "ignore_lcd=1" to /boot/config.txt, see https://www.raspberrypi.org/documentati ... e/display/.
ignore_lcd will totally ignore the LCD and not initialise it.
I think "display_default_lcd=0" is what is wanted here, and then reverse the raspi2raspi parameters.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
elkberry
Posts: 167
Joined: Wed Dec 28, 2016 9:21 pm

Re: How to run HDMI and Official Raspberry Pi Display (DSI) simu

Tue Jul 25, 2017 5:11 pm

Yes, of course! I've mixed settings.
From ZX81 to Raspberry Pi, but wait ... where's the 7805 gone?

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

Re: How to run HDMI and Official Raspberry Pi Display (DSI) simu

Mon Sep 03, 2018 5:45 pm

Hi ElkBerry and AndyD,

HELP with raspi2raspi, please.

I have recently come across this thread, and after reading it, I realised that 'raspi2raspi' does exactly what I want. I have installed it as per the instructions on AndyD's GitHub and it worked first time. I do get a touchscreen reproduction on an HDMI connected screen. However, I am not able to interact with the system afterwards. There is no way to move the mouse pointer or enter any text, and because 'raspi2raspi' has been set to run at Boot, I cannot do anything with the Raspberry Pi at the moment.

Anyone knows why this is the case and most importantly how to solve it?
Thank you

BS


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

Re: How to run HDMI and Official Raspberry Pi Display (DSI) simu

Tue Sep 04, 2018 9:02 am

Thank you for your reply aBUGs,

I read the thread you posted and it is promising that RPi Engineers are finally working on this. However it is not clear if the package does screen cloning by default or what it has to be done to accomplish that, the same way as 'raspi2raspi' does. Also I am not sure if I understood correctly that omxplayer would not be able to see both fbs?

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

Re: How to run HDMI and Official Raspberry Pi Display (DSI) simu

Tue Sep 04, 2018 9:18 am

bs_pi wrote:
Tue Sep 04, 2018 9:02 am
Thank you for your reply aBUGs,

I read the thread you posted and it is promising that RPi Engineers are finally working on this. However it is not clear if the package does screen cloning by default or what it has to be done to accomplish that, the same way as 'raspi2raspi' does. Also I am not sure if I understood correctly that omxplayer would not be able to see both fbs?
Its not screen cloning, it's an extended desktop. Here is a screenshot showing extended desktop, total resolution for this example is 2560x1024. DPI screen is the right one (with mountain wallpaper).
2018-08-02-163159_2560x1024_scaled.jpg
extended desktop
2018-08-02-163159_2560x1024_scaled.jpg (26.73 KiB) Viewed 799 times
The hardware is a WXGA LCD (connected to DPI) and an SXGA monitor (connected to HDMI).
IMG_0541.jpg
IMG_0541.jpg (60.2 KiB) Viewed 799 times
Last edited by aBUGSworstnightmare on Tue Sep 04, 2018 12:11 pm, edited 1 time in total.

Return to “Advanced users”