Griffin Powermate with Debian

Dear all

 I run Debian with Matlab and i would like to have Powermate working with Psychtoolbox.

1) I installed https://github.com/stefansundin/powermate-linux
 Powermate works as an volume intensity device

2) When i run lsusb i get the following result
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 077d:0410 Griffin Technology PowerMate

The powermate is tracked as a USB device

3) But when i run PsychHID('Devices');
The Powermate can not be found

Any idea would be very helpful.

Thank you in advance,
Betty

 


XX---In PSYCHTOOLBOX@yahoogroups.com, <zampetakalogeropoulou@...> wrote :

Dear all

 I run Debian with Matlab and i would like to have Powermate working with Psychtoolbox.

1) I installed https://github.com/stefansundin/powermate-linux
 Powermate works as an volume intensity device

2) When i run lsusb i get the following result
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 077d:0410 Griffin Technology PowerMate

The powermate is tracked as a USB device

3) But when i run PsychHID('Devices');
The Powermate can not be found

Any idea would be very helpful.

Thank you in advance,
Betty

 

-> What's the output of "xinput --list"? Does /dev/input/powermate exist? If you kill the "powermate" daemon on the system, does anything change in these outputs? What is the output [a,b,c] = GetKeyboardIndices or [a,b,c]=GetMouseIndices?


-mario





1)xinput --list output
⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                  id=11    [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)]
    ↳ TOSHIBA Web Camera - HD                     id=9    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard                id=10    [slave  keyboard (3)]
    ↳ Toshiba input device                        id=12    [slave  keyboard (3)]

2) The /dev/input/powermate existd but it is empty

3) Here is the output of the two commands and it does not change if the deamon is dead or alive.
  [a,b,c]=GetMouseIndices

a =

     0     2     9


b =

    'Virtual core pointer'    'Virtual core XTEST pointer'    'SynPS/2 Synaptics TouchPad'

 [a,b,c] = GetKeyboardIndices

a =

     3     4     5     6     7     8    10


b =

  Columns 1 through 6

    [1x27 char]    'Power Button'    'Video Bus'    'Power Button'    [1x23 char]    [1x28 char]

  Column 7

    [1x20 char]

Thanks a lot for the help,

All the best,
Betty
The X-Server doesn't recognize the device as a valid input device. You could try adding a file /etc/X11/xorg.conf.d/10-evdev-powermate.conf with the following content: Section "InputClass"
        Identifier      "evdev Griffin PowerMate catchall"
        Driver          "evdev"
        MatchVendor     "077d"
        MatchDevicePath "/dev/input/event*"
        Option  "EmulateWheel"  "true"
        Option  "Emulate3Buttons"       "false"
        Option  "YAxisMapping"  "4 5"
EndSection

Then logout and login again and see if "xinput --list" shows the Powermate. Otherwise post the content of /var/log/Xorg.0.log.

There are other ways to do this, but ideally we'd have it turn up as a weird kind of mouse that can be easily handled with GetMouse. Unfortunately without having such a device finding the right config options is guesswork for me.

-mario

Thanks a lot for the help.

I tried your suggestion but it still does X-server does not report Powermate.

Here is the last part of the Xorg.0.log, where it refers to PowerMate

[  2755.455] (II) config/udev: Adding input device Griffin PowerMate (/dev/input/event6)
[  2755.455] (II) No input driver specified, ignoring this device.
[  2755.455] (II) This device may have been added with another device file.
[  2755.492] (II) intel(0): switch to mode 1360x768@59.8 on LVDS1 using pipe 0, position (0, 0), rotation normal, reflection$
[  2759.096] (II) config/udev: Adding input device Griffin PowerMate (/dev/input/event6)
[  2759.096] (II) No input driver specified, ignoring this device.


I also followed this link, Need help with Griffin PowerMate USB volume controller - new 64 bit desktop & Ubuntu 12.04 and powermate works for events recorder, the application evtest also works.

 


Since xinput does not recognize it, is there any other alternative?

Thanks a lot for the help
XX---In PSYCHTOOLBOX@yahoogroups.com, <zampetakalogeropoulou@...> wrote :

Thanks a lot for the help.

I tried your suggestion but it still does X-server does not report Powermate.

Here is the last part of the Xorg.0.log, where it refers to PowerMate

[  2755.455] (II) config/udev: Adding input device Griffin PowerMate (/dev/input/event6)
[  2755.455] (II) No input driver specified, ignoring this device.
[  2755.455] (II) This device may have been added with another device file.
[  2755.492] (II) intel(0): switch to mode 1360x768@59.8 on LVDS1 using pipe 0, position (0, 0), rotation normal, reflection$
[  2759.096] (II) config/udev: Adding input device Griffin PowerMate (/dev/input/event6)
[  2759.096] (II) No input driver specified, ignoring this device.

--> Try the same config file, but with MatchVendor and MatchProduct as name string like this, logout and login again:

Section "InputClass"
        Identifier      "evdev Griffin PowerMate catchall"
        Driver          "evdev"
        MatchVendor     "Griffin"
        MatchProduct    "PowerMate"
        Option  "EmulateWheel"  "true"
        Option  "Emulate3Buttons"       "false"
        Option  "YAxisMapping"  "4 5"
EndSection

--> There are different ways to access the PowerMate, but at the moment i'd like to have it work as a device that can be either treated like a mouse via GetMouse or keyboard via the KbQueue functions. And for that the X-Server needs to recognize and handle them like some odd type of keyboard or mouse.

Using evrouter would be another way, but that requires running a helper application in the background and may be slightly less accurate wrt. timing.

In the same way that that volume control app you mentioned or evtest do, one could also write a low level driver to directly access the /dev/input/event device from PTB. That would probably be the best long-term solution with the maximum level of control, but without having access to a PowerMate and not much time i don't fell the motivation to do that atm.

-mario


I also followed this link, Need help with Griffin PowerMate USB volume controller - new 64 bit desktop & Ubuntu 12.04 and powermate works for events recorder, the application evtest also works.

 


Since xinput does not recognize it, is there any other alternative?

Thanks a lot for the help
 
Cool. So the device index of the PowerMate is 11 according to GetMouseIndices.
This number may change on unplug/replug, so you need to match for the
"Griffin PowerMate" name string to find the corresponding deviceIndex.

Now you can look at the values returned by

[x,y,buttons,focus,valuators,valinfo] = GetMouse([], 11)

and see if some change in interesting ways if you actuate the PowerMate.

And look at the output of KbCheck(11), KbStrokeWait(11) etc.
and see if you see some button presses if you click or turn the
wheel.

Wheel turns should probably cause changes in the y-axis in GetMouse, or
button press events for buttons 4 and 5 in KbCheck et al.

There may be need for further tweaking. E.g., if a wheel turn by itself does
not have an effect, but only a wheel turn with pressed button, then you can
add another option to that config file (see "man evdev" for explanation):

Option "EmulateWheelButton" "0"

-mario


XX---In PSYCHTOOLBOX@yahoogroups.com, <zampetakalogeropoulou@...> wrote :

I changed the
 /etc/X11/xorg.conf.d/10-evdev-powermate.conf file according to your instructions and now
X server can see the powermate
Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                  id=11    [slave  pointer  (2)]
⎜   ↳ Griffin PowerMate                           id=13    [slave  pointer  (2)]

In Matlab the  [a,b,c]=GetMouseIndices
a = 0     2     9    11
b = 'Virtual core pointer'    [1x26 char]    [1x26 char]    'Griffin PowerMate'

But the PsychHID can not read the device, also when i run
GetChar , it does not get the rotations of the powermate.

It looks like, we are getting there.

Thanks a lot again,
Betty

On Friday, March 18, 2016 4:08 PM, "mario.kleiner@... [PSYCHTOOLBOX]" <PSYCHTOOLBOX@yahoogroups.com> wrote:


 
XX---In PSYCHTOOLBOX@yahoogroups.com, <zampetakalogeropoulou@...> wrote :

Thanks a lot for the help.

I tried your suggestion but it still does X-server does not report Powermate.

Here is the last part of the Xorg.0.log, where it refers to PowerMate

