yashsingh1/xdaforums huggingface dataset:
[Nexus 7 General] Turbotab:
Whilst looking at the updated 4.1.2 Kernal sources Git, I noticed the following entry related to mmc chip. There are few more similar entries, might be interesting for the low-levels guys.

https://android.googlesource.com/kernel/tegra/+/android-tegra3-grouper-3.1-jb-mr0

commit	009b6d1b2b35a7fac24ec3cd829112e4950feecb[log]

author	Ban_Feng <Ban_Feng@asus.com>	Wed Sep 26 10:44:07 2012 +0800

committer	Ramanan Rajeswaran <ramanan@google.com>	Wed Sep 26 12:37:31 2012 -0700

tree	7e7764c3098cf6fa100063822bedaf1922d33117

parent	3de09ec8e73b7352c37f50a40d696f20be454b8b[diff]

mmc: card: Bypass discard for Hynix and Kingston

In order to change mount option,

issuing discard request by chip to eliminate performance drop.

Bug ID: 7158066

Change-Id: Ia55bce8ae29c1751f180d76164e1ac1753af89f0

drivers/mmc/card/block.c[diff]

1 file changed
[Nexus 7 General] Jay Aristide:
I was thinking exactly that about the CM night lies, and suspected as much about the kernel build affecting the effectiveness of that script. Out of thanks for now, or I'd toss you one. Here's a ^5 as well.

On a side note, you seem to be quite the proficient when it comes to things like this.. What's the chance someone could convince you to build _motley's kernel based n 4.1.2 sources? He appears to be indisposed for some time, now..
[Nexus 7 General] styckx:
Definitely better results after a wipe and only having a fresh 4.1.2 flashed from the factory images.

After completely fresh flash of the stock 4.1.2 images w/ my 60+ apps restored and 100s of wallpapers (10GB free space)

I got nearly identical results 6 times in a row. 100% consistent FAST results

27 minutes later with 1.6GB free space

1st test

7 more tests later (and still only 1.6GB free), each one progressively getting better and better things are balancing back out now and normal operating speeds peak back out. Think I'll stick with only booting stock for now till the development scene catches up with things.
[Nexus 7 General] qhinton:
I had issues before the 4.1.2. My tab was super slow as I only had 1 GB left. Now I'm getting little to no lag its smooth again.
[Nexus 7 General] Turbotab:
If this is related to a very similar issue with Samsung devices (GS2 / G Note etc) a while back, which was never fully resolved, I will be pissed at Samsung.

The issue with the Galaxy phones was hard bricking when flashing under 4.0, not slow I/O due to a flawed emmc firmware. Entropy512 in particular spent a lot of time in discussion with Samsung about it, but afaik it was resolved. One of the reasons I sold my Note.

http://xdaforums.com/showthread.php?t=1698977&highlight=discard&page=66

Posts 659 & 660 both mention the DISCARD option, it seems that Sammy has been selling Flash with dodgy firmware!!
[Nexus 7 General] sark666:
I'm now on 4.1.2 and still lagging. Sequential/random writes are horrible. I went by previous comments and completely filled my device (it was almost completely unresponsive when full btw, don't recall that happening with gingerbread when I accidentally filled it) and then deleted those files to about 3 gigs free.

Sequential writes are now fine (10 MB, but random are still slow like .2 MB) I was hoping to not have to factory reset this but it sounds like that's what I have to do. I never have factory reset before, what exactly do I lose, apps, apps and data (my moves, music, books etc) or do I lose everything?

I really was hoping 4.1.2 would solve all my troubles. It's strange sequential writes got fixed.

If anyone else can suggest something to try, I'd appreciate it.
[Nexus 7 General] xopher.hunter:
Gingerbread???? Lol
[Nexus 7 General] mercado79:
sorry if this is a dumb question, but... how do you know if you have the samsung emmc?
[Nexus 7 General] Metallice:
I'm not entirely sure if it's the samsungs that have the problem. That's just an educated guess. To find out who manufactures your chip you just open up your nexus 7, remove the battery and speaker assembly, remove the copper shielding, disconnect the I/O cable, unscrew and remove your motherboard, and then flip over the motherboard and read what it says on the emmc chip.
[Nexus 7 General] TheRealCyberOptic:
I didn't check it yet, but I guess that you could look at dmesg, lsusb and lspci. With any luck you'll see the manufacturer.

---------- Post added at 09:42 AM ---------- Previous post was at 09:20 AM ----------

