yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] Coldwindofnowhere:
I don't think that's possible: RR is CM based and no one succeed to make cm 12.1 boot for now .... (and we can't say nobody tried)
[Galaxy S I9000 Android Development] althafvly:
What about slim roms?
[Galaxy S I9000 Android Development] Coldwindofnowhere:
It's aosp based right ? I will give it a try when i'll be in holidays.

Speaking about the kernel, do you guys have in mind some nice features i could backport ? (no cma and tv out of course :))

For now i'm trying to backport ARM JIT compiler for packet filters, we'll see if it works properly ...
[Galaxy S I9000 Android Development] :
Gcc 6.0 is out :D
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Yeah i know right, i've already tried some time ago but i will stay with 5.3 for the next builds since i don't see any big performance improvements with 6.0.

Also see this post.
[Galaxy S I9000 Android Development] phil_greg2001:
TWRP 3.0 is out too :)
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Um actually i got it to work on MM, i will upload a boot.img is someone is interested. Still, i'm not sure if it will work on LP ...

Edit : attached screenshot
[Galaxy S I9000 Android Development] softis:
TWRP for i9000?
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Then, here it is: the MM kernel, built with UberTC 6.0 wich includes TWRP 3.0.0 :D

Boot.img is attached to this post, with the following MD5: 1e9b7cb6d1f68bb3e759b871b4a002d5

I have tested it with MM and it works without any major issue but i have no idea if it will work on LP, if anyone wants to test it, go ahead.
[Galaxy S I9000 Android Development] Trainer_H:
Is the last Kernel_ION.zip compatible with MM?
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Not at all, you'll be stuck in a bootloop if you flash it. Use the boot.img attached to my previous post if you want a MM compatible kernel.
[Galaxy S I9000 Android Development] AdamDevlopper:
Hey !

It would be great if someone would help me im currently stucked while trying to compile the Kernel with this error:

Thanks in advance
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Are you trying to compile it for LP or MM ? Also can i take a look at your local manifest ?
[Galaxy S I9000 Android Development] AdamDevlopper:
Trying to compile MM Kernel Which Manifest?
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Well you have to setup all the files for the device ....

You have to create a local manfest with something like that in it :

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="lollipopi9000/proprietary_vendor_samsung" path="vendor/samsung" remote="github" revision="cm-13.0" />
<project name="lollipopi9000/android_device_samsung_aries-common" path="device/samsung/aries-common" remote="github" revision="android-6.0" />
<project name="lollipopi9000/android_device_samsung_galaxysmtd" path="device/samsung/galaxysmtd" remote="github" revision="android-6.0" />
<project name="Coldwindofnowhere/android_kernel_samsung_aries" path="kernel/samsung/aries" remote="github" revision="android-6.0" />
<project name="lollipopi9000/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" revision="cm-13.0" />
<project name="lollipopi9000/android_hardware_samsung" path="hardware/samsung" remote="github" revision="android-6.0" />
</manifest>

Anyway, don't bother yourself with compiling it, sooti has just realeased a new MM build with all my kernel commits and TWRP 3.0 (i don't know about gcc 6.0).
[Galaxy S I9000 Android Development] AdamDevlopper:
Okay seems like it was my fault i used just git clone https://github.com/Coldwindofnowhere/android_kernel_samsung_aries.git ............... Let me try again :D
[Galaxy S I9000 Android Development] Agghost:
Hello,

I have tested it on my i9000 with lollipop 5.1.1 and it's stuck at galaxy s... :crying:

Thanks for efforts
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Thanks for the testing, then i guess it's impossible to build a kernel compatible with both LP and MM ....
[Galaxy S I9000 Android Development] xc-racer99:
You can't just download the kernel and build it as the kernel requires several other parts that are built outside of the kernel tree (ie the things you were missing earlier). You need to download the full Android 5.1 (or 6.0, depending on which you're wanting) and build the kernel with it.

While it may be possible to use prebuilts for each of the parts built outside the kernel, I haven't tried it...
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Finally, i took a look at the CMA feature, there is still a lot of work to do , if any dev is intrested in contributing to it, take a look at https://github.com/Coldwindofnowhere/android_kernel_samsung_aries/commits/cma

Implementing CMA for FIMC sounds pretty good, because we already have a DMA coherent mask for it commit

My guess is that we need to modify the following file : https://github.com/Coldwindofnowhere/android_kernel_samsung_aries/blob/421a84213e71392658484be2a242b31407fc2081/drivers/media/video/samsung/fimc/fimc_dev.c

