yashsingh1/xdaforums huggingface dataset:
[Nexus One General] slavixtube:
Integrate USB Host into Cyanogen Mod

Hello,

There is great interest among CyanogenMod users for this feature.

I hope the author of this original work will help integrate it into the Cyanogen Rom for everyone to use!

thanks alot for your great work!
[Nexus One General] sama:
+1

Having this in a regularly maintained build would be fabulous.

Sam
[Nexus One General] xghostyxjokerx:
can we actually have somoene make a step by step video tuturial on how to do this ...please!!!!!!!!!!!!!!!!!!!!
[Nexus One General] Slick1123:
I've done this (compile the sources for the Incredible). I'm making progress, but something's not quite working right.

Actually, now that Froyo is leaked for the Incredible (and HTC has released the 2.6.32 sources for it), there's really no need to try to support Android 2.1 for this feature on the Incredible. Much more tempting to work on 2.2, especially since the USB host mode patches from Sven's website apply cleanly.

For those who are interested in following the development of USB host mode on the Incredible, please see thread ID 7708701 (because I'm not cool enough to post a link to it :p )
[Nexus One General] niematunikogo:
Finally I got time to read all this stuff carefully.

Firstly: Thank you for this one! It's pretty awesome ;)

Now I'm ordering all the cables and stuff:) so hopefully I get to play with this sooon.

First question though:

I saw you playing with webcam at the video. One of my ideas to use this USB host driver would be to connect HD webcam and try to use my N1 as portable recorder.

Do you thing there will be any problem in connecting usb HD webcam? I saw that Microsoft (!!) is selling quite small HD cams, but I'm not sure if they are linux friendly :)

on the other hand what software or preferably commands could I use to capture video from HD cam on my nexus?

I'm also to order some powerpack to charge usb hub...

Do you think It would be safe just to use modified cable with power from 5V baterry pack attached to +/- wires?

so one end would be male micro-sd and the other "normal" female" usb ?

Thanks!

now i'm going shopping :)
[Nexus One General] sonic74:
Not if the webcam delivers an already compressed stream.

I powered my hub from a LiIon pack via the power plug.
[Nexus One General] tordne:
Hi,

First I want to say thanks Sven.

You don't have to buy all those things. I modified one micro USB to mini usb, sliced the micro usb plug open, connected pin 4 with 5, then took a M USB A plug with a little cable connected and soldered only the black and red to the micro USB cable. This is a "micro USB otg and dual powered"

I found that android uses a lot of resources so I have got debian squeeze on my SD card(quite expensive but useful 16gb sdc10)

I only use X11 xorg, no gnome kde or lxde, want to keep things small for this beauty.

Everything works perfect except for when I want to record a video with my Logitech 9000 pro using mencoder at 1280x720 at 30fps he gives a "video buffer full" after 2 seconds, even on a lower resolution 640x480 I only got 8 secs of recording.

Normally seen it means that the processor is not fast enough to encode all the frames. At 640x480 he does about 6fps encoding, but that doesn't mean that those 8secs were scattered, they're still fluent 8secs at 30fps. Just video streaming is ok, not so CPU and mem intensive.
[Nexus One General] niematunikogo:
Do you run debian over android or insteed android?

I've "installed" ubuntu on my N1 (link) but this way two systems are loaded at the same time.

If you know the way to run only debian it would be an option... maybe?

on the other hand, maybe using nandroid backup + flashing some ultra light android MOD , then after recording restoring nandroid...would work a bit better?

*** what I wrote above is based on believe that Sven's way of connecting usb stuff is done while "full" android is running - I didn't follow his instructions yet so I'm not sure:) ***

1) are there any specific HD webcams that would compress/encode/[do some different magic] so that N1 would be able to store captured video?

2) is this "video buffer" size depending on CPU capabilities or free ram?

mhmm.. I was really hoping to get this working...

edit: I hope that I'll receive d-link hub and all cables before weekend:D

edit 2: funny thing.. I can buy that dual power cable for.. 8Euro ... but I bought external 2,5''IDE case for 2Euro.. and guess what... dual power cable is included :D
[Nexus One General] tordne:
i run debian without android, but if i really want, i can still chroot in to debian and then with thightvnc i get the same result.(only advantage for the chroot, you can still use it as a phone, i didn't have the time yet to sort these things out.)

but when i boot in to debian things become different, after my initial bootup i end up in xorg and then i just use 70Mb ram. that means 320 Mb free.

while writing this i just found a package wammu, gonna see if i can get this phone thing to work in linux.

if you look at the quality of the videos that the inbuilt camera makes, this is low quality and at max 20fps, and it's 3GP.

and it matters a bit both the cpu is needed to encode the video stream, but when to many fps he needs some mem to store the frames. i think it must be possible with other cameras, or with use of other codecs.as the 3GP.
[Nexus One General] niematunikogo:
please let me know if you have any luck with this ;)
[Nexus One General] rahuldave:
PenDrive

Lets say if I were to use this method to connect my pendrive to my nexus one to transfer files from nexus one to pendrive or vice versa.

Is it possible?
[Nexus One General] sonic74:
Yes, if you make sure it get's power.
[Nexus One General] rahuldave:
Pendrive

Does it means that I have to connect the pendrive to a USB Hub and connect it to Nexus One? Can we use it as OTG Device, we just plug in the USB to a compatible cable and connect the other end to the Nexus?

Thanks
[Nexus One General] sonic74:
Either that, or fiddle power into an Y-style cable.

No.
[Nexus One General] Remzy:
Who can make an assembly for Desire DeFroST FRF91? For the last kernel update.

http://xdaforums.com/show...62&postcount=1

usb_host.zip MOD

thx
[Nexus One General] _ReBoot_:
sonic74, Is there any way to use your drivers with other device (on HTC HD2 Android)?
[Nexus One General] sonic74:
Yes, as long as it's Qualcomm-based and the kernel source is available, one can try.
[Nexus One General] _ReBoot_:
I am not a developer. There are some information and files on your's web page (in the first post in thread). It's enough to begin the porting your driver to other device?

P.S. Sorry for my english, just in case
[Nexus One General] sonic74:
Yes, it is.
[Nexus One General] _ReBoot_:
One more question. HTC HD2 hasn't any interconnection for power supply for external devices. Is there a same problem on Nexus one? How do you think it is laziness of	vendor?

Both devices charges within usb. It follows thence there is interconnection	between usb and battery. This interconnection one-way? I mean there are diod or something like this?

Danke für alles
[Nexus One General] sonic74:
rumborak tried to activate the built-in power management chip.
[Nexus One General] niematunikogo:
I'm still stuck on getting power...

help? :)

I bought active DUB-H7 Dlink USB HUB, some cables and connected it as shown below:

HUB is powered, and I used additionally dual power cable, original N1 usb cable and [USB-Female 2 USB-Female] part.

My N1 is NOT getting power as it should... do You see any potential source of error? or I've just bought wrog HUB?

thanks!
[Nexus One General] sonic74:
Perhaps the [USB-Female 2 USB-Female] part does not route through all 4 pins?
[Nexus One General] niematunikogo:
i was wondering how this kind of "homosexual" :P part deal with power, is it "crossed" and is it always safe to connects multiple parts like that..

well, since I have NO electrical stuff to "measure" voltage and so on.. i dont know how to check it.. unless I'll buy male-male cable:)

I think that there is problem with this hub.. it has power light and light at each usb port... when it is connected to power then only one PWR light is on... so other ports seem not to be powered.

when it is NOT connected to power, but is connected to computer then ALL lights are ON.

It seems like I'm unable to use this dual power cable as needed... I'll check with different hub maybe...
[Nexus One General] smaspero:
Single device

Hi,

I am looking to connect a single usb device to the N1 and avoid having to plus it into a wall socket, and I think I could really use your help to get things straight.

My understanding would be that it seems possible using a Y cable to connect the N1, the device, and a power source, may be such as a battery, or may be such as the device power source itself.

Secondly, i need to access this device as a serial port. I guess it would work the same way as any USB to serial on any linux system ?

Thanks in advance for your help.

Simon
[Nexus One General] sonic74:
There seems to be one already.
[Nexus One General] smaspero:
Thanks for that, it seems that I missed it.
[Nexus One General] thndr686:
CM6 Kernel + Usb Host

Has anybody managed to compile the cm6 kernel with the usb host patched in?

I've been trying all day to figure out how to patch the cyanogenmod 6 kernel with the usb host patch and I cant figure out how.

Thanks!

-Scott
[Nexus One General] ironjaw33:
WiFi broken

Does anyone know why building the kernel with the supplied patch and .config file breaks the WiFi? I can check out a stock kernel (2.6.32), compile it, and install it to the phone and WiFi works fine. However, as soon as I modify the kernel source with the .patch file, compile, and install to the phone, the WiFi doesn't work. I have a bcm4329.ko that is compiled for 2.6.32, so I'm not sure what the issue is.

Any ideas?
[Nexus One General] sonic74:
Running a kernel with modules not compiled with it is merely luck. It's really much safer to build and install the corresponding modules with the kernel.
[Nexus One General] ironjaw33:
Ok, I figured it out. The scripts/localversion shell script appended "-dirty" to my build since I had modified the source from the repository version. By editing the script to remove the "-dirty" and by recompiling/reinstalling the modules (bcm4329.ko) and kernel image, I was able to get WiFi working again.
[Nexus One General] bergfex:
Huffman?

Hi, great work!

I'm also interested in playing around with the USB OTG possibilities of smartphones.

My plan was to wait on the HTC Desire HD to have a European phone with HDMI and USB OTG, but the Desire HD won't have HDMI like the EVO.

So I have some questions about the performace of using DisplayLink Docks.

Does any of your drivers already use the Huffman coding?

How many percent of the USB bandwidth does a DisplayLink adapter need?

Would there be a possibility to read a video from a USB stick and show it over a DisplayLink on screen with about 1024x768 or more pixles (at the same time)?

Danke für Alles!!
[Nexus One General] sonic74:
No, but it would be available in libtubecable.

Depends on the change of the screen content.

I watched DVB-T this way and got around 5-10 fps @ 720×288.
[Nexus One General] bergfex:
Sounds very promising.

Do you think it will be very hard work to merge the libtubecable stuff into a framebuffer driver? I only have very less experience in modifing linux drivers.

If it is not that impossible, why none has done this before?

I saw that there is an openBSD port of an DisplyLink driver that has gotten huffman coding suport.
[Nexus One General] sonic74:
I asked this myself. But I guess to make it efficient, one would have to be proficient in assembler optimization.
[Nexus One General] bergfex:
Does this mean a efficient implementation will not be compatible between x86 and an ARM based system?

Would this also mean that the implementation of the libtubecable is working but the implementation is not efficient enough to bring a real performace boost?

(Also I am very impressed by the work of the libtubecable team!!!!)
[Nexus One General] sonic74:
I may have been wrong, I don't see such optimization in the BSD driver.

Here is some talk regarding this between the reverse engineer and the maintainer.
[Nexus One General] bergfex:
Maybe we get a little of topic, but I have a quick look at the libtubecable sources.

It seems like the coding bases on a huge array. I would guess this array is 65536 x 1Byte in size.

So I think there would be no need for assembler optimization.

By the way a OMAP 3530 has a 16kB Data a 16kB Inst L1 Cache and a 256kB L2 Cache. I think this values should be comparable with a Snapdragon, but I don't have Qualcomm datasheets lying around.

Over all i think the Huffman coding can be done in an Smartphone, although the coding should not be done in the Cortex A8 part of the SoC in an perfect scenario, but I am not a expert in this.

Have anybody a idee, why it should not work or why it should be difficult?
[Nexus One General] sonic74:
I'd ask this on the libdlo mailing list, where the two mentioned people and perhaps even the BSD driver author can read it, too.
[Nexus One General] bergfex:
Thank you very much for this.
[Nexus One General] joeavery2:
Hello, I'm trying this out, I am having trouble with one part. In the video section I am able to get the console output to the display link screen but where it says Android Framework then has some, what appear to be "C" commands and I am unsure what to do with them. Also what do I do with the framebuffer file to get the option to send something to the other screen? And then again a little lower it has another Android Framework section with printwriter commands. Again not sure what to do.

Otherwise This is wonderful and I can't say thank you enough to sonic for the work.
[Nexus One General] sonic74:
This is Java, not C. It's just a programming example of how to use the linked Framebuffer class.

Build and install it, if you are writing of the zip file.

This is a Java code example for text console output.
[Nexus One General] joeavery2:
Ah, Ok. Thank you. Sorry I thought either they were commands or were supposed to be added to some file. Now it makes sense.

Thank you again
[Nexus One General] ironjaw33:
Thanks so much for this. I was able to get a USB keyboard working. Is there anything stopping me from compiling host support directly into the kernel? As it is now, the instructions require me to load host support from compiled modules.
[Nexus One General] ZenInsight:
Hi there. Is this universal to Android as long as the drivers are available for the device. Or are the drivers universal too? I'd like to see this work on the Samsung Epic. Also, does Android recognize NTFS file structure?

Thanks for your response in advance!
[Nexus One General] sonic74:
I'm a bit cautious there, because even without this it happened to me that the kernel seemed to big for its flash partition. Also I don't know the impact on power management.
[Nexus One General] sonic74:
It seems to be quite universal for SoCs from Qualcomm.

Yes, after loading the corresponding kernel module.
[Nexus One General] uipe:
hey I used your patch and adapted the config file for cm6 htc Desire build and was able to get the ball rolling, the problem is that my phone crashes when I load the storage module with a pet conected BUT a mouse works :S

this is how i have it,

otg cable (ebay same as u page) -> data y cable --- mini to host hub socket

\-- only power to client

the android just crashes and resets but by pen lights up a led that only goes away when i retry loading the module.
[Nexus One General] elkyur:
Can i connect hdd duevice to nexus, what cables do i need and what driver
[Nexus One General] eprst:
direct camera connection

Hi

I've got an idea of porting libgphoto2 and connecting a camera directly to the phone, this gives tons of possibilities for future development.

So far I've got the port (see agphoto2 project on gitorious, can't post the link due to forum restrictions), but don't even know if it actually works. Received the Micro USB OTG cable today and tried to connect the camera (Canon 5D2), but there're no messages in dmesg and lsusb doesn't show anything too. I'm trying this on N1 with 2.6.32.9-27240-gbca5320-dirty kernel and usbcore + ehci-hcd modules loaded.

Could this be because of the bus power absence? I wouldn't like to use a hub as it breaks the whole idea of connecting the phone to the camera directly, e.g. in the field..

Another thing that bothers me with this kernel: usual PC USB connection doesn't work too. Again, no messages in dmesg and nothing in lsusb, on both sides. Maybe I'm just missing something?
[Nexus One General] zanzee:
You need to supply 5vdc+ or the usb host will never activate. Most people don't seem to bother reading the first post as I've seen over and over again people asking why such and such wont work. You must have a power source indepentant of the phone or its a no go even if the device is self powered.
[Nexus One General] davidbubu:
HID mouse/digitizer on Android

Hi,

Im trying to connect HID mouse or digitizer to N1 and stuck on X11 part.

Can anybody please help with X11 install/configuration on N1?

Have anybody succeeded to get HID input device working on Sven's setup?

Thanks,

David
[Nexus One General] sonic74:
Aren't the config files I posted on my website working? You may have to change the device numbers:

Option "Device" "/dev/input/event[I]n[/I]"

You can test what is what by

$ cat /dev/input/event[I]n[/I]

and then pressing/moving around.
[Nexus One General] davidbubu:
Hi

yes I see this config files, but I don't Have X11 on my android ...

I use exactly the same kernel you posted on web site and insmod all needed drivers...

Am I missing something ?

david
[Nexus One General] sonic74:
Yes: Debian. besides some topics on my website means that you need a full Debian filesystem overlay to use them.
[Nexus One General] davidbubu:
Yeah, makes sense...

CAn you please give me a relevant link?

thanks
[Nexus One General] sonic74:
Unfortunately I forgot which instructions I followed. And there is more than one way to do it.
[Nexus One General] davidbubu:
Ok, I see.

Another question: is Android GUI functional after installing Debian? I mean would be the standard Android apps, shell etc. functional ?

My Idea is to use HID input devices on Android OS instead of touch interface.

Thanks

David
[Nexus One General] sonic74:
Yes, it's running parallel to Android, and only after you start it.

I also saw a dual boot construction once.
[Nexus One General] davidbubu:
sorry for being annoying another questions : what is an order of installation > I mean first Debian then your procedure , or vise versa ?

Thanks.

D.
[Nexus One General] sonic74:
My kernel is independent of Debian. And for my X11 config files you obviously need Debian.
[Nexus One General] TOMKA!:
This is amazing!

I'm using your great work and trying something with my HTC-desire.

I want to connect an external usb wifi network adapter.

I found cyanogenmod very convinient, since the source code is very easy to get, and updates often. I also have the source code of the driver, and was easily able to compile it to use my ubuntu x86 linux.

I am trying for over a month now, to cross compile this driver to work with my CyanogenMod ROM, but just can't find the right combination.

I will appreciate your help with the cross compiling proccess, even a rough guideline on how to cross compile any kernel module for android will help alot.

Thanks alot!
[Nexus One General] mloverme:
Hi Sven,

First off thanks for all your hard work and help with this. I would like to start to play with this more. I have been following the steps on your site but when I try to load the usbcore.ko module I get failed (Exec format error). So far I have:

1. rooted the device

2. fastboot boot arch/arm/boot/zImage

3. put all the modules on the sd card

4. attempted to use connectbot to load them when I got the error

Am I just missing something?

Thanks! :-)
[Nexus One General] sonic74:
What does dmesg say?
[Nexus One General] mloverme:
<3>[13097.452056] usbcore: version magic '2.6.32.9-27240-gbca5320-dirty preempt mod_unload ARMv7 ' should be '2.6.32.9-27240-gbca5320 preempt mod_unload ARMv7 '

So do I need to get rid of the dirty? And if so how would I do that?

EDIT: Nevermind I am a noob. I had rebooted the phone so it wasnt using the fastboot image anymore. Tried it again in order and it worked.
[Nexus One General] mloverme:
I think I got everything working now but I need the dual power cable. The link on your site brings me to a product unknown site now. Can you post a link to a similar cable? I have found lots of dual power cables that have mini on one end but not USB b.
[Nexus One General] sonic74:
I updated the link, but the new cable is also Mini-USB. Perhaps additionally an adapter to the upstream port.
[Nexus One General] mloverme:
So Now that Verizon has usb LTE radios out there any chance we could get one of those to work with the Nexus one? :D
[Nexus One General] ROM_Guest:
mloverme: If you don't mind me asking, what is your application of having two wifi adapters on the N1 (inherent and USB)? Routing in some way? :)
[Nexus One General] mloverme:
Well my idea is to get an LTE radio working on it not a wifi one. My N1 is not activated so I thought it would cool to have a data plan for vzw and have an Android phone with LTE before there are Android phones with LTE offically released. I know there are some coming out soon for Verizon.
[Nexus One General] mloverme:
I finally have all the right cables and was able to see it register the USB Mass Storage Device. I was unable to mount it though due to the fact that sda1 was not in /dev/block/sda1.

Also, I can't get my keyboard to work. I did insmod drivers/hid/usbhid/usbhid.ko

but have been unable to see any input go by. Do I have to do something special after the insmod?
[Nexus One General] mloverme:
for the keyboard it says nothing. I just have battery charging messages. Its a Dell quietkey:

http://www.computer-reclaim.co.uk/ekmps/shops/comprec/images/dell_keyboard_1(1).jpg

And for the usb flash drive:

Initializing USB Mass Storage Driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered
[Nexus One General] sonic74:
And for ehci-hcd.ko?
[Nexus One General] mloverme:
I didnt see anything for ehci-hcd.ko when I plugged either in but when I did insmod I saw:

Modules linked in: ehci_hci(+) usbcore

followed by a trace of a bunch of things.

I did see

usbcore: registered new interface driver usbhid

usbhid: v2.6:USB HID core driver

after I did insmod for the keyboard
[Nexus One General] sonic74:
Please post the complete log from the instant you insmod usbcore.ko.
[Nexus One General] mloverme:
Is there any easy way to copy and paste the log out of connect bot? There is no wifi avaiable here to I could not do adb over wifi.
[Nexus One General] sonic74:
Perhaps

dmesg >/sdcard/dmesg_out.txt
[Nexus One General] sonic74:
Looks good, but I haven't tried to run it without a hub.

btw., if you wrap your dmesg output in CODE tags with square brackets, it's put into a scrollpane and doesn't take up so much space.
[Nexus One General] sonic74:
Or do you use a hub and it's just not detected?
[Nexus One General] mloverme:
Okay thanks for the tip. I am running the keyboard off a hub. COuld it be the keyboard is just too complex or I don't have the correct kernel module for it?
[Nexus One General] sonic74:
No, the log has to show that the hub and the devices were detected. I think the hub chip doesn't get any power. Some get it via the wall wart, some via the upstream port (in the latter case a dual power cable is needed).
[Nexus One General] sonic74:
But the phone gets charged. Strange. Make sure to plug the phone into the upstream port, not one of the downstream ports.
[Nexus One General] mloverme:
It is plugged into the upstream port. The Hub I am using it the one built into my dell monitor. I know its powered because its charging the phone and gives power to my usb stick. I can try a different keyboard.
[Nexus One General] sonic74:
Better try a different hub, since even it isn't recognized.
[Nexus One General] networkmagician419:
Will you place compile this for the dinc?