yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Nexus] bamtan2:
I knew I liked Norwegians for a reason :good::D:good::D

You've got my attention! I might wipe and test this from scratch... for now, here's my last post about my ZRAM experience: http://xdaforums.com/showpost.php?p=62545920&postcount=1536 -- Basically the bugs I had were 1) ZRAM broke if set beyond 192MB, and 2) ZRAM couldn't be disabled/configured by the user when set on at startup by the kernel. (Bsmitty worked around this in his M1 kernel by turning it off and leaving the user to turn it on as they please)

ZRAM worked well for me some months ago. But only with LZO compression. Maybe LZ4 has started working recently. Also: the swapping acted very lazy at 60, so I set it to 100. At 100 it acts more like a RAM-replacement, as I need it to. This increases CPU usage (thus reducing battery life), but for me this is necessary because RAM is the main constraint on performance for me.

On ZRAM size: My primary goal was to allow more applications to stay running in the background. In particular, just ONE more would be worthwhile :) And in my testing, ZRAM at 192MB did prevent apps from shutting down so frequently. Of course: it cannot stop Chrome from using 200MB-500MB RAM and pushing all competing apps out of memory ;) So we must set our expectations realistically. But if the average application uses ~100MB RAM, and ~200MB of ZRAM also uses ~100MB RAM, then I think it's worth dedicating "one application" worth of RAM for the chance of fitting in "two applications". Sometimes it will work better than other times, but I had a good feeling when I used it (for some months).

I predict that giving more than ~200MB space to ZRAM will have diminishing returns, and the human operator will do a better job of swapping apps by using the multitasking button :)

Note to users trying ZRAM for the first time: the megabyte value for ZRAM is *not* the RAM size it will use. The RAM size is unpredictable, but usually ~40% of the ZRAM size. So, if you want ZRAM to use 40MB RAM, you need to multiply by 2.5x. 40MB real RAM * 2.5 = 100MB ZRAM setting. Or: 192MB of ZRAM should require 192/2.5 = 77MB of real RAM.

On ZCache: In my research, I could find no proof that ZCache was a good idea for Galaxy Nexus.

Thank you [MENTION=2633638]Ziyan[/MENTION] for your work in the new year :)
[Samsung Galaxy Nexus] jomigp01:
Hello. I cant flash openGapps error status 6 u.u. ROM Work fine thanks

Edit: gapps Work fine with twrp :)

Enviado desde mi Galaxy Nexus mediante Tapatalk
[Samsung Galaxy Nexus] agoyo2yk:
Hi. Reflashing. Now muuuuuuch better, no lags. Great work, Ziyan. Flashed with pico gapps.

Enviado desde mi Edison 3 mini mediante Tapatalk
[Samsung Galaxy Nexus] hgmichna:
Dirty-flashed this version and the Open Gapps 5.1 nano—worked fine. Thanks!

Very smooth at first, but I have not done any stress testing.
[Samsung Galaxy Nexus] Fenvarien:
The new build is working very smooth, multitasking between Opera browser and other apps is very fluently. Thanks [MENTION=2633638]Ziyan[/MENTION] for your hard work!
[Samsung Galaxy Nexus] Ziyan:
Alright, uploaded a slightly experimental build with the block part of the kernel updated, and BFQ set back as the default governor. This build is mainly for those to test who experienced lockups using the 01/02 build, which had BFQ set as the default gov as well (unlike today's first build). I really hope that this fixes the lockups, as BFQ provides a nice performance boost!
[Samsung Galaxy Nexus] Childe89:
Thanks for you activity :good:

I just flashed this test build, and works great, phone seems faster and Dolphin is not crashing anymore with BFQ :)
[Samsung Galaxy Nexus] bamtan2:
[MENTION=2633638]Ziyan[/MENTION] I did some research to see why some android distros are changing their swappiness from 60 to 40. I could not find a reason. However, I did find this android guide by INTEL which says to use 100 swappiness: https://01.org/android-ia/user-guides/android-memory-tuning-android-5.0-and-5.1

I am surprised Intel recommends 400MB ZRAM on a 1GB device. Maybe their 1GB devices have more free memory than ours ;) I can imagine their kernel is very optimized. In any case, I am very confident in intel's judgement about swappiness=100. Edit: Intel says "These settings will allocate about half of the physical memory that is generally available for user processes". Since 400MB ZRAM would use about 200MB real memory, that implies their test devices have ~200MB*2=400MB free memory. I think we MAY have 400MB free memory after a clean flash, but NOT after google play services / gapps are installed...

PS: I can change swappiness with kernel adiutor and synapse (after flashing [MENTION=4544860]osm0sis[/MENTION] GN_Synapse_Injector_Addon-AK2.zip from https://s.basketbuild.com/devs/osm0sis/osmods ). But ZRAM size cannot change, up nor down. I think this is okay for normal users, but for ZRAM testing purposes, I think it must be turned off by default so we can change it to a different value every reboot?

PPS: I have been using your 5.1.1 ZMOD for 6+ months. I still prefer the basic AOSP distro because I do not need audioFX, CM themer, etc. But I can say that this CM12 test build is working very well for me so far!!! :)
[Samsung Galaxy Nexus] Nautilus74:
It works now sync audio in video?
[Samsung Galaxy Nexus] 0s1ride:
Sadly no, not with 20160102.
[Samsung Galaxy Nexus] osm0sis:
You can adjust the zram size, it's just really finicky in Synapse due to the scripting required (race condition?); I find after setting it a few times it'll stick.
[Samsung Galaxy Nexus] Ziyan:
Attached below is a boot.img applicable for yesterdays BFQ build (it might not boot with the regular build). zRAM disabled by default, so you can enable it with whichever size you want to test :) waiting eagerly for the results ;) about swappiness, you might be right, seems like with 60, the system doesn't fully use it (ie. kills apps instead of moving stuff to zram when it's about 50% full).

Right now I'm experimenting with 256/100 - this is definitively the best combination yet.
[Samsung Galaxy Nexus] defy_owner:
Newer builds are working great, thanks for the updates!

Hey [MENTION=2633638]Ziyan[/MENTION] please have a look at this, it's related to this rom.
[Samsung Galaxy Nexus] hgmichna:
Yes, so far smooth here too on three Galaxy Nexus phones in my vicinity.

Any version with improved zRAM parameters will be very welcome.
[Samsung Galaxy Nexus] Fenvarien:
The experimental boot.img is working great for me, I tried 240/100, which results in a very smooth experience. Generally the high swappiness seems to help a lot! :)
[Samsung Galaxy Nexus] sddfdds:
The performance boosts and/or the no-watch-dog and/or voodoo now have the facebook app successfully installing and updating with no soft reboot

edit: so it would seem i spoke too soon...got another update (on the beta track so theres a steady stream of updates) and got a soft reboot
[Samsung Galaxy Nexus] Qwake:
Hello, please I have a problem, I'm tring to start phone and stucks on bootloop.

The solution should be start recovery, but my second problem is volume down doesn't work.

Is any chance to get to recovery throught ADB while phone is turned off?

Thanks.
[Samsung Galaxy Nexus] momojuro:
I'm confirming that the 256/100 combination is the best one for a 1GB device (through my tests on my OMAP4 tablet) as it's said here (thanks a lot [MENTION=5799877]csk1jw[/MENTION]).

He also provided good and useful kernel patches on the same thread (such as the support of the extra_free_kbytes tunable), so I suggest you to take a look when you will have time for.

Best regards.
[Samsung Galaxy Nexus] hgmichna:
The Galaxy Nexus is not a real 1 GB device. It is more like a 0.8 GB device because of its RAM sharing with its graphics chip.

Sometimes less is more. Please test thoroughly.
[Samsung Galaxy Nexus] momojuro:
^ My OMAP4 processor integrated tablet has 900MB of usable RAM, and the LGP880 has about 800 - 850MB of usable RAM. Don't worry about that. :)
[Samsung Galaxy Nexus] blystad:
All devices have "restricted" memory. It's just that newer kernels use CMA to make the memory visible to Android, instead of reserving it before Android sees it.

On OMAP4, these are the carveouts:

- 3MB for SMC Carveout (PHYS_ADDR_SMC_SIZE)
- 90MB for 1D ION Heap Carveout (OMAP4_ION_HEAP_SECURE_INPUT_SIZE)
- 105MB for Ducati Heap Carveout (PHYS_ADDR_DUCATI_SIZE)
- 96MB 2D TILER Carveout for YUV data (OMAP4_ION_HEAP_TILER_SIZE)
- 32MB 1D TILER region for UI surfaces (OMAP4_ION_HEAP_NONSECURE_TILER_SIZE)
- 16MB for VRAM - depends on your display resolution
- 2MB for RAM Console (OMAP4_RAMCONSOLE_SIZE)

Which, if you take 1GB - the above, should result in 680MB available. The Galaxy nexus kernels has some more then this due to amazing work from Ziyann, MWIsBest and others.

Then, after carveouts, the kernel takes some (~80-100MB from what I can see from dumpsys procstats), and the rest is left to Android.

Our device runs kernel 3.4, and if I make one simple config change and switch Ducati (the secondary processor responsible for the image pipeline, e.g. video codec, camera, etc) to not use carveouts, but rather CMA, then Android will think that we have 795MB of RAM. Sounds great, right? Except....It's no big change...since this pops up in the kernel log:

<6>[ 0.000000] cma: CMA: reserved 112 MiB at 99000000

Meaning the memory is still reserved, not usable.
[Samsung Galaxy Nexus] momojuro:
Didn't know about that, thanks a lot for the information ! :good:

Best regards.
[Samsung Galaxy Nexus] playitlouder:
Could these Carveouts be set to get dynamically allocated? Eg. if no video decoding action / camera app is open the memory can be used by the userland?

But I guess this gets problematic, if the camera gets started on a "low memory condition" :(

Zram probably is a pretty good idea, but it would be great if we could also compress these statically reserved carveouts.

In my opinion Google should redo project svelte and rewrite the play services for better memory management.

[Unrelated: The "industrial smartphone" your firm makes looks awesome and that fix for vertical video syndrome is cool. I just wonder, why the camera manufactors just don't make a sensor that can record vertical as well, just by using different areas of the sensor. The industrial phones doesn't run Lollipop though, I suppose :silly:]
[Samsung Galaxy Nexus] Ziyan:
Are you fully sure about that (ie. did you test it using a memory fill app)? Without taking a look at how TI set up the CMA reservations, I would think that it releases that memory when ducati/tiler2d isn't actually used (page/slide 41, reported here as well). If that's not how it works for ducati, then there was little point even implementing CMA for it... :silly:
[Samsung Galaxy Nexus] blystad:
Regarding Zram, Yep I think that's a good idea and we will probably enable it on our build as well. We're working on getting Lollipop on our device, and it's a lot thanks to the marvelous effort by Ziyan, MWIsBest, freshgiammi and others on XDA that we undertook this project :) (Plus we need to beat our competitors...which are on Kitkat. Marshmallow would be nice, but first priority is jumping from 4.2 to 5.1. That alone is years of catch up).

And yeah, Google Play Services really needs to use less RAM...and same goes for Facebook...How a chat app, and a news app can use 100MB+..each...is beyond me...

Hmm...That's actually a good point...Let me test that tomorrow. I honestly just enabled it, checked that it worked as it

Hmm....Good comment....

What makes me a bit unsure is this: https://android.googlesource.com/kernel/omap.git/+/eb1a682b3dec223ff0eef373dc76589984207fc4

What I know is that the ducati firmware is loaded during bootup...so that part will always be allocated, but the firmware isn't what takes the most space...The major buffer are related to storing images (IOBUFF).

In the firmware there are various constants for defining various buffers required ("resources"), and the type of buffer ("resource type"). See this table: https://android.googlesource.com/kernel/omap.git/+/glass-omap-xrx13b/include/linux/remoteproc.h#95 The IOBUFF is of type RSC_DEVMEM...so you might be right.

I'll do some tests tomorrow and read more into it.
[Samsung Galaxy Nexus] callmewind:
Hi guys,

just a suggestion; have you considered backporting zswap and using a little of swap?

Info about zswap vs zram: http://askubuntu.com/questions/471912/zram-vs-zswap-vs-zcache-ultimate-guide-when-to-use-which-one

Those guys did it for the galaxy note II: http://xdaforums.com/showthread.php?t=2239453
[Samsung Galaxy Nexus] hgmichna:
zRAM vs. swapfile

Judging from my experience with swapping on earlier Android versions I can only say that I am all for a good old swapfile or perhaps some refined version of it. I do not believe in zRAM, mainly because its advantage is too small, which is partly because it adds some virtual RAM, but at the same time takes some real RAM away.

In many multiple-app-running situations the working set is small enough to fit into real RAM, so the much slower virtual (swapfile) RAM does not get in the way of smooth phone operation. Of course, switching to another app involves swapping and can take a few seconds, but you gain so much more total RAM, real plus virtual, that it is worth the trouble in my view.

That said, I gladly admit that zRAM also helps a little, if it is adjusted to work well.
[Samsung Galaxy Nexus] Ziyan:
Using swap on our emmc will not only kill it, but will also ruin the whole system performance. IO lag is already horrible, luckily, BFQ helps a lot with that. Did you guys try out this lz4-backed zRAM? Basically, when set to 256/100, it gives us ~160 mb more RAM (when full, takes away ~80mb and gives ~240mb) - I didn't notice any slowdowns at all, lz4 is extremely efficient.
[Samsung Galaxy Nexus] hgmichna:
zRAM vs. swapfile

If that is so, then I (gladly) retract my swapfile recommendation. I bow to your much greater experience with this particular type of phone.
[Samsung Galaxy Nexus] Ziyan:
When exactly is that happening? I wasn't able to reproduce this bug with YouTube and camera :(
[Samsung Galaxy Nexus] aosp:
[MENTION=7024484]blystad[/MENTION] Maybe the source for 1.13 DDK?

gpu: pvr: Drop unused omaplfb code.

This code is only for OMAP and was never used. Delete it.

Cherry-picked from the branch klp-pdk.

Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com>

https://github.com/MIPS/CI20_linux/commit/4d465f7a93459d9e64bba8339b1418963bf60667

gpu: pvr: Upgrade to SGX_DDK_Android_1.13@3495621.

This is the RTM for DDK 1.13.

https://github.com/MIPS/CI20_linux/commit/e04b3a71b487123a71c407f74d2f924e8c084f94

removed 3.0.8 UM binaries

They are available here instead

http://mipscreator.imgtec.com/CI20/sgx/UM_Binaries.1.13.3341330.2015-06-25_10_09_21_withXSGX.tar

http://mipscreator.imgtec.com/CI20/sgx/UM_Binaries.1.13.3341330.2015-06-25_10_09_21.tar

https://github.com/MIPS/CI20_collateral/commit/5180ae6778270bbde078ba1089ff24ff9389b191

Upgrade GPU blobs to SGX_DDK_Android_1.13@3495621.

This is the RTM candidate plus cherry-picks to support AOSP

master (post L) and the M PDK.

Add support for GRALLOC_USAGE_CURSOR.

Many other bug fixes.

Android 'M' ready.

Changlog in pvrum:

965cd81 Add support for M PDK's RAWxx pixel formats.

b5ff36d Support building against the M PDK.

928a525 Remove LINKER_RPATH definition.

c42f6d2 Build fixes for AOSP master.

8b2b76d Avoid linking against deprecated stlport library.

3183a69 Support linking against boringssl instead of openssl.

04e6979 Fix initialization of IMG reference camera HAL.

Build Directions:

cd $TOP/hardware/ingenic/DDK-UM

export ANDROID_ROOT=$TOP/hardware/ingenic/xb4780/libGPU

export ANDROID_BUILD_TOP=$TOP

export DISCIMAGE=$TOP/hardware/ingenic/DDK-UM/GPU_Staging_Area

export TARGET_ROOT=$TOP/out/target

export TARGET_DEVICE=npm801

make

make install

Change-Id: I6dbbbc2ee7bff420e2815d188f340035405b1730

https://github.com/MIPS/hardware-ingenic-xb4780/commit/ef2159a85012c8411d26e1c9807e7c8960ee4240
[Samsung Galaxy Nexus] 0s1ride:
Basically with every HW accelerated video, including the YouTube app (YouTube on a browser seems fine).

Another example is MX Player: fine with SW/HW decoder, out of sync with HW+.

The last build without this issue is 20150831.
[Samsung Galaxy Nexus] blystad:
Unfortionally the libraries are compiled for the MIPS CPU architecture instead of ARM :(

{ /tmp } » file libGLESv2.so.1.13.3341330 /tmp
libGLESv2.so.1.13.3341330: ELF 32-bit LSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, stripped

Our TI contact has been busy this week so I haven't heard back from him regarding SGX source. What we hope to get is the actual source code, not just precompiled binaries. But lets see what happens.
[Samsung Galaxy Nexus] thagringo:
wow, really impressed with the zram settings you suggested. Have always been very sceptical about zram but this really made a difference !

well done [MENTION=2633638]Ziyan[/MENTION] and everyone involved !

cheers
[Samsung Galaxy Nexus] bamtan2:
I have just remembered something of note about ZRAM for those testing it: When I was testing this 6 months ago with bsmitty's kernel, I could not set ZRAM above ~200MB. It would either not work, or not be utilized. So maybe we can all keep an eye out (using ZramCC? https://play.google.com/store/apps/details?id=com.javilonas.zramcc.app ) for how much ZRAM is actually being utilized when it is set over 200MB. Just to make sure it is working.

I have a few bugs to report!

New?:

1. Chrome crashed for me while browsing, and it continued to crash on all websites even after wiping its data and rebooting. Only uninstalling and re-installing fixed this problem. I have never experienced this bug, so I am worried that BFQ caused a data corruption. Since I can't switch off BFQ (doing that crashes), I think I should leave ZRAM disabled and try to reproduce this bug, and at least isolate it away from ZRAM.

Old?:

2. The video + audio synchronization is still happening. As noted by others, it is a regression from some time ago. It appears to me that certain operations in the youtube app make the app slow down, and when it slows, the audio/video moves ahead/behind. I think I can reproduce this by rotating the device, or hitting the full-screen button, or tapping the screen multiple times to make the GUI come up and go away.

3. The speaker still clicks sometimes when starting/switching apps.

4. I definitely can't change ZRAM settings once they're set, despite [MENTION=4544860]osm0sis[/MENTION] telling me otherwise ;) ;)

5. Changing the IO scheduler crashes the system for me.

Overall I'm very happy with the state of 5.1.1 on Galaxy Nexus. The only mandatory advice I have for users is to start from scratch and only install the apps you absolutely need, because apps you don't use will still run in the background and steal RAM away from the apps you DO use. PS: The only user tweak I find mandatory now is of the OLED display: I need to raise the blue in order to make whites on the screen look white. ;) But I don't have a display calibrator, so I just "eyeball" it.
[Samsung Galaxy Nexus] Ziyan:
This is new - I used to be able to switch back and forth between CFQ and BFQ, but indeed it crashes now. For now, if you want to switch back to CFQ, set sys.io.scheduler back to cfq in /system/build.prop. I don't really think BFQ could cause a data corruption, I'd like to think it was an app bug or something - try to grab a logcat and dmesg if it happens again.

Classic problem, still no idea what's the exact cause, and why isn't it happening for everyone (for example, it never happens on my secondary half-broken maguro, but almost always on my new one). It usually happens with touch sounds enabled, for some reason there's a click sound coming from the speaker after/before switching it's power on and off or at the start and stop of the sound data stream (I don't know which one, didn't really investigate it yet). The workaround is to disable touch sounds, so at least you'll hear it rarely. Some people thought it was caused by the high system load, but don't worry, it's really just a problem somewhere in the audio handling (low priority for me).
[Samsung Galaxy Nexus] playitlouder:
I installed Greenify for this purpose. Works well, as far as I can tell.

Would be awesome, if CM implemented something like this.

In the CM10 days, they had a awesome feature request page, but today they don't seem to do that anymore.
[Samsung Galaxy Nexus] hgmichna:
Many apps

I would not be too worried about that. One Galaxy Nexus here is my backup phone, mostly a clone of my main phone, and has some 270 apps installed, including system apps.

After booting it needs a few minutes to get settled and occasionally complains that Trebuchet or the system does not respond within the standard time limit (so I tell it to wait), but then the phone runs just fine with the occasional moderate and bearable slowness.

Now I am looking forward to a version with optimized zRAM parameters.
[Samsung Galaxy Nexus] playitlouder:
270 Apps on a 16GB Phone, good job sir :D

You'll probably have screen burn in, by the time it finishes "optimizing apps" :silly:
[Samsung Galaxy Nexus] playitlouder:
[MENTION=2633638]Ziyan[/MENTION]

https://github.com/awanga/tuna-kernel

Isn't this thing using DDK 1.12?
[Samsung Galaxy Nexus] chakme:
Hi there!! I'm not a developer, but I keep following and reading all this topic since the beginning, since I still want to have my GNexus working fine... But there are some things here, that I've got some limitations on doing.

For those last updates "cm-12.1-20160105-UNOFFICIAL-maguro-ZCACHE-LZ4-ZRAM.zip " and "cm-12.1-20160105-UNOFFICIAL-maguro-BFQ-ZCACHE-LZ4-ZRAM.zip + boot.img" released by [MENTION=2633638]Ziyan[/MENTION], I noticed that this last one is running smoother, but you have to set ZRAM to 256/100 and THAT's what I'm not able to do.

Could some one help me doing that? Or in this last one (BFQ + boot.img), even not setting ZRAM values, will I get a better experience??

Thanks in advance !!
[Samsung Galaxy Nexus] hgmichna:
It runs well and smoothly, so why don't you just flash it and then wait for the next version, which can almost certainly be dirty-flashed over the current one, so you will not lose anything?
[Samsung Galaxy Nexus] bamtan2:
Is this what I should use for that? https://play.google.com/store/apps/details?id=com.tortel.syslog&hl=en

This makes sense! I didn't realize there was a "touch sounds" option buried deep in the sound settings. I had my system volume set down to mute, so I never expected any sounds to get through, even if another option was on. This could help find the cause -- the clicks totally bypass the device's volume level!

I think Greenify puts apps to sleep so they don't wake the phone and use processor time. This can help battery life, but I don't think it can help RAM use, which is why I suggested installing fewer apps.

These are all test builds! No one knows what ZRAM settings are stable, and no one knows if BFQ is stable. You're asking for trouble if you use these as final builds!

This is for testing if ZRAM will work: cm-12.1-20160105-UNOFFICIAL-maguro-ZCACHE-LZ4-ZRAM.zip

This is for testing if BFQ and ZRAM will work: cm-12.1-20160105-UNOFFICIAL-maguro-BFQ-ZCACHE-LZ4-ZRAM.zip

This is for testing different sizes of ZRAM by disabling it so you can manually change it: boot.img
[Samsung Galaxy Nexus] playitlouder:
[MENTION=4545566]bamtan2[/MENTION]

The greenified apps don't show up in Apps>Active App's/Cached apps. Haven't investigated with Adb though.

To grab logs I recommend Andy Log. It's quite nice.
[Samsung Galaxy Nexus] Nabbolo:
I tried to shoot a video with Google Camera and replayed it and it seems to be synced.

I have this audio/video sync problem but for now I only noticed it with the Youtube app, but that's probably because I don't use other video playbacks.