Edit : FIMC2 implementation of CMA done however, i cannot get FIMC0 to work properly: the camera crashes every time ... Also any help is appreciated.

Edit2 : Memory isn't released properly ... not a big deal with FIMC2 since it's tv out but that's why FIMC0 isn't working.
[Galaxy S I9000 Android Development] jupiter5700:
May be kernel must contain two ramdisk, one for 5.1.1 second for 6 and turn it automaticly? You can look at NeatKernel sources, this kernel universal for all roms from 4.1.2 to 4.4.4. And may be if you put to kernel 5.0 ramdisk kernel will be work with RR rom.

Are you modify USB host routine from humberos sources or you not touch it? Humberos USB host controller sources has a bug and devices can't mount to i9000 properly. You can take worked sources of USB host from MackayKernel, it work proper. If you will make it i will test it.
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Holy sh*t I got CMA to work !!!!!!!!!!

449872 kB of mem with a (almost) working camera :D

Edit : Camera is now completely working, even 720p video recording works.
[Galaxy S I9000 Android Development] phil_greg2001:
Bravo !!!

:)
[Galaxy S I9000 Android Development] Trainer_H:
Dam that sounds great :)
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Surely, unfortunately it's not really stable yet, i still have a lot of work.

Btw i still need some help, so if someone is intrested, don't hesitate ! (commit)
[Galaxy S I9000 Android Development] althafvly:
Superb. But check whether front camera working after taking photo. It stuck on kk builds
[Galaxy S I9000 Android Development] Alokhacker:
man you are genius

This will make roms much smoother and faster
[Galaxy S I9000 Android Development] jupiter5700:
Very good! It is bigger then pawitp CMA results. Proof.
[Galaxy S I9000 Android Development] phil_greg2001:
Hi Coldwindofnowhere,

When we can try CMA kernel :confused:

:cool:
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Surely but it's not really usable yet, i guess you'll have to wait more.

In itself, CMA works fine but many features of the kernel are disabled so it's not really usable for now.

If you really want to try, pm me and i will give you the kernel but it's not ready for everyday usage...

Edit : here is a picture to make you wait :p
[Galaxy S I9000 Android Development] phil_greg2001:
No pb, we waiting :cool:
[Galaxy S I9000 Android Development] althafvly:
Have u checked the front camera working??. Front camera didnt capture photos in kk kernals with CMA
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Let me see ... ... yeah it works
[Galaxy S I9000 Android Development] althafvly:
Hey. The new MM kernal with f2fs shows the old emulated partition. Shows the internal sdcard too

About 114mb left in system with f2fs

Also try to add CMA in Next MM build ☺☺?
[Galaxy S I9000 Android Development] (°_o):
If you dirty flashed remove this file

/data/system/storage.xml
[Galaxy S I9000 Android Development] althafvly:
No

Clean flash
[Galaxy S I9000 Android Development] (°_o):
Can you point me to the latest MM kernel?

Its been a long time I havent followed this thread. Just got my i9000 back.

Thanks.
[Galaxy S I9000 Android Development] althafvly:
Its in the omni MM thread.
[Galaxy S I9000 Android Development] (°_o):
Then why post here?

Kernel has nothing to do with how Android hanldes Storage.

I checked the omni thread and it's just a link.. Is it a new build or a ramdisk edited?

Anyways, let's move the discussion to there..
[Galaxy S I9000 Android Development] Coldwindofnowhere:
CMA news

Here are some news about the work on CMA for aries :

We can currently get a maximum of 449780 kB of ram .

Camera is working fine, even if it's a bit slow to start due to memory allocation/release.

All video recording modes are working.

Video playback seems to work fine (it needs more testing).

720p decoding is working with old unpatched libraries (without 720p patch).

Zsmalloc, Zram, Zcache and KSM are all enabled and it's quite usable.

We're still getting errors on allocation with zram, especially for mfc allocation (video playing) but i have no clue how to resolve them ....

FIMC 0/2 and JPEG allocations are working without any errors, even under stress test.

The kernel will be released when there wont be critical kernel errors anymore.

Please don't ask for ETA

Also, thanks a lot [MENTION=3807917]volk204[/MENTION] for helping me.

As usual if any dev wants to help us, feel free to PM me.

If anyone is curious, here is the error i'm stuck with :