Yes, it can decrease performance until you reboot which will reset the DISCARD mount option. However there is no danger of data loss in any way. Discard option works also with my Q (4.0.4) and stock Nexus 7 (4.1.1). If DISCARD is not supported by the kernel, it throws an error at mount. If you are curious about getting deeper into the material you might want to check if TRIM actually works (for your convinience: http://techgage.com/article/enabling_and_testing_ssd_trim_support_under_linux/2 ).
[Nexus 7 General] Metallice:
I'm confused. I never said that there is any danger of data loss. I never said discard wouldn't work on your nexus q or on your nexus 7.

All I said is that it looks like discard functionality was added or fixed for Samsung EMMCs which explains why I and others would have had resets and lockup if we enabled discard on 4.1.1. You can enable discard on 4.1.1 without hard resetting? Well your nexus 7 probably has a Kingston or Hynix chip. Not everyone does.
[Nexus 7 General] ratson:
My findings:

latest Franco Kernel (r21) has full 4.1.2 kernel source merged and uses the new ramdisk, automatically mounts with discard.

if you don't want to use the dd method you can use the market app Forever Gone, it creates small files in a directory than deletes them, has the same effect.
[Nexus 7 General] TheScarecrow:
I'm in France with a UK purchased N7, and waiting for the OTA 4.1.2 update. I'm wondering if anyone has had this update OTA yet? Or am I just waiting because France always seems to be at the back of the queue (line in USA speak).
[Nexus 7 General] TheRealCyberOptic:
Just wanted to clarify the current knowledge - as there was a brick-thread referenced to earlier which was about samsung phones.

Discard was just added default on the mount, with a downstream ignore on non-Samsung drives. You actually could have modified the 4.1.1 boot files to achieve the same feature - but then you would be missing some other fixes that would improve the android experience ;)

Yes, I can enable discard on all my android devices (two N7, one NQ) without hard resetting, as long the underlying filesystem is ext4. Also both N7 have the lag issue, so I assume they have the Samsung eMMC built in.

Currently there not enough data to confirm the suggestion that remounting with the discard option will eventually lead to a hard reset. Do you have that issue? What kernel do you run? Did you reflash the full factory image before trying the remount? etc. you know what I am going for - just a guess which might be completely wrong: the hard reset might result from incompatible kernel modules that have been left after trying non-stock kernels.

But still I am curious about that remount-hardreset issue.
[Nexus 7 General] Metallice:
...as does does any kernel included with any 4.1.2 ROM and consequently every other custom 4.1.2 kernel if you flash them over a 4.1.2 ROM since they preserve the ramdisk.

Don't know what to tell you. Tried to mount with discard a while back on ParanoidAndroid as I thought the IO issue might have something to do with discard. Eventual hard reset after a a minute or so. Definitely storage related as file explorers would crash and then reset. Flashed pure stock, same thing. So I said oh well and continued on.

It works now so whatever. I though it may have something to do with the commit I referenced specific to Samsung emmc and discard (not the one that bypasses it on non samsungs)
[Nexus 7 General] dynamicpda:
I got the biggest boost copying fat nandroid backup files using 4.1.2 to fill up space and then deleting them. Nothing after that has increased Androbench speeds further.

That said, I did find the Forever Gone app in the Play store that seems to be a good alternative to the big file copy and the dd method.

https://play.google.com/store/apps/details?id=com.kovit.p.forevergone

The app shows free space counting down as it is being written over so you can track the progress. When it is done filling up free space, a button push clears it.
[Nexus 7 General] dmalovic:
Just a quick question. I downloaded the factory image, and am using the Stock 4.1.2, not rooted. I want to go to the out of the factory state like you. Is it enough to run the batch file from the zip file or do I need more?

PATH=%PATH%;"%SYSTEMROOT%\System32"
fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot erase userdata
fastboot flash bootloader bootloader-grouper-3.41.img
fastboot reboot-bootloader
ping -n 10 127.0.0.1 >nul
fastboot -w update image-nakasi-jzo54k.zip

echo Press any key to exit...
pause >nul
exit

My device is much faster with 4.1.2, but the random writes are still erratic and slow, so I would like to get all the speed I get. If I am not mistaken, after returning to factory, it is probably a good time for me to root, before I manually reinstall all my apps?

Thanks for your help!

