yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] sztupy:
sorry for being misleading. The post did contain he used the semaphore version, which is JVU.
[Galaxy S I9000 Android Development] Chainfire:
Well, I do have it working correctly now on your ICS-CM9 kernel. It will be working from DSLR Controller v0.85. Should be on the Market in a few days.

I'm not sure what's up with Semaphore 2.6.0/JVU, but as soon as I switch the device into host mode, the device freezes and reboots (only if hub connected). This is with the exact same setup as under ICS-CM9.
[Galaxy S I9000 Android Development] Chainfire:
Also, @sztupy, why are you mounting to /mnt/ehdd specifically ?

Samsung devices that support USB sticks and whatnot mount them to /sdcard/usbStorage/sd.... This will allow any app that understands external storage to work with external drives, if said app lets you choose a folder to use on external storage.
[Galaxy S I9000 Android Development] sztupy:
I just didn't knew how it worked on other devices, as I only own an SGS. And I thought that mounting in external_sd is considered bad practice (like ext sd is mounted in emmc in non samsung roms). But that's also why there is an option to change the mount point.
[Galaxy S I9000 Android Development] sztupy:
Good to hear, but I'm curious what the problem was, cause if DSLR controller works on other devices with built in host support, that means something is missing here (either in the kernel or in the ICS ROM itself)
[Galaxy S I9000 Android Development] sztupy:
I haven't seen how the backporting was done, so I have no idea either. I did fixed the root hub though, so in build2 connecting the camera should as simple as using only an y cable with power (as fortunately canon use miniusb ports), no external hub is needed.
[Galaxy S I9000 Android Development] Chainfire:
This is not mounting in /sdcard/external_sd/, it is mounting in /sdcard/usbStorage/...

As for it being bad practise... according to whom? Douchebags? HTC? Is it ideal? No it isn't, but it's a lot less silly than mounting a secondary card in /mnt/whatever or /emmc or whatnot. Why? Because the Android API has no provisions to detect or use these things, so it's all completely useless to normal apps not specially designed to take advantage of these non-standard paths (which are often hardcoded as well).

From a Linux viewpoint /mnt/whatever would make more sense. From an Android standpoint, /sdcard/whatever is the place to be.

Until such times that a proper mechanism and API is devised by Google to work with this, the only practical place to mount world-writable disks/partitions/drivers/usbsticks/networkdrives/etc is in /sdcard/... And for USB mounted stuff other Samsung devices happen to use /sdcard/usbStorage/sda (sda1, sdb, etc).

(upon re-reading, the above sounds a bit unfriendly - it is not meant to be unfriendly)

There are multiple parts to USB host. You have your basic kernel support that your patch (in combo with your app) offers, then you have the Android USB host APIs (that require USB host kernel, obviously). These are Java APIs officially introduced in Honeycomb (3.1).

DSLR Controller is mostly based on those Java APIs, because it allows you to get raw access to USB devices without root.

Older devices may support only kernel USB host and not the APIs (like various Gingerbread Samsungs). For those, I have backported the Android USB host APIs, BUT this requires root to get permissions on the USB device.

So if you do not have root but a proper 3.1+ Android build, DSLR Controller will work. Else, DSLR Controller requires root.

There is a third class of USB host supporting devices: devices that actually do have the Android USB host APIs AND "advertise" to apps that this works, AND have working USB host kernels, BUT the API doesn't actually work (actually not uncommon!). The SGS with ICS and your kernel falls into this category. DSLR Controller was _meant_ to handle this situation, but I never had a device with this problem so I couldn't test it. And it appears there was a bug in this handling. This is now fixed (literally a one-line fix in the code).

... or, to make a long story short: a bug in DSLR Controller has been fixed :)

Will it still work with an external HUB ? (I don't have a y-cable only hubs... any advice on where to get a good one?)
[Galaxy S I9000 Android Development] sztupy:
Yeah, it was. not that I care :)

I too think the main problem is the lack of official android devices with more external memories than one. But there is a good reason while CM didn't choose the /sdcard way: mounting in /sdcard has the unfortunate disadvantage that the sd card might be removed (like when using the phone as a mass storage device - although this is not a problem in this case as you cannot use the phone as a mass storage device _and_ have usb host at the same time). That's why they mainly chose to have separate mount points in /mnt. Meanwhile the standard on samsung is to mount everything in /sdcard (I don't know how other vendors with external and internal memory solve this. I think they go the samsung way though for reasons you have mentioned).

I will extend UHC to handle both mount points the easy way though. It's better to support both standards than to use only one.

This is the actual part I want to fix. I know there aren't many usb host supporting apps there, but the proper API support would be nice. It seems I have to fix the ICS build for this though.

Of course, it's just that the root hub had some bugs that made using an external hub more stable (I think I mentioned this in the intro too). I fixed this bug, so connecting the device straight to the phone should be as stable as connecting it through an external hub now. This does simplify connecting to one device if it has a mini-usb connector (and most stuff that you want to connect to /external hard drives and canon dslr's/ are among them).

