admiralakber / thinkpad-yoga-scripts

Thinkpad Yoga S1 scripts for GNU/Linux
http://blog.admiralakber.com/?p=400
GNU General Public License v3.0
147 stars 31 forks source link

xinput call error #13

Open eudoxos opened 9 years ago

eudoxos commented 9 years ago

Hi, thanks for your wonderful scripts. I am having an issue with rotation of the touchscreen matrix. The service runs, but when I rotate the computer, calling xinput results in an error:

unable to find device SYNAPTICS Synaptics Touch Digitizer V04

When I run the relevant command manually (xinput set-prop "SYNAPTICS Synaptics Touch Digitizer V04" "Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1), everything works. The device is there, as can be seen from the output. The service is run with username replaced by my real username.

 $ xinput list
⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Wacom ISDv4 EC Pen stylus                 id=10   [slave  pointer  (2)]
⎜   ↳ Wacom ISDv4 EC Pen eraser                 id=14   [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=12   [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                     id=15   [slave  pointer  (2)]
⎜   ↳ SYNAPTICS Synaptics Touch Digitizer V04   id=16   [slave  pointer  (2)]
⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
    ↳ Power Button                                id=6    [slave  keyboard (3)]
    ↳ Video Bus                                   id=7    [slave  keyboard (3)]
    ↳ Power Button                                id=8    [slave  keyboard (3)]
    ↳ Integrated Camera                           id=9    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard                id=11   [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                      id=13   [slave  keyboard (3)]

Some suggestions what I could do to debug the issue?

Thanks!

admiralakber commented 8 years ago

I believe this issue has been fixed in latest merge - thanks to christoph-h.

The issue was that the xinput list is empty when you boot up, give it a go with the latest set of scripts.

LittleHuba commented 8 years ago

This bug occurs to me at every screen rotation. It seems xInput needs some time to "refind" the touch digitizer. I made a messy workaround:

while(1):
        try:
             check_call([
                  'xinput', 'set-prop', dev,
                  'Coordinate Transformation Matrix',
              ] + s['coord'].split(),env=env)
        except CalledProcessError:
             sleep(0.2)
             continue
        break

(You need to import CalledProcessError from subprocess)

Hope this helps