<7>[ 666.820469] migrating range 34000 34e00, retry (0)
<6>[ 666.821302] __test_page_isolated_in_pageblock:111
<1>[ 666.821392] page:c1391300 count:1 mapcount:0 mapping: (null) index:0x4ef
<1>[ 666.821574] page flags: 0x60040008(uptodate|swapbacked)
<3>[ 666.821796] alloc_contig_range: test_pages_isolated(34000, 34e00) failed
<3>[ 666.821934] alloc_contig_range[6288] free 24394, cma count 20974
<3>[ 666.925305] alloc_contig_range[6293] free 24333, cma count 20975
<7>[ 666.925507] migrating range 34000 34e00, retry (1)
<6>[ 666.953528] s5p-cma: allocated pages for mfc

It happends when opening a video (yeah quite obvious) but only the first time you open it.

Maybe this will help but i'm really unsure....

By the way i was wrong, this issue is not related to Zram, nor Zsmalloc.
[Galaxy S I9000 Android Development] phil_greg2001:
That sounds good :good:
[Galaxy S I9000 Android Development] althafvly:
Still CMA is in what u won't do ??
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Experimental release

Here is the long-awaited CMA feature for MM, but before you do anything, note a few things:

- this is ONLY for MM aka android 6.0

- /system must be formated in ext4

- this is an EXPERIMENTAL release so except bugs

- the camera might not start sometimes

- all the logs are enabled so feel free to look at the kernel log

- i know everything isn't working so please don't tell me to fix something unless you have any log or idea on how to solve the issue

The change log is the following :

- CMA for aries devices added

- FMIC implementation of CMA and various fixes

- Zcache backported and enabled (thanks to [MENTION=5916159](°_o)[/MENTION] )

- Both Zcache and Zram uses now LZ4

- Big RCU update from 3.4

- Updated F2FS

(see GitHub for more)

Again thanks to [MENTION=3807917]volk204[/MENTION] for his help

Link

236f89a961b559c666a1c064aaccd728 Kernel_CMAEXP.zip
[Galaxy S I9000 Android Development] jupiter5700:
Thank you! And may be we will see next NO CMA kernel with all this features? ))
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Surely, i will release a kernel with standard bigmem for MM (and LP too if people are still using it), i'll just have to sync the latest changes to the 6.0 branch ... but it will be in a few days.

Also i will work on the 'standard' kernel features again once most CMA issues will be resolved.
[Galaxy S I9000 Android Development] jupiter5700:
Yes of course LP kernel also needed. Just tried your CMA kernel, work fine for now. Thank's again!

Unfortunately second boot and give black screen. Only power menu working. Revert back to stock kernel.

Tried second time. Playgame Subway Surfers - first attempt - slow mo, second attempt - system hang. Kernel still need to develop.
[Galaxy S I9000 Android Development] jupiter5700:
Black screen was due to somethink corrupted in data. Then i reverted back to stock sooty kernel i get black screen again. Factory reset solved this problem.

I am not programmer, unfortunately. System responce and performance i always checking by Sybway Surfers game, if game run perfect, without any little lag then system will be worked perfectly. Ok i will try to disable zRam and swap by deviltools and check again.

I think i find black screen reason. Im turn off zRam and set Swappines to 0% by devil tools, start Subway Surfers and game hang on game boot screen, all systen hung and do not answer on keys. After reboot i see black screen, only power menu available. Something corrupts in data.
[Galaxy S I9000 Android Development] (°_o):
The black screen, and system freezes are caused by 100% CPU usage. This stuffs are hard to debug because you cant even get logs. I was able to get one top output when this happened.

There must be a deadlock or an infinite loop somewhere.
[Galaxy S I9000 Android Development] Trainer_H:
So we can use your updated F2FS only for /data and not for /system?
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Yeah, you can still try it with f2fs on /system but i think you'll get in a bootloop.
[Galaxy S I9000 Android Development] Trainer_H:
i just try it wit A-Rom and F2FS /system and if i try to start, my phone goes back to TWRP.

I think with CMA and F2FS /system we can get the maximum out of our phone.
[Galaxy S I9000 Android Development] Coldwindofnowhere:
This will be for later, i prefer focusing on a less buggy CMA for now.
[Galaxy S I9000 Android Development] (°_o):
Well ofcourse, f2fs uses a lot of caching..

I think the current max limit is set to 10MiB. So with two f2fs that's 20MiB..

Yeah, it won't always use the whole 10MiB.. but I've seen it go easily upto 7-8MiB
[Galaxy S I9000 Android Development] Coldwindofnowhere:
The only problem is that we cannot switch from ext4 to f2fs on the fly. It would be great to have a kernel that support both ext4 and f2s formated partitions.

