Daemon to handle Jabra speakerphone HID volume workaround

On the Jabra speakerphone USB device, we need to do a volume change
every time we are receiving a volume key press else we are not sure we
will receive the next key press.

Implement a daemon to handle the volume poke through ALSA everytime the
device sent a volume key event on its HID interface.
The state of the call still needs to be handled by the webapp, so the
daemon is not opening directly the HID interface but snooping the
incoming request from the device interrupt endpoint using the Linux
kernel usbmon interface.

The daemon is started by a UDEV rule detecting the USB device insertion
and sending a signal to the upstart script.

It also injects "fake" volume volume key press/release on the keyboard
input in order to notify the UI of the volume change.

Intercept volume keys release using usbmon

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=chromium:278394
TEST=on Stumpy, connect Jabra speakerphone and test all the buttons
see volume going up and down and muting properly

Change-Id: I368bc611c401bfff3d28a9db195ef6a68ea315a9
Reviewed-on: https://chromium-review.googlesource.com/169721
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
6 files changed
tree: c11070f3f0becb144c8b7f6bdced9f2787b23fba
  1. 99-jabra.rules
  2. jabra-vold.conf
  3. jabra.c
  4. LICENSE
  5. Makefile
  6. PRESUBMIT.cfg