Posts: 8
Joined: Thu Dec 06, 2018 5:09 am

XDMX - Raspberry PI 3B+ Dualscreen

Thu Dec 06, 2018 6:55 am

I am looking for a Dualscreen solution for 2x 1080p monitors.
I know the Hardware is pretty limited on the PI and it would be easier to just use a PC with a graphicscard with multiple outputs.
Well... I have a Computer, but i like to tinker a bit and get it working with the PI.

In my search for the perfect solution I came across Gert666.
Great project, but I want to use the GPIO for other things (audio in, microphone, other things and of course RGB-LEDs) and the Gert666 uses all of them as far as i know.

There are also cheap USB to HDMI or USB to DVI adapters in several online shops.
I dont wanted to go this route. Because I have seen that you can only get slideshows out of them.

Then I came to XDMX.
It took me about a week setting everything up and searching all over the internet to get it working, and in fact it does work right now for me and it does a pretty decent job.

First of all, if anybody is interested on how I did it, I'll try to to explain a bit:

I am using the Raspberry PI 3B+ as my host and a Banana PI M2 Zero as the XDMX client.
At this point I can't really recommend the Banana PI M2 Zero.
It has a Quad-Core, but its not worth the extra 3€ opposed to the Raspberry PI Zero (or maybe Raspberry 3A+?) for this application.
The Support is'nt great and I could barely get some of the "official" OS releases running.
At the end I used an inofficial Armbian from a user at the BPI forums that I think works better then every other "official" release, as long as you dont update it.

My Idea was to keep the LAN-port free on the raspberry for local networking and setup the bananas USB OTG as g_ether host.
That means you just connect a USB cable (USB A -> micro USB) from the raspberry to the banana, and get a new network interface (usb0) on both.
Setting up static IP-Adresses for both and IP routs, I get about 95 MBit/s in Iperf3 (I am not entirely sure if this could be a bottleneck).
If you set this up, dont be stupid like me and waste 2 days on the software just to find out later that the USB cable is broken or does not have data lines.

Now that I have the network connection between the 2 SBCs I installed XDMX (and a Desktop for the Armbian).
As of the time I am writing this XDMX does not work on the Raspberry PI as Host.
It just gives segmentation faults whatever i tried.
The Solution that worked for me is to downgrade and lock XDMX to the version from Raspbian jessie (2:1.16.4-1+deb8u2)

I am using the following script at startup on the raspberry to connect everything:

Code: Select all



# wait for 2nd screen
while [ $LOOP -ne 0 ]
	sleep 5
	echo "Waiting for $HOST: $?"

sudo chown -R pi:pi /home/pi
xauth -b quit
#xhost +
startx -- /usr/bin/Xdmx :1 -display :0 -display $HOST:0 -norender -noglxproxy -ignorebadfontpaths +xinerama -param XkbModel pc105 -param XkbLayout de
The banana just needs a desktop and "xhost +" or xhost with the ipaddress at startup.

I guess synergy is not needed, since it crashes anyway when xdmx starts, but I have it installed and set up.

With the latest apt-get upgrade somehow everything broke and I was not even able to play a youtube video on the first screen (raspberry), without it turning into a slideshow.
After a little research i found out that disabling OpenGL in raspi-config increased the performance a little.
And somehow (I dont know why) installing libgl1-mesa-dri=10.3.2-1+deb8u1 from jessie, makes it usable again.

In conclusion:
Yes, XDMX ist still useable in 2018 even if it's not really maintained for years by now.
On the other hand, dont expect too much, the performance on the 2nd monitor is not really any better than just using an USB to HDMI/DVI adapter.
I have seen XDMX doing pretty well with videos, but from the Raspberry PI i can only have Slideshows on the 2nd screen.
On the plus side I can use the banana PIs remaining processing power for other tasks, what you can't have from an USB to HDMI/DVI adapter, for almost the same price.

Please let me know what you think, and maybe ideas on how to improve it?
Thanks, Bentschi

Posts: 1481
Joined: Tue Jun 30, 2015 1:35 pm

Re: XDMX - Raspberry PI 3B+ Dualscreen

Fri Dec 07, 2018 5:50 am

Why not use a compute module, running dual frame buffer beta (still beta atm, will hopefully be officially released soon).

n case your display needs 18-bit colour only you have some more I/O available.

Some details are here viewtopic.php?p=1187622 or search the forum for lvds4cm3l

Posts: 8
Joined: Thu Dec 06, 2018 5:09 am

Re: XDMX - Raspberry PI 3B+ Dualscreen

Fri Dec 07, 2018 6:24 am

Thank you,
I definitely like the idea.
I just dont like that it is LVDS, I like to have HDMI for my project.
18 bit color is more than enough in my opinion, I even tried to go down to 16 bit to speed XDMX up, unfortunately i did no get it running below 24 bit.
But that looks like a cool and interesting project, thanks

Posts: 8
Joined: Thu Dec 06, 2018 5:09 am

Re: XDMX - Raspberry PI 3B+ Dualscreen

Tue Dec 11, 2018 9:58 pm

Here is a little update on this topic.
I came up with the great idea, that I could simply make a VPN connection on the USB network bridge to compress the data from xdmx, and fight the network bottleneck with CPU power.
So I installed OpenVPN on raspberry and banana, broke the network manager from the banana pi and set up everything from scratch.
Because somehow i got it to boot with g_ether enabled, without connecting to anything and since this is the only usable USB port, and that port was in network mode, I wasn't even able to attach a keyboard :roll: .

I am only able to test lzo compression, no lz4 compression, since I can't update the banana pi from Jessie to Stretch.
Well, the result isn't really great or bad. If openvpn can compress the data stream from xdmx I wasn't really able to notice (from my highly professional, "just play a youtube video" benchmark).

I think I scrap this idea and focus more on getting it down to 16-bpp graphic, and maybe tweak some more opengl related stuff.

Return to “Advanced users”