[  2755.455] (II) config/udev: Adding input device Griffin PowerMate (/dev/input/event6)
[  2755.455] (II) No input driver specified, ignoring this device.
[  2755.455] (II) This device may have been added with another device file.
[  2755.492] (II) intel(0): switch to mode 1360x768@59.8 on LVDS1 using pipe 0, position (0, 0), rotation normal, reflection$
[  2759.096] (II) config/udev: Adding input device Griffin PowerMate (/dev/input/event6)
[  2759.096] (II) No input driver specified, ignoring this device.

--> Try the same config file, but with MatchVendor and MatchProduct as name string like this, logout and login again:

Section "InputClass"
        Identifier      "evdev Griffin PowerMate catchall"
        Driver          "evdev"
        MatchVendor     "Griffin"
        MatchProduct    "PowerMate"
        Option  "EmulateWheel"  "true"
        Option  "Emulate3Buttons"       "false"
        Option  "YAxisMapping"  "4 5"
EndSection

--> There are different ways to access the PowerMate, but at the moment i'd like to have it work as a device that can be either treated like a mouse via GetMouse or keyboard via the KbQueue functions. And for that the X-Server needs to recognize and handle them like some odd type of keyboard or mouse.

Using evrouter would be another way, but that requires running a helper application in the background and may be slightly less accurate wrt. timing.

In the same way that that volume control app you mentioned or evtest do, one could also write a low level driver to directly access the /dev/input/event device from PTB. That would probably be the best long-term solution with the maximum level of control, but without having access to a PowerMate and not much time i don't fell the motivation to do that atm.

-mario


I also followed this link, Need help with Griffin PowerMate USB volume controller - new 64 bit desktop & Ubuntu 12.04 and powermate works for events recorder, the application evtest also works.
 

Since xinput does not recognize it, is there any other alternative?

Thanks a lot for the help
 


 
Hi all,

at the config file I added
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "number"

With number above 2, the KbStrokeWait(), gets only the press not the rotation.
Also, the [x,y,buttons,focus,valuators,valinfo] = GetMouse([], 11),
the valuators change when the knob is rotated.
But, when the knob is rotated the whole Matlab command window scrolls.
And the getChar does not work.
The evtest works fine.

Any ideas?

Thanks a lot,
Betty
Betty,

thanks to the very useful PowerMate hardware donation from your lab i was quickly able to create a nice Linux function for the handling of Griffin's PowerMate today. I'll release it later today as part of a PTB beta update.

The optimal xorg.conf file for me looks like this:

 Section "InputClass"
        Identifier      "evdev Griffin PowerMate catchall"
        Driver          "evdev"
        MatchVendor     "Griffin"
        MatchProduct    "PowerMate"
EndSection

Iow. simpler than we had. It just tells the X-Server to use the "evdev" input device driver to handle the PowerMate, no need for extra options. This should work on Ubuntu 14.04.2-LTS and later (tested on 14.04.4-LTS and 16.04-LTS beta release), and should work on Debian-8 "Jessie" and later. One needs version 2.9.0 or later of the evdev driver (/var/log/Xorg.0.log will list the evdev version). Then GetMouse() valuator(3) will contain the rotary knob position, and mouse button 1 will tell the state of the knob. Anyway the PsychPowerMate() function will handle all this.

Anyway, more later.
-mario


XX---In PSYCHTOOLBOX@yahoogroups.com, <zampetakalogeropoulou@...> wrote :

Hi all,

at the config file I added
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "number"

With number above 2, the KbStrokeWait(), gets only the press not the rotation.
Also, the [x,y,buttons,focus,valuators,valinfo] = GetMouse([], 11),
the valuators change when the knob is rotated.
But, when the knob is rotated the whole Matlab command window scrolls.
And the getChar does not work.
The evtest works fine.

Any ideas?

Thanks a lot,
Betty
 
Hi Mario,

thanks a lot. I am looking forward for the function!

All the best,

Betty

I have the neurodebian version of Psychtoolbox and I updated the applications but I did not get the Powermate function.
Do I have to install psychtoolbox with svn?
The Neurodebian version does not provide DownloadPsychtoolbox function.

Thanks a lot,
Betty