LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Displaylink temperamental - Not hot pluggable - xrandr - auto config monitors (https://www.linuxquestions.org/questions/linux-hardware-18/displaylink-temperamental-not-hot-pluggable-xrandr-auto-config-monitors-4175511387/)

Lop3 07-17-2014 08:49 AM

Displaylink temperamental - Not hot pluggable - xrandr - auto config monitors
 
The holy grail for me in terms of usability and mobility is having hot pluggable displaylink monitors. (displaylink are USB->DVI/HDMI/VGA adapters)

I just want to say a big thank you to anyone who contributes to Linux. It's such a pleasure and a blessing to be able to use Linux and be part of this community.

Edited Jul 29 2014

I'm using a standard Linux Mint 17 64 bit install (based on Ubuntu 14.04) with kernel upgraded to 3.14.1
My /etc/modprove.d/blacklist-framebuffer.conf is unmodified, showing that udlfb is BLACKLISTED. (meaning I'm using the new udl driver)

I'm very pleased that the new udl driver works with xrandr.
I've written a script that automatically detects what is connected and arranges my monitors and mate-panels accordingly.

Troubles
Sometimes when the DL adapters are connected, they don't show up in xrandr or xrandr --listproviders.

If they aren't showing up in xrandr, I first check if they've been detected as USB devices: lsusb | grep DisplayLink. And ensure neither device is showing a device ID of 8060 so I know it has initialized itself properly.

Sometimes I can make the DL adapters appear in xrandr if I restart X: pkill X
And then xrandr should have both displaylink adapters recognized.
But sometimes only one DL adapter is enabled and xrandr fails with errors trying to enable the other one, and restarting X is not enough. I have to do a full reboot.
Killing X or rebooting kills all my programs, so it's inconvenient. Does anybody know a way to re-initialize the DL adapters without restarting X or rebooting?

Displaylink Info
https://wiki.archlinux.org/index.php/DisplayLink#udl

If there are any displaylink / kernel driver devs who want to play around with displaylink and iron out the bugs, I recommend giving the following scripts a try to see how reliably displaylink is running. See if you can enable 2 DL's, disable both, then enable both again. See how many rounds you can do? I can't even do 1. I have 2 DL devices with DL-165 chipset. They can be found on ebay for about $46 1 2 Make sure you only buy chipsets supported by Linux.

I've separated each xrandr action into it's own command with delays in between to reduce crashes, and specified --display so the scripts can be run from outside the X session.
Ideally one could issue one xrandr command to set the new configuration.

I don't use these scripts anymore, I've created an all-in-one automatic script that just does whatever is necessary, depending on what is connected.
I'll leave them here for anyone who feels like ironing out xrandr/displaylink bugs or wants some xrandr inspiration.

=========================

LAPTOP SCREEN ONLY

Code:

#!/bin/bash
#turn on HDMI and turn off junk and Displaylinks
echo "turning off non existent VGA"
sleep 1
xrandr --display :0 --output VGA-1-1 --off --output VGA1 --off --output VGA-1-2 --off
sleep 2

echo "turning on LVDS1"
sleep 1
xrandr --display :0 --output LVDS1 --mode 1366x768
sleep 2

echo "disabling left displaylink"
xrandr --display :0 --output DVI-2-0 --off
sleep 10

echo "disabling right displaylink"
xrandr --display :0 --output DVI-3-1 --off
sleep 10

echo "disabling HDMI1"
sleep 1
xrandr --display :0 --output HDMI1 --off
sleep 2


HDMI ONLY

Code:

#!/bin/bash
#turn on HDMI and turn off junk and Displaylinks
echo "turning off non existent VGA"
sleep 1
xrandr --display :0 --output VGA-1-1 --off --output VGA1 --off --output VGA-1-2 --off
sleep 2

echo "Enabling HDMI1"
sleep 1
xrandr --display :0 --output HDMI1 --mode 1920x1080
sleep 2

echo "turning off LVDS1"
sleep 1
xrandr --display :0 --output LVDS1 --off
sleep 2

echo "disabling left displaylink"
xrandr --display :0 --output DVI-2-0 --off
sleep 10

echo "disabling right displaylink"
xrandr --display :0 --output DVI-3-1 --off
sleep 10


3 MONITORS

Code:

#!/bin/bash
#turn on HDMI and turn off junk and Displaylinks
echo "turning off non existent VGA"
sleep 1
xrandr --display :0 --output VGA-1-1 --off --output VGA1 --off --output VGA-1-2 --off
sleep 2

echo "turning off LVDS1"
sleep 1
xrandr --output LVDS1 --off
sleep 2

echo "disabling left displaylink"
xrandr --display :0 --output DVI-2-0 --off
sleep 10

echo "disabling right displaylink"
xrandr --display :0 --output DVI-3-1 --off
sleep 10

#enable HDMI
echo "Enabling HDMI1"
sleep 1
xrandr --display :0 --output HDMI1 --mode 1920x1080
sleep 6

echo "turning on left displaylink"
sleep 1
xrandr --display :0 --output DVI-2-0 --mode 1920x1080 --left-of HDMI1
sleep 10

echo "turning on right displaylink"
sleep 1
xrandr --display :0 --output DVI-3-1 --mode 1920x1080 --right-of HDMI1
sleep 10
echo "Finished, you should have 3 monitors on"

REARRANGE 3 MONITORS
Lastly this file is just for convenience. When I boot up and my screens are in the wrong order. It doesn't stress test anything because the correct screens are already on.

Code:

#!/bin/bash
echo "rearranging 3 monitors"
sleep 1
xrandr --display :0 --output DVI-2-0 --mode 1920x1080 --left-of HDMI1 --output DVI-3-1 --mode 1920x1080 --right-of HDMI1

echo "finished rearranging monitors"



All times are GMT -5. The time now is 03:30 AM.