37

Now that the Android APIs support working directly with USB devices (since 3.1), I am curious if there has been any work to create "soft-mode" drivers for some of the more popular class-compliant devices (such as audio or HID).

In other words, are there any open source projects that wrap up more useful communication with specific classes of devices into a Java class that can be added to an Android project?

For my purposes, I am specifically interested in USB audio, but it seems that a community-built set of classes derived from Linux kernel module sources could be beneficial to many projects. My hope is that others have thought of the same thing and have already began work. Any pointers in this direction would be most appreciated.


A few more resources that I have stumbled on:

Community
  • 1
  • 1
Brad
  • 159,648
  • 54
  • 349
  • 530
  • 5
    USB Audio: If you are interested in audio data streaming, this is impossible with android, because isochronous endpoints are not supported by the API. However the MIDI part of the Audio Class will work (uses bulk endpoints only). Not seen any projects so far. – Alexander Jul 09 '12 at 20:48
  • Thanks Alexander, this is *very* good to know. – Brad Jul 09 '12 at 21:05
  • This is an interesting idea. However it may be tricky to handle large amounts of small data pakets with a 'thick' API layer. Also, it is questionable if universal USB access would undermine security considerations. On vanilla linux, each USB device is configured according to system defined rules which also decide who is able to access the device. On the other hand, an Android device is usually a 'single user' device and apps are sandboxed on the API layer, so that should be ok. However, for the beginning it would be nice if Android just incoorperates a well chosen set of kernel mode drivers. – dronus Aug 08 '12 at 09:39
  • @dronus, Agreed. It actually seems that adding some additional kernel drivers is happening. The problem is, it is device-specific. Only a couple manufacturers are stepping into that right now. – Brad Aug 08 '12 at 12:48
  • 3
    However, it is not specific to any Android device (where USB is abstracted by the generic USB stack) but to the connected device. So any pluggable-device manufacturer could make a Java driver this way, where it would be more useful to add a kernel module driver... which cannot be added to the Android devices by an 3rd party developer. On the other hand, native code can be added to an Android application, secured by the application sandbox. This maybe shows a design flaw in linux itself, making it questionable if drivers should be always placed inside the kernel mode. – dronus Aug 11 '12 at 00:06
  • DSLR Controller from Chainfire shows what you can do over USB. It allows you to control a range of Canon DSLR cameras, showing a live on-screen preview, controlling F-stop, ISO and other settings as well as manual focus adjustments. Just connect a supported camera (I have the 40D) using a USB cable. This app works for me on the Galaxy Tab 10.1, Nexus 7 and Galaxy Nexus. Not open source but a great example of third parties implementing USB support for something new. You can find it at https://play.google.com/store/apps/details?id=eu.chainfire.dslrcontroller – Phil Haigh Aug 30 '12 at 20:45

1 Answers1

1

I have started work on an IRDA driver stack over USB in user space. I am working out the basic plumbing but as far as I can see if I can create the equivalent user space driver to the linux kernel drivers such as the STIR4200 driver then I "ought" to then be able to port over existing IRDA protocol stacks such as JIR.

We shall see...

Neil
  • 539
  • 3
  • 11