Griffin Powermate on Ubuntu

Hi


Just wondering if anyone has any experience at all with using a Griffin Powermate rotatory controller (older USB version) working in PTB on Ubuntu?  


I'm running Matlab R2012b on Ubunu 12.04.  The info I can supply is:


GetChar does not respond to it.


It does not appear as a Gamepad device.


At appears in the PsychHID list, but with the following Device info:


    usagePageValue: 12

        usageValue: 1

         usageName: 'TBD'

             index: 1

         transport: '0004:0004:00'

          vendorID: 1917

         productID: 1040

           version: 1024

      manufacturer: 'Griffin Technology, Inc.'

           product: 'Griffin PowerMate'

      serialNumber: ''

        locationID: 262148

       interfaceID: 0

     totalElements: 0

          features: 0

            inputs: 0

           outputs: 0

       collections: 0

              axes: 0

           buttons: 0

              hats: 0

           sliders: 0

             dials: 0

            wheels: 0


If I understand that correctly, PsychHID is not picking up a lot of info (0 axes, etc), but I notice it does the same when querying the mouse etc; moreover trying:


PsychHID('Elements',1) % where 1 is the index of the Powermate


throws an error that that sub-command does not exist -- neither is there a help file for that on PTB Linux - so I guess this command class is very different on Ubuntu than Mac etc?


Anyway, does anyone have a clue how to get this device working on Linux (if it's possible)?


I have noticed this possible work around which "hijacks" the Powermate:   -- TomTheGeek: Griffin Powermate working with Ubuntu Feisty Fawn :: I haven't tried it yet, what I'd ideally like to do is yoke the PM to the vertical mouse axes rather than a volume control, so if anyone can point me towards the underlying commands to do that, this might be a workaround.


Alternately, if anyone can recommend a different rotatory input device that does work with PTB/Linux, then please let me know!


PsychHID on Linux, Windows and OSX differ greatly in the way they support low-level HID access, due to the very different underlying operating system mechanisms. E.g., PsychHID will always report hard-coded zero values for axis, button, ... counts on Linux - detecting the numbers is not implemented.

What does the terminal command "xinput -l" show you? I'd expect the Powermate to probably show up as some kind of weird keyboard/mouse combo. Or what does GetMouseIndices give you? GetMouse with some optional parameters, maybe after some configuration via xinput will probably expose it in a meaningful way.

-mario
Hi
 

 Thanks for the reply
 

 xinput -list
 

 gives me
 

 ⎡ Virtual core pointer                        id=2    [master pointer  (3)]
 ⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
 ⎜   ↳ Logitech Optical USB Mouse                  id=9    [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)]
     ↳ Power Button                                id=7    [slave  keyboard (3)]
     ↳ Dell Dell USB Keyboard                      id=8    [slave  keyboard (3)]
     ↳ Dell WMI hotkeys                            id=10    [slave  keyboard (3)]
 

 ("xinput -l" doesn't work...)
 

 So the Powermate isn't there.  But plugging in the PM gives the following in Syslog
 

 Oct  2 12:16:06 sacklerubuntu1 kernel: [  335.022472] usb 4-2: new low-speed USB device number 3 using uhci_hcd
 Oct  2 12:16:06 sacklerubuntu1 kernel: [  335.203515] usb 4-2: New USB device found, idVendor=077d, idProduct=0410
 Oct  2 12:16:06 sacklerubuntu1 kernel: [  335.203520] usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
 Oct  2 12:16:06 sacklerubuntu1 kernel: [  335.203524] usb 4-2: Product: Griffin PowerMate
 Oct  2 12:16:06 sacklerubuntu1 kernel: [  335.203526] usb 4-2: Manufacturer: Griffin Technology, Inc.
 Oct  2 12:16:06 sacklerubuntu1 kernel: [  335.225618] input: Griffin PowerMate as /devices/pci0000:00/0000:00:1a.1/usb4/4-2/4-2:1.0/input/input13
 Oct  2 12:16:06 sacklerubuntu1 mtp-probe: checking bus 4, device 3: "/sys/devices/pci0000:00/0000:00:1a.1/usb4/4-2"
 Oct  2 12:16:06 sacklerubuntu1 mtp-probe: bus: 4, device: 3 was not an MTP device
 Oct  2 12:16:06 sacklerubuntu1 udevd[688]: kernel-provided name 'input/event2' and NAME= 'input/powermate' disagree, please use SYMLIN
 

 So it's registering it to some degree, as far as I can understand (limited Linux knowledge).
 

 Anyway, I have managed a work-around to some degree: using 
 

 http://tomthegeek.blogspot.co.uk/2007/05/griffin-powermate-working-with-ubuntu.html  


 I managed to use that evrouter daemon to output alphanumeric characters.  These can be recognised by CharAvail/GetChar -- but not by KbQueue/KbCheck (I think someone on here did something similar with OSX).
 

 This means it can be used for things which do not require fine-timing, so it's OK for my current purposes (participants adjust the position of a point around the circle under unspeeded conditions).  On the otherhand, if you have any pointers towards getting the thing working to a more accurate timing level (i.e., can it be polled by KbQueue or PsychHID) that would be really great.
 

 Anyway, thanks for the help.
Ok look at these instructions, which are almost the same you used:

Griffin Powermate on Linux | screamingroot.org

 



But: Instead of using the unix group 'video' in step 1 you can use 'psychtoolbox', as in order to use Psychtoolbox, you will be part of that group anyway if you followed the instructions of PsychLinuxSetup() the first time you installed PTB.

You should delete the udev rule file you created before, then step 3 for udev to pick up the changes, probably also an unplug/replug of the device to fully accept them.

Now you hopefully have a file "/dev/input/powermate" and the kernel no longer complains about "Use SYMLIN" and mismatches and such.

Next you can try creating a text config file /etc/X11/xorg.conf with this content:

Section "InputDevice"
        Identifier  "Powermate0"
        Driver      "evdev"
        Option      "Name" "Griffin PowerMate"
        Option      "DialRelativeAxisButtons" "6 7"
EndSection
Save it, logout, login again and then check if "xinput --list" now lists some Powermate entry.

Otherwise you could try this content:

Section "InputDevice"
        Identifier  "Powermate0"
        Driver      "evdev"
        Option      "Device" "/dev/input/powermate"
        Option      "DialRelativeAxisButtons" "6 7"
EndSection

If none of these works with xinput --list, then i'd actually have to read the manual for "man evdev" because some option is wrong or missing, but i'm booted into the wrong os for this atm.

If it works, then these entries shouldn't be done or added to xorg.conf, but into one of the xorg.conf.d/ directories on your system under a name like "10-evdev-powermate.conf"

Let us know asap, maybe we can provide a ready made config file for the future with the PTB distro.
-mario
Thanks - it may be a week or so before I can test that, I am very wary about messing with the current setup now it works; am setting up a new Ubuntu machine soon so I will try that advice then and let you knwo

Don't be scared of messing it up. If it doesn't work, you can simply delete that text file again, logout, login, and you'll be back to the old config. Even if you'd somehow manage to screw up so badly that the system won't let you get to the GUI, most Linux distros have some "recovery mode" choosable at boot (e.g, Ubuntu flavors) where you get a text login and can delete the file from there, then reboot and be good. Or edit the text file with a simple text editor like "pico" or "nano".

That's the beauty of text configuration files. One can always undo screwups by simple renaming or deleting a file, or copying back a good backup file.

-mario