LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Lenovo X230 Dual Monitor / Docking Station Problems (https://www.linuxquestions.org/questions/slackware-14/lenovo-x230-dual-monitor-docking-station-problems-4175452802/)

OscarMike 03-05-2013 10:57 AM

Lenovo X230 Dual Monitor / Docking Station Problems
 
*SOLVED* See Post #2

I'm having problems with getting my X230 to work properly with my dual monitors when docking into a ThinkPad Mini Dock Series 3.

The docking station has a DVI out and VGA out, there is an option for a display port but I do not have the adapter, nor will work purchase one for that matter. One thing to note is that the X230 *WILL NOT* do three simultaneous screens without using the display port. So Laptop LCD and a VGA LCD with a DVI connected LCD will not work, however Laptop LCD and a VGA or DVI connected LCD along side a DisplayPort Connected LCD *WILL* work.. allegedly.

I'm posting because I've searched endlessly and have looked at the think wiki ( http://www.thinkwiki.org/wiki/ThinkWiki - Specifically http://www.thinkwiki.org/wiki/Docking_Solutions ) but either I don't understand it fully, which may be the case as this is my first foray into Linux, or it's not working properly ( Newer series 3 docks no longer register themselves as a dock, but instead behave like a port replicator, as such the below method does not work. They do however cause a key event on dock and undock which could be used as a trigger, but for now these key events are not exposed by the thinkpad-acpi driver before kernel 3.0 )

Surely there are X220 or X230 users here with docking stations that have ran into the problems that I am having?

My setup is _almost_ working. Currently I have the DVI cable unplugged from the docking station so that the laptop LCD is working and the one VGA external LCD is on.

So here's what I've done thus far:
As root: X -configure && mv /root/xorg.conf.new /etc/X11/xorg.conf
vim /etc/X11/xorg.conf
(I did notice a xorg.conf-vesa as well)

Code:

Section "ServerLayout"
        Identifier    "X.org Configured"
#        Screen      0  "Screen0" 0 0
#        Screen      1  "Screen1" RightOf "Screen2"
#        Screen      2  "Screen2" LeftOf "Screen1"
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
        ModulePath  "/usr/lib64/xorg/modules"
        FontPath    "/usr/share/fonts/local"
        FontPath    "/usr/share/fonts/TTF"
        FontPath    "/usr/share/fonts/OTF"
        FontPath    "/usr/share/fonts/Type1"
        FontPath    "/usr/share/fonts/misc"
        FontPath    "/usr/share/fonts/CID"
        FontPath    "/usr/share/fonts/75dpi/:unscaled"
        FontPath    "/usr/share/fonts/100dpi/:unscaled"
        FontPath    "/usr/share/fonts/75dpi"
        FontPath    "/usr/share/fonts/100dpi"
        FontPath    "/usr/share/fonts/cyrillic"
EndSection

Section "Module"
        Load  "glx"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option            "Protocol" "auto"
        Option            "Device" "/dev/input/mice"
        Option            "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
        Identifier  "Monitor0"
        VendorName  "Monitor Vendor"
        ModelName    "Monitor Model"
EndSection

Section "Monitor"
        Identifier  "Monitor1"
        VendorName  "Monitor Vendor"
        ModelName    "Monitor Model"
EndSection

Section "Monitor"
        Identifier  "Monitor2"
        VendorName  "Monitor Vendor"
        ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option    "NoAccel"                    # [<bool>]
        #Option    "AccelMethod"                # <str>
        #Option    "Backlight"                  # <str>
        #Option    "DRI"                        # <str>
        #Option    "ColorKey"                  # <i>
        #Option    "VideoKey"                  # <i>
        #Option    "Tiling"                    # [<bool>]
        #Option    "LinearFramebuffer"          # [<bool>]
        #Option    "SwapbuffersWait"            # [<bool>]
        #Option    "TripleBuffer"              # [<bool>]
        #Option    "XvPreferOverlay"            # [<bool>]
        #Option    "HotPlug"                    # [<bool>]
        #Option    "RelaxedFencing"            # [<bool>]
        #Option    "XvMC"                      # [<bool>]
        #Option    "ZaphodHeads"                # <str>
        #Option    "TearFree"                  # [<bool>]
        #Option    "PerCrtcPixmaps"            # [<bool>]
        #Option    "FallbackDebug"              # [<bool>]
        #Option    "DebugFlushBatches"          # [<bool>]
        #Option    "DebugFlushCaches"          # [<bool>]
        #Option    "DebugWait"                  # [<bool>]
        #Option    "BufferCache"                # [<bool>]
        Identifier  "Card0"
        Driver      "intel"
        BusID      "PCI:0:2:0"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option    "SWcursor"                  # [<bool>]
        #Option    "kmsdev"                    # <str>
        #Option    "ShadowFB"                  # [<bool>]
        Identifier  "Card1"
        Driver      "modesetting"
        BusID      "PCI:0:2:0"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option    "ShadowFB"                  # [<bool>]
        #Option    "DefaultRefresh"            # [<bool>]
        #Option    "ModeSetClearScreen"        # [<bool>]
        Identifier  "Card2"
        Driver      "vesa"
        BusID      "PCI:0:2:0"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device    "Card0"
        Monitor    "Monitor0"
        SubSection "Display"
                Depth    24
                Modes        "1366x768"
                Virtual        2048 2048
        EndSubSection
EndSection

An xrandr -q provides me with LVDS1 (laptop lcd) and VGA1 (dell 23" 1920x1080)
So far so good. I can use output to turn off the LVDS1 properly, move it left-of or right-of so that's all good.

To replicate this I powered down the laptop, unplugged the VGA cable and plugged back in the DVI, booted up. Both screens come up just like the previous method, xrandr -q provides with LVDS1 (laptop lcd) and HDMI1 (dell 23" 1920x1080) again, I can use output to turn off the LVDS1 properly, move it left-of or right-of so that's all good.

Layout (Left -> Right | Laptop, Dell VGA, Dell DVI)

Now I'm running XFCE as my window manager, by default there is no .xinitrc in the home directory. I setup my .xinitrc as follows:
Code:

/usr/bin/xrandr --output VGA1 --auto --output HDMI1 --auto --right-of VGA1
exec /usr/bin/startxfce4

This brings me into my Xsession however only on the VGA screen. The LCD on the laptop is blank an xrandr shows all three connected devices. I've also tried a variation of the above .xinitrc where I turn off LVDS1 first then set the outputs, this does not work right either. I noticed with this configuration I see an xfsettings:3241 error 'xsettingsd-Warning Failre to Configure HDMI1' from console, but if I rerun the command /usr/bin/xrandr --output VGA1 --auto --output HDMI1 --auto --right-of VGA1 everything gets setup correctly but I have to resetup the screen resolutions, which I can alleviate if I change it from --auto to --mode 1920x1080.

I don't know if I've made the problem clear or not but this is what I'm in the middle of trying to figure out while still green to Slackware and Linux in general.

OscarMike 03-05-2013 05:40 PM

Got it working! Here's the solution:

I went all the way back to the beginning and took a new approach, I removed /etc/X11/xorg.conf && ~/.xinitrc ( I'm using the defaults ) from the original post.

I then opened terminal and did an acpi_listen;
I docked / un-docked the X230 to find the following hotkeys:

ibm/hotkey HKEY 00000080 00004010 *DOCK
ibm/hotkey HKEY 00000080 00004011 *UN-DOCK

From here I changed directory to /etc/acpi/events/
I created two files:
*Note:replace $SUDO_USER with an account that can change X settings, example user: OscarMike

thinkpad-dock
Code:

event=ibm/hotkey HKEY 00000080 00004010
action=su $SUDO_USER -c /etc/acpi/thinkpad-dock.sh

thinkpad-undock
Code:

event=ibm/hotkey HKEY 00000080 00004011
action=su $SUDO_USER -c /etc/acpi/thinkpad-undock.sh

From here I changed directory to /etc/acpi/
I created two files:
*Note: You will want to change around your xrand -q information appropriately for your monitor layout

thinkpad-dock.sh
Code:

#!/bin/sh
# 2 invocations because the Intel graphics card can only handle two outputs at a time
xrandr -d :0.0 --output VGA1 --auto --primary --output LVDS1 --off
xrandr -d :0.0 --output HDMI3 --auto --right-of VGA1

*IMPORTANT*
Code:

chmod a+x /etc/acpi/thinkpad-dock.sh
thinkpad-undock.sh
Code:

#!/bin/sh
xrandr -d :0.0 --output VGA1 --off
xrandr -d :0.0 --output LVDS1 --auto --primary --output HDMI3 --off

*IMPORTANT*
Code:

chmod a+x /etc/acpi/thinkpad-undock.sh
Next you will need to edit the acpi_handler.sh
I simply added the following:
*Note:replace $SUDO_USER with an account that can change X settings, example user: OscarMike

/etc/acpi/acpi_handler.sh
Code:

#!/bin/sh
# Default acpi script that takes an entry for all actions

IFS=${IFS}/
set $@

case "$1" in
  button)
    case "$2" in
      power) /sbin/init 0
        ;;
        ibm/hotkey HKEY 00000080 00004010) su $SUDO_USER -c /etc/acpi/thinkpad-dock.sh ;;
        ibm/hotkey HKEY 00000080 00004011) su $SUDO_USER -c /etc/acpi/thinkpad-undock.sh ;;
      *) logger "ACPI action $2 is not defined"
        ;;
    esac
    ;;
  *)
    logger "ACPI group $1 / action $2 is not defined"
    ;;
esac

Lastly, /etc/rc.d/rc.acpid restart

DONE & DONE
Docking / Un-Docking works like a champ!


All times are GMT -5. The time now is 09:50 PM.