Last Comment Bug 852945 - Gonk gamepad backend
: Gonk gamepad backend
Status: NEW
:
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: unspecified
: All Gonk (Firefox OS)
-- normal with 2 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: Andrew Overholt [:overholt]
Mentors:
Depends on: 852944 880759
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-20 06:41 PDT by Ted Mielczarek [:ted.mielczarek]
Modified: 2015-06-10 15:45 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description User image Ted Mielczarek [:ted.mielczarek] 2013-03-20 06:41:56 PDT
We don't have a Gonk gamepad backend at the moment. We have a bug open on an Android backend as well, but I'm not sure they'd share code because the Android backend is likely to be written in Java.

I'm not actually even sure what we want to do here. Being able to handle Bluetooth-attached devices would probably be sufficient (and maybe USB-attached devices if we have USB). The Linux backend uses the joydev driver via the /dev/input/jsN devices, and uses udev to enumerate devices and get notifications of connection/disconnection. Does joydev work on Gonk? Additionally the Linux backend is sort of tangled up in glib right now, which clearly wouldn't work.
Comment 1 User image Kyle Machulis [:qdot] 2013-11-08 10:42:02 PST
Bluetooth HID DOM landed, but we'll need to add a backend to query BT for bonded joysticks, as well as HID to button/access translation. Adding dependecy to reflect that.
Comment 2 User image Kyle Machulis [:qdot] 2013-11-08 10:42:16 PST
button/axis translation, that is.
Comment 3 User image Ted Mielczarek [:ted.mielczarek] 2013-12-19 12:46:25 PST
FYI the OS X backend uses pretty much a raw HID API, so you might be able to get pointers from there:
http://mxr.mozilla.org/mozilla-central/source/hal/cocoa/CocoaGamepad.cpp
Comment 4 User image Dietrich Ayala (:dietrich) 2014-09-10 16:51:38 PDT
Is there a BT profile or something that this would use? What are some gamepads that would work once we have this support on Firefox OS devices? Same as those that support Android via BT?
Comment 5 User image Kyle Machulis [:qdot] 2014-09-10 21:06:41 PDT
We'd need either the BT HID profile, or libusbhost with HID support. I'm guessing we're looking at bluedroid and BT4 support for 2.2 now that it's next March-ish. ni?'ing echou to double check this because everything I just said is a complete guess.
Comment 6 User image Ted Mielczarek [:ted.mielczarek] 2014-09-11 08:04:31 PDT
There are a fair amount of products in the bluetooth controller space nowadays:
http://www.theverge.com/2013/2/20/4001278/best-controllers-for-your-smartphone-android-or-ios
http://rightandroid.com/6-best-bluetooth-android-game-controllers/
Comment 7 User image Eric Chou [:ericchou] [:echou] 2014-09-11 23:31:44 PDT
(In reply to Kyle Machulis [:kmachulis] [:qdot] (USE NEEDINFO?) from comment #5)
> We'd need either the BT HID profile, or libusbhost with HID support. I'm
> guessing we're looking at bluedroid and BT4 support for 2.2 now that it's
> next March-ish. ni?'ing echou to double check this because everything I just
> said is a complete guess.

Yeah, at the very beginning our plan was to support Bluetooth HID profile for 2.2. However since we started to work on supporting BLE and exposing a set of privileged APIs, it had been pushed back a release to 2.3. In fact, Gecko implementation for Bluetooth HID is not that hard and we had worked on it for a while. The main reason we didn't get it done was that we needed Gaia/UX developers coming in but we couldn't get enough resources at that time.

In short, we will do this at some point before Firefox OS 2.3, but I can't tell if it will be done for 2.2 or 2.3 since it depends on the progress of our original 2.2 tasks.
Comment 8 User image Dietrich Ayala (:dietrich) 2014-09-12 09:46:45 PDT
(In reply to Eric Chou [:ericchou] [:echou] from comment #7)
> The main reason we didn't get it done was that we needed
> Gaia/UX developers coming in but we couldn't get enough resources at that
> time.

Thanks Eric. Are the bugs filed for the Gaia work? Are they blocking the Bluetooth HID meta bug?
Comment 9 User image Eric Chou [:ericchou] [:echou] 2014-09-15 03:43:04 PDT
(In reply to Dietrich Ayala (:dietrich) from comment #8)
> (In reply to Eric Chou [:ericchou] [:echou] from comment #7)
> > The main reason we didn't get it done was that we needed
> > Gaia/UX developers coming in but we couldn't get enough resources at that
> > time.
> 
> Thanks Eric. Are the bugs filed for the Gaia work? Are they blocking the
> Bluetooth HID meta bug?

Not really. Since HID hasn't been a feature of any release, it was just a discussion on our internal meeting about the Gaia and UX resource. Any kinds of implementation for HID UX/Gaia part would be more than welcome. BT team will take care of Gecko work.
Comment 10 User image Dietrich Ayala (:dietrich) 2014-09-15 09:12:27 PDT
(In reply to Eric Chou [:ericchou] [:echou] from comment #9)
> > Thanks Eric. Are the bugs filed for the Gaia work? Are they blocking the
> > Bluetooth HID meta bug?
> 
> Not really. Since HID hasn't been a feature of any release, it was just a
> discussion on our internal meeting about the Gaia and UX resource. Any kinds
> of implementation for HID UX/Gaia part would be more than welcome. BT team
> will take care of Gecko work.

Can you describe the Gaia work? If you could outline what needs to be done, I can file the bugs and maybe find someone to help out.
Comment 11 User image Eric Chou [:ericchou] [:echou] 2014-09-25 23:58:34 PDT
(In reply to Dietrich Ayala (:dietrich) from comment #10)
> (In reply to Eric Chou [:ericchou] [:echou] from comment #9)
> > > Thanks Eric. Are the bugs filed for the Gaia work? Are they blocking the
> > > Bluetooth HID meta bug?
> > 
> > Not really. Since HID hasn't been a feature of any release, it was just a
> > discussion on our internal meeting about the Gaia and UX resource. Any kinds
> > of implementation for HID UX/Gaia part would be more than welcome. BT team
> > will take care of Gecko work.
> 
> Can you describe the Gaia work? If you could outline what needs to be done,
> I can file the bugs and maybe find someone to help out.

That would be good. I can think of some but maybe there are more:

1. Decide whether Bluetooth mouse should be supported or not.

There should not be too much effort to support Bluetooth Mouse in terms of Gecko. However personally I'll put mouse support behind keyboard because of lack of application on the phone (or even other connected devices).

2. Users should be able to connect a Bluetooth HID device from Settings UI

Currently only Bluetooth headset/speaker could be connected via Settings UI. clicking on a Bluetooth HID device appearing on Bluetooth page would only trigger the pairing process.

3. Corresponding icons of Bluetooth HID devices should appear on status bar.

4. When a connection between the phone and the Bluetooth keyboard has been established, virtual keyboard should not show up after clicking on a text entry.

Note You need to log in before you can comment on or make changes to this bug.