yashsingh1/xdaforums huggingface dataset:
[Nexus 4 Original Android Development] sszz:
Well, sad news. Although I do not have that deep knowledge, nor the neccessary hardware I found some contradictionary infos floating around and started wondering whether there is a way to trick the system to provide more current when someone linked this a few pages back:

"What's different about SlimPort from a user-facing perspective is that external microUSB power is not required for the adapter to work and is instead only required for optional charging. At the same time, the adapters draw no power from the source to operate."

How does the adapter gets powered up then? Over the HDMI side? What's the situation with adapters that have VGA output instead of HDMI? Can you please shed some light on this?

By the way, could you link the specs you use? I only found this datasheet but no word on output power limits there.

Finally: thanks & respect for your hard work.
[Nexus 4 Original Android Development] prateek80:
Well I've posted the same link few days back and asked the same question....

then someone replied that The phone provides the power not the TV or Display or HDMI...

But not the necessary 5v for usbOTG.

i guess right now no one can provide a better answer then that....:(
[Nexus 4 Original Android Development] sszz:
Yeah, I can't help the feeling that some of those those comments are nothing more than educated guesses, assumptions without any actual proof behind. At least that's what the many contradictions about this issue tell me. Hope someone with the correct source of information (datasheets, specs, insider infos, whatever) can help to sort it out, which would hopefully help us to move towards a working solutions - if possible at all.

Thanks anyway.
[Nexus 4 Original Android Development] tarroyo:
Received my USB OTG Y Cable in the mail this afternoon, Bought it from amazon http://www.amazon.com/Micro-Cable-P...id=1370558033&sr=8-1&keywords=usb+otg+y+cable

Everything is working good, Can transfer files to and from my device with no problem at all.
[Nexus 4 Original Android Development] ziddey:
2013.06.06 1736ET: ziddey-otg-r151-06061736.zip Releases will now include modules ff-memless.ko, hid-dr.ko, hid-logitech.ko, and xpad.ko (/system/lib/modules). Manually insmod as needed or create an appropriate init.d script to load on boot. Rebase to Franco r151.

Considering the amount of free (wasted) space on the /system partition, I figured I'd include some popular/relevant kernel modules. Refer to http://xdaforums.com/showthread.php?t=1584850 for more information. They are NOT automatically loaded since most people don't have a need for them. Feel free to create an appropriate init.d script if desired. I can't imagine they'd have any noticeable effects on boot time / memory consumption.
[Nexus 4 Original Android Development] tarroyo:
Tested the latest release, working properly.
[Nexus 4 Original Android Development] matanp:
the links are dead

can anyone post a mirror please?
[Nexus 4 Original Android Development] tarroyo:
Links are not dead, I just checked its working.

http://fs1.d-h.st/download/00049/R9c/ziddey-otg-r151-06061736.zip
[Nexus 4 Original Android Development] parkedraccoon:
Kernel is working great, except wired tethering does not work, I do not know if this is Franco's or the OTG build's issue.

https://dl.dropboxusercontent.com/u/59323047/Camera Uploads/2013-06-07 17.20.17.png
[Nexus 4 Original Android Development] ziddey:
Did that app work with the stock kernel?

Native wired tether works just fine.
[Nexus 4 Original Android Development] parkedraccoon:
I never had even tried using the app before. Usually I would use the built in USB tethering option, and currently that allows me to check it and just doesn't do anything. It could be a ROM issue but I came here because it said it was a kernel level problem.
[Nexus 4 Original Android Development] bamsbamx:
hey guys does anyone own a go pro camera???

i have tried to connect via OTG to the mobile, but it only works if I execute the following command (taken from OP):

# echo host > /sys/kernel/debug/msm_otg/mode

Is there any way to get working without executing this command??? thanks

UPDATE: I have executed that command and tried with a normal microsd reader. It works even after executing it, so I will create an script for init.d :)

If anyone wants a flashable zip tell me and i will post here :)
[Nexus 4 Original Android Development] vikas_toad:
Hey, sorry i could not report back saying i would test the hid-dr.ko module, haven't been around my nexus.

Any ways, the good news is, the generic ps3 looking cheap usb controllers like the one attached in the pic works without any modules. The mappings are already present in the kernel, so all that is needed is activation , activate it using any IME enabler supporting usb. My personal favourite is usb/bt joystick center 7. Available on playstore.. It lets you remap the buttons for different games and also save them as profiles, for other non supported games, theres a companion App joy2touch server 4 which lets you map touch screen events and save them... So you can play games which aren't supported natively..