I guess that it should be possible to make busybox choose the right fs, but i have no idea if it's possible. (see commit)
[Galaxy S I9000 Android Development] (°_o):
Yeah it could be done.. but I will need to see the /stage1/busybox

And looking at the script.. the only reason it mounts /system is to check for /system/build.prop

I guess the logic is if there is no build.prop the user rebooted from recovery without installing ROM.. so that checks for it and reboots to recovery..

Which gets me thinking.. the actual problem.. why isn't it going to recovery by just holding the buttons..

Like we couldnt boot reboot to recovery, if /data is not formatted to f2fs earlier...

Android asks to boot to recovery thinking data is corrupted.. but then it just gets stuck at bootlogo.. until we flash with Odin...

Something is really wrong with booting to recovery detection..
[Galaxy S I9000 Android Development] xc-racer99:
The stage1 busybox is just the static busybox executable so it should work for whatever you have in mind. Note that when it checks mounting /system we do not have access to any of the rest of the ramdisk (including fstab.aries) as its extracted near the end.

I have no problem (on my variant) of booting into recovery by using the keys or with having difficulty rebooting into recovery from Android. Perhaps a regression introduced into your trees? (I build from my own).
[Galaxy S I9000 Android Development] (°_o):
Uhh.. yeah thats what I wanted to to check the busybox.. If there is `blkid` command in the busybox.

blkid raw scans block devices and lists their uuid's and fs types, without mounting..

I just wrote and tested this snippet on shell and it works.. but I have no way of checking on stage1

test_fs_type() {
blkdev="$1"
fs_type=$(busybox blkid "$blkdev" | busybox awk -F 'TYPE=' '{print $2}' | busybox sed -e 's/"//g' )
echo "$blkdev filesystem is $fs_type"
}

test_fs_type /dev/mapper/lvpool-userdata
test_fs_type /dev/mapper/lvpool-system

No thats not what I meant... The script is mounting /system and checking for build.prop..

If build.prop is not there it means no rom was flashed..

Which will get the device stuck on samsung boot logo, with no way to boot into recovery.. the recovery combo wont work...

You can try deleting everything in /system except build.prop and see what I mean...
[Galaxy S I9000 Android Development] xc-racer99:
Yeah, I think we're kinda saying the same thing here but in different words...

Anyways, the stage1 busybox is copied in from the utilities folder in https://github.com/Coldwindofnowher...lob/android-5.1/usr/galaxysmtd_initramfs.list (as you probably already know). I have attached a copy of the static executable for you to test with (unfortunately in a zip as XDA won't allow me to upload the file directly) - just append /path/to/unzipped/busybox before each command to make sure you're using the right version.
[Galaxy S I9000 Android Development] (°_o):
You are currently using the CMA version right? Cause that disable bigmem, so maybe issue is with bigmem... it adds stuff to bootmodes..

Errm.. you can just modify the path temporarily

# PATH=/data/local/tmp busybox sh /data/local/tmp/fstest.sh
/dev/mapper/lvpool-userdata filesystem is f2fs
/dev/mapper/lvpool-system filesystem is ext4

Anyways, looking at the busybox.. we could just remove the fs type and just do a busybox mount without the '-t' ...

mount uses blkid if no fstype is given i think..
[Galaxy S I9000 Android Development] xc-racer99:
Good point, that's probably easiest.

And no, I'm using my own kernel as my variant is weird (to my knowledge, I'm the only one that's ever built a ROM for it).

Do note that there are some issues with using busybox to mount when detecting the fs, if you happen to run it on an MTD partition (cache and datadata in the i9000s case, but my variant has /system on it as well), it causes a complete system crash.
[Galaxy S I9000 Android Development] (°_o):
[MENTION=5414656]xc-racer99[/MENTION] No idea about that.., which fs were you trying for mtd?

Anyways I modified stage 1 init and added fs detection and fallback to without fs type. It works for ext4, I dont see why it wouldnt work for f2fs.

And after lot of hex dumping, I was able to extract the ramdisk and recovery img from zImage.

And done some weird symlinking to get the kernel built without the full ROM source.

Anyways I have attached the zip below, so if anyone is on /system f2fs can try it and report back.

If it boots, upload the /boot.txt

This is a test CMA version with some minor changes. The prior work was done by if you didnt know yet, [MENTION=6794010]Coldwindofnowhere[/MENTION]

The following data won't be consistent with the CMA released earlier by him. But the concept should be same.

These are my findings, and insights are from my understandings, they might not be totally accurate. If anyone with more experience can correct or clear somethings, it will be grateful.

The actual available memory for "Normal" use is 371.8MiB.

Yes, lower than non-cma kernels. Because 80MiB is reserved for DMA in CMA version. (In non-cma kernels with no bigmem it's 68MiB, might be due to unaligned allocations)

Out of 80MiB, 76Mib is only reserved so 4Mib is kind of wasted right now. But I dont know which device to give that.

Currently: MFC L/R, FIMC 0/2 and JPEG use seperate CMA areas of 16,24,16,16,4 respectively.

CMA only seems to reserve 4MiB aligned, so JPEG gets 4MiB even tho its actual requested size is 900KiB. I think a better option would be to set DMA only 76MiB, so "Normal" memory will increase a bit.

A even better option would be to unify FIMC,JPEG and FIMD CMA areas. ( FIMD reserves 750KiB and is not CMA'ed yet.)

A bigger "Normal" area is better than CMA area,as CMA area can only be used by movable pages. At least in our version and implementation, it's used by fs caches, I don't know if it's used for page caches or not.

Movable pages can be migrated, this might be why camera was not working after sometime, as the reserved mem was exactly needed.

I have increase the values of reserved memory, and also ignored the base address restriction, so the allocation likely won't fail due to them.

But sometimes due to free_cma taking a long time, the camera seems to crash. But now at least theres no need to reboot.

Sometimes, the allocation will still fail due to insufficent free space in CMA area, this seems like a general problem with older CMAs, which is the version we use.

So before using camera, closing all apps should be helpful.

Also the device freezes during memory pressure, especially multi-tasking, and memory intesive apps.

But IIRC this used to happen in non-cma kernels too, so I guess some other thing is fvcked up.

Okay I just got this, and one thing I noticed is that zRAM was full. So the freezes are due to memory pressure alright. But why?

All in all, I think CMA on this device as of now, should be taken as "broken by design bigmem without rebooting".

Maybe things will change in the future.
[Galaxy S I9000 Android Development] xc-racer99:
I wasn't trying anything new, I just couldn't figure out for the life of my why recovery kept rebooting when trying to install SuperSU/gapps - turns out Busybox started using blkid in around August 2015 so when the updater-script called "mount /system" it used blkid on the mtd partition causing a reboot. I ended up patching busybox (see here). Probably will never happen on the i9000 except for perhaps /cache.
[Galaxy S I9000 Android Development] rootingguide:
I have flashed latest Omni and your kernel on f2fs /system partition and it booted fine. Can`t tell anything about stability yet.

edit: Camera app seems working fine but after capturing a photo or starting video recording is`s giving error something like "unable to connect to camera", so it`s unusable. Internet browsing is very unstable without ability to play videos on every browser i tried (stock, UC, Opera, Speed Browser). Visiting xda forum in most cases caused system crash on every browser. Anyway UI is very smooth and responsive.
[Galaxy S I9000 Android Development] (°_o):
CMA is really broken as of now.

Anyways, I looked into No-cam mode as we only had 426MiB there but 439MiB in CMA.

So, I found out that there was some error due to removing of FIMC1. And sort of fixed it.

However I noticed there was some disproportions in XLMem and BigMem. So for now I kept them the same and have not even tested it.

I will need to discuss about this and patched libs with [MENTION=6794010]Coldwindofnowhere[/MENTION] and [MENTION=5414656]xc-racer99[/MENTION] .

Also, normal mode memory is decreased a few megabytes because I fixed the overlapping of MFC and JPEG. This might fix some problems with camera, just saying not tested.

Well, for now, enjoy the 439MiB No-cam mode.

Or maybe test BigMem/XLmem (same) mode

(you could say they are combined as now they do what both of them use to do seperately), if you want to help.

This should work on both ext4 amd f2fs /system. Credits to [MENTION=7115391]rootingguide[/MENTION] for initial testing for f2fs.
[Galaxy S I9000 Android Development] ghorban_pirizad:
720p

---------- Post added at 08:29 PM ---------- Previous post was at 07:33 PM ----------

I can't play 720p video in last 5.1 kernel?
[Galaxy S I9000 Android Development] Coldwindofnowhere:
Just dropping out a MM kernel with various fixes and a completely updated RCU from linux 3.4.

I have no idea if the performance will be better or worst .... needs testing but i don't have the time to do it.

Note that the kernel is booting but i haven't made any test

Edit : after some tests, i find it a bit slower to boot but the benchmark score is way higher ....