yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Nexus] alfadon:
Its all good man. New version seems to work fine. Pulling the power from the cable stops the charging. Also once power is cut the Usb drive will unmount then remount itself. Doesn't show that its still charging like the last version. Tried it a few times and it worked. ADB and fastboot function seem to work, also shows up as a media device. Looks like a winner to me.:victory: Good job thanks for all your hard work making this work.
[Samsung Galaxy Nexus] highvista:
Thanks for the testing, everyone. I've uploaded the current V4 ZIP files to my post at

http://xdaforums.com/showpost.php?p=32474150&postcount=70

The ZIP files contain the boot image, original and modified kernel source files, and a README.txt with information on the mod.

I've only posted the Android 4.1.2-based images. Rotary Heart, if you test out the 4.2.1 boot image I posted and find that it is working for you, I'll post 4.2.1 images for takju and yakju phones.

I can also post an image for the Sprint/mysidpro phones, if anyone is interested.
[Samsung Galaxy Nexus] Rotary Heart:
Is working here, anything special you want me to test?
[Samsung Galaxy Nexus] highvista:
Thanks for the info. No, nothing special to test. As long as it works the same for you as the 4.1.2 version did, as well as properly changing from charging mode to battery mode when power is disconnected, we should be good to go. I'll post the 4.2.1 ZIPs tomorrow morning. Feel free to post the current ZIPs in the OP now or after I get the other three up. And thanks again for maintaining the OP with current info. :good:
[Samsung Galaxy Nexus] highvista:
I've uploaded the ZIP archives for Android 4.2.1 (JOP40D). They can be found at

http://xdaforums.com/showpost.php?p=32474150&postcount=70
[Samsung Galaxy Nexus] Rotary Heart:
I updated the OP with the new files and info.
[Samsung Galaxy Nexus] highvista:
Thanks, Rotary Heart. :good::good:
[Samsung Galaxy Nexus] resh1:
I've flashed takju-jop40d-JourneymanMod-Kernel-V4 on a stock Android 4.2.1 JOP40D but now the phone never charge anymore.

I'm using the standard Samsung micro usb cable, i need to use USB OTG y-cable?

How many ohms has the resistor between pin 4 and 5 in a USB OTG y-cable?
[Samsung Galaxy Nexus] sto1911:
Can I use v4 JZO54K on a Nexus 7 running 4.1.2? If not is there an OTG power patch for 4.1.2? I know there is one for 4.2.x but I still find it sluggish.

Thank you!
[Samsung Galaxy Nexus] latinmaxima:
I would be interested in the sprint versions. Still waiting for my cable to come in but this is awesome to be progressing so well.
[Samsung Galaxy Nexus] highvista:
This is the first report of a problem charging when using the kernel under Android 4.2.1. Anyone else out there with 4.2.1 and stock JOP40D having this problem?

In order to charge the phone while also using a flash drive or other USB device, you'll need either a USB OTG y-cable or a USB hub, along with a standard USB OTG cable. This kernel will work with a standard USB OTG cable on its own, but the phone battery will be drained while it powers the attached USB device.

I don't believe there is a resistor in the y-cable, though I can't say for sure since I've never built one. The USB OTG specification describes using a resistor between the sense/ID pin and ground to select different operational modes, but the Galaxy Nexus doesn't implement this feature.

You can buy y-cables from various eBay vendors. A search for "usb otg cable power" on eBay will turn up several vendors.

---------- Post added at 06:27 AM ---------- Previous post was at 06:13 AM ----------

The boot images I've posted are built for the Galaxy Nexus. But the source code for the patch is included in each ZIP archive containing the boot image. If there's someone out there with a Nexus 7 that would like to use this source as the starting point for a patch to the Nexus 7 kernel, that would be great. I don't have an N7 so can't test a patch.

The original source code for this patch was found at

http://rootzwiki.com/topic/30615-can-you-charge-usb-host-mode-simultaneously/

