yashsingh1/xdaforums huggingface dataset:
[HD2 General] sherlockpwnz:
Thats exactly what I'm saying man. The threads just sit and collect replies and replies and die and then someone just posts another one. It takes up alot of threads that are really useful and I"m tired of having to go to sometimes 7 pages before I see all the important threads.

It's a little bit out of control and it's an outrage. Noobs don't listen to the mods on making pointless posts
[HD2 General] watcher64:
So you started another one ... that is taking up my time ... geez look at me, it is like an addiction cannot ignore the damn things .....
[HD2 General] eenbox:
SPAMMER...

You cried about them asking all the time - and you just created another thread talking about it??? That my friend is called SPAMMING!!!!
[HD2 General] ASCIIker:
sorry to say, this is one hell of a pointless thread, and the idea of it is full of contradictions. sorry OP! :eek:

the OP created this thread, mentioning in the first post that people don't search (which may very well be true).

given the first assumption, the OP is justifying the creation of the thread with the motive that "people looking for android will come to this thread". dude! how will they come to find this thread if they are incapable of searching in the first place?

a thread to attract those interested in android development for the HD2 already exists...it has been STICKIED in the ROM development section. a stickied thread about the topic doesn't seem to deter the noobs from asking about it...how can this new thread be any more successful at minimizing the clutter?
[Nexus One Q&A, Help & Troubleshooting] n8s:
Hello everybody. I have an ATT n1 that i updated to froyo w/o the radio update. everything was working fine until i decided that i wanted to try the new CyanogenMod-5.0.8. this mod requires the froyo radio so i updated. after trying the mod i decided it wasn't for me and restored my nandroid backup. Everythin seems to work but now i get no data when connected to att. i do get full signal and can make/receive calls and texts, but i get no data. There is no "3g" or "E" logo above the cell strength icon. I also tried to wipe the dalvik and user cache. still no data. Any ideas? below is my system info:

baseband version:

32.36.00.28U_4.06.0012_7

Kernel version:

2.6.32.9-27220-g328f560 android-build apa26 #1

build #

FRF50

thank you so much for any help provided. I promise i searched all over and was unable to turn up any answers
[Nexus One Q&A, Help & Troubleshooting] URPREY:
Check out this thread and make sure your APN is set correctly: http://android.modaco.com/content/g...-desire-port-with-online-kitchen-final-alpha/
[Nexus One Q&A, Help & Troubleshooting] n8s:
awesome thank you. I think that worked. I actually flashed a rom to return me back to stock and then restored my nandroid again and now it works. it makes sense that it was a missing apn setting though.
[Galaxy S I9000 Android Development] coooolboyz:
Samsung's press release for the processor confirmed USB host capabilities. But it doesnt look like that functionality is exposed at an OS level yet.

As done similarly for Nexus One, will it be possible to write up a driver or something like that for Samsung Galaxy S?

It would be too good to have an external HDD connected to this device!!! (That means, practically unlimited storage!!)

I know that there could be problems with power required to spin a drive, but my Creative Zen Vision M (60 GB) player had USB host (badly implemented) capabilities - and it was able to spin hard drives.

Is it worth a try with SGS?
[Galaxy S I9000 Android Development] coooolboyz:
What?? Nobody interested? :(
[Galaxy S I9000 Android Development] ash99:
Was having a look for this same answer. Hope things have progressed a bit.
[Galaxy S I9000 Android Development] coooolboyz:
SGS USB Host Documentation

Guess What!! I was going through the bundled "Documentation" along with the SGS i9000 code and I found this!!

S3C24XX USB Host support
========================

Introduction
------------

This document details the S3C2410/S3C2440 in-built OHCI USB host support.

Configuration
-------------

Enable at least the following kernel options:

menuconfig:

Device Drivers --->
USB support --->
<*> Support for Host-side USB
<*> OHCI HCD support

.config:
CONFIG_USB
CONFIG_USB_OHCI_HCD

Once these options are configured, the standard set of USB device
drivers can be configured and used.

That is very encouraging. But I haven't done any kernel compiling (hell, I haven't even done any Android coding, this being my first Android phone!!). So its gonna a be a while before I can put this to a good use.

Now, I am not sure if this is just "Host" or if it would support "OTG" also. I found the documentation on S5PC110 [Dev Sheet] a bit confusing also. It does show that the microprocessor has both HOST and OTG capabilities, but I am not sure to what the USB port has been wired to.

May be somebody can put this to a good use.
[Galaxy S I9000 Android Development] coooolboyz:
Well if this as easy as it sounds, it beats any logic whatsoever, why Samsung didn't put in this functionality out-of-the-box with SGS. This device seems severely constricted in features which the S5PC110 chip init readily supports.
[Galaxy S I9000 Android Development] SiL3nTKiLL:
samsung are idiots lol, hopefully it works tho
[Galaxy S I9000 Android Development] coooolboyz:
Are there any apps which would tell us what exact piece of hardware we have in an Android phone?
[Galaxy S I9000 Android Development] futaris:
You have a s5pc110 processor, in the Galaxy S.

Any talk about usb host drivers (for that processor / s5pc series) would probably be done on the linux-samsung-soc mailing list.
[Galaxy S I9000 Android Development] amir_rafie:
+1

Really looking for this feature ,,,, very helpful ....

thanks for starting this topic ....
[Galaxy S I9000 Android Development] brunes:
What do people use this feature for? I guess I am having a hard time envisioning why this would be useful on a phone.
[Galaxy S I9000 Android Development] amir_rafie:
You could connect USB memory disks , external HDDs ,external camera and so on to your Galaxy S and browse files ...... very very helpful...
[Galaxy S I9000 Android Development] 19arek93:
Any one know how to use this feature? I badly wanna connect USB keyboard to my SGS.
[Galaxy S I9000 Android Development] 19arek93:
Anyone? Sorry for spaming, but i really need it. Maybe someone have got some links explaining how to enable usb host? I'm not a dev. but i can try do something, anything to get this to work!

What we have to do? Some drivers, or new kernel?

Right now I'm going to buy 2-female USB adapter. Please, reply!
[Galaxy S I9000 Android Development] brunes:
If you are this desperate why not just use a bluetooth keyboard...
[Galaxy S I9000 Android Development] 19arek93:
Because is very expensive.
[Galaxy S I9000 Android Development] forcedv:
Has it been officially confirmed that the Galaxy S can't do USB host ?

This would be an amazing feature on an already amazing device.
[Galaxy S I9000 Android Development] imparator:
From what I know a about jpc rom it now installs a cdrom drive when plugged in to windows. Seems to that there's soms sort of host capabilities are built in
[Galaxy S I9000 Android Development] handarmbeinfuss:
samsung source code

Hi!

I too find this feature very useful. However, I found little information about it on the net. So I started digging through the source code provided by Samsung (GT-I9000_OpenSource.zip). From this and from the specs of the chip (S5PC110_EVT1_UM10.pdf), I take it that the phone does support USB host. The problem is, it can only do either client or host, not both at the same time. Now here is where it gets tricky.

The Samsung kernel source is not as neatly separated into independent modules as you would expect from a Linux kernel. The USB client stuff (usb-storage, modem...) is connected with the driver that checks for cable plugging and unplugging which in turn is connected with the driver for the voltage regulator that starts charging the battery and supplies the cpu with power as soon as you connect the phone to your computer. Consequently you can't just build the USB client stuff as a module to be able to unload it and load the USB host module instead.

I have started to write a workaround for that, separating these interconnected drivers from each other. The easiest point to take it apart seems to be the driver of the voltage regulator. It has the fewest external dependencies. It does, however, pose the problem that the phone won't charge if something goes wrong...

Well, I got as far as being able to compile the source with the USB client stuff as bunch of modules and the independent part compiled into the kernel. I got that flashed on the phone. It boots, it doesn't blow up, and USB client is disabled. So far, so good.

Problem is, the client modules won't load. I don't know why, yet. Having to work with the on screen keyboard and a terminal instead of getting a shell via "adb shell" isn't helping either...

Well. That's as far as I got today.

Suggestions? Comments?
[Galaxy S I9000 Android Development] coooolboyz:
Woah!!! You've gone forward way farther than I have!! :-)

I took a lot of time trying to get around to a proper working kernel itself! :-( I am a complete noob at this - SGS being my first phone. [Not to mention the fact that I almost got my phone bricked once and got into infinite boot sequence on another instance.]

I had been trying to add modules built-in into the kernel itself - without making any code changes. I find when I plug-in my Mircro USB OTG cable - dmesg gives out 4 lines of log entries -

[s3c_usb_cable]done_clk_enable
[s3c_usb_cable]done_udc_reinit
[s3c_usb_cable]done_udc_enable
FSA INTR = dev1 : 0x80, dev2 : 0x0, Attach : 0x1

Of the above 4 lines - for the first 3 I was able to find the code in the file -

<Path_to_source_code>/GT-I9000_OpenSource/GalaxyS_Kernel.tar/GalaxyS/linux-2.6.29/drivers/usb/gadget/s3c_udc_otg.c

Now these entries come up only when I connect my OTG cable. Normal cable does not give this. May be the SGS can do both OTG and Device mode at the same time?

To understand more of this I tried to enable DEBUG. But apart from getting in to infinite boot loop, I was not able to move ahead much.

Another interesting thing that I noticed was that -

CONFIG_USB_S3C_OTGD=y

is set in the normal/unmodified .config file obtained from OpenSource website of Samsung.

From what I understand, this means that the OTG module is directly compiled and linked in to all of our kernels. But for some reason, it is not working as expected.

Well I am stumped!!! May be I will look more in to this during this weekend.
[Galaxy S I9000 Android Development] Finguz:
If you used an SSD you wouldn't have to worry about power to spin it up ;) Although I don't think I've seen a USB one anywhere...

Best of luck, this would be an awesome and very useful feature to have!
[Galaxy S I9000 Android Development] Arise:
Some updates.

in function: int oci_start(void)

we have oci_core_init() and oci_init_mode()

Now, the oci_init_mode is the function that goes in the client mode, but ... if we set

usbcfg.b.forcehstmode = 1;

in oci_core_init() then the oci_init_mode will switch the branch to the Host mode instead of client.

However, at some time in code (can't figure out how to spot the problem) function otg_handle_interrupt is called with the flag set on gintsts.b.conidstschng. As a result, oci_init_mode gets called for the second time and this time it goes back again in client mode.
[Galaxy S I9000 Android Development] hololight:
Add a kprint to the check, im curious what curmode actually is.

Chris
[Galaxy S I9000 Android Development] magurin:
Good news!!
[Galaxy S I9000 Android Development] hololight:
I think the gadget stuff has to go, at least until we can narrow down the issues. Im going to start on that now.

Chris

Edit:

Removing usb gadget stuff breaks other stuff (arise already said as much), most of the issues are in the driver for the max8998 (voltage regulator). Trying to fix it(lots of duct tape....)
[Galaxy S I9000 Android Development] jamesd256:
Please keep going guys, a lot of people are interested in seeing this working.

For me, supplying power to USB devices is no problem. The low current drain of memory sticks and external controllers means that some very compact power supply options can be considered. Just need a bit of cable hacking and duct tape. No problem!
[Galaxy S I9000 Android Development] Arise:
This mail messages was forwarded to me. So I made it public (after asking permission from Steve Modica) because it has some general interesting stuff.

P.S. Please note this is for Nexus S, but I assume it is valid for Galaxy S.
[Galaxy S I9000 Android Development] Arise:
After forcing into Host Mode, I forgot to sleep as recommended in sheets.

So, after adding the sleep to give time to the OTG controller to switch in the HostMode got again some interupt errors, but this time it was finalized. no more interupts or kernel exceptions now!

Check the attached log.

So now, I have 3 usb hubs enumerated. :D

/system/lib/modules/2.6.32.9 # lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0001
Bus 003 Device 001: ID 1d6b:0002

USB stuff we all want still not working! :D
[Galaxy S I9000 Android Development] DamianGto:
well you make progress and that more important.

don't rush, let it take the time it takes.

**DamianGTO Steam kernel. 350MB Ram. 500HZ. all ext2. Steam Rom. Js5**
[Galaxy S I9000 Android Development] hololight:
So my update,

Pulled out the usb gadget stuff, destroyed charging in the process. Can get the otghcd module loaded without bowing up but for got to enable all the debugging messages so I don't know where im at. Just recompiled the driver again with debugging but wont have a chance to test till later.

Regardless, I destroyed my makeshift org cable so im waiting for some microusb breakouts in the mail.

Arise, did you get yours up without pulling the gadget drivers?

Slightly OT: I noticed a JTAG circuit in the schematic for the fsa9480... needs looking into at some point.

Chris
[Galaxy S I9000 Android Development] Arise:
I have compiled a full fledged version of lsusb. The one embedded in busybox was pretty minimalist.

1. Copy the libusb-1.0.8.so into /system/lib

2. Copy the lsusb & usb.ids file in some folder, like /data/xbin

export LIBUSB_DEBUG=1
mount -t usbfs usbfs /proc/bus/usb
cd /data/xbin
./lsusb

Should give you info about usb stuff connected on the phone.
[Galaxy S I9000 Android Development] magurin:
errror

I have copied the files in the directories but mounting usfs i get an error in usbfs

# cp lsusb /data/xbin

# cp usb.ids /data/xbin

# export LIBUSB_DEBUG=1

# mount -t usbfs usbfs /proc/bus/usb

mount: mounting usbfs on /proc/bus/usb failed: No such file or directory

---

and when I copy the executable in /system/xbin get this message (I think because usbfs don't loads correctly because usbfs not found)

# ./lsusb

link_image[1995]: failed to link ./lsusb

CANNOT LINK EXECUTABLE
[Galaxy S I9000 Android Development] Arise:
Without a proper kernel you can't use this program. Not sure what the busybox is doing, but my version requires that your kernel support usbfs. And a stock kernel doesn't.

Also to run the program you have to copy the usbutil.so in the /system/lib folder.
[Galaxy S I9000 Android Development] fackamato:
Is there a precompiled kernel out there with this support, so we can test and report back?
[Galaxy S I9000 Android Development] Arise:
This is the latest kernel.

You should test it if you use something like a voodoo kernel, hardcore or speedmod.

The kernel is based on a voodoo repository, so it expects your partitions to be ext4 ready. Don't know what this is going to do if it finds RFS. It might attempt to do voodoo ext4 conversion in theory, but I don't know for sure cause I didn't delved that much into initramfs content and scripts. I know for sure at least that CWM recovery doesn't work on this kernel.

After you write the kernel on your phone with Odin or heimdall you can login to the phone over wifi with a ssh client (putty). So first before Odin make sure you have ssh installed on the phone and you can start it on the phone!

When you are done with testing, report please.
[Galaxy S I9000 Android Development] fackamato:
Eh btw. How do I flash back a normal kernel? This one doesn't support USB mass storage, doesn't have clockworkmod recovery...

edit: rom manager.
[Galaxy S I9000 Android Development] hololight:
@fackamato:

Download mode is independent of the kernel you are using, just pop in there, and Odin/ Heimdall.

Chris
[Galaxy S I9000 Android Development] magurin:
Download mode, can be accessed with 3 button combo ( shutdown terminal, pressing all time: Volume down + Center Home button , press same time power button and download mode appears). If the combination don't work you need to apply fix:

1) Download the file in PC

http://xdaforums.com/showthread.php?t=785201

2) Boot the phone in download mode

3) Open odin, select the file in PDA and mark the check Phone loader update.

4) Update and combination now works.

======================

There are two utilities develop by sven killing i think there are interesting for us,

search in the market:

- Gamepad IME

- Send to framebuffer.

The first is to connect a gamepad to our terminal, and the second is to send photos from any app to an attached Linux framebuffer device like a DisplayLink monitor/adapter
[Galaxy S I9000 Android Development] pichemanu:
Hi,

I don't know if you guys saw this:

http://www.xda-developers.com/communicate-with-samsung/

Maybe it can help.
[Galaxy S I9000 Android Development] brianking21:
It would be used so that files on the phone can be 'hosted' via the micro usb port on the phone. This means that files could be delivered to other devices directly from the phone. It also would open up a whole new world of options as far as the power and connectivity of the phone. Basically anything with usb capability could be connected to the phone and used by the phones software!
[Galaxy S I9000 Android Development] fackamato:
I think we all know what we could use this for. All that's needed (except the software) is a special cable and a power source (batteries or whatever).

Now, the hard part is making the kernel/modules work with the chipset. Doesn't matter how many people want this, or how badly they want it, or how much they scream for it... it takes skilled programmers and real hours. Unless, of course, it's not possible at all (due to physical chipset design), but IIRC it should be possible.

The coolest thing would be if we could separate the modules and have an app that unloads/loads the modules you want, on the fly. So with a click you could put the phone in host mode, plug in some memcard or whatever, do your stuff, then change it back to client mode and be able to charge using the USB cable or whatever.
[Galaxy S I9000 Android Development] Ptrout:
Just wanted to say thanks to all the dev's and ppl working on this.

There is lot of us in the carputer forums looking forward to USB hosting.

With galaxy s phones having full video out, USB host will hopefully allow ID devices such as external touch screens to be used. And a portable solution that can directly plug in to existing screen on cars will be great for phone, radio, navigation for some of us.
[Galaxy S I9000 Android Development] neemask:
OTG Hardware Register Programming

Arise,

I have couple quick questions for you if you don't mind. I basically took the same track as you, and updated the s3c-otg host code from the Eclair source tree (i9000 source code) to get it to compile for Nexus-S (android-samsung-2.6.35 from android samsung branch). I turned off the gadget driver in the compile configuration. I am able to generate a zImage with this procedure. Then I am building a downloadable boot image using an extracted ramdisk, and I install it using "fastboot boot boot.img". So I am not flashing the boot image which improves my recycle time.

Unfortunately, the problem I have is that my writes to the OTG device registers are not suceeding. For example, I write to the GINTMSK register unmasking some interrupts, however, when I read back I read a 0x0. Similar things are true with other registers as well.

I noticed in your dmesg printout from a post couple days back that you were reading back the GINTMSK okay (it was non-zero). So I am wondering what I am missing. Any help you can provide would be greatly appreciated

thanks,

sandeep
[Galaxy S I9000 Android Development] Arise:
Hi there. There is also another source code but I never tried it. You can check it out and download here: http://www.hackchina.com/en/cont/96900

Never tried this code in my kernel, but I guess it should be somewhat compatible.

Anyway, in regards to your question. After I read the documentation, I've seen:

In GUSBCFG register you have something like ForceHstMode.

So in order to do the above thing all you have to do is to jump to the file s3c-otg-oci.c and look at:

int oci_core_init(void)

and at the end of the /*PHY parameters*/

just before if(oci_core_reset() == USB_ERR_SUCCESS)

add:

usbcfg.b.forcehstmode = 1;
//so we sleep
//After setting the force bit, the application must wait at least 25 ms before the change to take effect..
write_reg_32 (GUSBCFG, usbcfg.d32);
mdelay(100);

P.S. Keep us updated with your success. :D
[Galaxy S I9000 Android Development] tknv:
Where is SGS i9000 kernel source ?

Nice thread!

I would like to try it too.

Can anyone tell me SGS i9000 kernel source URL ?
[Galaxy S I9000 Android Development] fackamato:
here
[Galaxy S I9000 Android Development] fackamato:
:D

haha, well there you go!
[Galaxy S I9000 Android Development] magurin:
any updates?
[Galaxy S I9000 Android Development] radus81:
will try this one too

looks interesting...
[Galaxy S I9000 Android Development] brunes:
Actually all it takes is for the people already making custom kernels (speedmod, Voodoo, etc) to enable the checkbox in the linux kernel config...

If setting up an environment to build these kernels was a simple process I would do it myself. Unfortunately most of the time in hacking android is not the hacking itself but the convoluted process to setting up the environment, and the steps involved are spread across android.com and many different XDA forums, I simply do not have the patience for it... I started one and when I still did not have a working setup after over 3 hours of downloading things and messing around, I gave up.

I wish someone would just zip up a whole working dev environment and put it somewhere for download so coders who know a lot about Java and linux (such as myself) could contribute to this scene without so much overhead. Even more ideal would be to put up a full VM disk image for download. Frankly I don't know why in today's world of prolific VMs all development environments are not simply VM downloads (vs. Google's download this custom tool and check out a brazillion things using Git you don't need)
[Galaxy S I9000 Android Development] fackamato:
No. Did you read the thread?
[Galaxy S I9000 Android Development] brunes:
Yes I have read the thread. The support for this chipset exists in the Linux kernel already. It's the same chipset as the N1 has. If you go back a few pages someone even already built some form of kernel and it plainly loads the support for the chipset. The issue is no one has hacked up a cable that injects power.

Build the module into the kernel, build the crazy custom cable that supplies power, and it will work. It's not a USB OTG cable that someone else mentioned that is needed, it is a cable that has some kind of power source, likely something you have to hack together yourself.

Frankly I still don't see the conceptual use for this when you have to supply your own power...
[Galaxy S I9000 Android Development] fackamato:
USB stick + a battery? Or use the phone as a computer (usb hub, kbd, mouse, usb vga). Or just for fun.

Would this cable work? http://cgi.ebay.ie/short-Usb-2-0-fe...neChargers&hash=item5adf476ac3#ht_2357wt_1141

Of course, just cut it open and supply +5v on the correct cables.