[KERNEL][ICS-CM9] USB Host mode (OTG) driver for Captivate [BUILD 5]

Search This thread

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
877
Edinburgh
sztupy.hu
USB Host mode driver for Samsung Captivate

Also available on the Samsung Galaxy S and Nexus S

(main post and more info at the SGS dev site)​

Disclaimer: This kernel will enable some very early, and rough usb OTG support for your phone. Currently the phone DOES NOT give out power, so you NEED an external power source to be able to use this kernel. This is true for ALL USB devices, even with those that have their own power source, and doesn't requre external bus powering. Solving this limitation is a TODO, but we cannot guarantee anything. There are some other phones that have usb host support the same way this kernel has (eg. they need external power), like the Nexus One, and there is also a community using this, so if you're saying that usb host support has no sense if you need an external power source then you are definitely mistaken.

This kernel is built upon teamhacksung's ICS Build 14 kernel, and will only work with that particular ROM (and possibly later versions of it). It is possible to port this to older ROMs (like CM7, or stock Gingerbread). Ask your favourite kernel developer to do this for you.

Credits goes to:
  • The misterious guy at Samsung(?) called chul2 for the original s3c host drivers
  • Kevin Hester (kevinh, probably also nicknamed geeksville, punkgeek and humcycles) for fixing the s3c host driver for the Samsung Galaxy Tab
  • Ever kernel developer at teamhacksung for bringing ICS goodness to Galaxy S

This is a very early, and very rough usb host support. Expect crashes, freezes and things that are not working! You will also need external power (probably through a Y-cable or a powered usb hub, see the device connection guide below). Also make sure you are only using USB 2.0 (high-speed) devices. The driver does has some quirks with USB 1.x low-speed and full-speed devices, like mice, keyboards and similar things. Read the FAQ for more information about them. And of course it doesn't work with USB 3.0 (super-speed) devices.

Device connection guide:
attachment.php


FAQ: see post 2 at SGS
ChangeLog: see post 3 at SGS
Developer notes: see post 4 at SGS
Download links: see post 6 at SGS

Usb Host Controller: see it's own topic
 

Attachments

  • usbhost_2.jpg
    usbhost_2.jpg
    44.8 KB · Views: 54,256
Last edited:

RockRatt

Senior Member
Aug 1, 2010
4,101
3,711
Build 4 released

Has USB 1.x support for mice, keyboards, gamepads and such.

DL: http://xdaforums.com/showpost.php?p=21503469&postcount=6

Really cool to see how this works. Have you looked at how it is built into cm7 for the sgs2 by chance. On the sgs2 you do not need an external power source/hub to run a USB thumb drive. Curious if it could be set up the same for the cappy? Neat work your doing here. I had briefly spoken to Atinm a while back once we got it for the sgs2 and he basically said they had never looked into it for the cappy. Look forward to see how this progresses. Thanks

Sent from My KickAss CM7 Captivate
 

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
877
Edinburgh
sztupy.hu
Build 5 released

ChangeLog

  • Added ability to turn charging on/off while the USB is connected
  • Added ability to change the Host mode driver. Currently three drivers are present: S3C High-speed (the default), S3C Low-speed/Full-speed (this disables USB 2 mode. Use this if you want to have USB 1 compatibility), and DWC (a separate driver for the same OTG specification, that will probably get into upstream)
  • Fixed some small issues regarding cleanup after cable is disconnected

The DWC driver does NOT yet work, it will probably crash your phone if you try to use it. I however hope that I will be able to fix it. The other two drivers work well of course. Note that you have to turn off host mode if you want to change the driver (then turn it back on).

Also note that to change the charging mode you have to unplug every cable from the phone before changing the charging mode. In ICS it seems that the small battery icon on the top and the lock screen will still say the phone is charging, but the battery menu in the settings will properly tell you they are mistaken and the battery does not charge indeed.

Usb Host Controller has also changed to version 0.2.
I made a separate thread for it: http://xdaforums.com/showthread.php?t=1468531

Changes include stability fixes, a new icon, support for the new features mentioned above (changing drivers, disabling charger, etc.) and two nice commands:
  • Reset USB device
  • Re-read partition table

The latter command should probably solve a few issues where the flash drive was recognized, but there were no partitions to mount. It also solves the issues of connecting other Android devices. (Simply re-read the partition table after you have enabled usb mass storage mode on the other android, and you will be able to get files from the other phone too)
 

lillejord

Member
Apr 13, 2010
29
7
Seattle
Got a cheap OTG cable off of eBay and spliced in the power wires from an other USB cable. Was able to see and copy from the thumb drive and also was able to watch a movie directly from the drive. Was able to charge the phone during the same time.

Next up is to see if an Ant+ receiver will work.

ROM: Dark Night 5.5
Kernal: Devil3_0.79_cappy

USBHostControllerScreenshot.jpg
OTGUSBhack.jpg
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    USB Host mode driver for Samsung Captivate

    Also available on the Samsung Galaxy S and Nexus S

    (main post and more info at the SGS dev site)​

    Disclaimer: This kernel will enable some very early, and rough usb OTG support for your phone. Currently the phone DOES NOT give out power, so you NEED an external power source to be able to use this kernel. This is true for ALL USB devices, even with those that have their own power source, and doesn't requre external bus powering. Solving this limitation is a TODO, but we cannot guarantee anything. There are some other phones that have usb host support the same way this kernel has (eg. they need external power), like the Nexus One, and there is also a community using this, so if you're saying that usb host support has no sense if you need an external power source then you are definitely mistaken.

    This kernel is built upon teamhacksung's ICS Build 14 kernel, and will only work with that particular ROM (and possibly later versions of it). It is possible to port this to older ROMs (like CM7, or stock Gingerbread). Ask your favourite kernel developer to do this for you.

    Credits goes to:
    • The misterious guy at Samsung(?) called chul2 for the original s3c host drivers
    • Kevin Hester (kevinh, probably also nicknamed geeksville, punkgeek and humcycles) for fixing the s3c host driver for the Samsung Galaxy Tab
    • Ever kernel developer at teamhacksung for bringing ICS goodness to Galaxy S

    This is a very early, and very rough usb host support. Expect crashes, freezes and things that are not working! You will also need external power (probably through a Y-cable or a powered usb hub, see the device connection guide below). Also make sure you are only using USB 2.0 (high-speed) devices. The driver does has some quirks with USB 1.x low-speed and full-speed devices, like mice, keyboards and similar things. Read the FAQ for more information about them. And of course it doesn't work with USB 3.0 (super-speed) devices.

    Device connection guide:
    attachment.php


    FAQ: see post 2 at SGS
    ChangeLog: see post 3 at SGS
    Developer notes: see post 4 at SGS
    Download links: see post 6 at SGS

    Usb Host Controller: see it's own topic
    3
    Build 5 released

    ChangeLog

    • Added ability to turn charging on/off while the USB is connected
    • Added ability to change the Host mode driver. Currently three drivers are present: S3C High-speed (the default), S3C Low-speed/Full-speed (this disables USB 2 mode. Use this if you want to have USB 1 compatibility), and DWC (a separate driver for the same OTG specification, that will probably get into upstream)
    • Fixed some small issues regarding cleanup after cable is disconnected

    The DWC driver does NOT yet work, it will probably crash your phone if you try to use it. I however hope that I will be able to fix it. The other two drivers work well of course. Note that you have to turn off host mode if you want to change the driver (then turn it back on).

    Also note that to change the charging mode you have to unplug every cable from the phone before changing the charging mode. In ICS it seems that the small battery icon on the top and the lock screen will still say the phone is charging, but the battery menu in the settings will properly tell you they are mistaken and the battery does not charge indeed.

    Usb Host Controller has also changed to version 0.2.
    I made a separate thread for it: http://xdaforums.com/showthread.php?t=1468531

    Changes include stability fixes, a new icon, support for the new features mentioned above (changing drivers, disabling charger, etc.) and two nice commands:
    • Reset USB device
    • Re-read partition table

    The latter command should probably solve a few issues where the flash drive was recognized, but there were no partitions to mount. It also solves the issues of connecting other Android devices. (Simply re-read the partition table after you have enabled usb mass storage mode on the other android, and you will be able to get files from the other phone too)
    2
    New member dim319 tested it, and said it's working:

    attachment.php
    2
    Build 4

    Build 4 released

    Has USB 1.x support for mice, keyboards, gamepads and such.

    DL: http://xdaforums.com/showpost.php?p=21503469&postcount=6