I haven't kept up with the discussion, but I believe most of it is concerning the Nexus 7.

Hope that helps! :)

---------- Post added at 06:31 AM ---------- Previous post was at 06:27 AM ----------

I'd like to have someone test the boot image for a Sprint phone before I ask Rotary Heart to post a ZIP archive in the OP. Once you get your cable, let me know and I can post the boot image in reply.

Anyone else out there that can test a Sprint boot image right now? If so, let me know and I can post it.
[Samsung Galaxy Nexus] elichai2:
2 Questions:

1.Can you make it a flashable zip? it will be easier.

2. There is something like that for Nexus7?(wifi)(CM10.1 Android 4.2.1)

Thanks
[Samsung Galaxy Nexus] highvista:
I'll think about the flashable ZIP idea. The problem is, the ZIP archives that are posted include source code files and a README, so I can't simply turn the top-level file into a flashable ZIP--I wouldn't be able to include the current files.

As I mentioned in a previous post, this kernel and boot image are only for the Galaxy Nexus. I don't know what the current state of work is for the Nexus 7, since I don't own one and wouldn't want to develop a kernel without having a device to test it on.
[Samsung Galaxy Nexus] alfadon:
Just download this flashable zip and drop the boot.img file in the root of the zip(meaning no folders).

This is just a kernel flashing template, this file doesn't contain a kernel. Please download the kernel for your phone on page 1 and drop the boot.img from the zip into this template zip and then flash.
[Samsung Galaxy Nexus] elichai2:
it's didn't worked, the phone stucked in boot so i needed to flash CM again.

and i tried to flash the img file and when the phone turn on everything crashed(it's said "NFC crashed,Android OS crashed again and again)
[Samsung Galaxy Nexus] highvista:
The file alfadon posted was meant as an example "template" if I wanted to post the boot image in a flashable zip but does NOT contain a boot image. If you want to install the boot image containing the JourneymanMod kernel, you can get it by clicking on the link in my sig or going to the opening post of this thread. Note that these aren't flashable files. You'll want to download one, unzip it, and use the boot image contained within.

And, before installing the boot image, please make sure you read the notes in the post about using the kernel, as well as the README.txt contained in the zip file. Good luck!:)
[Samsung Galaxy Nexus] alfadon:
Yes sorry should have worded my post a little better to avoid confusion. I edited the post to hopefully avoid confusion in the future.

On another note Air Kernel has started using your mod v3 in the latest 4.2 version.
[Samsung Galaxy Nexus] DoesntPostAThing:
Hi guys, I've been following this project for a while. I may not be using this kernel, but the kernel I'm using (AK) included this mod in it. I'm wondering how I'd use charging while OTG? Thanks.
[Samsung Galaxy Nexus] alfadon:
This is what I use

http://www.ebay.com/itm/Micro-USB-Host-OTG-Cable-W-Micro-USB-power-4-Samsung-i9100-i9300-i9220-N7100-S3-/281039515850?pt=PDA_Accessories&hash=item416f42b0ca

it works great. You can also use a powered usb hub.
[Samsung Galaxy Nexus] DoesntPostAThing:
Thanks for the suggestion, but I already bought my OTG cable. As for the USB hub, do I just plug the hub into the wall, plug flash drive into USB, then plug USB hub into OTG that's already in the phone?
[Samsung Galaxy Nexus] elichai2:
When i said that i tried to flash the boot.img i ment i tried to flash it with fastboot, and the device crashed like i said.
[Samsung Galaxy Nexus] highvista:
It sounds like you're doing the right things, then. What version of the Galaxy Nexus are you using? Make sure that the version of the boot image that you're flashing is the right one for your phone.
[Samsung Galaxy Nexus] elichai2:
I got Gnex GSM yakju 4.2.1(CM10.1) and i flashed with fastboot that file:

