Audio Volume Control with Arduino USB Controller9

Hi all,

I recently installed Lakka on generic pc and i try to control master volume with a USB Button. This function is natively recognize on another debian notebook so it can works under Linux ^_^.

Is usb give this line :

Bus 004 Device 007: ID 2341:484d Arduino SA

and command ‘cat /proc/bus/input/devices’ gives this :

I: Bus=0003 Vendor=2341 Product=484d Version=0101
N: Name="Arduino LLC iWit USB Controller"
P: Phys=usb-0000:00:1d.2-1/input2
S: Sysfs=/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.2/0003:2341:484D.0008/input/input20
U: Uniq=HIDPH
H: Handlers=sysrq kbd mouse1 event7 
B: PROP=0
B: EV=10001f
B: KEY=3f0003007f 0 0 483ffff17aff32d bf54444600000000 ff0001 130f938b17c007 ffff7bfad9415fff febeffdfffefffff fffffffffffffffe
B: REL=143
B: ABS=100000000
B: MSC=10

I wrote a rules for udev with this content :

SUBSYSTEM=="input", ATTRS{name}=="Arduino LLC iWit USB Controller", KERNEL=="event*", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1" 

to try to set param in GUI config but it’s not works… The only changing is that a message which precise that “Arduino LLC iWit USB Controller is not configured” when the USB is plugged.

Can anyone help me to activate this kind of controller ? Is there a way to configure it into retroarch config ? Or maybe a way to bind key directly to an alsa command (like amixer -q sset Master 3%+ to increase) ?

Edit : On the other debian, I use evtest to get keycode of this controller :

Event: time 1538904002.122141, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
Event: time 1538903999.400210, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0

maybe it could be helpful to answer…

Edit2 : The volume+ and volume- button on my keyboard doesn’t works too :frowning:

Edit3 : Here is the link to the picture of this USB audio controller : https://goo.gl/kK658k (it’s the picture from amazon product card).

Thanks by advance :wink:

Hi all !

Some news on this problem :slight_smile: :

I think I found a correct configuration file to make the controller recognize by the system but I don’t found how to assign volumeup and volumedown to alsa command…

This is what i’ve done :

File .config/udev.rules.d/99-arduinousb.rules SUBSYSTEM==“input”, ATTRS{name}==“Arduino LLC iWit USB Controller”, KERNEL==“event*”, MODE=“0666”, ENV{ID_INPUT_KEYBOARD}=“1”, SYMLINK+=“input/volume”

File .config/hwdb.d/99-usbremotecontrol.hwdb evdev:input:b0003v2341p484D* KEYBOARD_KEY_114=volumedown KEYBOARD_KEY_115=volumeup

How to rebuild / reload configuration Lakka:~ # systemd-hwdb update Lakka:~ # udevadm control --reload Lakka:~ # udevadm trigger

The next commande shows that the device has the keyboard_key’s values well :

Lakka:~ # udevadm info /dev/input/event4 P: /devices/pci0000:00/0000:00:1d.3/usb5/5-2/5-2:1.2/0003:2341:484D.000E/input/input26/event4 N: input/event4 S: input/by-id/usb-Arduino_LLC_iWit_USB_Controller_HIDPH-if02-event-mouse S: input/by-path/pci-0000:00:1d.3-usb-0:2:1.2-event-mouse S: input/volume E: DEVLINKS=/dev/input/by-id/usb-Arduino_LLC_iWit_USB_Controller_HIDPH-if02-event-mouse /dev/input/volume /dev/input/by-path/pci-0000:00:1d.3-usb-0:2:1.2-event-mouse E: DEVNAME=/dev/input/event4 E: DEVPATH=/devices/pci0000:00/0000:00:1d.3/usb5/5-2/5-2:1.2/0003:2341:484D.000E/input/input26/event4 E: ID_BUS=usb E: ID_INPUT=1 E: ID_INPUT_KEY=1 E: ID_INPUT_KEYBOARD=1 E: ID_INPUT_MOUSE=1 E: ID_MODEL=iWit_USB_Controller E: ID_MODEL_ENC=iWit\x20USB\x20Controller E: ID_MODEL_ID=484d E: ID_PATH=pci-0000:00:1d.3-usb-0:2:1.2 E: ID_PATH_TAG=pci-0000_00_1d_3-usb-0_2_1_2 E: ID_REVISION=0100 E: ID_SERIAL=Arduino_LLC_iWit_USB_Controller_HIDPH E: ID_SERIAL_SHORT=HIDPH E: ID_TYPE=hid E: ID_USB_DRIVER=usbhid E: ID_USB_INTERFACES=:030000: E: ID_USB_INTERFACE_NUM=02 E: ID_VENDOR=Arduino_LLC E: ID_VENDOR_ENC=Arduino\x20LLC E: ID_VENDOR_ID=2341 E: KEYBOARD_KEY_114=volumedown E: KEYBOARD_KEY_115=volumeup E: MAJOR=13 E: MINOR=68 E: SUBSYSTEM=input E: USEC_INITIALIZED=8025688726

