yashsingh1/xdaforums huggingface dataset:
[Nexus 4 Original Android Development] AdrienC:
I was noticing that the device was on several times I took it out of the pocket. Disabled Xposed and nothing. Decided to try another kernel, fixed.

So I found out why, the doubletap to wake was enabled.

Solution?

ADB, Create a Tasker Shell task or terminal emulator and:

echo N > /sys/module/lge_touch_core/parameters/doubletap_to_wake

WIN! :laugh:
[Nexus 4 Original Android Development] Renecek:
Will it work with this cable please? Using CM 10.1.3 Stable with no custom kernel
[Nexus 4 Original Android Development] zaptac:
Short answer: no

Long answer: Read the first post

-- Send by me.
[Nexus 4 Original Android Development] goofball2k:
hopefully not too long before a 4.4 compatible kernel is released. :)
[Nexus 4 Original Android Development] Silicon Knight:
I 2nd that, I got a hub that came with my old rockband xbox 360 game lol (hate that game lol) it has it's own AC Adapter and 4 2.0 ports on it and works perfect for this. not feasible for on the go tho haha. was bummed when i first got this phone cause Phone Arena lists it as USB Host enabled.

Has anyone tried using a PS3 controller via bluetooth ? Did that with the My Note 3 and SIII. pretty fun.
[Nexus 4 Original Android Development] Sillik:
I did.

But it is easier by Bluetooth, using the sixaxis app. :)

Edit: oops, misread. I thought you meant by USB.

Then the answer is simply: "yes"
[Nexus 4 Original Android Development] GottZ:
works fine on paranoid android. big thanks!
[Nexus 4 Original Android Development] fuze_freak:
Works great with cyanogen 10.2 nightly

---------- Post added at 10:52 PM ---------- Previous post was at 10:05 PM ----------

One question I'm thinking about buying a micro SD with the USB adapter so I can use it both on my nexus 4 with this kernel patch and my other android devices that have micro SD support. But does anyone know if a 64gb micro SD class 10 would work on the nexus 4?
[Nexus 4 Original Android Development] GottZ:
depends in what file systems your Rom supports. fat32 has a limit of around 40 GB i think.

if you Format it ext2 or 3 you would most likely be unable to usw the card in your PC in case you are running Windows.
[Nexus 4 Original Android Development] tej12345:
Does this work with miui??
[Nexus 4 Original Android Development] Silicon Knight:
Fat32 has a 2TB limit normally, but the SDHC limits it to 32GB exactly. It's pretty lame. And you can't have a single file that is more then 4GB.*
[Nexus 4 Original Android Development] Sacob:
franco has released a 4.4 update for his kernel. hope to see an update here too :D
[Nexus 4 Original Android Development] ziddey:
ziddey-otg-krt16s-TEST.zip

This is a first build, but everything seems to be in order. Note I have only tested on the stock rom, and it probably won't work on CM11 or any of its derivatives if they've kept the additional kernel commits. All bets are off at this point for custom roms, so have a safety plan.

The usb/otg driver (un)fortunately remained unchanged since 4.3, so the same hacks are able to work just fine. The kernel is based on 4.4r2, KRT16S. There are a few newer commits on google's git, one of which is an update to the prima wireless drivers, but rather than risk incompatibility, those are not being included. If anything, this may be the "stock" release, and I will continue to focus on Franco or another custom kernel (whatever I decide on using).

It looks like 4.4 implements a little more security by running all storage devices through FUSE: http://source.android.com/devices/tech/storage/config-example.html. I've adjusted the scripts accordingly, but since this may not be backwards compatible with 4.3, the current r193 and stock builds are now final.

Because of this new method, the permissions workaround previously required for write access may no longer be needed. I haven't tested that yet, so it's included for now.

I precompiled a new storage_list.xml based on krt16s, but haven't located the hex values for the strings (Internal Storage, USB Storage), so they will NOT be modified during the flash. This is fine for the stock rom, but may cause (hopefully superficial) issues with custom roms. I'm going to try to modify the script to locate these values on the fly, so I won't have to manually do it every time for a new storage_list.xml.

Because of a few changes I made in implementation, the revert zip will NOT work for this build. As usual, reflash the system and boot.img to manually revert.

I can't wait to get off stock rom. This is a nightmare.
[Nexus 4 Original Android Development] Silicon Knight:
I don't get why Phone Arena says this phone is USB Host compatible. I still would've got the phone obviously. But I got all stoked about being able to do that. My S4 and Note 3 did it and it was awesome. Sold the Note 3 for the nexus 5 and got this to use until they were in stock (Nexus 5 gets here tomorrow and this will become my Dev phone) and bought a new OTG cable for it and then I find out you have to patch the device and it needs It's own power source. Not a big deal, just annoying I guess, not really conducive to On The "GO" lol

Mostly I just think a site like phone arena that people use to base their buying decisions off of, should be more accurate about specs/features. Especially one like OTG Host, which is a pretty big deal IMO. I don't ever wanna have a phone without it.

---------- Post added at 07:18 PM ---------- Previous post was at 06:33 PM ----------

Thanks bro downloading now and giving it a go. Will post results

Update - Had to wait til I got home and I am having trouble with drivers for my Nexus on my new install of Windows 8.1 Pro. Damn you windows. This is why I got a PS4 and not a Xbox1 lol

I will post my results as soon as I figure this issue out
[Nexus 4 Original Android Development] TheQuarterMile:
Will a Franco 194 build come any done soon?
[Nexus 4 Original Android Development] ziddey:
ziddey-otg-krt16s.zip

Because of a little mixup, the test build was actually based off KRT16O. This one is true KRT16S and should patch the storage strings on the fly.

Rather than add the usbdisk commands to init.mako.rc, it will now be imported via a standalone file, init.mako.usbdisk.rc:

# USB Storage -ziddey

on init
mkdir /mnt/media_rw/usbdisk0 0700 media_rw media_rw
mkdir /storage/usbdisk0 0700 root root

export SECONDARY_STORAGE /storage/usbdisk0

# Support legacy paths
symlink /storage/usbdisk0 /usbdisk
symlink /storage/usbdisk0 /mnt/usbdisk

service fuse_usbdisk0 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/usbdisk0 /storage/usbdisk0
class late_start
disabled

Everything should work as before.

Note that this is an "anykernel" in that it doesn't come with a base ramdisk. This is fine for stock, and may even benefit some roms, but know that a "reset" may be necessary if switching from a full boot.img (like Franco).

I gotta go for now. Will work on Franco tomorrow.
[Nexus 4 Original Android Development] ziddey:
4.4: 2013.11.21 1922ET r194: [KRT]

Franco. No CM support.

As mentioned in the last thread, if switching to the modded stock kernel, you will need to flash a reset boot.img first (i.e. the stock boot.img). Otherwise, Franco's modded ramdisk will remain.
[Nexus 4 Original Android Development] TheQuarterMile:
Thanks a tone for 194!
[Nexus 4 Original Android Development] Sillik:
Hello,

I'll post here since my post doesn't seem to get much visibility in the recovery thread:

http://xdaforums.com/showpost.php?p=47656918&postcount=26

Has anyone succesfully used the recovery patch on the latest TWRP?

I read somewhere it uses an updated kernel with some SELinux stuff in there so I'm not sure a patched TWRP will be able to flash a kitkat rom...
[Nexus 4 Original Android Development] Silicon Knight:
New kernel works. Plugged in a memory card reader. Worked great. Thanks bro !
[Nexus 4 Original Android Development] ziddey:
Try it and report back. Or update the kernel to the modded KRT16S one.

For what it's worth, I used the r193 kernel with multirom and was able to flash/boot one of the early kk builds over usb. I'm not too well versed with SELinux.
[Nexus 4 Original Android Development] Sillik:
I'll try something like that.

But I'm waiting for a custom rom like PA or CM to make the jump...
[Nexus 4 Original Android Development] krups:
This works perfectly over Stock Android 4.4. Used manually patched y cable. Tested Flash drive & logitech wireless kb/ms. All working good. Thanks [MENTION=584916]ziddey[/MENTION]!
[Nexus 4 Original Android Development] nigelhealy:
works perfectly with NTFS drive on my Nexus 4.4 with a few tweaks

Installed ziddey-otg-krt16s.zip on my rooted Nexus 4 4.4 KRT16S. It did not recognise a large NTFS drive initially, installed Stickmount, still didn't work, copied the ntfs-3g file to /sdcard, still didn't work, then did a chmod 755 /sdcard/ntfs-3g then it worked!

The Android says empty filesystem and do I want to format, but Stickmount works.

So that's a 500GB USB harddrive now works.

I assume a FAT drive would have worked out-the-box just with the zip? I later tried a 4G dongle which has a microSD slot with a 8GB FAT-formatted card and the SD card was recognized by both Android and Stickmount.

I also thought I'd try, as it works on my Nexus 7, the PPP Widget to see if my USB 4GB would work as 4G, it was not detected, pity but not really needed on a phone (useful on a wifi-only tablet though).

Good work and I don't see any reason anyone to not install.
[Nexus 4 Original Android Development] sga999:
Maybe I'm having a similar problem. I have a micro sd card reader attached with a micro sd card inserted. A few hours ago, I was on 4.3.x, and if I used ES File Explorer to look at "Local", it showed the card as usbdisk0, and clicking on that displayed its contents. It has worked like this for many months.

Then I went to kitkat, installed this ziddey 194 kernel, and tried the same thing, but it displays an error: "/mnt/media_rw/usbdisk0 is not found".

However, if I start at the root under "Local" instead, then go to /mnt/usbdisk, everything is fine. It certainly isn't difficult to access it this other way, but I thought I'd mention it anyway. ziddey, you said something about the permissions workaround for write-access. But I'm not trying to write to it, and besides, you said you haven't changed that code yet, so I guess that isn't pertinent.

EDIT: ziddey, I forgot to ask about TWRP. I was able to see the external sd card while in TWRP and could even do a backup to it. Yet I had NOT installed recovery.zip yet. Shouldn't we always have to reflash that after flashing a new kernel?
[Nexus 4 Original Android Development] nigelhealy:
Why can't Franco kernel have this?

So... this is an either/or, I can ROM manager apply Franco's kernel when I want its features (E.g. headphone boost) or apply this Ziddey kernel if I want to connect USB storage? Why can't we have both?

---------- Post added at 09:50 PM ---------- Previous post was at 09:24 PM ----------

I was confused, if I use this one then it is Franco's current N4 4.4 r194 with this USB power change? It works, I got all of the Franco features and USB drive support.

It is very finnicky on timing and sequence for my USB harddrive. What works for me is power into Y-cable, then harrdrive into Y-cable, count to 10, then connect the Y-cable to the Nexus 4. That 10 seconds for my harddive seems needed, if I plug in hdd and then immediately plug Y into N4, it doesn't work.

Using flash drive, it seems less tempermental can plug in almost any sequence and seems to work.
[Nexus 4 Original Android Development] ziddey:
I believe that's actually the desired effect. /mnt/media_rw/ is new in 4.4 and is not designed to be directly accessed. Instead, after vold mounts the drive there, it is FUSE mounted to /storage/usbdisk0, which is what's accessible. Note /usbdisk and /mnt/usbdisk are symlinks which point to /storage/usbdisk0.

Why ES can't access /mnt/media_rw/, especially if it has root privs, is beyond me. It may be similar to TiBu requiring you to point to /mnt/shell/... vs /storage/emulated/... vs /data/media/... or whatever (I don't use TiBu but I've seen people crying about it incessantly for some time).

I don't know how ES is determining what's appropriate to show in "Local" (/sdcard is a symlink to /storage/emulated/legacy whereas ES's Local has /storage/emulated/0). Further, both EXTERNAL_STORAGE and SECONDARY_STORAGE are properly set. Maybe it's an ES issue and they can fix it? It's possible I'm not implementing it correctly, but based on http://source.android.com/devices/tech/storage/config-example.html everything seems appropriate (at least if treating a usbdisk like an external sdcard).

At the end of the day, DRM is taking over and we are losing control of our own devices.

As for the media_rw workaround, it looks like it's still applicable in 4.4. As http://source.android.com/devices/tech/storage/index.html shows:

Looks like it has more to do with apps no longer needing WRITE_EXTERNAL_STORAGE at all, as long as they're restricted to their own directories.

About TWRP, it has its own kernel. The recoverymod simply takes the "main" kernel and copies it to the recovery's. It will stick so long as you don't reflash your recovery.
[Nexus 4 Original Android Development] msihp:
Hi ziddey!

I have some (probably noob) questions. I on my Nexus 4 I have SlimKat 1.4 Alpha (KTR16S). I heard that your kernel is based on franco one, that supports kexec-hardboot patch. I tried the test build, and the OTG is working but I need also this kexec patch. How can I manage this? What version do I have to download?

I'm little scared because I have broken vol controls and I can't go to fastboot if something goes wrong.

Cheers, msihp
[Nexus 4 Original Android Development] ziddey:
I've been building both off the stock kernel sources as well as Franco's. You've installed the stock one (test one at that).
[Nexus 4 Original Android Development] Overdose1986:
I have a externally powered usb dock for xperia

Do you think it may work?
[Nexus 4 Original Android Development] Sturdy_99:
Help need

I have a otg cable flashed your recovery mod and francos modded kernel...usb gets recognized but im not able to use usb says invalib path in es file manager...u Have given the fixes bt not able to understand did all the fixes but cant modify the storage.xml file...can someone please make a flashable zip of all the fixes..im on kitkat stock with your kernel..:(
[Nexus 4 Original Android Development] Sturdy_99:
Again help..

i reverted back to 4.3...very thing great now usb is reading...I just want to use this pc controller with otg..the red light is working on pc but when i connect to otg no red light....i did a lot of research...but did not got anyhting...can someone please help me...any tips any apps to get it work....Please help..Thank you
[Nexus 4 Original Android Development] sanket_gupta96:
Usb charging

Guys please help with one thing . Please tell me how to make script of stop usb charging when i am using usb otg !! i dont know how to make scripts !! completely noob about all this stuff ! Thanks !!
[Nexus 4 Original Android Development] HighRidas:
I'm getting a bootloop after the "android is optimizing applications". Tried a full wipe and install on both the franco and stock version same bootloop. do i have to install the recoverymod? or is it because im using a 4.4 that i built from source? My build is from Nov.17th

Edit: answered my own question. kernel works on stock(google) but not stock(source build)
[Nexus 4 Original Android Development] rohit297:
Hello, Sorry a very noob question, can anyone guide me that what patch i should flash and other things i need to do, i am on stock 4.4 with franco kernel 194, does it replaces my kernel, n also usb gamepads works or not with this workaround
[Nexus 4 Original Android Development] nigelhealy:
I can help a little. Download this file http://d-h.st/m2k and put it on your N4 say at /sdcard.

Recommend you have "ROM Manager" app installed, and let it install customer recovery. Then get ROM manager to install the file you downloaded above.

Then you're running Franco's r194 just with the one modification for USB powered Y-cable support. If in future you get a Franco auto update it will then lose this modification, unless of course Franco can incorporate this mod into his future kernels. You can get it back easily enough by telling ROM manager to the above again. Your need for USB storage support is unlikely to be needed frequently so you can collect a few kernels with different features and swap between them as you need a specific feature at a specific time.
[Nexus 4 Original Android Development] rohit297:
Okk thanks for the help, n one thing more i have a otg cable but confused that how will i use that with usb y cable, i mean usb y cable doesn't have female port then where i will connect my pen drive

---------- Post added at 06:07 AM ---------- Previous post was at 06:05 AM ----------

N also, i am on latest twrp recovery, do i still need to flash a custom recovery through rom manager
[Nexus 4 Original Android Development] nigelhealy:
Well if you got and know how to use twrp recovery you can use that but you SAID you were a noob so...

Y-cable, is has micro-usb female to take power, micro-usb male to plug into N4 and USB female to take your pen drive.
[Nexus 4 Original Android Development] rohit297:
Means i don't need to flash custom recovery over twrp, i just need to flash this modded kernel through twrp,

But the usb y cable described in the op has two male usb ports and one female mini usb port, or is there any other
[Nexus 4 Original Android Development] nigelhealy:
I don't know you're seeing but at the first post, the first image, from left to right you got a male microUSB, plugs into N4, the female microUSB plugs into your power, and female USB plugs into your pen drive.

The lower pics give you a more complicated to build the same thing which I'm not sure is a good idea. The top Y-cables are cheap and simple, make sure you buy based on a recommendation.
[Nexus 4 Original Android Development] cobyman7035:
Can anyone write to an NTFS drive?

Via Google voice Δ |\|€×u$™ 7 FHD on Tapatalk²
[Nexus 4 Original Android Development] rohit297:
Thanks for ur help bro, i got it working, my pen drive and mouse is working great, but why my game controller is not working, it used to work on my previous phone that support otg out of the box, can u help me in this regard
[Nexus 4 Original Android Development] Sturdy_99:
I am in same problem as u.....my also controller does not get started....i have a wired pc controller....i want to use that..
[Nexus 4 Original Android Development] nigelhealy:
Nope, tried everything

stickmount on its own with ntfs-3g in /sdcard

stickmount with ntfs-3g in $PATH /system/sbin and chmod 777

Paragon NTFS app on its own

Paragon and Stickmount

terminal and remount the ntfs readwrite

ensuring the mount point is read-write itself

So only NTFS read-only here. There is a video claiming read-write.
[Nexus 4 Original Android Development] RedGoblinz:
Has anyone gotten OTG working on Purity 4.4 with Hellscore b42-t4?

It doesn't seem to work.
[Nexus 4 Original Android Development] TheQuarterMile:
First when you use to connect a pendrive there use to be a pop up but with 194 there seems to be no automount .. Infact had to use Stick Mount and manually mount it.. Have I missed something or three have been some changes?
[Nexus 4 Original Android Development] nigelhealy:
FUSE was introduced in earlier Android kernel versions. I was trying to figure why NTFS read-write not working with Paragon and I was looking for FUSE kernel support. Does Franco not compile in FUSE? Hence with this modification of Franco's kernel it similarly lacks FUSE? That would explain also why with this kernel you have to use stickmount?
[Nexus 4 Original Android Development] rohit297:
We both are sailing in same boat, just crying, badly want to use my pc game controller with my beloved nexuss
[Nexus 4 Original Android Development] Sturdy_99:
see i think this problem could be because the controller must not be getting enough power....bcoz our nexus is charging when we connect it....try disabling the charging.....im a bit busy..:good:
[Nexus 4 Original Android Development] Sacob:
franco.Kernel - r195 is out :D
[Nexus 4 Original Android Development] nigelhealy:
yep

Yep I'm seeing it on my N4. Reading the changes is seems worth having with the ziddey mods.
[Nexus 4 Original Android Development] Sacob:
indeed
[Nexus 4 Original Android Development] ziddey:
4.4: 2013.11.29 0219ET Franco r195: [KRT]
[Nexus 4 Original Android Development] nigelhealy:
works

It works.

I still have issues with it takes a few tries at cable connections and trying different sequences to get it to work eventually, I don't think its this version issue but timing/cable/method issues. A reliable sequence, pause times, needs evolving. USB stick worked at 3rd insertion, USB harddrive at 6th insertion.
[Nexus 4 Original Android Development] karol1981:
Thanks ziddey , everything working :)
[Nexus 4 Original Android Development] ziddey:
4.4: 2013.11.29 1758ET: [franco r195-CM]

This is a test release for CM users. Because of ramdisk incompatibilities, I created a script to try and apply franco's ramdisk changes to any ramdisk:

#!/sbin/sh
# modrd.sh by ziddey
# attempts to apply franco's ramdisk mods to any ramdisk
# based on diff of factory krt16s ramdisk vs franco
# with check/mod for init.cm.rc

cp ../fkbootscript.sh sbin/
# init.mako.rc
sed "/#/! {/dev\/socket\/mpdecision/ s/^ / #/g}" -i init.mako.rc
sed "/vibrator/ s/70/100/g" -i init.mako.rc
sed "/ondemand/ d" -i init.mako.rc
sed "/^on charger/,/^on / {/write/d}" -i init.mako.rc
# must use /class/ since +1 doesn't work with busybox sed:
sed "/#/! {/service thermald/,/class/ s/^/#/g}" -i init.mako.rc
sed "/#/! {/service mpdecision/,/class/ s/^/#/g}" -i init.mako.rc

sed "/service fkbootscript/,/gsm.sim.state=READY/ {/gsm.sim.state=READY/! d}" -i init.mako.rc
sed "/gsm.sim.state=READY/ i\\
service fkbootscript /sbin/fkbootscript.sh\\
class late_start\\
user root\\
disabled\\
oneshot\\
\\
on property:sys.boot_completed=1\\
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor \"interactive\"\\
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor \"interactive\"\\
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor \"interactive\"\\
write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor \"interactive\"\\
start fkbootscript\\
write /dev/cpuctl/apps/cpu.notify_on_migrate 1\\
" -i init.mako.rc

# init.rc
sed "/randomize_va_space/ s/2/0/g" -i init.rc
sed "/sys\/devices/ s/0660/0664/g" -i init.rc
if [ -e init.cm.rc ]; then
sed "/sys\/devices/ s/0660/0664/g" -i init.cm.rc
else # cm should already have the following...
grep -q "scaling_governor" init.rc || sed "/chmod.*scaling_max_freq/ a\\
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq\\
chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq\\
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor\\
chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor" -i init.rc
fi

This was made by comparing franco's ramdisk with the factory krt16s one. However, it is impossible to account for other ramdisks and their differences, so be prepared if something goes terribly wrong. I am not using CM11, so these are _untested_.

CM "compatibility" is achieved by cherry-picking the two YCBYCR overlay commits.

It should go without saying that you will be in a world of hurt if you flash this on a non-CM (or derivative) ROM.
[Nexus 4 Original Android Development] ziddey:
4.4: 2013.11.30 0258ET: [aosp r3]

No changes since last aosp build except for addition of kernel modules (cifs and ones for gamepad support). As usual, these are not loaded by default and so will have no tax if you don't use them.
[Nexus 4 Original Android Development] tarroyo:
Good looks on this 4.4 mod [MENTION=584916]ziddey[/MENTION] working great for me.

Seeing this as well, what I had to do was disconnect then reconnect the charger for the flash drive to be recognized.