yakju-jop40d-JourneymanMod-Kernel-V4.zip
[Samsung Galaxy Nexus] highvista:
That's the right one for your phone, so no problem there. Is anyone else seeing a problem with this version of the phone and boot image?
[Samsung Galaxy Nexus] DoesntPostAThing:
Any tips on how to use this? Is my phone supposed to display that it's charging? Also what do I need to do to enable charging while OTG? Thanks.
[Samsung Galaxy Nexus] highvista:
I can't tell you just how the patch has been implemented in another kernel, but in the JourneymanMod kernel, the phone will show charging when you use the y-cable and have power attached to it. Charging will take place whenever power is attached to the y-cable. Just make sure you plug power into the y-cable before you attach it to the phone. If you attach the y-cable to the phone before attaching power, the phone will go into standard USB OTG mode, which means the phone will provide power to the attached USB device.
[Samsung Galaxy Nexus] DoesntPostAThing:
So I plug hub into outlet first, then plug into my phone, then plug USB into hub?

Sent from my Paranoid Maguro powered by AK Berserk
[Samsung Galaxy Nexus] highvista:
I think you're going to need a USB OTG y-cable to get this to work. There are several vendors on eBay selling the cables. I don't use a hub myself. I attach my USB flash drive to the cable, attach a powered USB cable to the power input on the y-cable, and then attach the cable to my phone. I also make sure the phone is awake before attaching the cable or the flash drive doesn't mount properly via Stickmount.
[Samsung Galaxy Nexus] mthous01:
I'm having issues with Fast Charge when I try to build this mod into a couple of the custom kernels I like. Has anyone else tried to build this into a custom kernel having the same issue?
[Samsung Galaxy Nexus] Ladaga:
how install this script?
[Samsung Galaxy Nexus] ghostofbunuel:
Stock kernel flash?

Hello,

Is there any way to make a flashable recovery zip of this mod for the stock 4.2.1 kernel? I'm using MMUZZYRom which is basically stock. You could use this with stick mount and have your entire music collection while at work, that would be great.
[Samsung Galaxy Nexus] mthous01:
Which version of the phone do you have? That makes a difference.
[Samsung Galaxy Nexus] ghostofbunuel:
If you're asking me I have takju magura 4.2.1 thanks.
[Samsung Galaxy Nexus] mthous01:
http://db.tt/ioeJaD9O

