yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] Arise:
In the last days I've studied the problem a little bit more in detail, and despite talking about powering usb devices, if we are going to use usb host functionality, then we have to make a choice, cause we have only one USB connection and this connection right now serves for a USB Gadget not USB Host. So first we have to "remove" the gadget mode functionality in order to switch to USB Host functionality.
[Galaxy S I9000 Android Development] Arise:
After 1 day of struggling trying to understand this linux ****ty kernel/modules compiling managed to get this:

<6>[ 945.208118] usbcore: registered new interface driver usbfs
<6>[ 945.212032] usbcore: registered new interface driver hub
<6>[ 945.213724] usbcore: registered new device driver usb

<6>[ 968.245592] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
<7>[ 968.245638] ehci_hcd: block sizes: qh 60 qtd 96 itd 160 sitd 96

<6>[ 1027.498783] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
<7>[ 1027.498931] ohci_hcd: block sizes: ed 64 td 64

and some more...

<6>usbcore: registered new interface driver libusual
<6>Initializing USB Mass Storage driver...
<6>usbcore: registered new interface driver usb-storage
<6>USB Mass Storage support registered.

<6>usbcore: registered new interface driver usbhid
<6>usbhid: v2.6:USB HID core driver
[Galaxy S I9000 Android Development] magurin:
Arise we love you!

Waiting for your privilege information! And thanks for your work!!
[Galaxy S I9000 Android Development] karl999999:
so does that mean it works now?

can you post the modules/software?
[Galaxy S I9000 Android Development] Arise:
insmod usbcore.ko
insmod ehci-hcd.ko
insmod ohci-hcd.ko
insmod usb-libusual.ko
insmod usb-storage.ko

Everything is insmoded just fine, but... no results. :(

~ # cat /proc/scsi/scsi
Attached devices:

~ # lsmod | grep -i usb
usb_storage 45898 0 - Live 0xbf265000
usb_libusual 9548 1 usb_storage, Live 0xbf0bd000
usbcore 146457 4 usb_storage,usb_libusual,ohci_hcd,ehci_hcd, Live 0xbf223000
[Galaxy S I9000 Android Development] karl999999:
how are u testing this?

when u plug a device to usb, how do u get the kernel logs?
[Galaxy S I9000 Android Development] Jumba:
Oh I like the look of that. :D
[Galaxy S I9000 Android Development] Arise:
I'm working with a new compiled kernel with those modules. Not sure if this works with standard kernels because the phone works by default in slave/gadget mode. And it should work as a host.
[Galaxy S I9000 Android Development] magurin:
A method to make test to terminal or configure more quickly is using SSHdroid (market), connecting with putty or any ssh client and SwiFTP to upload files.

I hope that this advice is worth to someone. Thanks for the files Arise!
[Galaxy S I9000 Android Development] RippeR37:
Hey guys, u wrote before (i kinda lost track on this topic, but couples pages ago) that external hdd like 320gbs or smthing like that wont work becouse of power consumption, but what about something smaller like pendrives or smthing like that? ;)

It would be cool if some1 bring to you pendrive on meeting with photos or smthing and u wont need to take it back to home for time u meet with him again or u could just together watch them, etc etc... ;) Possibilities are endless ;)

So, how about them (pendrives)? And what sort of cable would we need for that? miniUsb <-> usb ? :| I kinda hope some1 could make that happen, it would be really gr8 :)
[Galaxy S I9000 Android Development] skyworxx:
As far as I understand, the port is completly unpowered. For any USB device, you will need an external USB battery thingy, like this one:

And a custom cable, of course.

It wouldnt be a big deal to solder a wire together.

I am looking forward to this project. Pluging in usb thumbdrives would be great, as would be gamepads
[Galaxy S I9000 Android Development] 2k4ever:
if thats really the case, the hole thread is quite useless imo

if you have to use an external battery like that, you can just use a thing like this

http://www.amazon.de/USB-2-0-On-The-Go-Bridge-USB-Datenkopiergerät/dp/B000KBB7LA

Arise, can you confirm that the port is completely unpowered or does it provide some power?

i have always been under the impression that it provides some power, just not enough to spin a HDD - but for a flash pen it should be enough
[Galaxy S I9000 Android Development] skyworxx:
Would be still great for gamepads, external gps, etc...
[Galaxy S I9000 Android Development] Arise:
The port is not powered. This is the main problem I'm concerned with and the one that makes things hard to do. The chipset should be able to supply power and it seems that it does supply it considering the triggered messages in the logs, but looks like the regulators are not wired physically. So no juice on the VDD port of the microUSB cable. Yet.

This is not my conclusion, I speak based on this topic:

http://groups.google.com/group/android-kernel/browse_thread/thread/e05a737708e2585a?fwc=1

I don't know if this is possible to solve, but for now the only thing that matters is to make it work with a NON USB compliant hub. That means we need a hub that provides power on the upstream port. (A compliant hub is not allowed to provide power that way).
[Galaxy S I9000 Android Development] magurin:
But actually loading this modules and powered hub can we connect usb devices or also we need to recompile kernel?

Tomorrow I'm going to take the cable and a powered hub and make test with device.

Yes, the power supply its some uncomfortable but acceptable. Don't worry we have already seen the worst. Come'on boys it's doit!
[Galaxy S I9000 Android Development] Arise:
It looks like we need a new kernel also. The problem comes from the fact we can't have in the same time USB Host capabilities and also USB Client/Peripheral/Gadget capabilities.

So, we must have some splitting in the source code, to keep the charging but to remove the client part, because we want the phone to act like the host not like the client.
[Galaxy S I9000 Android Development] DamianGto:
If you can make a modul of it then you could make some option in the recovery then you boot. Maby even when you are running the phone you just use an app to change this modul.

**DamianGTO Steam kernel. 350MB Ram. 500HZ. Ext2 on all partitions. js3 base**
[Galaxy S I9000 Android Development] magurin:
Yes, I think is better in a module and default in client mode because when we consume all battery we need the mobile stay in this mode to charguing.

And with a simple app or script load modules easy.

Are possible this way?
[Galaxy S I9000 Android Development] Arise:
The phone can be charged just fine over an OTG cable or the original cable. The only thing is the source code for the USB client drivers must be splited because the charging part loads in the same modules that also do the USB client/google gadget part.

The charging part must be stripped out from the Samsung source code, not very easy, but ... definitely not something hard. It was already done before by handarmbeinfuss but he is missing in the action for now... so someone else must do it for now. :)

handarmbeinfuss repository is pretty descriptive about what must to be done.
[Galaxy S I9000 Android Development] magurin:
A user message

I received a message from friend who likes comment :

Originally Posted by cartmanmyass

Hi,

My friend is able to connect his external USB HDD with ARCHOS 70s via a 4-pack AA battery extender (can also use an AC external HDD enclosure) and an USB 2.0 Mini-B Male to 2 USB A Male Y-Cable. I have a Galaxy Captivate and Galaxy Tab. I hope you guys can make the USB Host Driver works.

http://www.mobiledriven.com/usbbaexaaba.html

http://www.amazon.com/Cables-Go-281...2?s=electronics&ie=UTF8&qid=1297118059&sr=1-2

http://forum.archosfans.com/viewtopic.php?f=73&t=44692&sid=d9f1a6e85c35031703ae4cd3b5bc8e06

https://picasaweb.google.com/103887649572739108963/MixedPhotos#5555767828926568210

Peter
[Galaxy S I9000 Android Development] neemask:
Port Enumeration

Arise,

Are you now able to enumerate a USB Device using a powered hub? I got the ehci modules to be built, and did all the mods to the machine init to actually load the device etc. However, I am not sure about the Device I/O Resource and IRQ configurations. For example, the Ehci host driver is plugged into a different IRQ from the OTG - which makes me a little nervous. Also, I was able to get the hub enumeration but it reported 0 port, so curious to know how you got it to list 1 port?

Have you started splitting the s3c_otg_udc driver? Any further lead-ins from the Odroid source tree?
[Galaxy S I9000 Android Development] hololight:
Why the host controller on the main app processor and not the one on the s3c? (Yes I know the latter is not 2.0) I guess the logic is that since the s5v is 2.0 and the phone shows as a 2.0 device?

Has anyone had success with a usb device? I mean a device enum with the host modules loaded on phone? Problems with host/ device coexistance aside.
[Galaxy S I9000 Android Development] Arise:
I just managed to compile everything, lots of warnings from the compiler and ...

I started patching on a voodoo kernel, now I have the zImage and all modules compiled. Don't know if it works can't test them now, so in about couple of hours once I reach home.

Don't know if it makes sense to release anything yet, because is not tested and I don't know if it works.

A new kernel is required, it's not enough to have only the modules because like I said, the client part must not coexist with the host part. Also the new kernel is required because there are a couple of symbols exported required for the modules.

Regards,

Andrei
[Galaxy S I9000 Android Development] DamianGto:
like i did say if you made them like module that you can load at boot up then it would be easy to change them in the recovery(to start with) so you choose if you want to use usb hub or usb client.

i think thats the goal you must have.

**DamianGTO Steam kernel. 350MB Ram. 500HZ. all ext2. Steam Rom. Js5**
[Galaxy S I9000 Android Development] Arise:
Don't know if it is a requirement to reboot the phone into recovery to do that.

If the modules behaves nice then we can rmmod/insmod them on runtime from a widget, or we can hook the the OTG detect code to do that for us.
[Galaxy S I9000 Android Development] DamianGto:
yes that's true. but just to test it out it would be easier on the recovery..

**DamianGTO Steam kernel. 350MB Ram. 500HZ. all ext2. Steam Rom. Js5**
[Galaxy S I9000 Android Development] magurin:
****!

I would like to know more about compiling kernels in order to help you.

: (
[Galaxy S I9000 Android Development] Arise:
There is no need to swear.

If you have question you can ask but it is not a matter of kernel compiling, it is a matter to write code that works. It is a metter of doing something you understand and figure it out.

Like I said, I managed to compile everything, that means kernel and the modules. To my surprise (I wasn't expected TBH) the phone charged as soon as I connected it to usb. And it shouldn't.

Anyway... loading the regulator module works, but if I insert the cable the phone restarts.

Also, loading the usb gadgets won't trigger the status bar messages. Don't know yet, but I assume some java code running at boot expects to find everything it expects already in kernel, so lazy loading at a later time with insmod doesn't work.
[Galaxy S I9000 Android Development] hololight:
The story thus far...

Some of this is likely well known to some...

Main app proc in phone is the s5pv210

--datasheet/ user manual states that it contains a single ehci host and a single 2.0 otg

--I dont see how both host and otg would be connected at the same time, fsa9480(usb switch) seems to only have one usb connection according to block diagram

s3c2410

--has only a ohci host and device (no otg).

--this chip is not shown in the block diagrams of the i9kB

--drivers for the s3c2410 are being loaded right now, but it would appear that this is only because they have compatible hardware.

OTG is already connected

--we know it is since our phones connect to computers

--host cant be

--we need otg host working

s3c-otg-hcd (host)

--drivers are in eclair kernel source (only samsung's, not aosp)

-----drivers/usb/host/s3c-otg/

--references to registers are the same as in the otg gadget drivers we are currently using

--contains a bunch of comments about s3c6410 and even appears to check for this chip(kinda)

--I have a feeling they were in the process of porting this driver

--It does compile as a module ( i haven't started playing yet as I need to odin back to eclair)

Chris
[Galaxy S I9000 Android Development] Arise:
Tried the sources from 2.1 into 2.2.

After 2 or 3 compiling errors, I made everything working. Compiled s3c_otg_hcd.ko.

When I insert it I get a reboot.

Some messages get in my logs, so far I got:

<7>[ 376.345396] otg_dbg: in s3c6410_otg_module_init()::00231 => s3c_otg_module_init
<4>[ 376.345486] => 1inside s3c6410_otg_drv_probe
<7>[ 376.345907] otg_dbg: in s3c6410_otg_drv_probe()::00056 => s3c_otg_drv_probe
<7>[ 376.346116] otg_dbg: in otg_hcd_init_modules()::00046 => OTGHCD_InitModuless
<7>[ 376.346199] otg_dbg: in otg_hcd_init_modules()::00048 => otg_hcd_init_modules: calling init_transfer()
<7>[ 376.346295] otg_dbg: in init_transfer()::00055 => start to init_transfer
<7>[ 376.346374] otg_dbg: in otg_list_init()::00202 => otg_list_init
<7>[ 376.346448] otg_dbg: in otg_hcd_init_modules()::00050 => otg_hcd_init_modules: calling init_scheduler()
<7>[ 376.346545] otg_dbg: in init_transfer_ready_q()::00053 => start init_transfer_ready_q
<7>[ 376.346631] otg_dbg: in otg_list_init()::00202 => otg_list_init
<7>[ 376.346705] otg_dbg: in otg_list_init()::00202 => otg_list_init
<7>[ 376.346779] otg_dbg: in otg_hcd_init_modules()::00052 => otg_hcd_init_modules: calling oci_init()
<7>[ 376.496348] otg_dbg: in otg_hcd_init_modules()::00054 => otg_hcd_init_modules: calling spin_unlock_irq_save_otg()
<6>[ 376.496871] s3c_otghcd s3c_otghcd: S3C OTGHCD
<7>[ 376.502825] drivers/usb/core/inode.c: creating file '003'
<6>[ 376.502901] s3c_otghcd s3c_otghcd: new USB bus registered, assigned bus number 3
<6>[ 376.503003] s3c_otghcd s3c_otghcd: irq 88, io mem 0xec000000
<7>[ 376.503036] otg_dbg: in s3c6410_otghcd_start()::00121 => s3c6410_otghcd_start
<7>[ 376.503077] otg_dbg: in s3c6410_otghcd_start()::00127 => OTG HCD Has Root Hub
<7>[ 376.503117] otg_dbg: in otg_usbcore_resume_roothub()::00233 => otg_usbcore_resume_roothub
<4>[ 376.503159] inside function usb_hcd_resume_root_hub
<4>[ 376.503184] --->spin_lock_irqsave
<4>[ 376.503205] --->if (hcd->rh_registered)
<4>[ 376.503228] --->spin_unlock_irqrestore
<4>[ 376.503250] end function usb_hcd_resume_root_hub
<7>[ 376.503277] otg_dbg: in s3c6410_otghcd_start()::00131 => Finished resuming the OTG Root Hub
<7>[ 376.655341] otg_dbg: in oci_init_mode()::00650 => GINSTS = 0x14003020
<7>[ 376.655399] otg_dbg: in oci_init_mode()::00651 => GINMSK = 0x3000000a
<7>[ 376.655441] otg_dbg: in oci_init_mode()::00669 => DEVICE Mode
<7>[ 376.655486] otg_dbg: in otg_handle_interrupt()::00071 => Connect ID Status Change Interrupt
<7>[ 376.655531] otg_dbg: in oci_init_mode()::00650 => GINSTS = 0x14003020
<7>[ 376.655571] otg_dbg: in oci_init_mode()::00651 => GINMSK = 0x3000000a
<7>[ 376.655611] otg_dbg: in oci_init_mode()::00669 => DEVICE Mode

This is including some of my hand written debug messages.

The interesting part is that it looks like going on device mode instead of host mode. :)
[Galaxy S I9000 Android Development] DamianGto:
Seems that you have come some way with it. I hope you solve the reboot thing.

I guess its a crash for a lack of some routine or conflicting routine that make the driver crash and the phone.

**DamianGTO Steam kernel. 350MB Ram. 500HZ. all ext2. Steam Rom. Js5**
[Galaxy S I9000 Android Development] TheBeano:
I noticed this in the CPU data sheet (section 5.6.1), I wonder if this is what's causing the reboot:

"If the OTG Link operates in either Device or Host mode, the application must not access registers from other modes. If an unauthorized access occurs, a Mode Mismatch interrupt is generated and value is reflected in the Core Interrupt register. If the core switches from one mode to another, reprogram the registers in the new mode of operation to match state after a power-on reset."

So if it is ending up in device mode like it says in the log this may be throwing an unhandled interrupt.
[Galaxy S I9000 Android Development] hololight:
I will have to look at that interrupt possibility in a bit.

What I was wonwonderingis if perhaps the driver is checking a register that is supposed to be written by the usb switch, telling it that a usbotg cable is actually plugged in.

Im not at home so I can't look into it yet.

Chris
[Galaxy S I9000 Android Development] Arise:
So far I haven't figured out how to make it go in the host mode, I even tried to set the "init" bit to host mode

//we have those values defined
#define HOST_MODE	1
#define DEVICE_MODE	0

gintsts.b.curmode = HOST_MODE;

but as soon as it starts reading from registers

gintsts.d32 = read_reg_32(GINTSTS);

the value goes back to client mode.

Which obvious is a dead end as the module doesn't include a working client mode.

int oci_dev_init(void)
{
otg_dbg(OTG_DBG_OCI,"Current Not Support Device Mode! \n");
//return USB_ERR_FAIL;
return USB_ERR_SUCCESS;
}

Some conclusion for people reading this:

In the Samsung sources (current) there is the OTG client part in drivers\usb\gadget\s3c_udc_otg.ko

It does contain code for setting up the OTG in client mode only! Also there is work to be done in order to get this as module, by default Samsung made this compilable only in the kernel.

In the old sources from Eclair we had the OTG host part in drivers\usb\host\s3c-otg\s3c_otg_hcd.ko

The code between the client and host is kinda different, it doesn't seem to follow the same style of coding, looks like different guys with some completely different programming skills and vision regarding writing code were involved.

For the client part the device registers can be found in

"\arch\arm\plat-samsung\include\plat\regs-otg.h"

Also there are the registers for the host mode, however only their definition is there. I wasn't able to find a way to setup/init/work with those registers.

In order to get more logs spitted out on the wifi I added a msleep. Don't know if this is ok.
[Nexus One Q&A, Help & Troubleshooting] extrafuzzyllama:
hi everyone i am getting my nexus one soon and my friend let me borrow his nexus overnight

he wiped it and is running stock 2.1 so i can setup my email and things like that to get used to the nexus one

anyway i am trying to setup my google apps domain with the email app using exchange but i dont know what settings to use

i am not sure what to put in the domain/username field

i already know i should put m.google.com for the server field
[Nexus One Q&A, Help & Troubleshooting] wesbalmer:
I don't think google apps supports exchange? I could be wrong. You'd probably want to just add this as a google account, where in 2.2 multiple google accounts are possible. I think you're doing it wrong.
[Nexus One Q&A, Help & Troubleshooting] extrafuzzyllama:
but u can use the m.google.com for google sync

i even had a setting to enable it on my domain options

and i also used that m.google.com server and recieved emails right away using a normal gmail account to test it out and worked but cant seem to get it to work with google apps domain cuz i dont know what domain/ username i am supposed to put in
[Nexus One Q&A, Help & Troubleshooting] wesbalmer:
You're still doing it wrong....

Exchange is for MS Exchange servers.

What you should do go into accounts and sync, add another google account, type in imdoinitwrong@mygappsdomain.com and your password. Should work
[Nexus One Q&A, Help & Troubleshooting] extrafuzzyllama:
how was ot able to work with my regualr gmail account?
[Nexus One Q&A, Help & Troubleshooting] wesbalmer:
Correct me if I'm wrong...

Windows Mobile phones use POP/IMAP to sync with any other type of email address other than an Exchange account, because when using an Exchange account you'll need to use the Active Sync protocol.

Google Apps and Exchange are services, not clients or protocols. I don't see how you would be able to use Google Apps with Exchange unless you're doing a migration or have GPO's set on the network to set up Google Apps accounts in Outlook.
[Nexus One Q&A, Help & Troubleshooting] wesbalmer:
Probably through either IMAP or its own proprietary communication protocol. Gmail doesn't support ActiveSync
[Nexus One Q&A, Help & Troubleshooting] MountainDrew:
Gmail does in fact support Exchange ActiveSync protocol, and that is exactly how Windows Mobile devices sync most effectively with Gmail, regular or apps version. They made an announcement last year when the ActiveSync Protocol was enabled.

The config settings should be m.google.com for server, and full email address for username. I haven't tried it, because of the following reason:

The most effective way to get at your gmail from an Android phone is with the Gmail app. It does push just like ActiveSync, and supports more of the features of Gmail, like stars, threaded conversations, labels, etc.
[Nexus One Q&A, Help & Troubleshooting] MountainDrew:
Just tried it with my google apps account, works fine in the email app.

On the first screen, enter your email address and password, then hit manual setup

On the second screen, select Exchange Activesync

On the third screen, enter your email address in the username box (remove the leading "\" as well). Leave the password as entered, and replace the server with m.google.com. Select both checkboxes, click Next

Fourth screen, select your sync options (use Automatic(push)) and other settings as you like

Finally, give the account a name, and enter your display name on outgoing messages, and click Done.

Works great.
[Nexus One Q&A, Help & Troubleshooting] msticninja:
Just wanted to put in my pennies. I set up Google Apps accounts as part of my business, and Activesync is the ONLY way you should sync your email on Windows Mobile. It also works for standard Gmail accounts, and it will sync your Contacts and Calendar too. Just don't select Tasks in the sync options or the sync will fail.

Windows Mobile isn't just an Enterprise Solution anymore, thanks to Google.
[MDA II, XDA II, 2060 ROM Development] advanced15:
can someone please help and write up a guide on how to use a kitchen for himalaya.

something like this would be very helpfull=

http://www.modaco.com/content/i8000...-4-14-new-version-convert-to-oem-package-now/

the layout is easy to understand and there are links to the apps that are needed.

please someone share a little knowledge !!!:D
[MDA II, XDA II, 2060 ROM Development] aeroflyluby:
Firstly - Download my aero kitchen (which is newbie-friendly), when done, run it and ask what you want
[Hero, G2 Touch Android Development] Bjarte:
I assume this will speed things up a bit? :)

http://www.androidpolice.com/2010/06/23/the-wait-is-over-android-2-2-froyo-source-out-today/
[Hero, G2 Touch Android Development] qpop:
yup, there's a fiver in it for whoever does this first!
[Hero, G2 Touch Android Development] bonesy:
'there was 3 threads on this earlier and i think they got deleted....in general not development!
[Hero, G2 Touch Android Development] Bjarte:
Well, whatever happens, happens..

I just meant this as a "giddy up" for the amazing devs out there!

We love your work! :D
[Hero, G2 Touch Android Development] bonesy:
I was merely pointing out that they were deleted,i think all of the devs may have known as most of them follow others who follow others etc etc lol but yea id like to see it too.....just have to wait!