I have a lot of Y cables, as it's a usual accessory for small, bus powered external hard drives, which I have a few. And it's only 0,8€ in the cheapest local store. (and not much more expensive from some sellers at ebay) "Frankensteining" together a Y-cable and an USB-A extension cord is also very easy (you don't even have to solder anything) and cheap. Much cheaper than an (powered) external hub, and has the advantage that it works for sure (as you will connect it to a device that is proper USB 2.0). I never thought there will be much problems with external hubs, but it seems a common problem :(
[Galaxy S I9000 Android Development] Chainfire:
Probably, yes. It can't be a big change that is needed - if it was, DSLR Controller (in rooted native code mode) wouldn't work either (same codebase) ! I'm not sure how I could help, though.

Would this work ?
[Galaxy S I9000 Android Development] sztupy:
Unfortunately I only own an SGS, and I don't really know how other devices work. (I did order very a cheap chinese tablet with ics and otg support though, should be getting it in a few weeks). If it's not a problem I might PM you if I've found out something in the ICS code that makes this working / not working.

Yep.
[Galaxy S I9000 Android Development] Chainfire:
PM me anytime. Can't always guarantee quick response, but I'll do my best.

It may simply be something that gets automatically excluded if the kernel isn't built with USB host in the build setup...

Great! I wasn't sure if that was really the type of cable I needed.
[Galaxy S I9000 Android Development] nsa666:
@Chainfire Can you post here when the new version of dslr-controller is out? Just waiting for working version to buy it.
[Galaxy S I9000 Android Development] AdamOutler:
There's no real link where you can learn about the SBL> prompt, officially. I did set up something here: http://xdaforums.com/showthread.php?t=1209288

If you want to develop bootloaders, you'll need internal UART because the PBL initializes the FSA chip which was used in the last link: http://xdaforums.com/showthread.php?t=1235219 and http://xdaforums.com/showthread.php?t=1206216 I don't have the internal points for i9000

Here's the code I run on my Arduino: http://xdaforums.com/showpost.php?p=13351363&postcount=223

I just received a Samsung GalaxyS2 yesterday and I was able to get in on internal UART to obtain this for you....

normal:

SBL> usb_read
---------read MUIC register : multiple
(0x0 : 0x5d), (0x1 : 0x0), (0x2 : 0x0), (0x3 : 0x0),
(0x4 : 0x3f), (0x5 : 0x0), (0x6 : 0x0), (0x7 : 0x0),
(0x8 : 0x0), (0x9 : 0x0), (0xa : 0xd), (0xb : 0x0),
(0xc : 0x0), (0xd : 0x3a), (0xe : 0x0),
SBL>

with USB-OTG cable connected

SBL> usb_read
---------read MUIC register : multiple
(0x0 : 0x5d), (0x1 : 0x3), (0x2 : 0x0), (0x3 : 0x0),
(0x4 : 0x0), (0x5 : 0x0), (0x6 : 0x0), (0x7 : 0x0),
(0x8 : 0x0), (0x9 : 0x0), (0xa : 0xd), (0xb : 0x0),
(0xc : 0x0), (0xd : 0x3a), (0xe : 0x0),
SBL>

Kernel commandline:

ATAG_CMDLINE: 39 54410009 'loglevel=4 console=/dev/ttySAC2 sec_debug.enable=0 sec_debug.enable_user=0 c1_watchdog.sec_pet=5 sec_log=0x100000@0x5ea00000 s3cfb.bootloaderfb=0x5ec00000 ld9040.get_lcdtype=0x2 consoleblank=0 lpj=3981312 vmalloc=144m

Your Params.lfs file:

SBL> printenv
PARAM Rev 1.3
SERIAL_SPEED : 7
LOAD_RAMDISK : 0
BOOT_DELAY : 0
LCD_LEVEL : 97
SWITCH_SEL : 1
PHONE_DEBUG_ON : 1
LCD_DIM_LEVEL : 0
LCD_DIM_TIME : 6
MELODY_MODE : 1
REBOOT_MODE : 0
NATION_SEL : 0
LANGUAGE_SEL : 0
SET_DEFAULT_PARAM : 0
FLASH_LOCK_STATUS : 1
PARAM_INT_14 : 0
VERSION : I9000XXIL
CMDLINE : loglevel=4 console=ram
DELTA_LOCATION : /mnt/rsv
PARAM_STR_3 :
PARAM_STR_4 :

This is the meat of what is available from the SBL prompt. It's quite a bit. However, there is alot more. These are only what I find interesting currently...
[Galaxy S I9000 Android Development] sztupy:
Thanks for this. I couldn't figure out what MUIC stand for. Do you know?

I checked the kernel code of the SGS2, which had two differences than the code of the SGT:

1. when initializing the otg controller, it sets one of the bits as true, while the SGT set it as false. I tried both, haven't noticed anything changing

2. It initializes a charge pump using GPIO GPX3.3. Probably this is what is powering the device. Couldn't find anything related to this in the SGT/SGS files. I've tried setting some of the unused gpio pins (there are a few unused GPH pins) but nothing changed

About the UART: I usually use a USB-RS232 converter and a simple homemade RS232-UART (5v or 3.3v) converter for debugging. (giving serial commands from the PC). This setup should work too, right?

Btw. I don't think I'll tear the SGS apart for the internal uart. I haven't got any other phones :)
[Galaxy S I9000 Android Development] sztupy:
Ah, now that I have the S5PV210 documentation it states that it's GPIO ETC2.5 (page 2-122):

ETC2[5] XuotgDRVVBUS USB OTG charge pump enable 0

ETC2[6] XuhostPWREN USB HOST charge pump enable 0

ETC2[7] XuhostOVERCUR USB HOST oevercurrent flag 0

changing this pin doesn't seem to do anything though
[Galaxy S I9000 Android Development] AdamOutler:
you'll likely need to change that pin and route it through the FSA chip registers. the FSA is the gateway... its an input and output to many lines on the processor including audio, video, UART2, USB PHY0 (OTG) and USB PHY1(HOST). It has an I2C connection with the processor for controlling functions like "play" and "pause". It also has 2 separate lines which control boot mode and power modes. This chip is very important. It would not surprise me if tweaking those registers AND enabling charge pump is required.
[Galaxy S I9000 Android Development] AdamOutler:
MUIC= MicroUsb Integrated Circuit. the FSA92xx.
[Galaxy S I9000 Android Development] sztupy:
To bad the FSA documentation avialable is for the 928x, while the phone has a 948x, the former lacking USB OTG support (this can be seen in the kernel sources as the register values the 9480 gives are considered reserved in the 9280 documentation)

On the SGS2 the FSA is not really used for this. Instead the MAX PMIC/MUIC does the job. I couldn't find anything about that chip either.
[Galaxy S I9000 Android Development] AdamOutler:
Looks like the MAX8998 line we're concerned with is VBUS_5V, or V_BAT.
[Galaxy S I9000 Android Development] sztupy:
Oh, haven't seen this file. To bad it still lacks a scematic that shows all the pins of the AP. The OTGDRVVBUS pin is pin number F7. Well, at least it shows it's not yellow, so it might actually be connected somewhere, that's good to see.

And according to it the power from the usb port is avtually routed through the FSA until it gets to the PMIC? I think it's a bit strange though. There is actually nothing power related in the fsa9480.c.
[Galaxy S I9000 Android Development] AdamOutler:
There's more in the "Galaxy S Hack Pack" http://xdaforums.com/showthread.php?t=1111866
[Galaxy S I9000 Android Development] sztupy:
Yeah I saw that. I just thought that "Samsung GT-i9000 Troubleshooting Guide.pdf" is more or less the same as "Samsung GT-i9000 Troubleshooting Guide 2.pdf" :)
[Galaxy S I9000 Android Development] sztupy:
Build2

BUILD 2

Upgraded to latest driver from SGS2 sources.

Fixed root hub device enumeration issue

Driver now clears allocated resources after cable is disconnected

I also added a "nice" painting describing how to connect external devices to the phone.

I'm working on stock gingerbread support now.
[Galaxy S I9000 Android Development] Epic_VS:
Is anybody working on porting this to the Nexus S? If so I can test.

Sorry for my impatience.
[Galaxy S I9000 Android Development] sztupy:
Build 3 released

Build 3 is the same code as Build 2, but it is built from the original GB/U2 kernel sources with JVU and CF-root 4.3 (link: http://xdaforums.com/showthread.php?t=788108 )

This kernel update works through Odin and does not contain "Usb Host Controller". You can download it from the market though.

One of the most visible changes are that USB 1.x devices do work on this kernel, but their working are a bit strange:

If connected straight to the phone they work fine. I've tried a mouse, a keyboard and a wireless mouse+keyboard combo. All three worked, although sometimes I had to unplug and replug them for the phone to recognize them. Mice and keyboards do work out of the box on the JVU version of android though, you will get a nice small mouse cursor, that you can use the same ways as you use it on a PC

They do not work if connected through an USB 2.0 hub, they throw the same errors, and won't enumerate

You can connect more than one USB 1.x device if you have an USB 1.x HUB though (I found one covered in dust in the attic :) ). I did need to unplug/replug it at least 20 times before all of the devices I connected to it were enumerated properly. After that they did work without problems though. You can also connect USB 2.0 devices to the USB 1.x hub, but they will work with inferior speed of course.

It also seems that some RFS code in the JVU ROM is sometimes trying to do something with the freshly connected flash drive. Doesn't really does anything useful though.

The sources can be found here: https://github.com/sztupy/samsung_kernel_galaxys_gb

They have been "hand ported", so they should apply to any GB kernel source without problems.

Now that I know that usb 1.x devices work I think I'll know why they fail on the CM9 build. Going to fix that.

Download link is at post 6, as usual.
[Galaxy S I9000 Android Development] sztupy:
Build 4

Build 4

Fixed the USB 1.x issue on the CM roms too.

The problem was that since kernel 3.x they started checking whether the root hub has a TT (transaction translator, which is responsible for converting USB 1 signals to USB 2 signals) and they hard coded that USB 2.0 root hubs doesn't have TT's. (quite stupid if you ask me) I haven't really found a way to circumvent this nicely so I simply hardcoded that our device's root hub does have a TT.

The other issues still remain though with USB 1.x devices, but at least external mice and keyboards are working (probably gamepads can be connected too now).

Download link at the usual location.
[Galaxy S I9000 Android Development] sztupy:
I don't know anything about an ongoing Nexus S port. I will help, but only if the following list is true:

The kernel source is avialable on github. It is either a kernel for gingerbread (>=2.6.35) or for ICS (>=3.0)

It also contains (or has links to) the initramfs and all the other files needed to create an update.

If creating the update is not straightforward I also need a script to do this for me

After the update is made I need someone with the device to test it for me. If the feedback is positive I'll build versions for that device too, whenever something is changed.

(added this porting checklist to the FAQ too)
[Galaxy S I9000 Android Development] Dinesen68:
@sztupy sir i didn't understand your post on build #3... you said that usb 1.x devices (mouse, keyborad,etc...) works when connected directly to the phone??? no need for a hub then... :) so i neeed only otg cable and mouse... YOU sir are LEGEND!!!!!
[Galaxy S I9000 Android Development] Chainfire:
Great work - still hope you (and Adam?) figure out powered host.

Sent you some beers!
[Galaxy S I9000 Android Development] Chainfire:
Also, it seems the BUILD3/JVU link is wrong.
[Galaxy S I9000 Android Development] Dinesen68:
what is the maximum donation you accept:D
[Galaxy S I9000 Android Development] GrNick:
Just logged in to write the same. I downloaded the supposed JVU kernel but it's for CM9. Also _does_ contain the controller app in system/app, contrary to what stated in post #6.

When the link is fixed, I suppose it is ok to flash it on JW1?
[Galaxy S I9000 Android Development] mf_417:
tanx for great job, is there any future plan for using usb-flash without external power? you know, when connecting a flash to SGS2 it works fine and there is no need for external power.

ps: I know that using devices such as external hard drive will need power, but it seems (at least to me!) that using flash disks will not need any external power.
[Galaxy S I9000 Android Development] coooolboyz:
I am still hopeful that this can be done. May be the current draw from the USB port is also modifiable. If it can be allowed for a max of 1A draw - even USB HDDs will work :)

Yeah - go ahead, call me a dreamer :D - but my dream of USB host on SGS came true, ain't it? :p
[Galaxy S I9000 Android Development] caravagio:
Great work guys! But i have one question:

A friend of mine give me an micro USB to USB male adaptor. Can I use it in some configuration to receive data? Maybe with a USB Y cable!

Or a OTG cable it's a must!

Thank you!
[Galaxy S I9000 Android Development] eruur:
First of all fatastic work! I've been dreaming of an USB host driver for months :) So basically you made my dream come true <3

However there is one point I haven't understood. Out of curiosity, how come we need a Y USB cable for DSLR even though the camera has it's own powersource? Wouldn't OTG+µUSB/USB cables work?

Thank you again!
[Galaxy S I9000 Android Development] sztupy:
Fixed the link for Build 3. Sorry for that:

It's: http://android.sztupy.hu/dl/usbhost/kernel_usbhost_build3_jvugalaxys.zip

All release can be found here: http://android.sztupy.hu/dl/usbhost/
[Galaxy S I9000 Android Development] sztupy:
Sorry, I might have not been clear: you still need external power, just not a hub.
[Galaxy S I9000 Android Development] sztupy:
Without power on the USB cable the external device won't recognize the phone as connected. You only need a small power (100mA/5V), but that's still more than 0...
[Galaxy S I9000 Android Development] GrNick:
Thanx for the GB kernel, had downloaded from your website and gave it a try on JW1. Booted normally, no freezes/reboots as was the case with Semaphore2.6.0beta

Still not working though, had tried the first and second setup (as shown in your photo-diagram). Apparently the hub is recognized but then a series of errors appear, see attached log.
[Galaxy S I9000 Android Development] Epic_VS:
The stock kernel source is available, but not at github: git://android.git.kernel.org/kernel/samsung.git

Mathkid95's kernel source is available at git hub though:

ICS: https://github.com/mathkid95/linux_samsung_ics_real

GB: https://github.com/mathkid95/linux_samsung

I don't really know what you are talking about, but I found these links:

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

http://forums.androidcentral.com/t-.../48675-how-compile-nexus-s-kernel-source.html

If my knowledge is correct, can't you just unzip a kernel update and replace the zImage.

You will have a lot of testers on the Nexus S SubForums
[Galaxy S I9000 Android Development] coooolboyz:
Hi sztupy

In the below log files - I see - "PHYPWR=0x1c0" - I remember seeing [in the S5PC110 manual] something like set the value to 0x1b1 or 0x1b0 for powering the connected devices.

Now I am not sure if this can be changed - or if I am way of the mark and making a very stupid dance in front of the whole world. My apologies if that's the case.

But do you think this is something which can be pursued to give peripherals their own power from the phone? I hope I'm not pestering you too much.

---------- Post added at 03:12 PM ---------- Previous post was at 03:04 PM ----------

I just did a quick search and found the manual here - http://pdadb.net/download/samsung_s5pc110_manual_en.rar

In all possibility, you may already know this - but please have a look at Page Numbers 880 and then 387.

Hopefully that may help us all?

:)
[Galaxy S I9000 Android Development] sztupy:
Hi!

Thanks for the link, I haven't seen that it contains specification to the USBPHYPWR register. This was a part where there was a difference between the SGS2 and the SGS1 usb host implementation: the PIN 5. Well the manual was not really a big help though:

Reserved [5] Reserved, but should be 0x1

The SGS2 AP documentation says nothing about this register unfortunately: http://www.samsung.com/global/syste.../2/738994Pulbicmanual_Exynos4210_Ver00001.pdf

SGS2 actually set this bit as 0 and not 1. I don't know if I should revert the changes to the code and set it as 1 as it was used to be.
[Galaxy S I9000 Android Development] Dinesen68:
thanks for your reply btw.. hmm this was asked at least a hundred times but i ask it again to make it clear in my mind and sorry to bother you... IS IT POSSIBLE TO HAVE USB OTG like the Galaxy s 2 or N8... does the board give power or at least we can make it give power??? sorry for the caps its because my brain has too much questions and i'm glad some people can answer them for me...:confused::confused::confused::confused::confused::confused:
[Galaxy S I9000 Android Development] sztupy:
It is stated a lot of times: the phone DOES NOT give out power, you NEED to give external power to the phone/device while connected to use this kernel. We are working on solving this limitation but we CAN NOT guarantee that we will succeed in doing this.
[Galaxy S I9000 Android Development] Dinesen68:
the word working on gives me hope and i respect your work guys.. thank you for such an awesomeness... i really want to donate but can't... ( i'm 14) i know a bit of coding maybe i can help you... but t =he chances of me advancing your work are not that great but can you please teach me :D :D :D
[Galaxy S I9000 Android Development] sztupy:
Nexus S build released

Okay, I made a Nexus S release. Untested! Please test.

http://xdaforums.com/showthread.php?t=1459304
[Galaxy S I9000 Android Development] Epic_VS:
Testing, now I will buy a USB OTG cable. Thanks so much! I now wish I could donate.
[Galaxy S I9000 Android Development] golanster:
hello, great work, i wanted to buy dslr controller for monthes now and you made it come true

just one question, i have a 4k camera, is there any chance that it will do something to it? the extra 5v that i have to connect with the y cable worries me.

thanks