Bluetooth remote

Hello all

I have a bluetooth remote “shutter”, which is a keyring with simple controller buttons.
I would like to map it for use with Mixx, for very simple actions (play/pause, volume, etc)

Do you know how I can achieve this ?
It is behaving as an HID “keyboard”, sending multimedia keypresses.

Do I have to handle it as an HID devices ? It doesn’t appear in the “controllers” section of the prefs.
Do i have to handle it as a keyboard mapping ? Then, how are handled multiple keyboards ? Do i have to map, ie, “volume +” and “next track” buttons, and mixxx will see it as keyboard input, independently of whether I press it on my keyboard or the controller ?

Thanks a lot.

PS :
here is how it appears in /proc/bus/input/devices (ubuntu)

I: Bus=0005 Vendor=05ac Product=022c Version=011b
N: Name=“Bluetooth Remote Shutter”
P: Phys=5c:51:4f:e4:4e:08
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.0004/input/input17
U: Uniq=aa:00:00:00:1d:33
H: Handlers=sysrq kbd event13 leds
B: PROP=0
B: EV=12001b
B: KEY=20 0 0 0 40000000000000 0 1000302100007 ff9f387ac1405fff febeffdfffefffff fffffffffffffffe
B: ABS=70000000000
B: MSC=10
B: LED=1f

Does your user have permission to access HID devices? See this Troubleshooting page section.

Thanks for the tip.
My user does belong to “users” group, and the udev rule is in place.
It seems this udev rule is meant for USB, I think I need to add bluetooth support in it… I’ll start reading some udev doc. Doesn’t look that easy :slight_smile:

OK I tried adding the following to the udev rules :

SUBSYSTEM==“bluetooth”, GROUP=“users”
ATTRS{phys}==“5c:51:4f:e4:4e:08”, GROUP=“users”, MODE=“0660”

And not working.

Mixxx sees other hardware, not the BT remote.
Note that the same hardware is detected if i run mixxx as root (to rule out access right issue)

Debug [Controller]: Scanning USB Bulk devices:
Debug [Controller]: Scanning HID devices:
Debug [Controller]: Found “ELAN” “Touchscreen” “r24” S/N “” “Interface 0”
Debug [Controller]: Found “Invensense” "Lenovo Yoga " “r4433” S/N “2D36906F17001300” “Interface 0”
Debug [Controller]: Found “” “USB Optical Mouse” “r512” S/N “” “Interface 0”

Here is my device data :

udevadm info /sys/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.0004/input/input16
P: /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.0004/input/input16
E: ABS=70000000000
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.0004/input/input16
E: EV=12001b
E: ID_BUS=usb
E: ID_FOR_SEAT=input-pci-0000_00_14_0-usb-0_4_1_0
E: ID_INPUT=1
E: ID_INPUT_KEY=1
E: ID_INPUT_KEYBOARD=1
E: ID_MODEL=07dc
E: ID_MODEL_ENC=07dc
E: ID_MODEL_ID=07dc
E: ID_PATH=pci-0000:00:14.0-usb-0:4:1.0
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_4_1_0
E: ID_REVISION=0001
E: ID_SERIAL=8087_07dc
E: ID_TYPE=generic
E: ID_USB_DRIVER=btusb
E: ID_USB_INTERFACES=:e00101:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=8087
E: ID_VENDOR_ENC=8087
E: ID_VENDOR_ID=8087
E: KEY=20 0 0 0 40000000000000 0 1000302100007 ff9f387ac1405fff febeffdfffefffff fffffffffffffffe
E: LED=1f
E: MODALIAS=input:b0005v05ACp022Ce011B-e0,1,3,4,11,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,8B,8C,8E,96,98,9E,9F,A1,A3,A4,A5,A6,AB,AC,AD,B0,B1,B2,B3,B4,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,D4,D9,E0,E1,F0,176,245,ra28,29,2A,m4,l0,1,2,3,4,sfw
E: MSC=10
E: NAME=“Bluetooth Remote Shutter”
E: PHYS=“5c:51:4f:e4:4e:08”
E: PRODUCT=5/5ac/22c/11b
E: PROP=0
E: SUBSYSTEM=input
E: TAGS=:seat:
E: UNIQ=“aa:00:00:00:1d:33”
E: USEC_INITIALIZED=133059645

Will keep trying…

Does it show up as a controller in Mixxx’s preferences when run as root? If so, then your udev rule isn’t working properly. Please share when you do get the udev rule to work. Better yet, make a pull request to add your rule to the udev rule file included in Mixxx. I think it would be a good idea to make the udev rule match any Bluetooth HID device so people can map other devices too.

Well no, as root I get the same detection for mouse and others. The BT remote doesnt show up.
So I’m not sure that modified the udev rules could help.

Hm, you may need to recompile hidapi to use the hidraw backend rather than the libusb backend and link that version of hidapi with Mixxx. See the hidapi linux/README.txt for more info. We may consider changing the build system of Mixxx to compile the hidraw backend now that the kernels that had issues with it are 6 years old.

thanks ! hmm… with this hidraw, do I risk losing the ability to use my midi controller ?
i also made progress in looking for scancodes with xev command. The remote does send keycodes, but only “release key”, not “key press”… strange. And this would allow me to map keyboard shortcuts only, much less flexible than a midi script.

No, it should only affect HID devices. Mixxx uses PortMIDI to access MIDI devices (except for Firewire MIDI devices that use hss1394).

Thanks

I changed the path in build/features.py from “libusb” to “linux”.

Now i get following error :
/usr/bin/ld: lib/hidapi-0.8.0-rc1/linux/hid.o: référence au symbole non défini «udev_list_entry_get_next@@LIBUDEV_183»
/lib/x86_64-linux-gnu/libudev.so.1: error adding symbols: DSO missing from command line

udev is part of systemd, so you probably need to install the systemd development package for your distribution (unless you’re using another init system and your distro packages udev separate from systemd). On Fedora it’s systemd-devel

In the main branch we recently switched to the hidraw backend of hidapi. This allows for using Bluetooth HID devices as controllers in Mixxx. Note that the udev rule file has been changed compared to 2.3 so unprivileged users can access devices through hidraw, so you’d need to install that to /usr/lib/udev/rules.d/69-mixxx-usb-uaccess.rules yourself. If your device is not made by one of the manufacturers listed in the udev rule file, you’ll need to add it there.