Page 9 of 10 FirstFirst ... 78910 LastLast
Results 81 to 90 of 98

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

  1. #81
    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

    Quote Originally Posted by asgard2 View Post
    0 should be the right screen and 1 the left.
    OK, it appears it is treating the right monitor as the "primary" or HEAD-0 monitor and the left monitor as HEAD-1. I wonder how it is determining that. The physical connections to the video card?
    Quote Originally Posted by asgard2 View Post
    But the problem is with both screens if I use MapToOutput, the lower part of the screen is unreachable.
    There seems to be a bug with how the Nvidia driver implements y-axis scaling with the RandR. Since it is still relatively early days for the Nvidia driver being compatible with RandR I guess that isn't too surprising.

    I think I have a handle on what is happening, maybe. The MapToOutput results tell the story I think. Instead of using the largest y-axis (in your case 1080) like the other Xorg drivers it is using the "primary" or right monitor's (HEAD-0) y-axis, i.e. 800. So the bug is in the code where it selects the appropriate or maximum y-axis.

    When MapToOutput is doing the CTM scaling for the y-axis you are getting:
    Code:
    Right:  800/1080 = .740741 for the scaling and the bottom 25% of the screen isn't covered
    
    Left:  800/800 = 1 Then remember it is applying the scaling to 800 or 1 x 800  But that is only 75% of the left monitor's 1080 y-dimension.  So the bottom 25% of the screen isn't covered.
    The fact that we can use xinput to set the CTM scaling for the right monitor to 1 and it fits seems to confirm the idea. What I don't understand is why setting the left monitor's y-scaling to 1.35 doesn't work. Why would anything over 800 get chopped off?


    I think you probably need to file a bug report with Nvidia against their driver. But first I would suggest you look carefully through the settings in the Nvidia control panel and see if there is something relevant there. There may even be a new setting or two that applies. Please post if you find something.
    Last edited by Favux; March 25th, 2013 at 11:45 PM.

  2. #82
    Join Date
    Nov 2005
    Location
    Oslo, Norway
    Beans
    206
    Distro
    Ubuntu 12.04 Precise Pangolin

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

    I updated the script posted a few pages ago. Save it as waspect and make it executable "chmdo a+x waspect". You can throw it into /usr/local/bin if you want to make it available systemwide.

    It's not tested very much but seems to work.

    To run it type waspect (if it's in path), or ./waspect if you're in the same folder as the script. This will match the aspect of the tablet to your screen(s). You can also run "waspect first" or "waspect second" to map the tablet to one of your screens. I've only put in support for two screens, so if you have more you're on your own.

    Code:
    #!/bin/bash
    #
    # Matches the shape of the active area on your Wacom tablet, to your screen resolution.
    #
    # Usage: waspect [first|second]
    # 
    #  Used with no argument it matches the aspect ratio to the resolution of your screen(s).
    #  Used with either first or second, it will match the aspect ratio of the tablet to the first or second screen.
    #
    # Modified version of Wacom Aspectratio script 0.1 \(ReasonNL\)
    
    
    if [ "$1" == "-h" ]
    then
        echo "Usage: waspect [first|second]"
        echo "waspect matches the active area of your wacom tablet to your screen(s) resolution."
        echo "Use first or second option, to match you tablet to one of two screens."
        echo "The script only supports one or two screens."
        exit 0
    fi
    
    # Config active tablet area position
    positionX=center    #left, center, right
    positionY=top         #top, center, left
    
    # Start script
    precision=10000
    
    # Maps to both
    resolution=`/usr/bin/xrandr -q  | grep "Screen 0" | grep "current [0-9]\+ x [0-9]\+" -o | tr -d "current "`
    mapto=-1
    count=0
    screens=`xrandr -q | grep "connected [0-9]\+x[0-9]\+" -o | tr -d "connected " | sed ':a;N;$!ba;s/\n/ /g'`
    screens=`xdpyinfo -ext XINERAMA | grep "head" | cut -d\  -f 5 | sed ':a;N;$!ba;s/\n/ /g'`
    screencount=`echo $screens | wc -w`
    for s in ${screens[*]}
    do
        if [[ "$1" == "first" && $count == 0 ]]
        then
            mapto=0
            resolution=$s
        elif [[ "$1" == "second" && $count == 1 ]]
        then
            mapto=1
            resolution=$s
        fi
        let count+=1
    done
    
    resX=`echo $resolution | grep "^[0-9]\+" -o`
    resY=`echo $resolution | grep "[0-9]\+$" -o`
    resRatio=$(((resX*precision)/resY))
    if [[ $mapto -eq -1 && $screencount -eq 1 ]]
    then
        echo Matching aspect ratio of the tablet to the screen at resolution $resolution
    elif [ $mapto -eq -1 ]
    then
        echo Matching aspect ratio of the tablet to both screens at resolution $resolution
    elif [ $mapto -gt -1 ]
    then
        echo Matchin aspect ratio of the tablet to the $1 screen at resolution $resolution
    fi
    xsetwacom --list | while read line; do
        device=`echo $line | grep "id: [0-9]\+" -o | tr -d "id: "`
        xsetwacom set "$device" ResetArea
        if [ $mapto -gt -1 ]
        then
            xinput map-to-crtc "$device" "HEAD-$mapto"
        else
            xsetwacom set "$device" MapToOutput "$resolution+0+0"
        fi
        area=`xsetwacom get "$device" Area | grep "[0-9]\+ [0-9]\+$" -o`
        areaX=`echo $area | grep "^[0-9]\+" -o`
        areaY=`echo $area | grep "[0-9]\+$" -o`
        # echo Area is $areaX by $areaY
        if [ "$areaX" != "" -a "$areaY" != "" ]; then
            if [ $resRatio -gt $precision ]; then
                newAreaX=$areaX
                newAreaY=$(( (areaX*precision)/resRatio ))
            elif [ $resRatio -lt $precision ]; then
                newAreaX=$(( (areaY*resRatio)/precision ))
                newAreaY=$areaY
            else
                if [ $areaX -gt $areaY ]; then
                    newAreaX=$areaY
                    newAreaY=$areaY
                else
                    newAreaX=$areaX
                    newAreaY=$areaX
                fi
            fi
            newTop=0
            newLeft=0
            if [ $areaX -gt $newAreaX ]; then
                if [[ $positionX == center ]]; then
                    newLeft=$(( (areaX-newAreaX)/2 ))
                elif [[ $positionX == right ]]; then
                    newLeft=$(( areaX-newAreaX ))
                fi
                newAreaX=$((newAreaX+newLeft))
            fi
            if [ $areaY -gt $newAreaY ]; then
                if [[ $positionY == center ]]; then
                    newTop=$(( (areaY-newAreaY)/2 ))
                elif [[ $positionY == bottom ]]; then
                    newTop=$(( areaY-newAreaY ))
                fi
                newAreaY=$((newAreaY+newTop))
            fi
            xsetwacom set "$device" Area "$newLeft $newTop $newAreaX $newAreaY"
            # echo Area of $line set to `xsetwacom get "$device" Area`
        else
            echo $line doesn\'t have an area
        fi
    done
    I've run it on Ubuntu 12.4 64bit, with Nvidia propriatary drivers, and two screens at 1600x1200 and 2560x1440.


    It's all a bit quick and hacky, so let me know if it doesn't work as expected.

  3. #83
    Join Date
    Apr 2009
    Beans
    43

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

    Hi there, I've got a couple of questions:

    Got a Sony Vaio Fit Multi-Flip (can invert the screen and has a touch display) which I want to setup, so far it's working, but:

    Is this still the preferred way to configure under 13.10 or are there now any tools that help?

    I've got the following setup:

    LEFT External Monitor 1680 x 1050
    RIGHT Laptop Touch Display Inverted 1920 x 1080

    Given the calculations above I get the matrix:
    -0.53333333333333333333 0 1
    0 -1.02857142857142857142 1.02857142857142857142
    0 0 1

    I don't seem to have a wacom device, xwacom --list devices returns nothing, xinput returns among others:
    ⎡ Virtual core pointer id=2 [master pointer (3)]
    ⎜ ↳ N-trig DuoSense Pen id=18 [slave pointer (2)]
    ⎜ ↳ N-trig DuoSense id=19 [slave pointer (2)]

    which seems to be my touch device.

    I then used:
    xinput set-prop "N-trig DuoSense Pen" --type=float "Coordinate Transformation Matrix" -0.53333333333333333333 0 1 0 -1.02857142857142857142 1.02857142857142857142 0 0 1

    to configure the stylus on the right (laptop) screen.
    it works, and is accurate on the top/right side - however, if I move the pen to the bottom/left edge it's off around 1 cm to the left and 1cm to the bottom.

    can anyone spot what I missed?

    Thanks a lot!

  4. #84
    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 Solars,

    Correct, it is an N-Trig digitizer not a Wacom digitizer. The Pen should be on the Wacom X driver however. The 50-wacom.conf in xorg.conf.d has this match:
    MatchProduct "HID 1b96:0001|N-Trig Pen"
    Run lsusb in a terminal and post the output, at least the N-Trig line. Let's see if the Product ID differs and is for a new N-Trig digitizer. As you can see 'N-Trig Pen' has changed to 'N-trig DuoSense Pen' which is why it isn't matching. Did it come with a Pen/Stylus? Sounds like it did.

    Multi-touch should be on the second node:
    ⎜ ↳ N-trig DuoSense id=19 [slave pointer (2)]
    and be through the evdev X driver.

    Theoretically you should be able to use the Gnome Wacom applet in System Settings to set the Pen to the monitor you want if it is on the Wacom X driver.

    Also it sounds like you may need to calibrate the stylus. When the Multi-Flip is not connected to another monitor is calibration good? There should be calibration in your version of the Wacom applet. Otherwise you can use xinput_calibrate (Calibrate Touchscreen in the Software Center). You can apply the calibration either through a custom xorg.conf.d .conf file or a script.
    Last edited by Favux; November 10th, 2013 at 04:35 PM.

  5. #85
    Join Date
    Apr 2009
    Beans
    43

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

    Hi there, thanks for your answer!

    lsusb returns Bus 002 Device 005: ID 1b96:0f04 N-Trig
    Stylus is included, yes, one from Sony with 2 buttons

    Do you mean the section "Wacom Tablet" in gnome-control-center?
    If I open it it says No tablet detected.

    The calibration is good if not connected to another monitor, yes
    If I invert the display though, the movement is inverted though.

    I used xinput_calibrate for the standalone use and the matrices I posted for the connected monitor.
    But as I've mentioned, it's off by about 1cm in x and y direction on the bottom left corner, not sure if the calculation is wrong, but I checked it.

    How can I enable multi-touch? Does this only work through this wacom applet?
    I'm now in a different window manager (i3) not sure if it would be different in unity for the wacom app?
    I can start all the gnome stuff anyways..

    Thanks,
    Christoph

  6. #86
    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

    There isn't a match so both the stylus and touch are likely on evdev. You can verify that by running:
    Code:
    xinput list-props ID#
    Using the current (can change) ID# of both nodes.

    Let's try to put the stylus on the Wacom driver. We'll be bad and modify the 50-wacom.conf rather than create the user xorg.conf.d and add a custom .conf to it. For an explanation see: http://sourceforge.net/apps/mediawik...le=Xorg.conf.d
    Code:
    gksudo gedit /usr/share/X11/xorg.conf.d/50-wacom.conf
    In 13.10 you may need to install the 'gksu' package first. Change:
    Code:
    # N-Trig Duosense Electromagnetic Digitizer
    Section "InputClass"
    	Identifier "Wacom N-Trig class"
    	MatchProduct "HID 1b96:0001|N-Trig Pen"
    	MatchDevicePath "/dev/input/event*"
    	Driver "wacom"
    	Option "Button2" "3"
    EndSection
    to read:
    Code:
    # N-Trig Duosense Electromagnetic Digitizer
    Section "InputClass"
    	Identifier "Wacom N-Trig class"
    	MatchProduct "HID 1b96:0001|ID 1b96:0f04|N-Trig Pen|N-trig DuoSense Pen"
    	MatchDevicePath "/dev/input/event*"
    	Driver "wacom"
    	Option "Button2" "3"
    EndSection
    Then either log out and in or restart. I'm not sure 'ID 1b96:0f04' will actually match so if you could try that alone at some point and report if it works that would be good. Post xinput list to check if the stylus is now on the Wacom driver and check if Wacom Tablet sees it now.

    The Wacom X driver won't work for N-Trig touch. Multi-touch, if enabled, should be automatic through the evdev driver. See: http://sourceforge.net/apps/mediawik...tle=Multitouch

    Edit: Thinking a bit I wonder if we shouldn't move this to a new thread. You've got a new N-Trig digitizer and a new thread about your model Vaio would probably be a good thing. Plenty of information already to copy over to it.
    Last edited by Favux; November 10th, 2013 at 05:17 PM.

  7. #87
    Join Date
    Apr 2009
    Beans
    43

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

    I will create a new thread once I figured out what can be done successfully

    The device properties was: https://gist.github.com/anonymous/cd1c294a34ee81e4dc9f

    Sso I changed the configuration and restarted X, the output includes now:
    ↳ N-trig DuoSense Pen stylus id=18 [slave pointer (2)]
    ⎜ ↳ N-trig DuoSense Pen eraser id=19 [slave pointer (2)]
    ⎜ ↳ N-trig DuoSense Pen pad id=20 [slave pointer (2)]
    ⎜ ↳ N-trig DuoSense id=21 [slave pointer (2)]

    The wacom settings are also working - I'm not sure how to continue now to set this up in the right/easiest way.
    Is there a way to configure the inverted mode and calibrate it? Or do I still need the CTM stuff?
    I noticed I can map it to a specific screen, but it still seems to be as it was before (touch pointer across both screens, inverted)

    The output

  8. #88
    Join Date
    Apr 2009
    Beans
    43

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

    Ah! Now this worked:
    xsetwacom set "N-trig DuoSense Pen stylus" MapToOutput eDP1

    It's limited to the laptop screen now (didn't work through the wacom settings)
    The axis are still inverted though:
    xinput set-prop 18 "Evdev Axes Inversion" 1
    property 'Evdev Axes Inversion' doesn't exist, you need to specify its type and format

  9. #89
    Join Date
    Apr 2009
    Beans
    43

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

    ok I understood, I think it is working now through xsetwacom!

    And: xsetwacom --set 18 Rotate half
    works like a charm

  10. #90
    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

    Sounding good. When on xinput list you see stuff like stylus, eraser, and pad appended you know it is on the Wacom X driver because that is what is doing that.
    Code:
    N-trig DuoSense Pen stylus
    For touch you'll probably need a xinput CTM command for evdev as I don't think the old axis swap stuff works. At least it was broken for a while anyway.

    Does the Multi-Flip use an accelerometer to change orientation?

Page 9 of 10 FirstFirst ... 78910 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
  •