Page 1 of 10 123 ... LastLast
Results 1 to 10 of 98

Thread: HOW TO Setup a Wacom Tablet with Multi-Monitors in Maverick and Natty

  1. #1
    Join Date
    Nov 2008
    Beans
    9,635
    Distro
    Ubuntu 12.04 Precise Pangolin

    HOW TO Setup a Wacom Tablet with Multi-Monitors in Maverick and Natty

    along with Aiptek, Hanwang, N-trig, Waltop, & WizardPen (Ace Cad, KYE Systems, UC-LOGIC) Tablets

    Last updated: November 21, 2011

    Preliminaries
    1) You must have X server 1.8 or up (Maverick has 1.9).


    Sources
    "xsetwacom: Support MapToOutput for TwinView" by Jason Gerecke
    "xsetwacom: add "MapToOutput" parameters" by Peter Hutterer
    "dix: add 3x3 transformation matrix xinput property for multi-head handling" by Peter Korsgaard
    xf86-input-wacom from part II of the Bamboo P & T HOW TO or section 2 of the linuxwacom HOW TO.
    "man xrandr"
    "Transformation matrix"
    "Matrix multiplication"


    Miscellaneous Notes
    First Wacom testers to report success were dsavi & mugginz.
    First WizardPen (Genius MousePen 8x6/UC-LOGIC) testers to report success were elnaureth & 1script.


    Summary
    This HOW TO is divided into three sections. The first is the xsetwacom MapToOutput Method for tablets on the Wacom drivers. MapToOutput has been extended to apply to the Nvidia proprietary driver, i.e. TwinView starting with the xf86-input-wacom-0.12.0 release. The second is the Coordinate Transformation Matrix Method which works for all tablets. The third deals with getting either method to work through a reboot.


    I. xsetwacom MapToOutput Method - for Tablets using the xf86-input-wacom driver: Hanwang, N-trig, Wacom, & Waltop
    The nice thing about MapToOutput is it does all of the matrix calculations for you automatically.

    1) You must have xf86-input-wacom 0.10.9 (0.10.8+ after the 8-11-10 commit "xsetwacom: add "MapToOutput" parameters."; the default in Maverick is 0.10-8 ) if you have a 32-bit install. Otherwise if you have a 64-bit install you must have xf86-input-wacom 0.10.10+ (after the 1-11-11 commit "xsetwacom: fix 64-bit issues with MapToOutput").

    First determine the "device name" of what you want bound on a specific screen. Your choices will be the stylus, eraser, or cursor (Wacom tablet mouse). In a terminal enter:
    Code:
    xinput --list
    The output should contain the "device names" you are after. For example for the stylus it might be:
    "Wacom BambooFun 2FG 6x8 Pen stylus"
    Quotes added because you'll need them.

    The new method relies on a new xsetwacom command in the form:
    xsetwacom set <device name> MapToOutput VGA1
    Enter in a terminal:
    Code:
    xrandr
    and select the name of the monitor, among the monitors you see in the output, that you would like the device on. Substitute that monitor name for VGA1 in the command. Using your "device name" (in quotes) from 'xinput list' you can now use the xsetwacom command:
    Code:
    xsetwacom set "device name" MapToOutput VGA1
    2) TwinView (NVidia proprietary driver binary). Support was added with the "xsetwacom: Support MapToOutput for TwinView" commit on 6-23-11 (in the 0.11.99+ tree) and is available in the xf86-input-wacom-0.12.0 release tar.

    Choose the monitor you want the input tool on using "HEAD-0", "HEAD-1", etc., e.g.:
    Code:
    xsetwacom set "device name" MapToOutput HEAD-0
    or
    xsetwacom set "device name" MapToOutput HEAD-1
    Note: the above MapToOutput commands only apply to the current xrandr configuration, they will need to be re-applied with a restart (or rotation). So you'll have to set up the xsetwacom MapToOutput command(s) in a startup script. See below.


    II. Coordinate Transformation Matrix Method - for all Tablets
    While the following may seem a little daunting if you look at the examples you'll find it is not that hard. The code does the matrix multiplication for you. You are determining the matrix values by solving fractions involving your monitors' dimensions.

    First determine the "Device name" of what you want bound on a specific screen. Your choices will be the stylus, eraser, or cursor (Wacom tablet mouse). In a terminal enter:
    Code:
    xinput --list
    Using the "Device name" (in quotes) enter in a terminal:
    Code:
    xinput list-props "Device Name"
    For example:
    Code:
    xinput list-props "Wacom BambooFun 2FG 6x8 Pen stylus"
    This will give an output that contains your current 'Coordinate Transformation Matrix' for the device as the X server sees it:
    Code:
    Coordinate Transformation Matrix (123):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    Now let's do a quick overview of the math involved. Notice that while it is an Identity matrix:
    Code:
    [ 1 0 0 ]
    [ 0 1 0 ]
    [ 0 0 1 ]
    which has the effect of multiplying by 1, or in other words no transformation, the addition of a third vector value (beyond X & Y) makes it an affine transformation with homogeneous coordinates. We need to determine the transform matrix appropriate to the monitor you want to place the device on.

    What we will do with the transform is translate the currently assigned pixel coordinate vector X,Y of your tablet device to a new pixel coordinate vector X',Y'.

    The numbers in the X server "Coordinate Transformation Matrix" are a 3x3 matrix read out row by row. Using an affine transformation means translation can be expressed with matrix multiplication. The equation we are looking at is in the form of:
    Code:
    [ x' ]   [ c0 c1 c2 ]   [ x ]
    [ y' ] = [ c3 c4 c5 ] * [ y ]
    [ 1  ]   [ c6 c7 c8 ]   [ w ]
    The third vector value w (the row) 0 0 1, with c8 or w always equal to 1, is what makes it affine.

    The associated linear equations would be:
    Code:
    x' = (c0x + c1y + c2) / w'
    y' = (c3x + c4y + c5) / w'
    w' = (c6x + c7y + c8) = 1
    So c0 and c4 corresponds to the scaling on the X and Y axes, c2 and c5 corresponds to the translation (X & Y offsets) on those axes, and c6, c7, and c8 are always 0, 0 and 1.

    Rumtscho describes how to calculate the general case in post #8 below.

    I. Dual Monitors
    a) Two monitors with the same resolution: is the simplest case.

    Say both monitors are 1280x1024. You first set up the linear transform (matrix) like so.
    Code:
      left:                               right:
    [ 1280/(1280+1280)  0         0 ]   [ 1280/(1280+1280)  0          1280/(1280+1280)]
    [ 0                 1024/1024 0 ]   [ 0                 1024/1024  0               ]
    [ 0                 0         1 ]   [ 0                 0          1               ]
    Using fractions amounts to scaling from 0-1 so you end up with the following.
    Code:
      left:           right:
    [ 0.5 0 0 ]     [ 0.5 0 0.5 ]
    [ 0   1 0 ]     [ 0   1 0   ]
    [ 0   0 1 ]     [ 0   0 1   ]
    With the c2 = 0.5 on the right matrix being the x offset.

    Now that you've determined the transform use the appropriate xinput command for the monitor you want your device on:
    Left monitor:
    Code:
    xinput set-prop "Device name" --type=float "Coordinate Transformation Matrix" 0.5 0 0 0 1 0 0 0 1
    Right monitor:
    Code:
    xinput set-prop "Device name" --type=float "Coordinate Transformation Matrix" 0.5 0 0.5 0 1 0 0 0 1
    b) Two monitors with different resolutions: example by Rumtscho

    * image courtesy of Rumtscho

    Setting up the linear transform (matrix).
    Code:
      left:                                right:
    [ 1280/(1280+2560)  0          0 ]   [ 2560/(1280+2560)  0          1280/(1280+2560)]
    [ 0                 1024/1440  0 ]   [ 0                 1440/1440  0               ]
    [ 0                 0          1 ]   [ 0                 0          1               ]
    Since for Rumtscho 'xinput --list' returned the stylus "Device name" as "Wacom BambooFun 2FG 6x8 Pen stylus" the appropriate xinput commands for device placement on the monitors are:
    Left monitor:
    Code:
    xinput set-prop "Wacom BambooFun 2FG 6x8 Pen stylus" --type=float "Coordinate Transformation Matrix" 0.333333 0 0 0 .711111 0 0 0 1
    Right monitor:
    Code:
    xinput set-prop "Wacom BambooFun 2FG 6x8 Pen stylus" --type=float "Coordinate Transformation Matrix" 0.666666 0 0.333333 0 1 0 0 0 1
    c) Two monitors with one rotated: example courtesy of lejono
    Left monitor 1600x1200 & right monitor (tablet pc) 1280x800. Tablet pc in laptop mode.
    Code:
      left:                                right:
    [ 1600/(1600+1280)  0          0 ]   [ 1280/(1600+1280)  0         1600/(1600+1280)]
    [ 0                 1200/1200  0 ]   [ 0                 800/1200  0               ]
    [ 0                 0          1 ]   [ 0                 0         1               ]
    Left monitor:
    Code:
    xinput set-prop "Serial Wacom Tablet stylus" --type=float "Coordinate Transformation Matrix" 0.555555 0 0 0 1 0 0 0 1
    Right monitor:
    Code:
    xinput set-prop "Serial Wacom Tablet stylus" --type=float "Coordinate Transformation Matrix" 0.444444 0 0.555555 0 0.666666 0 0 0 1
    * lejono established 6 decimal accuracy; matrices changed to reflect that

    Now if we rotate to tablet mode we are adding a rotional transformation. Let's use rotation by an angle A counter-clockwise about the origin. The functional form would be x' = xcosA − ysinA and y' = xsinA + ycosA but we want to make it affine so we can use multiplication. And we need to add it to the current matrix. So written in matrix form, it becomes something like:
    Code:
    [ x' ]   [ cosA*c0 -sinA*c1 c2 ]   [ x ]
    [ y' ] = [ sinA*c3  cosA*c4 c5 ] * [ y ]
    [ 1  ]   [ c6       c7      c8 ]   [ w ]
    representing the equations:
    Code:
    x' = (cosA*c0x + -sinA*c1y + c2) / w'
    y' = (sinA*c3x +  cosA*c4y + c5) / w'
    w' = (c6x      +  c7y      + c8) = 1
    If we rotate the tablet 180 degrees to inverted, since cos(180) = -1 and sin(180) = 0 you end up with:
    Code:
       right:
    [ -1280/(1600+1280)  0        1280/1280 ]
    [  0                -800/1200 800/1200  ]
    [  0                 0        1         ]
    
    [ -0.444444  0        1        ]
    [ 0         -0.666666 0.666666 ]
    [ 0          0        1        ]
    Right monitor rotated to inverted:
    Code:
    xinput set-prop "Serial Wacom Tablet stylus" --type=float "Coordinate Transformation Matrix" -0.444444 0 1 0 -0.666666 0.666666 0 0 1
    Now what happens if we rotate the tablet pc to portrait mode? Note X & Y swap, becoming 800x1280. Since cos(270) = 0 and sin(270) = -1 you end up with this matrix.
    Code:
       right:
    [  0          800/(1600+800) 1600/(1600+800) ]
    [ -1280/1280  0              1280/1280       ]
    [  0          0              1               ]
    
    [  0  0.333333 0.666666 ]
    [ -1  0        1        ]
    [  0  0        1        ]
    Right monitor rotated to portrait:
    Code:
    xinput set-prop "Serial Wacom Tablet stylus" --type=float "Coordinate Transformation Matrix" 0 0.333333 0.666666 -1 0 1 0 0 1
    II. Three Monitors - simple case
    Three monitors with the same resolution. You set up the linear transform and since we're scaling from 0-1 if all three monitors have the same resolution you'd end up with:
    Code:
      left                           center                                     right
    [ 1280/(3*1280) 0         0 ]  [ 1280/(3*1280) 0         1280/(3*1280) ]  [ 1280/(3*1280) 0         (2*1280)/(3*1280) ]
    [ 0             1024/1024 0 ]  [ 0             1024/1024 0             ]  [ 0             1024/1024 0                 ]
    [ 0             0         1 ]  [ 0             0         1             ]  [ 0             0         1                 ]
    
      left:              center:                 right:
    [ 0.3333 0 0 ]     [ 0.3333 0 0.3333 ]     [ 0.3333 0 0.6666 ]
    [ 0      1 0 ]     [ 0      1 0      ]     [ 0      1 0      ]
    [ 0      0 1 ]     [ 0      0 1      ]     [ 0      0 1      ]
    * tested by mugginz, he used 3 decimal accuracy
    * Rumtscho was able to use 4 decimal accuracy; matrices changed to reflect that

    So now the xinput commands to set the device to the desired monitor are:
    Left monitor:
    Code:
    xinput set-prop "Device name" --type=float "Coordinate Transformation Matrix" 0.333333 0 0 0 1 0 0 0 1
    Center monitor:
    Code:
    xinput set-prop "Device name" --type=float "Coordinate Transformation Matrix" 0.333333 0 0.333333 0 1 0 0 0 1
    Right monitor:
    Code:
    xinput set-prop "Device name" --type=float "Coordinate Transformation Matrix" 0.333333 0 0.666666 0 1 0 0 0 1
    Note: The xinput command does not last through a restart. See below.


    III. To Have the Settings Last Through a Reboot
    You have to apply the xinput or xsetwacom command with each restart. You should be able to add it to your xsetwacom start up script, if you have one. Otherwise run it from a convenient start up script. Sample start up scripts are attached to posts 1 & 2 of the Bamboo P & T HOW TO thread. Add the appropriate command for each device (stylus, eraser, and cursor) to its section.

    To set it up to auto-start, download a sample file or make your own, and rename it .xsetwacom.sh (or whatever you want) and place it in your home directory. Remember it will be a hidden file. To enable the xsetwacom commands in the .xsetwacom.sh file to apply to Xserver through a reboot you enter in a terminal:
    Code:
    chmod +x ~/.xsetwacom.sh
    or you could right click on the file and in Properties, in the Permission tab, check Execute as program. Then go to System->Preferences->Startup Applications and click on add and for the command write "sh /home/yourusername/.xsetwacom.sh" (without the quotes). You can also change your settings on the fly using the xsetwacom parameters in a terminal. They only apply during the current session.

    Once the script is executable you can double click on it to apply it's settings or reboot to check the auto-start set up.

    Note: In the sample scripts both "device name" and ID # are used. Be sure to check for yours using 'xinput --list' (without the quotes) in a terminal and use them. When you use a xorg.conf the "device names" will be stylus, eraser, touch, and pad. If you are hot plugging your tablet or other devices be sure to use "device name" as the ID # can change.


    Appendix 1 - Tablet PC Rotation with CTM
    Evdev rotation for those of you using evdev for touch seems to be broken currently on Natty. You can use the CTM to do it instead.

    The CTM for none/normal or no rotation is the identity matrix:
    Code:
     [ 1  0  0 ]
     [ 0  1  0 ]
     [ 0  0  1 ]
    and the command to implement it:
    xinput set-prop "Wacom Bamboo 2FG 4x5 Finger" "Coordinate Transformation Matrix" 1, 0, 0, 0, 1, 0, 0, 0, 1

    The CTM for ccw/left rotation is:
    Code:
     [ 0  1  0 ]
     [-1  0  1 ]
     [ 0  0  1 ]
    and the command to implement it:
    xinput set-prop "Wacom Bamboo 2FG 4x5 Finger" "Coordinate Transformation Matrix" 0, 1, 0, -1, 0, 1, 0, 0, 1

    The CTM for half/inverted rotation is:
    Code:
     [-1  0  1 ]
     [ 0 -1  1 ]
     [ 0  0  1 ]
    and the command to implement it:
    xinput set-prop "Wacom Bamboo 2FG 4x5 Finger" "Coordinate Transformation Matrix" -1, 0, 1, 0, -1, 1, 0, 0, 1

    The CTM for cw/right rotation is:
    Code:
     [ 0 -1  1 ]
     [ 1  0  0 ]
     [ 0  0  1 ]
    and the command to implement it:
    xinput set-prop "Wacom Bamboo 2FG 4x5 Finger" "Coordinate Transformation Matrix" 0, -1, 1, 1, 0, 0, 0, 0, 1

    Use your touch "device name" from xinput list of course.
    Last edited by Favux; November 22nd, 2011 at 04:19 AM.

  2. #2
    Join Date
    Nov 2008
    Beans
    9,635
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOW TO Setup a Wacom Tablet with Multi-Monitors in Maverick and Natty

    Using xsetwacom commands to set TopX & Y and BottomX & Y - this should work with any Xorg and xf86-input-wacom or linuxwacom

    by SnickerSnack from the "How to limit pen tablet to one display out of two?" thread, post #33.

    I'm fairly sure that the instructions below are correct.

    I followed post #15 by blady_pirat in the thread "Configuring Xorg for dual screen, single wacom" and it seems correct, if cryptic. I'm going to state my interpretation of that here, and I'll also cover changing vertical values for those who have different resolutions on their monitors.

    Preliminaries:
    These instructions assume that you haven't changed anything using xsetwacom. If you have, you should reset to default values (that is, the stylus should work normally when no external monitor is connected); rebooting should accomplish this. Also, I'm using xf86-input-wacom 0.10.8. I'm using
    Code:
    xsetwacom set "Serial Wacom Tablet Stylus" Screen_No -1
    I don't fully understand this setting yet, though it doesn't appear to do anything.

    I'm using xrandr to use an external monitor, so this may not work for those using the Nvidia or ATI proprietary drivers.

    Using xsetwacom:
    To start with, we're going to need to get some values using xinput. Read the output of
    Code:
    xinput list
    and find the lines that correspond to your stylus and eraser (if you have one). For me, it's this:
    ⎜ ↳ Serial Wacom Tablet eraser id=13 [slave pointer (2)]
    ⎜ ↳ Serial Wacom Tablet stylus id=14 [slave pointer (2)]
    Also notice the id for each device; this will make the commands a fair bit shorter. The device ids can change, so if you're going to write scripts to automate this, then you need to use the device names in quotes. Run the following commands:
    Code:
    xsetwacom get [device name/id] BottomX
    xsetwacom get [device name/id] BottomY
    the first value will be called Wxsw(Left+Right) and the second will be called Hxsw(Large) (these labels will make sense later). It's a good idea to record these somewhere. They appear to correspond to the resolution of the wacom digitizer, and better tablets will have larger values......I think.

    Example:
    Code:
    ~$ xsetwacom get "Serial Wacom Tablet stylus" BottomX
    Returns the output:
    24576
    Of course the stylus only works by pointing it at the tablet screen, but we can easily control which screen the pointer appears on, and we'll scale it correctly so that pointing the stylus at the bottom right corner of the tablet screen will move the pointer to the bottom right corner of whichever screen we've chosen, regardless of the resolution. You'll generally use this only to restrict the stylus to the tablet screen, but I found it more clear to write this more generally since an external monitor can be on the right or the left.

    Horizontal settings:
    Using "Left" and "Right" to refer to our monitors only with regard to their xinput topology (that is, we don't care which is physically on the left, only which X thinks is on the left), we'll use the following notation:

    Wxsw(monitor) = the width that xsetwacom seems to ascribe to the screen,
    Wact(monitor) = the "actual" physical width in pixels of the screen.

    These can also be used for the whole display, so Wact(Left+Right) is the sum of the physical widths of the two displays; in other words, it's the same as Wact(Left)+Wact(Right). The number we found earlier for Wxsw(Left+Right) is how wide xsetwacom thinks the whole display is.

    Now, for reasons unknown:

    Wxsw(Left)*Wact(Left) = Wxsw(Right)*Wact(Right) = Wxsw(Left+Right)*Wact(Left+Right)

    In other words, the width ascribed to a screen by xsetwacom is inversely proportional to its physical width, with constant of proportionality equal to Wxsw(-)*Wact(-) for any of the screens involved. Since we know Wact(-) for each of our screens, knowing Wxsw(-) for any one of them gives us a numerical value for the constant of proportionality and allows us to determine Wxsw(-) for each of the others. For example, if we know:

    Wxsw(Left+Right) = 24576
    Wact(Left+Right) = Wact(Left)+Wact(Right) = 1280+1024 = 2304
    Wact(Right) = 1024

    Then the constant of proportionality is:

    Wxsw(Left+Right)*Wact(Left+Right) = 24576*2304 = 56623104

    and therefore:

    Wxsw(Right) = Wxsw(Left+Right)*Wact(Left+Right)/Wact(Right) = 56623104/1024 = 55296

    so xsetwacom sees the Right display as being 55,296 units wide.

    So how do we use this? Disconnect any external monitor and restart your computer to reset the xsetwacom values (simply restarting X may be enough). Use xrandr to connect the secondary display and check that the stylus is (incorrectly) mapped across both screens. Use
    Code:
    xsetwacom get [device name/id] BottomX
    as detailed above to find Wxsw(Left+Right). Use this number to find Wxsw(Left) and Wxsw(Right).

    Now, if you wish to map the stylus to the Left screen, use "xsetwacom set" to set the following values:

    TopX = 0
    BottomX = Wxsw(Left)

    We set TopX = 0 since we want the stylus to abut the left edge of the whole display, and we set BottomX = Wxsw(Left) so that the stylus uses the proper width, that is we want:

    BottomX-TopX = Wxsw(Left)

    If you wish to map the stylus to the Right screen, use "xsetwacom set" to set the following values:

    TopX = Wxsw(Left+Right)-Wxsw(Right)
    BottomX = Wxsw(Left+Right)

    We set BottomX = Wxsw(Left+Right) so the the stylus abuts the right edge of the display (remember that Wxsw(Left+Right) is the width that xsetwacom assigns to the whole display) and set TopX = Wxsw(Left+Right)-Wxsw(Right) so that the stylus uses the proper width, which is:

    BottomX-TopX = Wxsw(Left+Right)-[Wxsw(Left+Right)-Wxsw(Right)] = Wxsw(Right)

    To continue the earlier example, if I want to map my stylus to the Right screen only, then I use, with "Device name" or ID #:
    Code:
    xsetwacom set 14 TopX -30720
    xsetwacom set 14 BottomX 24576
    Yes, I use a negative value for TopX, which seems odd, but it works.

    To recap:

    1. Find Wxsw(-) for the default (wrong) setting.
    2. Compute the constant of proportionality.
    3. Find Wxsw(Left) or Wxsw(Right).
    4. Input values.

    Unless you change the resolutions for your screens, you should only have to find the constant of proportionality once.

    Vertical settings:

    When you use xrandr to use a second monitor, the stylus should scale according to the larger screen, so if you intend to use the stylus with the larger screen, no changes are needed.

    If you want to use the stylus with a screen which is the smaller of the two screens, then you'll want to adjust the vertical as well. All you should need to do is scale things. Let:

    Hact(Large) = Larger screen height in pixels
    Hact(Small) = Smaller screen height in pixels
    Hxsw(Large) = height xsetwacom assigns to the larger screen
    Hxsw(Small) = height xsetwacom assigns to the smaller screen

    Again, these values are related by:

    Hact(Large)*Hxsw(Large) = Hact(Small)*Hxsw(Small)

    To get the value needed to restrict the stylus to the vertical region spanned by the smaller screen, obtain Hxsw(Large) using:
    Code:
    xsetwacom get [device name/id] BottomY
    and set:

    BottomY = Hsxw(Small) = Hxsw(Large)*Hact(Large)/Hact(Small)

    using the command:
    Code:
    xsetwacom set [device name/id] BottomY VALUE
    For me, this is 18342*1024/768 = 24456, so:
    Code:
    xsetwacom set 14 BottomY 24456
    sets my stylus to have the desired height range. Of course, I still have TopY = 0.

    Eraser:

    If you have an eraser on your stylus, don't forget to adjust the eraser as well. Use the same commands you used for the stylus but with the "Device name" or id for the eraser instead.

    I hope this is clear enough.


    Using the old xsetwacom Multi-monitor commands - Pending

    You may benefit from using these versions of the Wacom drivers:
    For xf86-input-wacom (X server 1.7 or up) use the snapshot from the 9-7-10 "Allow 0 for TwinView resolution if TwinView is NONE." commit: http://linuxwacom.git.sourceforge.ne...24b9f6e;sf=tgz
    The commit is at: http://linuxwacom.git.sourceforge.ne...=shortlog;pg=1

    For linuxwacom (X servers less that 1.7) use 0.8.8-10: http://sourceforge.net/projects/linu...r.bz2/download


    Sources:
    Linux Wacom Project HOWTO "11.0 - Tablet-Screen Mapping": http://linuxwacom.sourceforge.net/in...o/multimonitor
    LWP HOWTO "5.1 - Adding the InputDevices": http://linuxwacom.sourceforge.net/in...howto/inputdev
    LWP HOWTO "9.0 - Command Line Configuration Interface (xsetwacom)": http://linuxwacom.sourceforge.net/in...owto/xsetwacom


    wacom.fdi version:
    These are the 3 basic lines you need:
    Code:
              <merge key="input.x11_options.TwinView" type="string">Horizontal</merge>
              <merge key="input.x11_options.TVResolution" type="string">1440x900,1280x1024</merge>
              <merge key="input.x11_options.ScreenNo" type="string">0</merge>
    Notice in TV resolution you have to specify both monitors.
    * TwinView applies only to those using the Nvidia proprietary driver TwinView.

    xsetwacom version:
    Code:
    xsetwacom set "Device name" Twinview Horizontal
    xsetwacom set "Device name" Screen_No 1
    xsetwacom set "Device name" TopX ??
    xsetwacom set "Device name" BottomX ??
    xorg.conf version:
    Code:
    Option  "Twinview"  "Horizontal"
    Option  "Screen_No"  "1"
    Option  "TopX"  "??"
    Option  "BottomX"  "??"
    Last edited by Favux; January 13th, 2011 at 12:07 AM.

  3. #3
    Join Date
    Mar 2009
    Beans
    358
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Re: HOW TO Setup a Wacom Tablet with Multi-Monitors in Maverick and Natty

    Here is what I have using the old method: http://ubuntuforums.org/showpost.php...6&postcount=33

    I believe that it is fairly complete (though I don't have 3 screens to test with). If you think it belongs in this thread, you can of course either incorporate what I have or just link to my post.
    Last edited by SnickerSnack; December 31st, 2010 at 08:28 AM.
    xubuntu 64-bit 11.10: AMD Phenom II x4 970 @3.5GHz, GSkill 8GB 1333MHz CAS7, Gigabyte HD Radeon 6850 OC 1GB GDDR5 256-bit, Gigabyte GA-990FXA UD3, CoolerMaster Hyper 212 EVO, Seasonic 620W Bronze, CoolerMaster HAF 912, Samsung 23" LED LCD

  4. #4
    Join Date
    Nov 2008
    Beans
    9,635
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOW TO Setup a Wacom Tablet with Multi-Monitors in Maverick and Natty

    Hi SnickerSnack,

    Great! Thanks. I'll look at it.

    I reserved the second post for the "old" method or alternative methods. If I have the energy to comb through all the threads to figure it out. It seemed like it was constantly changing and depended a lot on the video drivers.

  5. #5
    Join Date
    Feb 2009
    Beans
    52
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOW TO Setup a Wacom Tablet with Multi-Monitors in Maverick and Natty

    Favux, I find the idea behind this post great. But I am afraid that I don't have enough grasp of math and Linux tools to follow it through. Could you please provide a more thorough explanation for the points below?

    My case is not the simple one.


    First, I didn't understand how you arrived at the new matrices at all using the matrix multiplication and the linear equations. I looked up "affine transformation" on Wikipedia, thought about how they have to work in the simple case, and arrived at a method to calculate my own. I think that my matrices should be

    Code:
    left:                                right:
    [ 1280/(1280+2560)  0          0 ]   [ 2560/(1280+2560)  0          1280/(1280+2560)]
    [ 0                 1024/1440  0 ]   [ 0                 1440/1440  0               ]
    [ 0                 0          1 ]   [ 0                 0          1               ]
    please correct me if I am wrong.

    When I have the (hopefully) correct matrices, you say to

    use the appropriate xinput command for the monitor you want your device on:
    Left monitor:
    Code:

    xinput set-prop "Device name" --type=float "Coordinate Transformation Matrix" 0.5 0 0 0 1 0 0 0 1
    If I just type in
    Code:
    xinput set-prop "Wacom BambooFun 2FG 6x8 Pen stylus" --type=float "Coordinate Transformation Matrix 0.333 0 0 0 1 0 0 0 1
    how is xinput to know that this is meant for the left monitor? Am I missing something here?

  6. #6
    Join Date
    Nov 2008
    Beans
    9,635
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOW TO Setup a Wacom Tablet with Multi-Monitors in Maverick and Natty

    Hi Rumtscho,

    Great, first non-simple dual monitor case. The diagram is very helpful, thanks.

    Looks like you've done it correctly. So now:

    Left monitor:
    Code:
    xinput set-prop "Wacom BambooFun 2FG 6x8 Pen stylus" --type=float "Coordinate Transformation Matrix" 0.3333 0 0 0 .7111 0 0 0 1
    Right monitor:
    Code:
    xinput set-prop "Wacom BambooFun 2FG 6x8 Pen stylus" --type=float "Coordinate Transformation Matrix" 0.6666 0 0.3333 0 1 0 0 0 1
    And with your setup you shouldn't need a y offset for your left monitor. Using your "Device names" of course. And let's try 4 decimal accuracy.
    Last edited by Favux; January 8th, 2011 at 12:33 AM.

  7. #7
    Join Date
    Feb 2009
    Beans
    52
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOW TO Setup a Wacom Tablet with Multi-Monitors in Maverick and Natty

    Thank you for the quick reply. I am happy to know that my matrix calculation was right.

    Using each of the lines you posted (my device name happens to be "Wacom BambooFun 2FG 6x8 Pen stylus" too) I was able to restrict the stylus to the desired area.

    I have trouble with the next step, the xsetwacom set line. Could you please explain a) what it is this command supposed to do? And b) how many times do I have to run it, once per monitor or only once, period? My xrandr only gives me a single identifier for the whole virtual monitor, and when I run the line with it, I get an "output not connected" error. Is this normal?


    ---
    The detailed TL;DR version of the problem (questions still as above):
    ---

    This is how I understood your instructions.

    1. calculate matrices, build matrix lines for each monitor.

    2. run the matrix line for the left monitor (the xinput -set-prop command). This confines the stylus input to the area on the virtual screen corresponding to the left monitor.

    3. find out the name of the left monitor by running xrandr

    4. run the mapping line for the left monitor (the xsetwacom set "Device name" "MapToOutput" VGA1 command). I looked into the Linux wacom project xsetwacom howto, but did not find a description of the MapToOutput option. My wild guess is that this binds the current input settings to the monitor specified as VGA1.

    5. run the matrix line for the right monitor

    6. run the mapping line for the right monitor.

    Step 1 and 2 were OK. This is what I get at step 3:
    Code:
    rumtscho@bradbury:~$ xrandr
    xrandr: Failed to get size of gamma for output default
    Screen 0: minimum 3840 x 1440, current 3840 x 1440, maximum 3840 x 1440
    default connected 3840x1440+0+0 0mm x 0mm
       3840x1440      50.0*
    I was expecting two names from xrandr, one for the left monitor and one for the right monitor. If I have understood it correctly, running steps 4 and 6 with the same monitor name is nonsence.

    Of course, this sequence depends on my interpretation of step 4. Maybe it does something else than what I thought, it is correct for xrandr to provide the name of a single virtual screen, the correct sequence is 1-2-3-5-4 and I should use the single output of xrandr instead of VGA1.

    I tested this possibility and ran step 4 as
    Code:
    xsetwacom set "Wacom BambooFun 2FG 6x8 Pen stylus" "MapToOutput" Screen\ 0
    and got in response
    Code:
    Unable to find output 'Screen 0'. Output may not be connected.
    This confused me thoroughly. I opened xorg.conf to see how the screens are called there. This are the relevant parts of my xorg.conf (colour added manually):
    Code:
    Section "Monitor"
        Identifier     "Monitor0"
        VendorName     "Unknown"
        ModelName      "CRT-1"
        HorizSync       63.0 - 67.0
        VertRefresh     58.0 - 62.0
        Option         "DPMS"
    EndSection
    
    Section "Screen"
    
        Identifier     "Screen0"
        Device         "Device0"
        Monitor        "Monitor0"
        DefaultDepth    24
        Option         "TwinView" "1"
        Option         "TwinViewXineramaInfoOrder" "DFP-0"
        Option         "metamodes" "CRT: 1280x1024 +0+0, DFP: nvidia-auto-select +1280+0"
        SubSection     "Display"
            Depth       24
        EndSubSection
    EndSection
    There is no monitor section for the Dell. Besides, the CRT part is wrong, because the small monitor is an LCD. It never gets recognized correctly under Linux.

    Anyway, I tried running the command from step 4, using following identifiers instead of VGA1: Monitor0, CRT-1, Screen0, CRT, DFP. All produced the same "device not found" output as Screen 0.

  8. #8
    Join Date
    Feb 2009
    Beans
    52
    Distro
    Ubuntu 10.10 Maverick Meerkat

    How to calculate the matrix for any monitor

    I needed a long time to understand how to calculate a matrix for my case, but it is actually quite simple. I am posting a description for anybody who needs it. Favux, you can link it from the first post or copy it there if you think it is useful.

    This description can be applied for any monitor in any case, simple or complicated. It does not depend on the number of monitors you might have.

    This matrix is calculated once for every monitor.

    Monitor width
    is the horizontal resolution of the monitor.

    Monitor height is the vertical resolution of the monitor.

    Total width is the horizontal size of the combined area of all your monitors.

    Total height is the vertical size of the combined area of all your monitors.

    Horizontal offset is the horizontal distance between the upper left corner of the combined area of all monitors and the upper left corner of the monitor.

    Vertical offset is the vertical distance between the upper left corner of the combined area of all monitors and the upper left corner of the monitor.

    Relative horizontal size = monitor width / total width

    Relative vertical size = monitor height / total height

    Relative horizontal offset = horizontal offset / total width

    Relative vertical offset = vertical offset / total height

    Matrix:


    Example (screenshot taken from the GUI of the proprietary nvidia driver):



    Matrix for this example (for the righthand monitor):
    Code:
    0.6666  0      0.3333
    0       1      0     
    0       0      1
    Last edited by Rumtscho; January 8th, 2011 at 03:57 AM.

  9. #9
    Join Date
    Mar 2009
    Beans
    358
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Re: HOW TO Setup a Wacom Tablet with Multi-Monitors in Maverick and Natty

    Eh, nevermind me. I misunderstood your problem.
    Last edited by SnickerSnack; January 8th, 2011 at 04:06 AM.
    xubuntu 64-bit 11.10: AMD Phenom II x4 970 @3.5GHz, GSkill 8GB 1333MHz CAS7, Gigabyte HD Radeon 6850 OC 1GB GDDR5 256-bit, Gigabyte GA-990FXA UD3, CoolerMaster Hyper 212 EVO, Seasonic 620W Bronze, CoolerMaster HAF 912, Samsung 23" LED LCD

  10. #10
    Join Date
    Nov 2008
    Beans
    9,635
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOW TO Setup a Wacom Tablet with Multi-Monitors in Maverick and Natty

    Hi Rumtscho,

    First thank you for your contributions to the thread.

    Could you answer some questions for me?
    Using each of the lines you posted (my device name happens to be "Wacom BambooFun 2FG 6x8 Pen stylus" too) I was able to restrict the stylus to the desired area.
    So you didn't need the xsetwacom command? The xinput command restricted your stylus to the monitor you selected without it?
    Were you able to use 4 decimal accuracy?
    Does the new transformation matrix from xinput last through a reboot?
    Or do you need to implement it after each reboot?

    On the whole I'd say your explanation is a lot more lucid (pun intended) than my original one. Love the diagram. We will need to work it and your explanation into the HOW TO. However:
    Total height is the vertical size of the combined area of all your monitors.
    I don't believe that is correct. I think it would be correct if the monitors were stacked not side by side. In the side by side configuration I believe it is:
    Total height is the vertical size of the largest monitor.
    So if the monitors are stacked then:
    Total width is the horizontal size of the largest of all your monitors.
    How you handle X & Y reverses in the stacked case. I think xrandr allows you to do that with the --above and --below switches.

    SnickerSnack and I have been working on the "old" way of doing it and I think SnickerSnack has it figured out now. Albeit with some things still being mysterious. So I'll need to include it in the HOW TO also. Meanwhile he points out 'man xrandr' also has an explanation of the transformation matrix.

    I've already revised the HOW TO a little. Is it clearer?

Page 1 of 10 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •