New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion/Wiki/How-to: Foot pedals #28

Closed
devhell opened this Issue Dec 30, 2017 · 13 comments

Comments

Projects
None yet
2 participants
@devhell
Contributor

devhell commented Dec 30, 2017

Hi,

First of all, thank you for making parlatype, it's absolutely the best. However, I think it would be a good thing if there could be some documentation on how to get hardware foot pedals working under various systems. I understand that this is not directly related to parlatype, but considering the coverage it has received in various online press, I would expect some poor researchers/transcribers would have an easier time to switch to parlatype if maybe foot pedals were documented here too.

I recently bought a foot pedal (Infinity IN-USB-2) for my transcriptions, and I've had a good look online regarding how to get it to work on various Linux distros. Unfortunately there is a lot of outdated information and some conflicting information too. Some mention using various udev/hwdb rules, others seem to have their own way of doing things. Unfortunately, as of yet, I have not found a way to get the aforementioned pedal to work under Ubuntu 16.04. The kernel recognizes the pedal, but that's about it. I've also tried writing a hwdb rules file with the scancodes taken from evtest, alas no luck.

I'd be more than happy to test various suggestions if anyone would like to help make this work. I'll submit documentation here if that's okay with you.

Thank you

@gkarsay

This comment has been minimized.

Show comment
Hide comment
@gkarsay

gkarsay Jan 3, 2018

Owner

Thank you! I was already waiting for the first feedback about foot pedals. Alas I don't have one myself and all I know that in theory they should work with Parlatype.

The best solution so far I found on the net is http://compsoc.man.ac.uk/~shep/pedals.html which was updated for Ubuntu 16.04. I hope you can get it working with those instructions. (Without the binding to modifiers part.) If you were successful assigning keys to the pedals you finally would have to assign those keys as media keys in GNOME settings.

I'm currently thinking of implementing pedals natively in Parlatype but that still needs a lot of investigation. In case I should make some progress I'm looking forward to having you as a beta tester.

Owner

gkarsay commented Jan 3, 2018

Thank you! I was already waiting for the first feedback about foot pedals. Alas I don't have one myself and all I know that in theory they should work with Parlatype.

The best solution so far I found on the net is http://compsoc.man.ac.uk/~shep/pedals.html which was updated for Ubuntu 16.04. I hope you can get it working with those instructions. (Without the binding to modifiers part.) If you were successful assigning keys to the pedals you finally would have to assign those keys as media keys in GNOME settings.

I'm currently thinking of implementing pedals natively in Parlatype but that still needs a lot of investigation. In case I should make some progress I'm looking forward to having you as a beta tester.

@devhell

This comment has been minimized.

Show comment
Hide comment
@devhell

devhell Jan 3, 2018

Contributor

Hi! How lovely that you are cool with this. I will check out that guide and document the results here. I'll be more than happy to work with you and be a beta tester. ;)

Thank you

Contributor

devhell commented Jan 3, 2018

Hi! How lovely that you are cool with this. I will check out that guide and document the results here. I'll be more than happy to work with you and be a beta tester. ;)

Thank you

@devhell

This comment has been minimized.

Show comment
Hide comment
@devhell

devhell Jan 5, 2018

Contributor

I'm stuck a bit, and I'm not sure what's going on.

I've created a custom hwdb entry with the following contents and stored it as expected in /etc/udev/hwdb.d/90-custom-keyboard.hwdb:

#Bus 001 Device 002: ID 05f3:00ff PI Engineering, Inc. VEC Footpedal
#Input device ID: bus 0x3 vendor 0x5f3 product 0xff version 0x100
#Input device name: "VEC  VEC USB Footpedal"
evdev:input:b*v05F3p00FF*
 KEYBOARD_KEY_90001=f13
 KEYBOARD_KEY_90002=f14
 KEYBOARD_KEY_90003=f15

After that I issued systemd-hwdb update and (for good measure) udevadm trigger and then rebooted.

The evtest output shows that the scancode/keycode mapping has been successful:

user@machine~$ evtest
No device specified, trying to scan all of /dev/input/event*
Not running as root, no devices may be available.
Available devices:
/dev/input/event0:	Power Button
/dev/input/event1:	Lid Switch
/dev/input/event2:	Sleep Button
/dev/input/event3:	Power Button
/dev/input/event4:	AT Translated Set 2 keyboard
/dev/input/event5:	Video Bus
/dev/input/event6:	SynPS/2 Synaptics TouchPad
/dev/input/event7:	VEC  VEC USB Footpedal
/dev/input/event8:	VGA Webcam
/dev/input/event9:	Acer WMI hotkeys
/dev/input/event11:	HDA Intel PCH Front Headphone
/dev/input/event12:	HDA Intel PCH HDMI/DP,pcm=3
Select the device event number [0-12]: 7
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x5f3 product 0xff version 0x100
Input device name: "VEC  VEC USB Footpedal"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 183 (KEY_F13)
    Event code 184 (KEY_F14)
    Event code 185 (KEY_F15)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1515172012.721967, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1515172012.721967, type 1 (EV_KEY), code 183 (KEY_F13), value 1
Event: time 1515172012.721967, -------------- SYN_REPORT ------------
Event: time 1515172013.433970, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1515172013.433970, type 1 (EV_KEY), code 183 (KEY_F13), value 0
Event: time 1515172013.433970, -------------- SYN_REPORT ------------
Event: time 1515172016.642000, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1515172016.642000, type 1 (EV_KEY), code 184 (KEY_F14), value 1
Event: time 1515172016.642000, -------------- SYN_REPORT ------------
Event: time 1515172017.265923, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1515172017.265923, type 1 (EV_KEY), code 184 (KEY_F14), value 0
Event: time 1515172017.265923, -------------- SYN_REPORT ------------
Event: time 1515172018.602134, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90003
Event: time 1515172018.602134, type 1 (EV_KEY), code 185 (KEY_F15), value 1
Event: time 1515172018.602134, -------------- SYN_REPORT ------------
Event: time 1515172019.225910, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90003
Event: time 1515172019.225910, type 1 (EV_KEY), code 185 (KEY_F15), value 0
Event: time 1515172019.225910, -------------- SYN_REPORT ------------

That's all good and well. However, xev doesn't recognize anything, and xinput doesn't list the device (didn't before, and I don't even know if it should or not, just FYI). Additionally, showkey --keycodes under the Linux console doesn't show anything either. I'm sure I'm missing something, but I don't know what. Any help would be greatly appreciated.

Contributor

devhell commented Jan 5, 2018

I'm stuck a bit, and I'm not sure what's going on.

I've created a custom hwdb entry with the following contents and stored it as expected in /etc/udev/hwdb.d/90-custom-keyboard.hwdb:

#Bus 001 Device 002: ID 05f3:00ff PI Engineering, Inc. VEC Footpedal
#Input device ID: bus 0x3 vendor 0x5f3 product 0xff version 0x100
#Input device name: "VEC  VEC USB Footpedal"
evdev:input:b*v05F3p00FF*
 KEYBOARD_KEY_90001=f13
 KEYBOARD_KEY_90002=f14
 KEYBOARD_KEY_90003=f15

After that I issued systemd-hwdb update and (for good measure) udevadm trigger and then rebooted.

The evtest output shows that the scancode/keycode mapping has been successful:

user@machine~$ evtest
No device specified, trying to scan all of /dev/input/event*
Not running as root, no devices may be available.
Available devices:
/dev/input/event0:	Power Button
/dev/input/event1:	Lid Switch
/dev/input/event2:	Sleep Button
/dev/input/event3:	Power Button
/dev/input/event4:	AT Translated Set 2 keyboard
/dev/input/event5:	Video Bus
/dev/input/event6:	SynPS/2 Synaptics TouchPad
/dev/input/event7:	VEC  VEC USB Footpedal
/dev/input/event8:	VGA Webcam
/dev/input/event9:	Acer WMI hotkeys
/dev/input/event11:	HDA Intel PCH Front Headphone
/dev/input/event12:	HDA Intel PCH HDMI/DP,pcm=3
Select the device event number [0-12]: 7
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x5f3 product 0xff version 0x100
Input device name: "VEC  VEC USB Footpedal"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 183 (KEY_F13)
    Event code 184 (KEY_F14)
    Event code 185 (KEY_F15)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1515172012.721967, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1515172012.721967, type 1 (EV_KEY), code 183 (KEY_F13), value 1
Event: time 1515172012.721967, -------------- SYN_REPORT ------------
Event: time 1515172013.433970, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1515172013.433970, type 1 (EV_KEY), code 183 (KEY_F13), value 0
Event: time 1515172013.433970, -------------- SYN_REPORT ------------
Event: time 1515172016.642000, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1515172016.642000, type 1 (EV_KEY), code 184 (KEY_F14), value 1
Event: time 1515172016.642000, -------------- SYN_REPORT ------------
Event: time 1515172017.265923, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1515172017.265923, type 1 (EV_KEY), code 184 (KEY_F14), value 0
Event: time 1515172017.265923, -------------- SYN_REPORT ------------
Event: time 1515172018.602134, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90003
Event: time 1515172018.602134, type 1 (EV_KEY), code 185 (KEY_F15), value 1
Event: time 1515172018.602134, -------------- SYN_REPORT ------------
Event: time 1515172019.225910, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90003
Event: time 1515172019.225910, type 1 (EV_KEY), code 185 (KEY_F15), value 0
Event: time 1515172019.225910, -------------- SYN_REPORT ------------

That's all good and well. However, xev doesn't recognize anything, and xinput doesn't list the device (didn't before, and I don't even know if it should or not, just FYI). Additionally, showkey --keycodes under the Linux console doesn't show anything either. I'm sure I'm missing something, but I don't know what. Any help would be greatly appreciated.

@gkarsay

This comment has been minimized.

Show comment
Hide comment
@gkarsay

gkarsay Jan 5, 2018

Owner

What's the output of udevadm info /sys/class/input/event7? event7 may have changed in the meantime, it's the event number you go from evtest.

It should have a line ID_INPUT=1 and a line ID_INPUT_XXX=1 where XXX is either KEYBOARD, KEY, MOUSE, TOUCHPAD, TOUCHSCREEN, TABLET, JOYSTICK or ACCELEROMETER. If it's missing, it won't be shown in xinput. Please post the output, even if you have the line in question.

I have to admit this is now more guess work than based on knowledge.

Owner

gkarsay commented Jan 5, 2018

What's the output of udevadm info /sys/class/input/event7? event7 may have changed in the meantime, it's the event number you go from evtest.

It should have a line ID_INPUT=1 and a line ID_INPUT_XXX=1 where XXX is either KEYBOARD, KEY, MOUSE, TOUCHPAD, TOUCHSCREEN, TABLET, JOYSTICK or ACCELEROMETER. If it's missing, it won't be shown in xinput. Please post the output, even if you have the line in question.

I have to admit this is now more guess work than based on knowledge.

@devhell

This comment has been minimized.

Show comment
Hide comment
@devhell

devhell Jan 6, 2018

Contributor

Here you go, that probably explains why xinput is not seeing anything:

user@machine:~$ udevadm info /sys/class/input/event7 
P: /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/0003:05F3:00FF.0002/input/input14/event7
N: input/event7
S: input/by-id/usb-VEC_VEC_USB_Footpedal-event-if00
S: input/by-path/pci-0000:00:14.0-usb-0:1:1.0-event
E: DEVLINKS=/dev/input/by-path/pci-0000:00:14.0-usb-0:1:1.0-event /dev/input/by-id/usb-VEC_VEC_USB_Footpedal-event-if00
E: DEVNAME=/dev/input/event7
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/0003:05F3:00FF.0002/input/input14/event7
E: ID_BUS=usb
E: ID_INPUT=1
E: ID_MODEL=VEC_USB_Footpedal
E: ID_MODEL_ENC=VEC\x20USB\x20Footpedal
E: ID_MODEL_ID=00ff
E: ID_PATH=pci-0000:00:14.0-usb-0:1:1.0
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_1_1_0
E: ID_REVISION=0120
E: ID_SERIAL=VEC_VEC_USB_Footpedal
E: ID_TYPE=hid
E: ID_USB_DRIVER=usbhid
E: ID_USB_INTERFACES=:030000:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=VEC
E: ID_VENDOR_ENC=VEC\x20
E: ID_VENDOR_ID=05f3
E: KEYBOARD_KEY_90001=f13
E: KEYBOARD_KEY_90002=f14
E: KEYBOARD_KEY_90003=f15
E: LIBINPUT_DEVICE_GROUP=3/5f3/ff/100:usb-0000:00:14.0-1
E: MAJOR=13
E: MINOR=71
E: SUBSYSTEM=input
E: USEC_INITIALIZED=2045733270

I've been doing some more reading, and I have found some people who have created something to make this pedal work under way older versions of Ubuntu, notably footswitch2 and footswitch3 (both same author just different backend I think). Early on (even before I found parlatype) I tried to get this going and had no luck because the pedal detection was completely outdated and used outdated Ubuntu plumbing. I also found some older driver stuff for what seems to be the same pedal and a similar issue here.

Oh, I also just found PI Engineering's Github page. Not sure if this is useful though.

Contributor

devhell commented Jan 6, 2018

Here you go, that probably explains why xinput is not seeing anything:

user@machine:~$ udevadm info /sys/class/input/event7 
P: /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/0003:05F3:00FF.0002/input/input14/event7
N: input/event7
S: input/by-id/usb-VEC_VEC_USB_Footpedal-event-if00
S: input/by-path/pci-0000:00:14.0-usb-0:1:1.0-event
E: DEVLINKS=/dev/input/by-path/pci-0000:00:14.0-usb-0:1:1.0-event /dev/input/by-id/usb-VEC_VEC_USB_Footpedal-event-if00
E: DEVNAME=/dev/input/event7
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/0003:05F3:00FF.0002/input/input14/event7
E: ID_BUS=usb
E: ID_INPUT=1
E: ID_MODEL=VEC_USB_Footpedal
E: ID_MODEL_ENC=VEC\x20USB\x20Footpedal
E: ID_MODEL_ID=00ff
E: ID_PATH=pci-0000:00:14.0-usb-0:1:1.0
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_1_1_0
E: ID_REVISION=0120
E: ID_SERIAL=VEC_VEC_USB_Footpedal
E: ID_TYPE=hid
E: ID_USB_DRIVER=usbhid
E: ID_USB_INTERFACES=:030000:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=VEC
E: ID_VENDOR_ENC=VEC\x20
E: ID_VENDOR_ID=05f3
E: KEYBOARD_KEY_90001=f13
E: KEYBOARD_KEY_90002=f14
E: KEYBOARD_KEY_90003=f15
E: LIBINPUT_DEVICE_GROUP=3/5f3/ff/100:usb-0000:00:14.0-1
E: MAJOR=13
E: MINOR=71
E: SUBSYSTEM=input
E: USEC_INITIALIZED=2045733270

I've been doing some more reading, and I have found some people who have created something to make this pedal work under way older versions of Ubuntu, notably footswitch2 and footswitch3 (both same author just different backend I think). Early on (even before I found parlatype) I tried to get this going and had no luck because the pedal detection was completely outdated and used outdated Ubuntu plumbing. I also found some older driver stuff for what seems to be the same pedal and a similar issue here.

Oh, I also just found PI Engineering's Github page. Not sure if this is useful though.

@gkarsay

This comment has been minimized.

Show comment
Hide comment
@gkarsay

gkarsay Jan 9, 2018

Owner

I think (well, I hope) you could make it work with this udev rule (that's a single line):
ACTION=="add|change", KERNEL=="event[0-9]*", ATTRS{idVendor}=="05f3", ATTRS{idProduct}=="00ff", ENV{ID_INPUT_KEYBOARD}="1"

Save it e.g. as /etc/udev/rules.d/10-vec-usb-footpedal.rules. Then it will be hopefully recognized.

Owner

gkarsay commented Jan 9, 2018

I think (well, I hope) you could make it work with this udev rule (that's a single line):
ACTION=="add|change", KERNEL=="event[0-9]*", ATTRS{idVendor}=="05f3", ATTRS{idProduct}=="00ff", ENV{ID_INPUT_KEYBOARD}="1"

Save it e.g. as /etc/udev/rules.d/10-vec-usb-footpedal.rules. Then it will be hopefully recognized.

@devhell

This comment has been minimized.

Show comment
Hide comment
@devhell

devhell Jan 9, 2018

Contributor

Success! Thank you so much, the udev rules did the trick. The only thing I had to change (this might be Ubuntu specific) was increment all f-key assignments by one. For some reason XF86Tools (F13) will be happily assigned in the Keyboard Shortcut settings, but does not do anything in parlatype (no rewind). F14-F16 (XF86Launch5-7) on the other hand worked flawlessly.

Now, I have everything documented, including screenshots. How would you like the documentation? Shall I clone and PR something in markdown, or just simple wiki, or something else?

Thank you again. 🍺

Contributor

devhell commented Jan 9, 2018

Success! Thank you so much, the udev rules did the trick. The only thing I had to change (this might be Ubuntu specific) was increment all f-key assignments by one. For some reason XF86Tools (F13) will be happily assigned in the Keyboard Shortcut settings, but does not do anything in parlatype (no rewind). F14-F16 (XF86Launch5-7) on the other hand worked flawlessly.

Now, I have everything documented, including screenshots. How would you like the documentation? Shall I clone and PR something in markdown, or just simple wiki, or something else?

Thank you again. 🍺

@devhell

This comment has been minimized.

Show comment
Hide comment
@devhell

devhell Apr 2, 2018

Contributor

bump?

Contributor

devhell commented Apr 2, 2018

bump?

@gkarsay

This comment has been minimized.

Show comment
Hide comment
@gkarsay

gkarsay Apr 5, 2018

Owner

Sorry, I had no time at all ... It would be really great if you could clone the gh-pages branch, and put your documentation into its own directory. The syntax is markdown. You can link from index.md, section "Media keys and foot pedals". I will then happily accept your pull request.

I was also investigating how I could support such devices out of the box. It seems like it would have to be quite low-level, probably libudev to monitor connected devices and libevdev to listen to key press events. In January I thought I could implement this quite fast and there would be no need to document devices individually, users could select their device from a list of connected devices and map the buttons to actions – then I realized it will take quite a long time because it's more complicated than I thought and I can't spend as much time on it as before. So your documentation is highly appreciated.

Owner

gkarsay commented Apr 5, 2018

Sorry, I had no time at all ... It would be really great if you could clone the gh-pages branch, and put your documentation into its own directory. The syntax is markdown. You can link from index.md, section "Media keys and foot pedals". I will then happily accept your pull request.

I was also investigating how I could support such devices out of the box. It seems like it would have to be quite low-level, probably libudev to monitor connected devices and libevdev to listen to key press events. In January I thought I could implement this quite fast and there would be no need to document devices individually, users could select their device from a list of connected devices and map the buttons to actions – then I realized it will take quite a long time because it's more complicated than I thought and I can't spend as much time on it as before. So your documentation is highly appreciated.

@devhell

This comment has been minimized.

Show comment
Hide comment
@devhell

devhell Apr 25, 2018

Contributor

No problem. :) I'm under massive time-constraints myself. I'll be happy to write the documentation (I'll get to it hopefully soon, it's on my task list) and send a pull request once done.

Until then, 🍻 😆

Contributor

devhell commented Apr 25, 2018

No problem. :) I'm under massive time-constraints myself. I'll be happy to write the documentation (I'll get to it hopefully soon, it's on my task list) and send a pull request once done.

Until then, 🍻 😆

@devhell

This comment has been minimized.

Show comment
Hide comment
@devhell

devhell Apr 30, 2018

Contributor

I've sent a PR. I hope the instructions are complete.

Contributor

devhell commented Apr 30, 2018

I've sent a PR. I hope the instructions are complete.

@devhell

This comment has been minimized.

Show comment
Hide comment
@devhell

devhell May 7, 2018

Contributor

Thanks for merging! Shall we close this then?

Contributor

devhell commented May 7, 2018

Thanks for merging! Shall we close this then?

@gkarsay

This comment has been minimized.

Show comment
Hide comment
@gkarsay

gkarsay May 8, 2018

Owner

Thank you very much, I'll close it then. I still have to investigate an issue with the github page. The theme has changed somehow and it doesn't show the header/the title as before. That's however a different issue about formatting, the content is already there.

Owner

gkarsay commented May 8, 2018

Thank you very much, I'll close it then. I still have to investigate an issue with the github page. The theme has changed somehow and it doesn't show the header/the title as before. That's however a different issue about formatting, the content is already there.

@gkarsay gkarsay closed this May 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment