Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,739,676 Members 52,488 Now Online
XDA Developers Android and Mobile Development Forum

[webcam support] USB Host support that YOU can try (now in nightlies)

Tip us?
 
verygreen
Old
(Last edited by verygreen; 15th July 2011 at 05:56 PM.) Reason: part of nightlies now
#1  
Recognized Contributor - OP
Thanks Meter 2562
Posts: 1,288
Join Date: Feb 2011
Location: TN

 
DONATE TO ME
Angry [webcam support] USB Host support that YOU can try (now in nightlies)

USB support and usb audio support were recently picked up by mainstream, so starting from nightly 135 you get all of the below (except for the webcam support). I am leaving the old information for history preservation purposes. The usb mode utility is replaced by Nook Tweaks

IMPORTANT! READ TO THE VERY END FIRST!

Ok, so I know some people want to try the usbhost mode and I am releasing this trial package to gather feedback and see how it works in the wild.
I am not responsible if you fry your nook (see below).

First, you need some hardware, namely microUSB to USB Female adapter. Something like this one. (There are cheaper ones on ebay, but delivery time is about 3 weeks, I got mine for $1.43).
Also an USB gender changer will work.

Then you need a kernel with usbhost enabled. I made a package that you can install onto emmc with CWM, or the same package could be installed on SD card if you use my installer. This package is only for CM7 users that already converted to .32 kernel. If you still run 2.6.29 kernel (ie CM7.0.3) - you need to upgrade to a fresh nightly like -87 or wait longer.

You can get the kernel here: http://nook.handhelds.ru/usbhost/upd...ost-2-emmc.zip

As you probably know, the Nook Color comes a little bit crippled in a sense that id pin on the OTG controller is not connected and so we cannot rely on it to properly choose mode. Instead I wrote an app to achieve the switching.
The app is ugly as hell, sorry, it's my first attempt at writing an Android app, bear with me, it would become better (I accept free Android programming lessons too! ).
You can get the app here: http://nook.handhelds.ru/usbhost/Noo...stSwitcher.apk
The app requires root, so make sure to allow it once asked and make it to remember the setting.

Install the kernel, install the app.
Reboot into the new kernel.
Run the app and you'll see a big "ToggleButton". When it's in Off mode, that means your nook is in usb client mode.
When you press it for the first time it will change to On, that means usb host.
(you can connect your external accessory before or after you enable the host mode).
When you press it again, it will change to Off and switch back to the client mode.
I recommend that before switching the host mode off you first disconnect your accessory, otherwise the internal hub cannot switch off.
(note that in some configurations the host mode enabling did not work for me on the first try and I needed to turn it off and on several times before the device registered. I believe there is no such problem with this kernel, but keep in mind such a possibility)
Addition in v2:
A second button is now added that lets you to force "external" vbus source. When you make it to ON, the battery charger pump is opened and connected to vbus terminals. In this state it is safe to connect nook to a power source, usb host will work and the battery should be charging at the same time.
Even without external power if your battery has high enough voltage (usually when it's full for me), it still somewhat works.
Additionally if you try to enable HostMode and an external power source is connected already, the "external" power mode is enabled (not shown in the app, though). This is to avert a potential disaster from below and to save battery.
Now the important part: When the Nook is in host mode, it drives 5V vbus off the connector at all times. If you connect the nook to a PC in this state, the PC will try to drive it's own vbus. Last time I tried to do this, my usb port in the nook fried! You've been warned! But that was before I had the host mode working and it might have been caused by a number of other things I was doing at the time too. Anyway I am not very keen on repeating this experiment again. If you are curious and decide to try it anyway regardless of the warning, make a comment and tell me what happened

Supported devices (this is important, right?)
Note that only low power devices will work if you don't have an externally powered hub. Don't expect to be able to drive a cdrom or a hard drive out of just nook. 100mA is the current limit. (Current testing shows that if you use ISB hub, even unpowered, it hides this issue).
  • All keyboards should be supported. (the keymap in CM7 is a bit strange, though, you'll see it).
  • All mice should be supported too, though I have not tried.
  • I enabled Xbox and PS3 controllers support, but have not tried.
  • Usb camera support - I only enabled UVC-compliant cameras (Microsoft Live cameras are compliant for example, probably many others). You also need specially built nigthtly with videocam support (try Camera app).
  • USB storage - generic support enabled, so should work for you.
  • Serial port support - only generic support enabled (I guess GPS devices mostly work as serial ports)
  • USB audio support enabled - not sure if the Android has any idea how to support it.

The kernel is basically normal dalingrin's kernel with USB host support enabled and ipv6 disabled (to keep kernel size below 3M threshold).

Kernel source (for the curious and if you want to build your own kernel with some mode devices support): git://github.com/dalingrin/nook_kernel.git branch usbhost

Enjoy and share your experience.
The Following 26 Users Say Thank You to verygreen For This Useful Post: [ Click to Expand ]
 
olm3ca
Old
#2  
Senior Member
Thanks Meter 30
Posts: 108
Join Date: Apr 2011
Just ordered the adapter for this. Thanks so much for your efforts!
 
Arbelzapf
Old
(Last edited by Arbelzapf; 1st June 2011 at 12:52 PM.)
#3  
Arbelzapf's Avatar
Senior Member
Thanks Meter 120
Posts: 644
Join Date: Oct 2010
So if anything goes wrong, we can revert by just flashing Dalingrin's kernel again, right?

Going to order an adapter now

Quick (and possibly stupid) question: Would gender changer plugs work in combination with a regular micro USB->USB cable?
 
jamima69
Old
#4  
Account currently disabled
Thanks Meter 5
Posts: 25
Join Date: Jun 2010
this is incredible, thanks for all your hard work !!!
 
tkascak
Old
#5  
Junior Member
Thanks Meter 0
Posts: 10
Join Date: Feb 2010
Default Awesome news

Thanks for all your work on this. It just amazes me how much talent is here on XDA.

It also amazes me that Android tablets/phones struggle with something a 10+ year old Windows 98SE laptop can do with ease.

Ordered my cable and can't wait to try transferring pictures from my camera to the Nook!
 
paleh0rse
Old
#6  
Senior Member
Thanks Meter 633
Posts: 1,747
Join Date: Jan 2011

 
DONATE TO ME
Has anyone seen a netbook-style keyboard/case combo that would work with the nook? (Bluetooth and/or USB)

Great work man, can't wait to try this out!!
"To be rooted is perhaps the most important and least recognized need of the human soul." - Simone Weil
 
hazridi
Old
#7  
Member
Thanks Meter 13
Posts: 73
Join Date: Dec 2010
Just built cm7 from source as of 6AM and flashed your kernel, turned usb host on and attached my usb gender changer to my phone's micro usb cord and plugged in a mass storage device. dmesg in Terminal Emulator showed the device properly but apparently android has no idea what to do with it, the light didn't even come on. Encouraged by this minor sign of life, I plugged in a keyboard and it works (though of course the android keymap is close to full retard).

Good job! I think nullghost's idea of adding this to the CM7 pulldown menu is a good idea. Maybe also the power control?
 
hololight
Old
#8  
Senior Member
Thanks Meter 171
Posts: 274
Join Date: Dec 2010
You will need to mount the USB storage yourself.
The Following User Says Thank You to hololight For This Useful Post: [ Click to Expand ]
ace7196 Old
#9  
Guest
Thanks Meter
Posts: n/a
Glad I though ahead and got an adapter

Working well so far. Will try more accessories at school!
 
Divine_Madcat
Old
(Last edited by Divine_Madcat; 1st June 2011 at 04:02 PM.)
#10  
Divine_Madcat's Avatar
Forum Moderator
Thanks Meter 2214
Posts: 2,576
Join Date: Sep 2005
Location: USA
Any advice on what adapter to buy? I was looking at this one:
http://www.amazon.com/USB-Micro-Adap...6940268&sr=8-1

but not sure if it is what we are looking for since one review said it does not work for USB OTG.

Actually, thinking about it, is the USB host mode that is enabled here, different from the USB OTG that i am thinking of?


And since i dont mind being the first to ask a dumb question..
Quote:
Originally Posted by hololight View Post
You will need to mount the USB storage yourself.
Would this be something done in the terminal, or through the settings UI (aka, it will show up on the same place that the SD card shows up)?

Tags
nook color, usb host, usbhost
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes