yashsingh1/xdaforums huggingface dataset:
[Nexus One General] tphuc_ibc:
I try and the usb host mode worked perfect. Thank u so much.
[Nexus One General] @seb:
@tphuc_ibc

No problem ;)

I made some pictures an a video of my construction:

http://www.youtube.com/watch?v=W5KYRuXKS2E
[Nexus One General] virtualflyer:
Good morning,

I'm trying to make usb host works on n1. Would this be fine http_//cgi.ebay_it/two-short-USB-2-0-A-male-to-Micro-microusb-b-Male-Cable-/230597347698?pt=PDA_Accessories&hash=item35b0ac4972 or this http_//www_amazon_com/USB-Micro-Female-Male-Adaptor/dp/B0023FTRUO? I'm trying to understand the instructions, which isn't so easy to me! What's most I can't understand when and how and which files I've to install to patch it to make it work for the 2.3.3. Would a simple vga to usb cable work or would I need a real adapter like the ones which starts from 40€?
[Nexus One General] @seb:
1. You have to use a otg cable (or a selfmade cable) because the id-pin has to be connectet to GND. Otherwise it can´t work.

2. Do you have root and a unlocked bootloader. If not you can´t flash the kernel.

3. Of course you need a real adapter.
[Nexus One General] virtualflyer:
So if I don't have an unlocked bootloader I can't? Of course I have root, I don't have the unlocked bootloader. Even in sonic74's page says only a rooted n1 as required, but this could be done when you had to unlock the bootloader to root.

What does a real adapter does?
[Nexus One General] @seb:
You can unlock the bootloader via "fastboot oem unlock".

I don´t know a unreal adapter. ;) A USB to VGA adapter coverts the digital USB-signal to the analog Video-signal for a monitor.

Edit: You should do a backup before you unlock the bootloader, because the process wipes all userdata.
[Nexus One General] virtualflyer:
I don't want to unlock the bootloader to not void the warranty. Id this id really needed I'll probably keep Lu n1 ad it is. For a real adapter I meant the adapter and not the cable
[Nexus One General] @seb:
As far as I know there is no other way then unlocking the bootloader.

You need the idpin connected to Gnd because thats the differece between micro-usb a and b.
[Nexus One General] virtualflyer:
So I'll have to surrender unless anyone knows how to do it whitout unlocking bootloader. That's so depressing, being able to do everything whith your phone, but not being allowed to do it to not void the warranty!
[Nexus One General] tphuc_ibc:
I have a question for you: how to have a cursor in your N1 like your clip when you using wireless mouse?
[Nexus One General] @seb:
You only have to insmod usbhid.ko and plug the mouse in, that´s it.
[Nexus One General] tphuc_ibc:
I insmod usbhid too, I can use my wireless mouse but it not have a cursor like your N1. This is my mouse in my N1: http://www.youtube.com/watch?v=0JHUqM_9vKY

I think that is a part of X11 Debian, so, are you use debian x11?

PS: I use rom cyanogen mod 7.0.0 rc2
[Nexus One General] @seb:
Yes, i have ubuntu on my N1, but I haven´t started it in the video. I think it depends on your rom. I have CM6 on my N1.
[Nexus One General] tphuc_ibc:
Another question: I have my N1 with unlocked bootloader, but it is S-ON, so I cant using fastboot flash zImage zImage.

Any ideas?
[Nexus One General] @seb:
What is S-ON?
[Nexus One General] tphuc_ibc:
When i boot into boot loader, I see S-On. I hear that with S-OFF you can flash the kernel.

I think that your N1 is S-OFF
[Nexus One General] @seb:
I've checked my bootloader and it's also S-On. So it shouldn't matter.
[Nexus One General] tphuc_ibc:
So, now I dont know what problem with my N1, I type:

fastboot flash zImage zImage (like you say)

But I have a error:

<bootloader> signature checking...

FAILED <remote: signature verify fail>
[Nexus One General] @seb:
Try it one more time, i had the same problem.
[Nexus One General] tphuc_ibc:
Oh, I see, but I want to enable usb host mode not using computer, but when I use fastboot boot zImage, I cant make a nandroid backup for the next time to use it.

I think the only way that is flash the zImage and make a nandroid backup.

Can you give me your CM6 backup which was load the kernel. I like your cursor in the video but I cant do that.
[Nexus One General] Canute:
What if I wanted to integrate the USB patches and Modaco's host mode switch UI into my own custom CM 6.1 build?
[Nexus One General] robross0606:
Anyone else notice that Sven's website appears to be down? Almost 24 hours now.
[Nexus One General] sonic74:
Yes, my linuxbox @ home has gone offline and I'm on a business trip ;-( Will have to drive home for the weekend...
[Nexus One General] robross0606:
LOL, no problem Sven. :)

Just looking for any hints, patches, or direction for porting your USB_HOST into Nexus One Gingerbread. I have it working fine on Froyo, but there are some pretty glaring multicast problems (loopback, ttl, etc.) on that release.
[Nexus One General] sonic74:
Breaker was triggered. Replaced PSU, now online again :-)

You can find my patch for a 2.6.35.4 kernel here.
[Nexus One General] robross0606:
Saw that but wasn't quite sure what to make of the minimal instructions and complication of Meego. Am I just interested in the leviathan-incoming-ga604b47.patch file?
[Nexus One General] sonic74:
Yes, but leave out the fbcon related stuff.
[Nexus One General] robross0606:
Sorry for the stupid questions but where do I get the actual kernel source to patch? For the Froyo version, you supplied the source tree. However, the instructions on the Meego page have me a little confused. This looks like a kernel source tree, but what is the "ubuntu_sound+WIP" reference?

I would like to patch the vanilla kernel and not complicate my ROM with unecessary features.
[Nexus One General] sonic74:
Actually, I already prepared it for Gingerbread: just leave out this last step:

git checkout -b android-msm-2.6.32 origin/android-msm-2.6.32
[Nexus One General] robross0606:
Perhaps I'm still misunderstanding. Does the "master" baseline already have patched code or do I still need to apply the leviathan-incoming-ga604b47.patch? I ask because I checked out and compiled the master baseline but did not end up with an echi-hcd.ko after compilation.
[Nexus One General] sonic74:
No, it doesn't.
[Nexus One General] robross0606:
Okay, patched that source using leviathan-incoming-ga604b47.patch. Recompile yielded expected echi-hcd.ko files. Built new ROM and flashed as I have done several times with the FR83G kernel. However, unlike the FR83G kernel, I am not getting past the initial HBOOT "colored X" image. It never reaches my custom boot animation or anything else. Had to pull the battery to reboot. Reflashed back to custom FR83G ROM and it boots fine.

Any suggestions on how to debug that?
[Nexus One General] sonic74:
A serial console might help, although I'm not sure how well this plays together with host mode.

Have you left out drivers/video/msm/msm_fb.c ?
[Nexus One General] robross0606:
No, you said the leave out the fbconn stuff but I didn't realize that mean msm_fb.c. I will try reverting those changes and build again.
[Nexus One General] robross0606:
Removing msm_fb.c changes did not help. Everything builds and flashes without error, but the device will not boot after flash. It hangs on the bootloader image and never reaches the boot animation.
[Nexus One General] sonic74:
There are APIs to enable﻿ power. We just don't know yet if they are safe to use.

ConnectBot is needed for shell access to load modules or start Debian.

The keybord is supported in Android as soon as usbhid.ko is loaded.
[Nexus One General] jmgrosen:
Step by Step

I am not much of a developer and have never really worked with this kind of stuff. :p

Two questions:

1. Do you need root?

2. Is it possible for you to make a step-by-step on how to apply this?

Thanks in advance
[Nexus One General] Talderon:
The only thing I can't find is the USB Power Cable.

I can't seem to locate a USB Y-Cable with 3 Male Type A connectors.

Anyone able to locate one?
[Nexus One General] sonic74:
Yes.

Which step is unclear?
[Nexus One General] mykenyc:
wow dude you just made my day i was jumping ship for the N8 just for this reason im to scared to test my N1 without a usb power thingy but what's the worst that can happen if i do it direct phone to say mp3 player connection. Also have you reached out to anyone at Google asking about would it damage the phone?
[Nexus One General] sonic74:
I used this one with 2xA+1xB.
[Nexus One General] jmgrosen:
So you just

fastboot flash boot Z:\nexus\boot_usb_host.img
adb shell mv /system/lib/modules /system/lib/modules.orig
adb shell mkdir /system/lib/modules
#adb push Z:\nexus\android-kernel_msm-a971bfd\android-kernel_msm-a971bfd\drivers\net\wireless\bcm4329\bcm4329.ko /system/lib/modules
adb push Z:\nexus\android-kernel_msm-v2.6.30-rc2-27223-g248970b\android-kernel_msm-248970b\drivers\net\wireless\bcm4329\bcm4329.ko /system/lib/modules
adb push Z:\nexus\android-kernel_msm-v2.6.30-rc2-27223-g248970b\android-kernel_msm-248970b\fs\unionfs\unionfs.ko /data/local/bin

Surely there's more to do.:confused:
[Nexus One General] Talderon:
OH!! haha, I see it now... >.< lol

Thanks!
[Nexus One General] sonic74:
Nothing happens. I did this unintentionally for half a year :rolleyes:
[Nexus One General] SabrWolf:
so its possible to say connect a flash drive to the nexus one without a dedicated powered hub ?

would it work with the current implementation?
[Nexus One General] sonic74:
No, it wouldn't.
[Nexus One General] mykenyc:
yea that would be a minor drawback nothing biggie but thanks anyway hope it gets better and implemented into roms.:D
[Nexus One General] chesh420:
Ok, is it just me, or are there no instructions on the web page? I see the prereqs, but no instructions. Is it my browser?
[Nexus One General] sonic74:
Isn't it self-explanatory? ;)

Seriously, what steps should I describe?
[Nexus One General] :
That just means it's over your head.
[Nexus One General] peliROJO:
You're on Engadget now:

http://www.engadget.com/2010/06/04/nexus-one-gets-usb-host-driver-from-a-dude-with-an-oscilloscope/

In case you care. : )
[Nexus One General] cartoonmonkey:
Wow! Just what the doctor ordered!

I'm also a linux / android noob. Rather, a non programmer type who's interested in this. I would love to see if a simple thumb drive could be read without the external powered usb hub.

I also have a pico projector, that I would love to be able to plug into the Nexus One, and display pictures from it's internal SD card that way..

Anyone? Instructions for noobz cartoonists like myself?
[Nexus One General] sonic74:
I added instructions to the website.
[Nexus One General] chrs2021:
Power Question

Could we use a charger with a usb port - like the ipod touch/iphone wall charger to provide power for this?
[Nexus One General] sonic74:
You'd need to build an adapter cable to provide power to the wall wart socket of the hub.
[Nexus One General] robross0606:
Further investigation shows that the issue appears to be in the boot.img builder of dsixda's Android ROM Kitchen. On FRG83G I was able to use the kitchen to expand the boot.img, replace zimage file and compress back to boot.img. However, with GRI40, looks like even if I just expand the stock boot.img and immediately build it again, the resulting file causes the Nexus One to hang on boot as described above. I'm assuming this is some sort of script bug in the ROM kitchen. Need to dredge up some instructions for manually creating a boot.img file...
[Nexus One General] robross0606:
Gingerbread with USB_HOST

Okay, I was wrong again. Turns out the kitchen is able to expand and rebuild a working stock boot.img. Therefore, the problem must be in the custom compiled zimage and not a problem with the kitchen itself. Not sure how to debug the problem without mucking with the kernel some more to enable serial output. I also don't have a serial over USB cable.

I have attached my compiled zimage in case someone wants to test it out.
[Nexus One General] Aerohix:
External Touchscreen Monitor + Ubuntu (?)

Hi All!

I study electronics and know almost nothing about android programming, I just want to know if is it possible, using this USB host drivers I can connect it to an battery powered external touch screen monitor.

To transform my nexus one into a tablet when I'm home or at work so I can do the basic things using ubuntu because I feel irritated with the small screen (3.7") a 12" screen I have would fit it better and Ubuntu already have the drivers for my touch screen digitizer (from an HP Tx2 1020us laptop).

I also could try some programming to implement that driver into android hahaha but that's for another day.

Thank you!
[Nexus One General] robross0606:
In the absence of serial port access to kernel boot messages, is there a way to output kernel boot messages to a log file on the system? Or perhaps directly to the screen and disable the boot images? Any help would be greatly appreciated as I'm completely stuck right now.

I see some work has been done by Sven, but on a Nexus S.

http://sven.killig.de/android/console.html
[Nexus One General] Alt.F4:
Okay, so I managed to get Sven's binaries to work. I'm actually not sure what I was doing wrong. :( Wish I could report what the issue was. It just seems to work now when I flash them over. Perhaps I was using the wrong image, or rebooting after a ramboot or something? Dunno.

My hardware setup is essentially the same as what others have been posting:

N1 Plugged into a Powered USB Hub. Dual USB cord to provide upstream power to the N1.

I still cannot seem to get a build to work from source, however. I can build (using the r5b version of the NDK as stated above) and flash it to the phone.

If I try to insmod the the usbcore.ko provided by Sven, I get a "Failed (Exec format error)". dmesg says: "usb version magic '2.6.32.9-27240-gbca5320-dirty preempt mod_unload ARMv7 ' should be '2.6.32.9-27242-g4c0d547-dirty preempt mod_unload ARMv7 ' But that's probably to be expected.

When I try to insmod the usbcore.ko built from source, I get "failed (No such file or directory)" with dmesg saying "usbcore: Unknown symbol _GLOBAL_OFFSET_TABLE_"
[Nexus One General] sonic74:
Actually, that was a Samsung Galaxy i7500. But with some further kernel patches, it's possible for the Nexus One, too. Although I don't know whether Android runs still after that.
[Nexus One General] sonic74:
No, it isn't.
[Nexus One General] oelakkad:
Any chance you've tried usb wifi dongle?
[Nexus One General] n8loller:
Google is being tricksy with it. Though they don't provide a link to it anymore, they still host version r4b to download at... ok so they wont let me post links yet, and I haven't found a way around their parsing... so go to the download site for android ndk version r5b, then replace the file name in the download link with "android-ndk-r4b-linux-x86.zip"...

I ran into the problem too, and it took me a while to find somewhere to download r4b... just to find Google still hosting it. However, I wasn't able to find this alternative directory in r5b as you did.
[Nexus One General] n8loller:
I've been running into problems left and right trying to get this working on my motorola droid (original). I am running:

Android: 2.2.1

Baseband: C_01.43.01P

Kernel: 2.6.32.9-cm-stk mtwebster@eng-laptop#1

Mod: CyanogenMod-6.1.2-Droid

Build: FRG83D

It took me a while just to get the sdk, source, and ndk on my machine and able to be compiled... then once it worked, I tried to load it onto my phone and that didn't work either.

I am pretty sure from reading random web sites that my phone doesn't support fastboot, so I tried using flash_image instead. That gave me more errors, so I decided to load the boot.img using nandroid (I had to spoof the md5 checksum for that to work).

Once that got on, my phone would just boot to the moto logo and do nothing indefinitely (5 minutes at least).

I tried with your pre-compiled image and with one I build myself with the same results. Is there anything that I said that immediately raises a red flag?

edit:

Well for one thing, I assume the "msm" in "kernel_msm" means this is intended for the Qualcomm chips (I'm guessing if I checked what the hardware was for your phone, I'd see a Snapdragon or similar), where my phone has the ARM Cortex A8. I can see that being a problem... Is there anywhere that you have noted what files you changed from the msm kernel base to get USB working so I could try to mirror that in the generic kernel (or whichever is intended for my phone)?
[Nexus One General] Alt.F4:
That did the trick. I downloaded the r4b NDK and it just worked. I just went ahead with the build like normal from Sven's website and it built, flashed and installed. USB HID (keyboard / mouse) and USB storage working.
[Nexus One General] sonic74:
AFAIK, my patch isn't needed with the Droid: it switches already into host mode when some pins are shorted while switching it on.
[Nexus One General] bergfex:
Hi

Have you ever a look into the kernel sources of the Dell Streak? It seems, it supports switching between usb host and client/gadget mode.

The Dell Streak also has a QSD msm8250 SoC.

http://devdot.wikispaces.com/Dell+Streak+USB+Host+and+Game+Controller+Tutorial
[Nexus One General] hedpe:
has anyone figured out if it's possible to make udev rules for USB devices?

on my Droid, there is no /etc/udev

So I created /etc/udev/udev.conf and /etc/udev/rules.d with rules in there. For example, to mount a USB drive to a specific place when it's connected.

However, it seems as though Android is completely ignoring my set of udev rules.

Maybe they are located somewhere else? I have searched all over the place, and can't find anything related.
[Nexus One General] hnk1234:
thanks for the great work, it works fine with my nexus one.

now i want to communicate/receive data from a SunSPOT (9600 baud, 8 data bits, 1 stop bit, no parity). any suggestions how to use the serial port for this?
[Nexus One General] shopcity:
If i keep flashing rom after rom will the n1 become more worn out?
[Nexus One General] bled82:
Any chance this could be ported to the HTC Vision G2/Z . Also wonder if we could get cyanogenmod to include this in cm roms .
[Nexus One General] koutouyo:
Is it work on other android phone :confused:
[Nexus One General] Pwl10:
I'm trying to enable USB host feature on Samsung I5500. It has MSM7227 SoC - the same has ZTE Blade where Sven has already enabled it. So, I'm full of inspiration.

Just a few questions to heroes, who already have some experience.

1. Is it necessary to build and flash new kernel? Is it not enough to build required modules (at least usbcore.ko and ehci-hcd.ko) and load it with original kernel manually?

2. It's clear that in .config file we need to enable USB hosting. But do we need to disable something, e.g. USB gadgets?

3. Just to confirm. We need to "insmod" modules when the device (e.g. flash drive) is already connected to the phone. Is it right?

4. How can I confirm that the USB host driver is loaded properly?

Are there any signs in the system if there is not enough power on the USB port to detect the connected device? I'm using Y-cable with 5V-1A DC - not sure if this is enough to charge the phone and power the flash drive.

If someone could paste the dmesg log of this procedure it would be really helpful.

Wow, a bit more than a few but I really appreciate any help :)

Cheers,

Pavel
[Nexus One General] Pwl10:
Guys, sorry for bothering you again. Thanks everyone, I've got Nexus One, enabled USB host and answered to all my questions. :)
[Nexus One General] strags:
Hi Sven,

I've followed the instructions on your page, and I'm running into the same kernel module magic version issue as the previous poster.

Your modules.tbz file contains modules with a magic of "2.6.32.9-27240-gbca5320-dirty".

However, this doesn't seem to match the kernel version that you wind up with after doing the git clone and checkout commands.

"git rev-parse --verify --short HEAD" gives 4c0d547, which is used to construct a kernel magic version of 2.6.32.9-27242-g4c0d547-dirty.

I'd love to try the modules that you built, because I'm having a huge amount of trouble with a USB serial device (cp210x.ko) and I want to make sure it's not because I did something stupid.

By the way, what does this mean? (from your page):

(Mind /system/lib/modules/bcm4329.ko !)

As things stand, I can boot your kernel image directly, but Android tries to load bcm4329 from /system/lib/modules, and presumably the same version conflict occurs, and hence wifi doesn't work.

Any help much appreciated - cheers!
[Nexus One General] sonic74:
Hmmm, bad. Seems I messed it up with my git commits.

I want to update both to Android 2.3.4 with kernel 2.6.35.7 for a long time, I just didn't manage to do it yet.

Exactly, therefore this has to be replaced, too.
[Nexus One General] sonic74:
I finally updated it to kernel 2.6.35.7 g52630a3 for Android 2.3.4.
[Nexus One General] hwgasdfasdf:
Hi

I applied your patches to the cyanogen 2.6.37.6 kernel for desire, and have the kernel compiled and working, and can easily flip back and forth between usb host and usb gadget kernels.

My problem is that everything works great the first time, until I unplug say the keyboard. When I plug it back in, I get

drivers/hid/usbhid/hid-core.c: can't reset device, msm_hsusb-1.2.4/input0, status -71

if I rmmod usbhid, then pull the keyboard, and plug it back in, and modprobe usbhid, it works ok. Once it gets into the state above, I have to reboot the device to get it working again.

Anyone else seen similar behaviour?

Andrew
[Nexus One General] bled82:
Since you where able to port to the desire , do you think it would be possible to port it to the G2/desire z ? And would you be will to provide directions on how I could or be able to provide a kernal for my device? Thank you in advance , look forward to a response .
[Nexus One General] hwgasdfasdf:
Yeah, I'll write up a howto / have some slightly modified patches and stuff in time.

I've just been playing with various devices so far, keyboard, usb stick, usb hard drive, usb ethernet, everything seems to work good, except when I unplug devices without rmmodding the modules first.

Don't have a display-link device yet - would really like to get one and play with that - that would be cool!

Andrew
[Nexus One General] bled82:
Yeah mini monitor would be nice, they have display link drivers for android.I would like to mount a mini in car n have **** for phone and have every thing in need on a 7inch touch screen.
[Nexus One General] bled82:
Here is a driver i found that might help to get the external display working . https://github.com/magoroku15/DisplayLink-driver-for-android

This guy seems to have alot of stuff that might be usable on other devices . https://github.com/magoroku15
[Nexus One General] fegato:
Interactive Project

@sonic74

Hi, thanks for your really wonderful effort, thank you!

I have a question:

i'm doing a interactive project,

my purpose is to receive a video signal from a webcam (via USB),

and send it delayed of about 4 seconds (via HDMI or DVI) to an HDTV.

Do you think it is possible using your usb host method, linux, and a nexus one?

it would be great if I can do it 720p.

thanks for your time and your work

D
[Nexus One General] sonic74:
Yes, but don't expect more than a few FPS.
[Nexus One General] fegato:
Thanks is what I wanted to know, because i need 24fps, maybe I got to find another way
[Nexus One General] snakefreak:
Sven in your script to load dvb-t modules, i see #i9100 ;-)

have you tried on sgs2?

# i9100

#USBDEV=2-1

# UD-160-A

#USBDEV=2-1.6

#USBDEV=1-1.7

# DC DOCK4 back left

USBDEV=1-1.2
[Nexus One General] sonic74:
Yes, but without success: the tuner (/dev/dvb0.frontend0) isn't found because the detection via I2C fails ("DiB7000P: wrong Vendor ID (read=0x0)" twice).

Not the only problem I have with its OTG support :mad:
[Nexus One General] snakefreak:
Make test tomorrow. Think write you a pm in german. ;-)
[Nexus One General] gyurman:
usb host mode for I9000

Hello,

What I need to change, if I want usb host mode for I9000 cyanogenmod nightly?

Please I wait for your help.