but in the retroarch menu, when i try to assign a new key to increase / decrease volume, no key is detected when i use the controller :frowning:

Anyone has an idea ? I found a trick on retroarch but it’s on retropie (not lakka) and it use triggerhappy that is not available on lakka… If somebody is interrested : https://retropie.org.uk/forum/topic/2377/control-volume-through-retroarch-with-keyboard/3

Thanks by advance :wink:

I’m curious to know you resolve this when you do. I just wanted to mention that I had an issue with the volume control on the keyboard too.

I have an ASUS Tinker Board and there is a wireless USB mini keyboard attached. The multimedia keys do not work and I haven’t spent any time looking into it. The default volume keys are " - " and " + " and it took a while to figure out by looking at the keyboard that (interestingly) I’d have to hold shift to adjust it. So, I went to “Settings” > “Input Hotkey Binds” and changed the volume controls to " _ " and " = " now it works fine.

I try to change into this menu “Settings” > “Input Hotkey Binds” but when the message is showing to press the key, nothing is catched… :frowning: And nothing is shown in retroarch console log…

Hmm…

nothing is catched… :frowning: And nothing is shown in retroarch console log…

This is with your USB volume button or the keyboard or both?

The standard keys (letters, numbers, fn,… ) of the usb keyboard are correctly catched but not special keys like calc, volumeup, volumedown. For the usb audio controller, none of the action is detected (turned left, turned right, pushed button).

Any Idea ? :sweat_smile:

PS : the Crewell USB controller, which is identified as an Arduino controller is like this picture (from amazon product card : https://goo.gl/kK658k)

My suspicion (and I hate to clog up the thread with conjecture in lieu of a real solution) is that Lakka does not support any of the multimedia functions that happen on keyboard type controllers, i.e. volume, start/stop, etc, which are mapped differently than the regular keys.

Edit2 : The volume+ and volume- button on my keyboard doesn’t works too :frowning:

Just to verify, the normal plus and minus key that is set by default to control the volume works, and it’s the special volume buttons on the keyboard that is not working, right? If this is NOT the case, you might have to troubleshoot this first. If this IS the case, and you can remap the volume to other keys, I would suggest that you remap your Arduino to emulate the plus and minus keys instead of the volume functions.

Ideally, Lakka should support these multimedia type keys, but I’m not sure how to resolve that. Perhaps it already does support them, but it’s not auto-detected for some reason and you’d need to find the correct way to edit a config file by hand. But, I’m thinking there is a higher probability that you would need to make changes to the code and recompile it to make it work…

Either way, I’m super interested in how you get this issue resolved because I’ve been looking for a controller that can be a spinner/paddle (like the old Colecovision or original Pong controls) and I was contemplating getting one of these https://goo.gl/kK658k sort of gadgets to do it. A DYI Arduino controller might be super fun to build also, and then I can add triggers and use it as a steering wheel… Possibilities.

Hi bunglero,

Thanks for your reply and sorry for the long delay to respond (notification has been marked as a spam… :frowning: )

I confirm that plus and minus key are successfully configured and the volume is adjusted when these keys are pressed.

I arrived to the same conclusion : remap the KEY_CODE to plus and minus. I try to make it by editing .config/hwdb.d/99-usbremotecontrol.hwdb file but without success…

So, the next question is : how to do this :thinking::thinking::thinking:

Any Idea ?

PS : And this will be helpful to make a trackball usable :sweat_smile: #nextStep