Domi
[Nexus 7 General] _Gir_:
I noticed the trend as well. Asus needs to stop doing a crap job with their tablets.
[Nexus 7 General] DiCe!:
Anyone in the UK had an OTA update yet?
[Nexus 7 General] miscfiles:
I'm in the UK and still waiting...
[Nexus 7 General] ChrisM001:
Random writes are also slow in the delivery state and after a complete wipe. They reach the same level with 4.1.2. I think there is no possibility to improve them further. This seems to be the hardware boundary. But it's fast enough for me to work completely lag free.
[Nexus 7 General] TylerDurden1999:
Dont have the problem and i got 300 mb space free.
[Nexus 7 General] jonmorris:
When I first got my Nexus 7 it was extremely quick.. and the whole project butter thing was fantastic. Even if there are hardware limitations because of corner cutting to make it so cheap (and we knew or expected that at launch) as long as it consistently runs as it did out of the box - most people will be (or should be) happy.

I am not seeking an update that speeds the device up (you can always overclock the device if you so wish) but just makes it stable. I'm still waiting in the UK for the update and hope it comes before the weekend.

Another downside of the lagging is that if you attempt to use it with a Bluetooth keyboard, it is next to useless - missing out on keypresses, or doing the opposite and tyyyyyyyyyppppiiiiinggggg thhhinnnngggss liiiikkkeeee tttthhhiiss!
[Nexus 7 General] ChrisM001:
You will be satisfied with the update. Your Nexus will be as buttery smooth as it was when you got it.
[Nexus 7 General] joshtb86:
wow, 15 new pages in 2 days. did the 4.1.2 update fix the pronblem?
[Nexus 7 General] Metallice:
I dunno maybe read one of those 15 pages?

Ehh whatever. The answer's yes. I posted a very detailed write up on the changes and fixes a few pages back.
[Nexus 7 General] joshtb86:
not everyone has time to sit down and read all of the pages, but thanks, i aprpeciate it
[Nexus 7 General] TheRealCyberOptic:
4.1.2 discard + encryption

btw, anyone tried encryption performance yet?
[Nexus 7 General] miscfiles:
The update has just appeared for me in the UK. Downloading now...
[Nexus 7 General] TheScarecrow:
The update arrived in France too at least on my UK n7.
[Nexus 7 General] mercado79:
Thanks. dmesg came back with mmc prod_name = mag2ga. Couldn't find more info than that. Samsung has some mag2 emmc chips listed on their site, but didn't see this specific product code.
[Nexus 7 General] Jay Aristide:
MAG2GA is indeed Samsung NAND, as it's present in almost every Samsung mobile device made in the past year and a half. Don't think they would outsource something they make, themselves.

The odd thing is, neither of the tablets here in our house suffer from the lag issue, but both have this NAND...
[Nexus 7 General] mmaestro:
Just wanted to add my voice to those saying that 4.1.2 fixed my lag issues. Well, truthfully after a hard reset a few weeks ago and keeping my space empty, it never came back. But I just forced the OTA (cleared framework to do this), then used Forever Gone to fill and empty the space.

My sequential reads were ~10.5MB/s before, and they remain there after. But I went from 83.31 IOPS to 127.46 IOPS. It was noticable that while Forever Gone was doing its thing, it would fly through writing to the free space and then occasionally lock up for anywhere from 2-10 seconds, I assume hitting a spot in the storage that had had something in it previously and hadn't properly had garbage collection done.

Still, everything seems to be working well now. Better, even. It just seems that little bit snappier. Whether that's just 4.1.2 or the storage fix, I don't know.
[Nexus 7 General] mercado79:
wow. just used the app and my random write speeds jumped to triple digits for the first time since i bought the n7. actually, all speeds look better, but that's the one that jumped the most. thanks for the suggestion!

EDIT:

Pre 4.1.2 update: Random Writes hovered around 40 IOPS

Post 4.1.2 update: 65 to 80 IOPS

Post Forevergone: 115 IOPS

And all scores seem to be consistent from test to test. Not so previously.

Sweetness.
[Nexus 7 General] jonmorris:
I know it has been said so apologies, but I am not sure the best way to optimise the tablet after the update.

I really want to avoid a reset, so what can I do? I can see that simply updating doesn't fix it instantly.
[Nexus 7 General] sark666:
Ok, what are normal benchmarks for random writes? Both my random writes and seq writes were still awful after updating to 4.1.2 but after filling the device/clearing files seq writes seem fine but random writes still seem slow, however I'm seeing some of you quote speeds that I am getting and saying that's normal.

However in androbench when I look at rankings, others are getting way higher random writes. As far as usage goes, things feel better but it's certainly not as smooth, and currents still times out updating stories/doesnt' update all sources/doesn't grab all pictures even though I indicated as such. It was currents that first brought my attention to the issue so it was one of the first things I tried.

So if I am getting normal random writes, why are the avg benchmarks so much higher?
[Nexus 7 General] styckx:
Don't pay attention to the rankings or the Nexus 7 comparison your supposed to compare yours against. That list is so far beyond inaccurate it isn't even funny.
[Nexus 7 General] sark666:
Hmm, ok, so I assume the 'low' rnd write score is normal, or as good as it's going to get Well, I cleared the cache for currents and then did a sync. The majority of articles still don't have picture even though I have the option 'include images: all editions' selected. That was one of the first things I noticed when the issue started, currents wouldn't complete a sync so I was left without outdated articles and only the odd one having an image, something that never happened before. But not only pictures, some news feeds have the most recent story dates Sept 12! If I go online and go to that source then it updates, but updating by syncing usually fails/timeouts on most sources.

Again, that was one the first thing I noticed that brought this problem to my attention. Same thing in flipbook, it doesn't have an offline mode but was very laggy, haven't tried that yet though. Maybe it's a separate issue with currents but for a good while it was behaving fine and then started to behave poorly and I had assumed it was due to this issue.
[Nexus 7 General] sauceboy25:
Okay - so I'm running AOKP Build 4 with CWM, which seems to fix the lag problem, with some risk for data corruption, as I'm told.

I've downloaded the factory 4.1.2 image as per Google - how would I burn this ROM - the same way I do for Cyanogen or AOKP? The package apparently contains another ZIP file and a bootloader, etc.

What's the process - and I assume doing it doesn't disrupt my root?
[Nexus 7 General] Turbotab:
If you want to restore your N7 back to stock with a Google factory image, you can't just flash it in CWM. There is a great guide in the Q&A. However, it will remove root, but that is simple to get back.

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

There is also a Nexus 7 Toolkit in the development forum, which can flash a factory image, but I've never used it.
[Nexus 7 General] sauceboy25:
I used the Nexus 7 Toolkit originally to root and flash it, so I guess I could use it to flash the factory image. What a pain in the a$$.

Wait, so to be clear, to get the full updated Jelly Bean, I have to push the stock image in, and then re-root and re-install CWM?
[Nexus 7 General] volwrath:
Or just flash a stock rooted ROM found in android development subforum
[Nexus 7 General] evodon84:
I'm sure you made a backup of stock 4.1.1 rooted right?

1. Restore to that, if not then use the toolkit to return to stock 4.1.1 and then all in one root. Its easy.

2. Once you have rooted 4.1.1, d/l voodoo ota and go into the app and backup root.

3. Find the thread and Android Development with the flash able zips of stock 4.1.2. Download the right one and put it on your SD card.

4. Reboot into recovery. I am using TWRP 2.3

5. Make a backup

6. Flash the zip you downloaded

7. Reboot into Android

8. Open voodoo ota and restore root

9. Verify you have root

10. Win

I just bought my N7 from another member and it was running like ****. I tried a few different Roms and kernels and after I unlocked the screen, it took 5-10 seconds for the icons to even show up. It was horrible, like using a single core PC that hadn't been re-imaged in 5 years. I did the above and its running great now.
[Nexus 7 General] EdCof:
I can't say this is the best way, but all I did was update, then run Forever Gone. It stalled a couple of times with 50-250MB free space, locking the tablet and requiring a reboot, but after a few tries I could get it to run until the storage was completely full then release the filled space. After that it's been fine, even when I filled it up again to less than 3GB free.
[Nexus 7 General] miscfiles:
Same here - although I didn't need to reboot during the Forever Gone run.

Nexus 7 feels like new again :)
[Nexus 7 General] Dorkington:
I don't have any benchmarks to show, but I will say the tablet feels faster now that I finally received the update.

There are still hiccups, but I think that's just part of Android life.
[Nexus 7 General] khaytsus:
When i ran it the one time, it got to 12.3m free (from 3.6g) and watchdog'ed the VM (Android rebooted, not the tablet) and when it came up it was at 10m free. I just went ahead and cleared the space and left it as-is.

I was semi curious to see if I watched it do the process again would it be smoother, since there were times it'd pause for 5-10 seconds even at the beginning of the process.. the last 100m took about 10 minutes before it finally froze for so long the watchdog timer rebooted the VM.

Doesn't hurt to do I suppose, at least not do once or twice. I wouldn't do it daily ;)
[Nexus 7 General] niteowl360:
My lag only started after 4.1.2 update.

A 2 second tip I saw on you tube cured it for me.

Thanks to Noel Barcellos.

Go into Google Currents and disable Background Sync and you're done :)

Worked for me.

PS if you like Analog Clocks search for niteowl360 and download first set on Play Store for free!

Please rate highly if you think they deserve this :)

Thanks
[Nexus 7 General] joshtb86:
how are you getting forever gone? it wont show up on my app store and when i try to do it from a computer from the google play website, it says not compatible. im on 4.1.2 stock rooted.
[Nexus 7 General] mmaestro:
It showed up - and still shows up - as compatible with my N7, 4.1.2 stock (no root).
[Nexus 7 General] joshtb86:
this is weird. idk if the fact that im rooted changes it. tried using stock dpi 213, then tried tablet dpi i use 168 and neither work.

ugh. can anyone upload it to so i can sideload it?
[Nexus 7 General] jmdearras:
I had to turn off WiFi and sync before Forever Gone could finish, I guess background stuff was using the space, but it did the job!

Jim

---------- Post added at 03:38 PM ---------- Previous post was at 03:05 PM ----------

https://play.google.com/store/apps/details?id=com.kovit.p.forevergone&hl=en
[Nexus 7 General] joshtb86:
thanks, but thats just a link to the play store. im looking to see if anyone has the actual .apk.

or can anyone recommend another app? idk why it says incompatible with mine
[Nexus 7 General] sauceboy25:
So, with too much time on my hands today, I decided to almost brick my Nexus 7.

A little dissatisfied with the lag after flashing some 4.1.2 based ROMS - a couple of rooted nearly vanilla AOSPs, I decided to go into CWM and reformat everything, knowing that this would wipe out the OS.

After realizing that I couldn't mount USB drive, a minor panic set in.

Then I went back to the Nexus 7 toolkit, and used it to download and flash the Google stock image. When that worked, I realized I could use it to flash the 4.1.2 image available from Google. Which worked. Then after re-rooting and installing Busybox, things seem to be back to normal-ish.

Crisis averted, apparently.
[Nexus 7 General] Jay Aristide:
Good thinkin' :good: yeah, those toolkits are nice, but I prefer good old adb (especially on aosp devices :) )
[Nexus 7 General] glossywhite:
Slightly childish? It's stupidity like that which causes tension and arguments. Why would you care THAT much about what tech people use? Crazy.
[Nexus 7 General] joshtb86:
this is all off topic and not related to the lag issue.

to get back on topic, can anyone help me sideload foreever gone onto my tablet? or help me figure out why most apps arent showing up and on play it says foreever gone is incompatible?

thanks!
[Nexus 7 General] glossywhite:
./adb install apkname.apk
[Nexus 7 General] joshtb86:
thanks for the adb command, but i need the actual file unfortunately thats what im looking for
[Nexus 7 General] glossywhite:
Here you go :) - just took a few secs to install to my tab, and pull to Gmail for you!
[Nexus 7 General] joshtb86:
awesome.... thanks so much!!

btw, how do you pull apks from your device?
[Nexus 7 General] glossywhite:
Aww you're welcome! I just did:

./adb shell

cd data/app

cp com.kovit.p.forevergone-1.apk /mnt/sdcard

Then shared to Gmail, downloaded it, and attached here :)

Here's a Rapidshare link too: http://rapidshare.com/files/2848004382/com.kovit.p.forevergone-1.apk
[Nexus 7 General] Jay Aristide:
Maybe you should PM me sometime and ask me :) It's not crazy at all
[Nexus 7 General] glossywhite:
Nah, you're alright ;)
[Nexus 7 General] khaytsus:
Ah, so you screwed with DPI. Stock is NOT 213. Android has EXACTLY these DPIs:

120, 160, 240, 320.. Anything else is non-standard.

So either get the market app that lies about its DPI, or set your DPI back to stock (which is 240 btw) and clear Market and possibly Framework data. It might take a few times, even a reboot, before the market realizes you changed back.
[Nexus 7 General] Jay Aristide:
o.O Man, I gotta tell ya, when I got my 8gb from the play store and when I got the 16gb from wally*world, both tablets had a stock ro.sf.lcd_density of 213
[Nexus 7 General] Dragooon123:
Nexus 7's stock DPI is 213.
[Nexus 7 General] frankhart:
So I noticed the 'discard' options are not set on /data and /cache when you flash the latest cm10 nightly. When they update the kernel and scripts, will I have to do a factory reset or will a normal 'drirty' flash do the trick?
[Nexus 7 General] clusterchuck:
Wow I should have took a screen shot. I was getting 0.01 MBs in the random write section with 2.44 GBs of space left on 4.1.2. This is after trying the Forever Gone app.:eek: