PDA

View Full Version : Multiple Monitor Support


critsmagoo
06-05-2016, 11:25 PM
Does anyone know a good way to tie a xrandr Provider ID to a USB bus ID or something else that is adapter specific? Maybe there is something I can do with the id for a provider?

I have 2 displaylink adapters (same make, same model) connected to a Mint 17.2 laptop using the mainline 4.5.2 kernel & the latest driver -- both of the adapters appear in xrandr, but the provider ID is inconsistent across reboots.

Sometimes an adapter will appear as provider #1, sometimes it will switch with the other adapter as provider #2

The script I'm using to switch on the displays looks like:


LEFTMONITOR=DVI-2-1
RIGHTMONITOR=DVI-1-0
LAPTOPMONITOR=DP-0

RESOLUTION_FLAG="--mode 1024x768"

MONITOR_1_POS=0x0
MONITOR_2_POS=1024x0

xrandr --setprovideroutputsource 1 0
# Running the first line creates provider #2 in the list & I'm not sure why, so the ID jumps by 1 for adapter #2
xrandr --setprovideroutputsource 3 0
xrandr --auto


xrandr --output $LEFTMONITOR $RESOLUTION_FLAG --pos $MONITOR_1_POS --rotate normal
xrandr --output $CENTERMONITOR $RESOLUTION_FLAG --pos $MONITOR_2_POS --rotate normal
xrandr --output $LAPTOPMONITOR --off


Before running the script, xrandr --listproviders looks like:
~/laptop-stuff/scripts $ xrandr --listproviders
Providers: number : 3
Provider 0: id: 0x1b9 cap: 0x1, Source Output crtcs: 4 outputs: 6 associated providers: 0 name:NVIDIA-0
Provider 1: id: 0x26b cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 0 name:modesetting
Provider 2: id: 0x249 cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 0 name:modesetting