Closed Bug 852945 Opened 11 years ago Closed 7 years ago

Gonk gamepad backend

Categories

(Core :: DOM: Device Interfaces, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: ted, Unassigned)

References

Details

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.
Assignee: nobody → kyle
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.
Depends on: 880759
button/axis translation, that is.
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
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?
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.
Flags: needinfo?(echou)
(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.
Flags: needinfo?(echou)
(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?
Flags: needinfo?(echou)
(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.
Flags: needinfo?(echou)
(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.
Flags: needinfo?(echou)
(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.
Flags: needinfo?(echou)
Component: Hardware Abstraction Layer (HAL) → DOM: Device Interfaces
Assignee: kyle → nobody
FxOS/Gonk has been removed from the codebase. Mass-invalidating FxOS related Device Interface bugs to clean up the component. 

If I incorrectly invalidated something, please let me know.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Bulk correction of resolution of B2G bugs to INCOMPLETE.
Resolution: INVALID → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.