[jitsi-dev] working support for USB speakerphone


#1

I have been working on Jabra SPEAK 410 speakerphone integration into Jitsi.

Basically, the device is stateful, and communicates via the HID Telephony
usage pages (not keyboard) so requires some code to get it working. The
main thing is that the device must be set off-hook/on-hook properly or the
buttons won't work right.

And it does work now, answering calls and hangup works via buttons on the
device etc, via a new bundle in jitsi.

I've written a state machine to manage the device, and a "device driver" in
java using /dev/hidraw devices in Linux - so it's pure java. But there's
no support for other OS.

I have also explored with some success (on linux) using hid4java library
(from github) which uses JNA to use the hidapi library which claims support
for Linux, Mac and Windows (native libraries).

There are other USB devices that require some state tweaking to get working
that I haven't explored yet - I believe they require the same on/off hook
handling (and ring status possbile) to get the devices working properly.

Is there interest in this in the jitsi community? I can put a pull request
up for review on github with the code as is. Tons of it is copied from the
GlobalShortcut handling code.

Will it be possible to include a library that uses JNA to access native
libraries?

ยทยทยท

--
Thanks,
David Mansfield
Cobite, INC.


#2

I have been working on Jabra SPEAK 410 speakerphone integration into Jitsi.

Basically, the device is stateful, and communicates via the HID Telephony
usage pages (not keyboard) so requires some code to get it working. The main
thing is that the device must be set off-hook/on-hook properly or the buttons
won't work right.

And it does work now, answering calls and hangup works via buttons on the
device etc, via a new bundle in jitsi.

That is great to hear! Thanks for your efforts!

I've written a state machine to manage the device, and a "device driver" in
java using /dev/hidraw devices in Linux - so it's pure java. But there's no
support for other OS.

I have also explored with some success (on linux) using hid4java library
(from github) which uses JNA to use the hidapi library which claims support
for Linux, Mac and Windows (native libraries).

Having pure Java would certainly be much better than introducing even more libraries. If native is necessary, have you looked at javahidapi [1]? It uses the same library as hid4java (hidapi). Given that we need to compile all libs ourselves anyway, there is no point of accessing hidapi using JNA.
If we don't need any advanced features of these libraries, we might as well just use them for the platforms necessary and use pure Java on Linux.

There are other USB devices that require some state tweaking to get working
that I haven't explored yet - I believe they require the same on/off hook
handling (and ring status possbile) to get the devices working properly.

We'd probably need to set up some kind of device database.

Is there interest in this in the jitsi community?

Yes. I've looked into this on Windows for a Jabra and a Logitech headset early this year and had to give up due to lack of time, documentation of those state machines and cross platform support.

I can put a pull request
up for review on github with the code as is. Tons of it is copied from the
GlobalShortcut handling code.

I'll be happy to take a look. I guess it will need some work so that the code won't be duplicated in GlobalShurtcut and your bundle. We'd also need you to sign the BCA [2] before we can merge anything.

Will it be possible to include a library that uses JNA to access native
libraries?

Yes, as long as its license is compatible to the LGPL, but see comments above.

Ingo

[1] https://code.google.com/p/javahidapi/
[2] http://bluejimp.com/bca.pdf