Other than that.. Works flawlessly :D
[Nexus 4 Original Android Development] meranto:
Just want to say thanks to the dev for picking this issue up! I'm really hoping I can use the DSLR-controller app soon without the need for extra battery packs etc. No matter how dirty the hack, if it makes my Nexus 4 work with devices that have external power themselves I'd be very grateful!
[Nexus 4 Original Android Development] kanidevil666:
just confirming with anyone who is successful in working with the OTG..

Things i have to doto get it working:

1. A deodexed stock rom

2. install this kernel

3. Get a Y-cable

4. Connect the things up

5. Storage/mount usb

is that it...will my pen drive work??or i need to do any modding in the scripts!!!

Please help, after understanding all, i may proceed!!!:good:
[Nexus 4 Original Android Development] tarroyo:
That's all steps needed, pen drive should work with no modications.

This guide is a little outdated but helped me with the setup process

http://www.androidcentral.com/android-advanced-usb-otg-nexus-4
[Nexus 4 Original Android Development] TheUnknownCopy:
Is there a way to move the app data of say a game found in the Android/ folder to a USB pendrive, and then play the game?

Because the size of these folders for some games is way over 1GB.
[Nexus 4 Original Android Development] Alex240188:
You would have to move the folder to your external drive. Set permissions then symlink from where it's original location was to where it's new location is.

Just to add that you can't symlink on a fat32 drive which is standard on USB flash drives
[Nexus 4 Original Android Development] ziddey:
2013.06.10 1606ET: ziddey-otg-r153-06101606.zip Maintenance build-- rebase to Franco r153.
[Nexus 4 Original Android Development] TheUnknownCopy:
Wait so what kind of drive can I add symlink to? I can partition my flash drive to that drive right?

Also how can I add symlink and set permissions to the folder.

This should work with any games folder, found in /Android/data/ folder right?
[Nexus 4 Original Android Development] dexim:
I used this cable ...

http://www.amazon.com/dp/B009YPYORM/ ... with this kernel to get OTG working on my Nexus 4. The combination works perfectly. Thank you for all of your work getting OTG working.
[Nexus 4 Original Android Development] tarroyo:
Same one I have, works great.
[Nexus 4 Original Android Development] bmakk2055:
Thanks Dev for this, working very well but does this effect the use of HDMI output? And is this only a modded kernel that doesn't touch the ROM in case I want to flash my stock kernel back?
[Nexus 4 Original Android Development] ziddey:
No except otg and slimport cannot work concurrently.
[Nexus 4 Original Android Development] bmakk2055:
Okay thanks, I edited my post above.
[Nexus 4 Original Android Development] pautena:
Hello, I'm working in a university project where I try to connect a Nexus 4 to Arduino board. I use a plate Sparkfun USB Host Shield to make the connection but the Nexus 4 can not detect Arduino board.

Arduino board have a external power:

[/URL]

Uploaded with ImageShack.us[/IMG]

In some Youtube videos I've seen a people who use the same way to connect a GAlaxy Nexus with Arduino.

I use Revolution R9 + kernel Franco
[Nexus 4 Original Android Development] UgoBoss:
I just test that out and this is awesome ! Thank's to dev :D

I was just wondering, is this a kernel ? Because I was on Faux and now in settings it shows Franco Kernel.

Thanks for reply :)
[Nexus 4 Original Android Development] clienthax:
You need to supply +5v and ground to the usb connector phone side ;)
[Nexus 4 Original Android Development] ziddey:
2013.06.12 1429ET: ziddey-otg-r154-06121429.zip Maintenance build-- rebase to Franco r154.

Going on vacation for a week so here's another maintenance build.
[Nexus 4 Original Android Development] bmakk2055:
Thanks , have a great time.
[Nexus 4 Original Android Development] Gia90:
Yes it is a kernel, precisely Franco kernel with ziddey's OTG patches

Inviato dal mio Nexus 4
[Nexus 4 Original Android Development] UgoBoss:
Ok thanks dude !
[Nexus 4 Original Android Development] Glaux:
Works pretty well for me with a SD card reader. I plugged in a mouse as well and it was usable instantly.
[Nexus 4 Original Android Development] reve1:
android 4.1

Does it work on android 4.1.2, samsung galaxy specifically grand duos gt-I9082L ?
[Nexus 4 Original Android Development] yellowdie:
This is a

Nexus 4

kernel. In the

Nexus 4

category. It will break anything that's not a

Nexus 4

. I recommend not doing that. :) :D :laugh::good:

And welcome to XDA! In general, searching and reading through a thread will answer almost all of your questions; and searching on Google will take care of the rest of them.

That said, don't be afraid to ask questions--we're all here to help. :)
[Nexus 4 Original Android Development] Roastmeat:
So I am trying to make this thing portable.

I got my hands on an OTG cable and spliced power lines into it.

I connected a 7805 voltage regulator to ground and power in, the output goes to the cables 5v supply.

I got the mouse to work using a computer power supply at 12 V.

I got a USB stick to temporarily work until it lost power.

I felt the voltage regulator, it was very hot so I'm guessing thermal shutdown.

A 9V battery does not provide enough current itself, un loaded via voltage regulator its 5V. With just the USB stick in, it dropps to 4.3V.

Connecting it to the phone does nothing (nothing detected)

After taking out the USB, I plugged the cable into my phone and the regulator started to warm up by itself.

The phone seems to draw too much current, how do USB hubs do it? how much current does the phone draw, as well as a Kingston USB Stick?
[Nexus 4 Original Android Development] morrislee:
Maybe we should remove the OTG detection all together and make a switch that just switches it on or off would be just cleaner?
[Nexus 4 Original Android Development] buizon:
Hi guys! based on this forum, micro usb of nexus for don't supply enough power for an otg cable to work am i right?
[Nexus 4 Original Android Development] sszz:
There are many assumptions but no one knows exactly. Would be nice if someone with the correct knowledge and instruments could test this theory...
[Nexus 4 Original Android Development] buizon:
Well i was looking at diy otg tutorials. I was thinking if the nexus 4 can output at least 1v. Maybe we can put a dc-dc step up converter module with an output of 5v in between the usb male and micro usb. Fulfilling the required 5v by flash drives. May i ask if nexus 4 powers the slimports? Thanks!
[Nexus 4 Original Android Development] sszz:
This would only work if the Nexus 4 can provide sufficient current overhead for the step-up driver to work. This is why I said we would need someone with the required equiment to test...
[Nexus 4 Original Android Development] Sillik:
Hello,

I tried flashing this kernel on a stock rooted deodexed rom but it doesn't boot.

I get stuck on the "Google" splashscreen.

Any idea what could be wrong?

Thank you.

EDIT: Nevermind, it was a corrupted download. MD5 didn't match. A re-download did the trick, it works awesomely!
[Nexus 4 Original Android Development] buizon:
yup well I would like to test this that is why i also want to know if nexus 4 powers the slimport. if it did, i'll probably try to make my own otg. Thanks!
[Nexus 4 Original Android Development] bmakk2055:
Yes the nexus 4 does power the HDMI slimport without external power if that's what your talking about.
[Nexus 4 Original Android Development] Roastmeat:
If you try to be like me and make your OTG cable (battery powered) here's what i've discovered:

You will need a 5V voltage regulator:

- 7805 will work fine but will require a heatsink.

- I tried the 7805 without a heatsink with 12V from a computer power supply, it heat up so much that it shut itself down.

- This makes me think that with a USB stick and connected to the phone (especially), the current draw is probably >0.6A? (Power calculations necessary)

- I tried with a 9V battery, does not work. The voltage regulator outputs 4.3 V. Looks like we need more current.

7805 efficiency is really bad at these current levels as well, better off using a DC-DC converter/Switching regulator but that will include inductors and resistors and other components that increase the spatial footprint.

That is where i'm at.

EDIT: This might help http://learn.adafruit.com/minty-boost
[Nexus 4 Original Android Development] buizon:
Well I don't know if you can post a link here but I found a DC-DC step converter on the internet. I'm thinking that wires for power supply will run first on this module so 5v will be supplied to the usb peripheral.
[Nexus 4 Original Android Development] Mako321:
Try a Texas Instruments PTH08000 or PTH08080.
[Nexus 4 Original Android Development] parkedraccoon:
Any chance of a fuse.ko module? It's required for mounting NTFS drives.
[Nexus 4 Original Android Development] ziddey:
fuse is is already built into the kernel (required for our emulated internal sdcard).

Read-only NTFS support is included via vold (at least for Cyanogenmod). I did read about a modification to allow write a while ago, but didn't implement it because of potential risks of corruption.

You can download ntfs-3g and use it to mount ntfs partitions as rw. Or use that in conjunction with Stickmount if you'd rather deal with a UI: http://xdaforums.com/showthread.php?t=1400034

Just be careful to unmount before unplugging.
[Nexus 4 Original Android Development] ziddey:
2013.06.23 0339ET: ziddey-otg-r156-06230339.zip Maintenance build-- rebase to Franco r156.
[Nexus 4 Original Android Development] defroster:
Just rigged up a 3.7v li ion to a 5v step up converter and spliced it into the USB host power lines. Charged the phone but did not work with DSLR controller. Running latest kernel. Is there something obvious I'm missing?
[Nexus 4 Original Android Development] codf4ther:
Has anyone been able to get MIUI to boot after applying this mod? I tried with DATSUN.510's rom but it gets stuck at the boot screen.
[Nexus 4 Original Android Development] vikas_toad:
ok so i have been reading reading and reading and could hardly make any heads or tails out of it...

actually i understood what is written and explained.. but am not sure about how things actually should be...

so ill ask some simple questions...

1. how good does this otg solution work??

2. how exactly do i use it(im not asking how to flash and all.. I'm not that noob)

3. any precautions using this solution? what should i not do??

4. what does it not do and what are the problems(in simple language? :silly:)
[Nexus 4 Original Android Development] ziddey:
UPDATE: Added file to enable android api support for usb host. This consequently enables automatic media scanning when connecting a usb drive.

1. To my knowledge, no rom is claiming support for host mode in the API. I'm still investigating exactly what this means, since input and storage devices work just fine. I'm assuming it has to do with any programs that employ Android for usb devices rather than linux itself (would require root). I haven't used any such programs though, so I don't know. Input and storage devices should work in any app. Otherwise, it works as it should.

2. I'm not sure what you're asking here. There's nothing to setup. Just plug in your powered OTG cable and go. This can either be a Y cable or a powered hub that supplies power back to the host or however else you can supply power.

3. Shouldn't be any caveats anymore. Let me know if you find anything. The only problem that may exist is with manually triggering host mode since I didn't make any modifications except to force /sys/kernel/debug/msm_otg/mode. Currently this would only be useful for connecting say an external hard drive that doesn't provide power to the host. I can look into this if it becomes an issue, but it might end up being fixed slightly more upstream in the code in the future.

4. It obviously does not supply power to usb devices, instead requiring power to operate (unless you directly power your devices and force host mode via debug..). OTG host mode is triggered based on the "charger" since ID pin state detection is broken.

abnormalreply, I just tested media scanning. After the usb disk is mounted, music doesn't show up in the library. However, after navigating to the drive in a file manager and playing any file, everything seems to show up. Hopefully there's a way to easily implement automatic media scanning on mount. In the meantime, there should be apps in the market that force scanning (probably would require root).
[Nexus 4 Original Android Development] karendar:
http://www.ebay.ca/itm/2200mAh-USB-...159383?pt=PDA_Accessories&hash=item5aec93b397

This + a Y cable would make a decent portable OTG solution, no?

Or this:

http://www.ebay.ca/itm/Blue-Lipstic...312854?pt=PDA_Accessories&hash=item5650794756

Or this for 4500mah instead of 2200:

http://www.ebay.ca/itm/Blue-Lipstic...ader_Chargers_Sync_Cables&hash=item2c6cf895fb
[Nexus 4 Original Android Development] ziddey:
Alright, enabling support in the android api is a lot simpler than I was expecting. I had created /system/etc/permissions/android.hardware.usb.host.xml at one point but forgot I wiped /system shortly afterwards. So I had been assuming that the file was only allowing usb host apps from the market (I believe it's actually ro.usb_host=1 in build.prop that does that).

With android api support, it appears that the media library is now automatically refreshed when a usb drive is connected!

I will be creating a new update zip that pushes this file, and adds ro.usb_host=1 to build.prop if it's not already there.

I need feedback as to whether framework-res.apk is being patched successfully. It works for me with CWM 6.0.2.3 (official release), but there may be problems with 6.0.2.7?

Update:

2013.03.19 2042ET: ziddey-otg-03192013.zip All-in-one update now enables android api for usb host mode. Should automatically rescan media library when usb storage is connected. Kernel updated to Franco M1 (milestone), and will probably stay here for a while.
[Nexus 4 Original Android Development] baltac:
@ziddey: You should add a condition to your otgmod.sh (dunno if the sintax is correct, I've just checked a couple of tutorials for file checking in bash language) :

[...prev code...]
if ( ./zip -rf framework-res.apk res); then
[color=red]if	(-e /system/framework/framework-res.apk.1); then
cp framework-res.apk /system/framework/framework-res.apk
cd ..
rm -rf otgmod
exit
else[/color]
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.1
cp framework-res.apk /system/framework/framework-res.apk
fi
fi
[...etc..etc..]

or something like that, to check if the framework-res.apk.1 file exists, otherwise who already have your previous package will lost the original backup.

Anyway tomorrow I'll test your new update. Now time to sleep. :)
[Nexus 4 Original Android Development] ziddey:
That's the idea of doing the injection in the if statement. The -f flag causes zip to "freshen," or inject only if the file is changed. If it's already been modified, zip should not be outputting anything, and the if condition should fail. Maybe I'm mistaken though; I haven't tested too thoroughly :eek:.

Huh. Just found a minor cosmetic bug (could potentially be disastrous but probably highly unlikely):

In storage_list.xml, the description is defined as: android:storageDescription="@string/storage_usb"

I'm assuming it's some sort of pointer issue? Perhaps simply injecting a storage_list.xml compiled for a different framework-res.apk may not be such a great idea. The simple solution would be to statically define the descriptions, but then language settings would obviously not apply. It probably would not be feasible to dynamically decompile/recompile the apk.
[Nexus 4 Original Android Development] baltac:
R: [OTG] [19MAR13] [DIRTY HACKS] Externally Powered USB OTG (Seeking Devs)

Lol. In italian I have "SEMPRE" that mean "ALWAYS" in english. And on the PC browsing the Nexus 4 mtp folder, I dont see anymore the "Internal Storage" label, but just a cryptic "Invio..." ("Send..." in english). Apart this, it works flawlessly.

Ps. For the script, yes I've misuderstood the sense of -rf option. ^^

Inviato dal mio Nexus 4 con Tapatalk 2
[Nexus 4 Original Android Development] sga999:
ziddey, I got your latest zip with Franco's milestone 1, and all is well. I'm so pleased with all the improvements you're making, one of them being that you're now based on Franco's milestone kernel!

I'm using twrp 2.3.3.2, and your changes to framework-res.apk are working properly.

As your screenshot showed, USB Host Diagnostics now has all Yes, i.e. there are no longer 2 No under ANDROID API. Media library on the USB device is definitely being scanned when the device is inserted.

As far as your cosmetic issue, I have USB STORAGE instead of NAVIGATE HOME. I didn't understand what you were saying about when this occurs or how you might fix it, but it seems to be working fine for me.
[Nexus 4 Original Android Development] Silencer96:
This is fantastic news. Kudos to OP and his team! :)
[Nexus 4 Original Android Development] ziddey:
It looks like res/values/strings.xml changed in a recent nightly of cm10.1. storage_usb was previously on line 1322 (decompiled strings.xml...), and is now on 1327. Currently, action_bar_home_description, or "Navigate home" is on line 1322. How lovely.
[Nexus 4 Original Android Development] ritchea:
After installing the latest kernel, I definitely get the framework-res-apk plus the back-up. I have not moved on as the only powered hub I have isn't showing anything when connected (through usb otg cable). I'm 99.99% sure it's the hub. I tried a powered WD drive just for the heck of it. Nothing. Tried the script from # in TE: echo host> /sys/kernel/debug/msm_otg/mode (Enter) while drive was connected but no device shows. Looks like I need a space between host and >. Can't check now as I was using the usb hub connected to my husband's imac. If anyone notices any obvious errors (the OTG cable does work on N7 and on my GNex) in my method, please educate. I'm not new to this stuff but am very limited in my knowledge.

Since my goal is to be able to run videos from my thumb drive, I may look into this which I came across while searching for battery-powered usb hubs. It will work with the sd cards and power devices, too. Doesn't do anything for connecting usb peripherals such as mouse/keyboard.