Try this for 4.2.1 yakju stock kernel w/ JMM mod.
[Samsung Galaxy Nexus] ghostofbunuel:
Will try out this week (still haven't received my cable yet) and post results? Maybe someone will create a util where you can nandroid your current kernel and select the patch file and it will do the patching for you and create an update.zip that you can easily flash. I suppose there aren't significant differences in the yakju and takju kernels.

Thanks so much for the effort.

Update: tried flashing via twrp but it says "failed", any ideas?
[Samsung Galaxy Nexus] mthous01:
http://db.tt/fMCTLP5P

Bad zip, try this one.
[Samsung Galaxy Nexus] ghostofbunuel:
Thanks, I will post my results later on in the week when I get the cable.
[Samsung Galaxy Nexus] ghostofbunuel:
Kernel idea

Hey - I was looking at this kernel: http://xdaforums.com/showpost.php?p=31467636&postcount=1

Wouldn't this work - I'm using Mmuzzy which is aosp? Just for future reference so I wouldn't have to bother you for a kernel update. It says it supports "OTG Host Mode On Charge".

Thanks - I'm still waiting for my cable from china!
[Samsung Galaxy Nexus] DoesntPostAThing:
It should work. I'm using AK right now, but don't have a y-cable. If anyone could tell me where to buy one cheap that'd be great. I'm in Canada but I live close to the US border so shipping to US is ok. The eBay link posted a few pages ago sadly expired :(
[Samsung Galaxy Nexus] ghostofbunuel:
Here's one that was tested: http://xdaforums.com/showpost.php?p=37094582&postcount=8

Still haven't got my cable - I saved some bucks by ordering from China but man the wait is long for shipping. Should've just ordered it using amazon prime. I have a cowon x7 but this would be a good backup in case it goes out.
[Samsung Galaxy Nexus] DoesntPostAThing:
Thanks, but how does that work? It has a male micro-USB to go into the phone, but only one female USB and no female micro-USB?
[Samsung Galaxy Nexus] ghostofbunuel:
I think it works like this:

http://www.diigo.com/item/image/3lgr5/7jke

The power source (left) must be plugged in first.
[Samsung Galaxy Nexus] DoesntPostAThing:
Hmm, I see. It's not long enough though? Computer probably can't provide enough power, and it won't reach the wall.
[Samsung Galaxy Nexus] highvista:
Here's the cable I use. There's no problem with cable length, because your regular microUSB cable can be connected to your computer or a wall adapter and then into this cable to provide power to the phone and your OTG USB device.

http://www.ebay.com/itm/Micro-USB-H...486949?pt=PDA_Accessories&hash=item1e76395225

I've purchased several of these from this vendor, and the time from order to arrival from China has been fairly reasonable.
[Samsung Galaxy Nexus] DoesntPostAThing:
Thank you, this was exactly what I was looking for.
[Samsung Galaxy Nexus] ghostofbunuel:
I can comfirm that it works with the dummy kernel just great but only flash drives and a usb sd card reader that I tried. I couldn't get the external hdd to mount - it just kept trying to mount over and over every few seconds but never worked. Maybe it needs more power though one is an enclosed ssd. It charges and reads files great though. I'll try.a powered USB hdd this weekend and see if that's the issue. Still you could always get a 128gb flash drive or sd card if needed.
[Samsung Galaxy Nexus] DoesntPostAThing:
Awesome, I just ordered this. Hopefully it arrives soon. I need it to listen to music on my upcoming flight from Canada to China this summer. Would've brought my skyrocket because I can charge and listen at the same time, but my GNex is unlocked so cheaper calling in China :good:
[Samsung Galaxy Nexus] teq1lla:
Yeah, i have the same pro problem.

Com.android.phone error on boot.

Gnex Gsm cyanogenmod 10.1
[Samsung Galaxy Nexus] pedrolane31:
Thank you Rotary Heart for this project ! It worked perfectly on my stock nexus 4.2.1

I switched recently on 4.2.2 and tried to build a boot.img on my own, without any success (my phone is stuck at the boot, it displays the Google logo and nothing more).

Here are the steps I followed to make the boot.img :

#git clone https://android.googlesource.com/device/ti/tuna
#cd tuna
#git log -1 kernel
commit 3b26b79f592df5a739c1259c82b17f031526cfa9
Author: Todd Poynor <toddpoynor@google.com>
Date: Fri Nov 2 11:20:49 2012 -0700

tuna: prebuilt kernel (wifi wakelock revert, uname security fix)

[B]d5a18e0[/B] Revert "net: wireless: bcmdhd: Fix WD wakelock behavior"
0eaeacc use clamp_t in UNAME26 fix
4c15176 kernel/sys.c: fix stack memory content leak via UNAME26

Bug: 7459403, 7448654
Change-Id: I166daa13cfef2fec17385bac71d768a2726c7e59
#cd ..
#git clone https://android.googlesource.com/kernel/omap.git
#cd omap
#git checkout d5a18e0
#cp ../board-tuna-connector.c arch/arm/mach-omap2/board-tuna-connector.c
#cp ../fsa9480.c drivers/misc/fsa9480.c
#export ARCH=arm
#export SUBARCH=arm
#export CROSS_COMPILE=arm-eabi-
#make clean
#make tuna_defconfig
#make
#fastboot flash zimage arch/arm/boot/zImage

The flashing process went good but... the phone remains stuck...

Am I wrong ?

I also tried to build a boot.img from the boot.img of the google factory image (4.2.2) with no success...

#./unpackbootimg -i boot.img /////the boot.img is the one from the factory image
#BASE=$(cat boot.img-base)
#PAGESIZE=$(cat boot.img-pagesize)
#CMDLINE=$(cat boot.img-cmdline)

#./mkbootimg --kernel ../omap/arch/arm/boot/zImage --ramdisk boot.img-ramdisk.gz --cmdline "$CMDLINE" --base $BASE --pagesize $PAGESIZE -o boot_patched.img
#sudo fastboot flash boot boot_patched.img

Can you tell me the right procedure or build a boot.img base on the google stock image 4.2.2 ?

Thank you very much
[Samsung Galaxy Nexus] pedrolane31:
levedish was

Ok, I found how to make it work !!!

I replaced

git checkout d5a18e0

by

git checkout 9f818de

9f818de is the most recent commit found here : android.googlesource.com kernel omap +log android-omap-tuna-3.0-jb-mr1.1

Then I flashed my zImage and my phone boots !

In attacment, I give you the zImage compiled for android 4.2.2 stock
[Samsung Galaxy Nexus] tigrone:
Hi there, I was wondering I have been implementing your patch #3 (as can be found at your github https://github.com/caioketo/journeymanmod) in my own kernel, and what I did notice on my GNex was the following :

- now the device actually charges when connected via a OTG y-cable ! Which is great, because it wasn't charging before the patch ! I was wondering though the attached devices where do they get their power supply from ? From the device or directly from the via OTG attached power supply ?

- unfortunately a device which was working just fine before the patch ( a usb hub with integrated network controller) simply does not "power on" anymore ! The usb ports actually work (tried those with a 4GB usb key) but the networking part of the hub does not. Any idea what this could be ? Isn't there enough power ?

Thanks in advance for any help you can provide !
[Samsung Galaxy Nexus] highvista:
I'm still running Android 4.1.2 on my Galaxy Nexus, but I will build kernels for 4.2.2 that Rotary Heart can post in the OP in the near future...hopefully either this or next weekend.
[Samsung Galaxy Nexus] Rotary Heart:
Just let me know and I will upload them
[Samsung Galaxy Nexus] tigrone:
any change you guys know if beacuse the device is loading itself after applying patch #3 it cannot supply enough to external devices (like an external 2.5 inch USB harddisk) ? And because of the fact it's connected through a OTG Y-cable shouldn the HD be powered from the charger itself ?
[Samsung Galaxy Nexus] aadiflesher:
Hello!

I want the same thing, use a mouse, keyboard, HDD or USB stick and still be able to charge my phone. So I made an OTG cable. (see attached images)

And it works, I am able to connect a USB stick and charge my phone at the same time.

I am also using this ROM

If you want to try it, tell me if it works for you too.

Thanks! :)

If you want to make the cable yourself you must see image no2. Remember to make the connection between pin no5 GND and no4.
[Samsung Galaxy Nexus] Rotary Heart:
And it worked eithout the mod? Also what device you have? Kernel? That may help a little.
[Samsung Galaxy Nexus] aadiflesher:
I am using the cable from the first image, the Y cable. The second picture is just to show that you have to connect the two pins on the microUSB end of the cable (the end that you plug into the phone) You strip the end and with a small wire just connect pin 4 with 5.

I have a Samsung Galaxy Nexus i9250.

Using this ROM

I don`t know what kernel is in there. But I did nothing to the kernel, just installed the rom.

I think this method is cheaper than buying the OTG cable.

You need a normal microUSB and a usb extension cable.

Hope that helps. I want to know if this works for other people and if it is safe to connect the power and other device like keyboard, mouse, USB stick on the other end.
[Samsung Galaxy Nexus] highvista:
I've uploaded the zip files. They are attached to my original post once again, at

http://xdaforums.com/showpost.php?p=32474150&postcount=70

I haven't been able to test them, but the only change is the kernel source, so all should be well.

Many thanks!

---------- Post added at 06:42 AM ---------- Previous post was at 06:31 AM ----------

Thanks for posting your experience with building a kernel from the latest source code. Last weekend when I was working on building the kernel, I ran into the same problem as you, where the latest commit point was being reported as "d5a18e0." You are correct that "9f818de" is the correct commit hash number. I used this to checkout and build the kernel.

This weekend, I looked at the git log once again and this time it reported the 4.2.2 commit point of "9f818de". I'm guessing that the newest code wasn't available until sometime this week.
[Samsung Galaxy Nexus] Rotary Heart:
Updated OP with new files. Sorry for the delay, I don't know what happened that I miss the update post.
[Samsung Galaxy Nexus] highvista:
Thanks, RH!
[Samsung Galaxy Nexus] highvista:
Rotary Heart, could you replace the ZIP files for JDQ39 that you just attached to the OP with the two that are now attached to the post linked in my sig? I realized that they weren't build against the boot images from the factory JDQ39 images and so might create issues. The new ones are built properly. I'm also now using the takju one, since I've upgraded to Android 4.2.2/JDQ39. Thanks!!! :)
[Samsung Galaxy Nexus] Rotary Heart:
OP updated :)
[Samsung Galaxy Nexus] PieterAelse:
Thank you so much highvista for investigating and making these kernels! I'm currently using V4 on my Galaxy Nexus (GSM/yakyu) with many joy :victory:. I'm communicating with an USB device while charging using one of the USB OTG Y-cables.

Unfortunately I noticed that it doesn't charge when plugging it in while USB OTG is already plugged into phone. I saw your statement on that saying that the VBUS doesn't change. Have you made any progress on this or is it really impossible to make this real-life situation possible.

Furthermore I read the whole thread and saw some pogo-pin mentioning. I have a original (desktop) dock for charging trough pogo-pins and originally wanted to use your kernel to be able to use USB OTG while charging using the dock. I've cut a slice out of the dock to do this. Unfortunately USB OTG and pogo-pin charging is not working with the original kernel or your kernel.

Can you further investigate this situation and make a kernel which makes it possible? I have a unlocked GN, dock, normal USB OTG cable and Y-cable so I'm fully capable of testing anything if that helps you!

Thanks in advance, I really hope OTG and dock/pogo-pin charging can be made because I really need it! :D
[Samsung Galaxy Nexus] highvista:
It's great to hear that the kernel mod is working out for you, for the most part. I take advantage of it almost every day by connecting a 64GB flash drive to my GN and listening to music for hours while my phone is being powered via the y-cable.

I haven't done any more work on engaging charging when USB OTG is already in use. I'd have to review my notes but, as I recall, this is probably impossible without significant re-engineering of kernel code, which is beyond what I have time to do.

I also made a cut-out in the side of my dock to give access to the USB port on my phone when it is docked and found that charging via the pogo pins does not happen when USB OTG is engaged. Further kernel modifications might make charging possible, but this isn't something I'll have time to look into, either. Unfortunately, other projects are calling and taking up my free time.

I'm sorry to give you a negative report on the work you'd like to see done. :( Do let me know if you have any other questions.
[Samsung Galaxy Nexus] PieterAelse:
No sweat man! I understand that other projects take up time.

I'm happy that my problem of OTG and charging at the same time is basically fixed with use of your kernel :)
[Samsung Galaxy Nexus] PieterAelse:
I'm thinking about looking into the source and editing it myself. Can you maybe give some tips/advice/notes to accomplish the mentioned features?

Also, to set-up a build environment; can I use the source code at the GitHub page (https://github.com/caioketo/journeymanmod) with the updated two files of V4 in the zip or do I miss anything when doing this? (maybe a makefile or something).

Maybe it's possible to use your setup for compiling?
[Samsung Galaxy Nexus] PieterAelse:
*small kick*
[Samsung Galaxy Nexus] PieterAelse:
I'm currently trying to increase my battery-time because the connected device consumes up to 45mA.

Can you quickly tell me if it's possible to underclock the CPU with your kernel? I've gained root access and I've tried some apps to scale the CPU, but I don't think it's working. Is it true that the kernel needs to support CPU clocking? :confused: