[MDPI][412MB RAM] CM10 720p video recording 30 fps

Search This thread

miniuser123

Senior Member
Aug 17, 2012
203
1,641
V2:

It was tested by me only on latest cm10 nightly, but it is possible that it might work on top of other CM10 roms too (reported to work on SJB 8 too).

Install:
0. Make backup
1. install latest cm10 nightly (20131006):
http://download.cyanogenmod.com/?device=smultron
2. flash kernel - DEVICENAME_naaashmem.img
3. flash zip - cm10_enable720p_v2_allinone.zip or cm10_enable720p_v2.zip. The first one includes some useful mods not related to camera, read changelog (Other mods) below! The second one only includes stuff related to camera.

Downloads at:
https://www.mediafire.com/folder/1t1kwpbtbcl6w/cm10v2

Use default camera app for best results!

Changelog:
-enabled video stabilization (forced on for now, might make it optional later)
-disabled face detection in recording mode in default camera app to improve fps, it wasn't working anyway
-no-copy patch for recording buffer to regain ram and improve fps
-use ashmem instead of pmem for graphic buffers to regain even more ram (stock ics does this too). No issues found so far, performance is like before.
-total ram: 412 MB, out of which 4 megs is always allocated for gr. buffers, so 408 MB really
-stock ics like autobrightness enabled
Other mods (only included in cm10_enable720p_v2_allinone.zip):
-electron beam animation
-faster scrolling, reduced scroll friction
-more strick dalvik vm to save 1-1.5 MB ram per app.
-fixed web browser crash on some video sites


Sources:

The kernel is based on
https://github.com/nobodyAtall/msm7x30-2.6.32.x-nAa

The files modified by me can be found at https://www.mediafire.com/folder/m0t4hx8ac4hhz/naa_kernel
The changed files are to be copied here:
arch/arm/mach-msm/

Modified ramdisk file (init.rc) is also uploaded at the same place.

My CM10 patches are here:
https://www.mediafire.com/folder/gw8sy9ozc8cos/sourcepatch

V1:

I have been testing 720p recording in CM10 roms recently. It looks like it is not impossible to reach good fps in CM after all.
It was inspired by the maker of MESA kernel an0nym0us_ who used stock camera lib in cm10. Big thanks to him!
My test rom was SJB 8.0 and CM10 nightly 2013.10.06.
Basically I did 3 modifications:
1. Copied camera.semc.so to /system/lib/hw/
2. Modified media_profiles.xml
3. Modified pmem sizes in kernel. Used nAa kernel as base. Free ram is 388 MB at the moment. Still testing it...

The result is good hd recording at near 29.7 fps. The smoothest results come in the camera app found in Super Jelly Bean 8.0. Other apps like stock CM cam and LGCamera produce around 25-27 fps but it can be improved with a tweak.

So here is what to do:
1. Flash kernel (mini_naa720p.img or minipro_naa720p.img or lww_naa720p.img or active_naa720p.img)
2. flash zip in cwm (cm10_enable720p.zip)

https://www.mediafire.com/folder/f28fff1i6i5v1/


Make sure nothing is runnning (like mediascanner) when recording!

Check video fps with ffmpeg in terminal emulator:
Type
Code:
ffmpeg -i videoname.mp4

If fps is only around 25-27 try this in terminal:

Code:
su
renicesflinger.sh 0

Pls report back if it's working for you, I was a bit tired when writing this...


---------------------------------------------------------------------------------------------------

About the kernel: it's based on
https://github.com/nobodyAtall/msm7x30-2.6.32.x-nAa

I changed one file:
arch/arm/mach-msm/board-semc_mogami.c

The changed file can also be found at https://www.mediafire.com/folder/f28fff1i6i5v1/

Current values are these:

Code:
#define MSM_FB_SIZE		0x200000

#define MSM_PMEM_SF_SIZE	0x800000
#define MSM_PMEM_CAMERA_SIZE		0xBE0000
#define MSM_PMEM_ADSP_SIZE			0x1F80000

I think 1 mb more ram can be regained...
 
Last edited:

danutzgtx480

Senior Member
Apr 26, 2012
270
296
Can you post some recording samples?On stock .587 FW audio & video recording is very good so it would be great to compare the quality ;)
 

Grof87

Senior Member
May 29, 2013
246
62
Can you post some recording samples?On stock .587 FW audio & video recording is very good so it would be great to compare the quality ;)

MX player says it's 6mb/s, I did a quick capture (20-30 secs) it looks great on the phone. I can't say how well it looks on pc because I'm having some trouble with my sd-card (it wont show all the folders, only 4-5, when I connect it to a pc - this is not related to this great mod by miniuser123)
 
  • Like
Reactions: miniuser123

RaptorX88

Member
Oct 19, 2011
45
5
27
Palghat
Test with CM 10.1

The kernel contains a ramdisk for jb4.2 so it's not impossible. You could perhaps try...



Added source change to opening post.

Nope..It doesnt boot,after the bootanim,a blackscreen comes and stays like that.Tested with JV 6.0(Maybe its because it was based on CM10.1 LX 20131108 NIGHTLY for anzu and coconut ? :rolleyes:)
 

miniuser123

Senior Member
Aug 17, 2012
203
1,641
No....the camera libs are only compatible with 2.6.x kernel ....There are no libs compatible with 3.4.x kernel and rewriting them will take years ...

Just managed to get stock camera lib to work with kernel 3.4. It was really easy too:). FPS is almost as good as in kernel 2.6.
I tried it in CM10, I hope it will work in kitkat... Will install cm11 tomoz.


My theory: cm and stock camera lib only differs in that stock uses pmem_camera, while cm one uses pmem_adsp. For some reason pmem_camera is faster, probably because it is cached pmem (not sure what that means in case of pmem)...
 

rahimali

Senior Member
Just managed to get stock camera lib to work with kernel 3.4. It was really easy too:). FPS is almost as good as in kernel 2.6.
I tried it in CM10, I hope it will work in kitkat... Will install cm11 tomoz.


My theory: cm and stock camera lib only differs in that stock uses pmem_camera, while cm one uses pmem_adsp. For some reason pmem_camera is faster, probably because it is cached pmem (not sure what that means in case of pmem)...

did you just say you got stock ICS cam libs working with 3.4 kernel? then there's hope for us/our devices, lots of hope!!! :)
 

RaptorX88

Member
Oct 19, 2011
45
5
27
Palghat
Just managed to get stock camera lib to work with kernel 3.4. It was really easy too:). FPS is almost as good as in kernel 2.6.
I tried it in CM10, I hope it will work in kitkat... Will install cm11 tomoz.


My theory: cm and stock camera lib only differs in that stock uses pmem_camera, while cm one uses pmem_adsp. For some reason pmem_camera is faster, probably because it is cached pmem (not sure what that means in case of pmem)...

:D LINK PLEASE!! we'll test it.
 

Vynikal

Senior Member
Sep 29, 2012
1,021
765
Just managed to get stock camera lib to work with kernel 3.4. It was really easy too:). FPS is almost as good as in kernel 2.6.
I tried it in CM10, I hope it will work in kitkat... Will install cm11 tomoz.


My theory: cm and stock camera lib only differs in that stock uses pmem_camera, while cm one uses pmem_adsp. For some reason pmem_camera is faster, probably because it is cached pmem (not sure what that means in case of pmem)...
Is it even possible!? Great work, please test it asap. :victory:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 81
    V2:

    It was tested by me only on latest cm10 nightly, but it is possible that it might work on top of other CM10 roms too (reported to work on SJB 8 too).

    Install:
    0. Make backup
    1. install latest cm10 nightly (20131006):
    http://download.cyanogenmod.com/?device=smultron
    2. flash kernel - DEVICENAME_naaashmem.img
    3. flash zip - cm10_enable720p_v2_allinone.zip or cm10_enable720p_v2.zip. The first one includes some useful mods not related to camera, read changelog (Other mods) below! The second one only includes stuff related to camera.

    Downloads at:
    https://www.mediafire.com/folder/1t1kwpbtbcl6w/cm10v2

    Use default camera app for best results!

    Changelog:
    -enabled video stabilization (forced on for now, might make it optional later)
    -disabled face detection in recording mode in default camera app to improve fps, it wasn't working anyway
    -no-copy patch for recording buffer to regain ram and improve fps
    -use ashmem instead of pmem for graphic buffers to regain even more ram (stock ics does this too). No issues found so far, performance is like before.
    -total ram: 412 MB, out of which 4 megs is always allocated for gr. buffers, so 408 MB really
    -stock ics like autobrightness enabled
    Other mods (only included in cm10_enable720p_v2_allinone.zip):
    -electron beam animation
    -faster scrolling, reduced scroll friction
    -more strick dalvik vm to save 1-1.5 MB ram per app.
    -fixed web browser crash on some video sites


    Sources:

    The kernel is based on
    https://github.com/nobodyAtall/msm7x30-2.6.32.x-nAa

    The files modified by me can be found at https://www.mediafire.com/folder/m0t4hx8ac4hhz/naa_kernel
    The changed files are to be copied here:
    arch/arm/mach-msm/

    Modified ramdisk file (init.rc) is also uploaded at the same place.

    My CM10 patches are here:
    https://www.mediafire.com/folder/gw8sy9ozc8cos/sourcepatch

    V1:

    I have been testing 720p recording in CM10 roms recently. It looks like it is not impossible to reach good fps in CM after all.
    It was inspired by the maker of MESA kernel an0nym0us_ who used stock camera lib in cm10. Big thanks to him!
    My test rom was SJB 8.0 and CM10 nightly 2013.10.06.
    Basically I did 3 modifications:
    1. Copied camera.semc.so to /system/lib/hw/
    2. Modified media_profiles.xml
    3. Modified pmem sizes in kernel. Used nAa kernel as base. Free ram is 388 MB at the moment. Still testing it...

    The result is good hd recording at near 29.7 fps. The smoothest results come in the camera app found in Super Jelly Bean 8.0. Other apps like stock CM cam and LGCamera produce around 25-27 fps but it can be improved with a tweak.

    So here is what to do:
    1. Flash kernel (mini_naa720p.img or minipro_naa720p.img or lww_naa720p.img or active_naa720p.img)
    2. flash zip in cwm (cm10_enable720p.zip)

    https://www.mediafire.com/folder/f28fff1i6i5v1/


    Make sure nothing is runnning (like mediascanner) when recording!

    Check video fps with ffmpeg in terminal emulator:
    Type
    Code:
    ffmpeg -i videoname.mp4

    If fps is only around 25-27 try this in terminal:

    Code:
    su
    renicesflinger.sh 0

    Pls report back if it's working for you, I was a bit tired when writing this...


    ---------------------------------------------------------------------------------------------------

    About the kernel: it's based on
    https://github.com/nobodyAtall/msm7x30-2.6.32.x-nAa

    I changed one file:
    arch/arm/mach-msm/board-semc_mogami.c

    The changed file can also be found at https://www.mediafire.com/folder/f28fff1i6i5v1/

    Current values are these:

    Code:
    #define MSM_FB_SIZE		0x200000
    
    #define MSM_PMEM_SF_SIZE	0x800000
    #define MSM_PMEM_CAMERA_SIZE		0xBE0000
    #define MSM_PMEM_ADSP_SIZE			0x1F80000

    I think 1 mb more ram can be regained...
    26
    Good news! Finally got the ion version working. Recording and playback are fine too. I will upload sources to github in a few days and release a test version for mini users.
    23
    For stereo recording try this file:
    http://www.mediafire.com/download/ak8ytyqtj18w65x/audio.primary.msm7x30.so
    Copy it to /system/lib/hw, set permisssion to 644 and reboot (or type killall mediaserver in terminal).

    It enables dual mic real stereo recording mode like in stock ics. Unfortunately volume is still very low, no improvement on that front:(.

    Regarding CM 10.1 and 10.2: my modification could be applied to them, but it should be based on kernel 3.4, because some things would be difficult to fix in the 2.6 kernel (bluetooth is the most problematic). I did some work on 10.2, but I went back to cm 10 because it had better performance imho.
    My only problem with cm10 that it has some terrible memory leaks in SystemUI and webkit. After browsing the net for half an hour, the memory usage of the browser is usually above 200 MBs... So I might leave cm10 in the future.

    Did you just pick my back mic patch for stereo recording or you made additional changes? I guess the latter.
    Can you share the source fix?

    About the new ION kernel now: I have tried your patches but didn't work out of the box and broke camcorder. The problem now is that we can't use the system heap for camera preview since it's ION and we want pmem. Now the only pmem heap we have is pmem_adsp and it's used only for camera and nothing else, I guess this could simplify your buffer copying code.

    I suggest either cm-10.1 or cm-11.0, cm-10.2 is the heaviest of all versions. But we have some problems: qcom released code needed for msm7x30 support up to android 4.2 and then dropped support. We can bringup cm-10.1 with ION kernel and it will be almost perfect in terms of functionality and support from qcom, but that requires porting the kernel again on top of jb 4.2 qcom branch and adapting the device trees for ION, so it can take some time. We have ported most of the code from qcom's 4.2 branches to cm11 and we have almost fully functional builds except some small audio issues.

    Now, it's up to you to choose on which branch you are going to work.

    EDIT: we are also working on bringing official Omni 4.4 support which seems to be much faster than cm but of course it misses a lot of features.
    21
    I haven't played with libgemini...
    I am trying to get rid of the inefficient memcopying which I mentioned earlier, 50 percent of the job done. It would be a breakthrough if it worked.

    I managed to make video encoding less cpu intensive by using the camera recording buffer as input for the encoder, no more stupid copying to temporary adsp buffer. Now getting 28 fps with stabiliztation on, and 29.5 fps with stabilization off. This should also allow us to free up some more pmem. I will try to clean up the code a bit next week and optimize pmem usage.
    21
    I don't have a hdpi device so I don't support them, but Mike's LX roms will possibly have 720p recording enabled in the future for all devices when migration to ION is done.

    For CM10 (my daily rom atm) I am planning to release an update for mpdi devices. It will have 400 mb usable ram, decent fps with video stabilizer.

    Hi,
    camera is already working on ION kernels so I thought to start working on 720p recording again. Have you made any updates to your code or it's the same as the patches you provided before?