• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[DEV][TUT][JB] Camera Fix / Workaround JB [PLAY]

Search This thread

wedgess

Retired Forum Mod / Inactive Recognized Developer
Apr 23, 2012
3,229
14,093
Dublin, Ireland
www.pac-rom.com
Hi.
Just though I would create this thread to help other dev's with getting the camera to work on JB.
This example is for compiling from source.

I will give a guide with commits I have just made on an example repo for the purpose of this thread.

I have made all the changes to zeus they are exact same for zeusc



You will need to -


- Get libstagefright_soft_aacdec.so from the attachment below (extract the zip) or any working ICS ROM for our device

Place libstagefright_soft_aacdec.so into vendor/semc/zeus/proprietary/lib

https://github.com/garwedgess/propr...mmit/004057e96521b231e2b42800e5ea142a3ff8dde5


- Then add the path to zeus-vendor-blobs.mk in vendor/semc/zeus
NOTE - Do not add it to last line add it like this

Copy the whole line I made a mistake with initial commit :silly:

https://github.com/garwedgess/propr...mmit/1947b88aa45b2b879ac49241118a9cebcfa520b5


- Lastly Go into device/semc/msm7x30-common ----> open BoardConfigCommon.mk and make the changes like in this commit I have made


https://github.com/garwedgess/andro...mmit/d58dd288c1d277e661a4cb533fa8b9c6515c349f

You do not need last line TARGET_BOOTANIMATION_RGB565 := true


That is it, this will let you have a working legacy camera only thing that doesn't work is panorama. JB camera will not FC, can still take pictures and record but unusable due to the green tint on screen :(

Hope this guide helps you all to bring more JB ROM's to the PLAY and will hopefully help the development of JB on our device.
 

Attachments

  • libstagefright.zip
    125.7 KB · Views: 122
Last edited:

farenheith

Senior Member
Apr 5, 2011
858
423
Carapicuíba

Sorry xD. I meant about your shot.

Nice share! Have you tried porting official latest ICS camera sources or is that what you've already done? Anyway, perhaps the green tint is due to the RGBA offset change made to jellybean. See http://review.cyanogenmod.org/#/c/20403/

This change on the RGBA offset doesn't may affect the legacy camera too? I mean, if this is causing the green tint, then the legacy camera would have this problem too, isn't it?
 

wedgess

Retired Forum Mod / Inactive Recognized Developer
Apr 23, 2012
3,229
14,093
Dublin, Ireland
www.pac-rom.com
Oh! So only JB Camera has a green tint but ICS AOSP Camera is fine? Sorry I misunderstood :) I have no idea then.

Ye JB camera has the green tint on preview, however it can take pictures fine, record fine and no FC's. On legacy camera only thing not working ATM is panorama, this will give a FC :(

Sent from my GT-I9300 On Official JB
 

CosmicDan

Senior Member
Jun 19, 2009
5,890
7,736
34
Sydney
Google Pixel 3 XL
Xiaomi Poco X3 Pro
Ye JB camera has the green tint on preview, however it can take pictures fine, record fine and no FC's. On legacy camera only thing not working ATM is panorama, this will give a FC :(

Sent from my GT-I9300 On Official JB

Only on Preview? Maybe I will take a look at the smali and hack it to use same preview functions that AOSP camera does then. But not any time soon, so anyone else feel free to do it :p
 

farenheith

Senior Member
Apr 5, 2011
858
423
Carapicuíba
I had the same idea.

If you want, you can see the original source code of both, jellybean and cm9.1 brand, here:
https://github.com/CyanogenMod/android_packages_apps_Camera

I think it's easier to see patterns on java/c++/c code than smali. I analyzed until now the jni folder (cpp and c files). I didn't found much relevant difference :/...

  • jni/feature_mos/src/mosaic/Mosaic.cpp
    The code looks very the same, but on Jellybean this file have some treatment on a field called owned_frames. This field is declared at Mosaic.h and the ICS code looks pretty compatible with the JB one. Maybe is possible to compile the JB camera replacing this file for the one from ICS code... About what is owned_frames I didn't investigated yet xD.
  • jni/mosaic_renderer_jni.cpp
    This code looks to be optimized on JB. On ICS we have a lot of buffer treatment (clean and fill) that in JB code is replaced by comments like "there's no need to clean the buffer". The initizliation of some semaphores has been moved either... on JB we have those jni functions: JNICALL JNI_OnLoad and JNICALL JNI_OnUnload. Looks like some semaphores is been initialized and destroyed there, instead of AllocateTextureMemory (for the sem_init) and FreeTextureMemory (for the sem_destroy)

Until now this is the only potential relevant info :(. Maybe I'm looking at the wrong place
 
Last edited:

ravid1323

Senior Member
May 27, 2012
295
33
No, that's just basic change. We will soon have JB camera working thanks to CMX10 and wedgess (but probably no Photosphere because it requires gyroscope hardware AFAIK)

that's makes me happy :) but i thought that it will possible only with newer kernel. anyway, it doesn't so bad the missing photosphere. it's like on galaxy s. and about littel missing smooth, it is can done like here: http://forum.xda-developers.com/showthread.php?t=2013425 and about the other things that don't works, i belive that with help from markphyton, the other things will be fixed like what wedgess did with ics camera libs

and all this makes me happy!
 

CosmicDan

Senior Member
Jun 19, 2009
5,890
7,736
34
Sydney
Google Pixel 3 XL
Xiaomi Poco X3 Pro
that's makes me happy :) but i thought that it will possible only with newer kernel. anyway, it doesn't so bad the missing photosphere. it's like on galaxy s. and about littel missing smooth, it is can done like here: http://forum.xda-developers.com/showthread.php?t=2013425 and about the other things that don't works, i belive that with help from markphyton, the other things will be fixed like what wedgess did with ics camera libs

and all this makes me happy!

I have no idea what you're talking about. This is for Jellybean, not ICS. Wedgess, I and FXP are the main developers of JB for our device.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 18
    Hi.
    Just though I would create this thread to help other dev's with getting the camera to work on JB.
    This example is for compiling from source.

    I will give a guide with commits I have just made on an example repo for the purpose of this thread.

    I have made all the changes to zeus they are exact same for zeusc



    You will need to -


    - Get libstagefright_soft_aacdec.so from the attachment below (extract the zip) or any working ICS ROM for our device

    Place libstagefright_soft_aacdec.so into vendor/semc/zeus/proprietary/lib

    https://github.com/garwedgess/propr...mmit/004057e96521b231e2b42800e5ea142a3ff8dde5


    - Then add the path to zeus-vendor-blobs.mk in vendor/semc/zeus
    NOTE - Do not add it to last line add it like this

    Copy the whole line I made a mistake with initial commit :silly:

    https://github.com/garwedgess/propr...mmit/1947b88aa45b2b879ac49241118a9cebcfa520b5


    - Lastly Go into device/semc/msm7x30-common ----> open BoardConfigCommon.mk and make the changes like in this commit I have made


    https://github.com/garwedgess/andro...mmit/d58dd288c1d277e661a4cb533fa8b9c6515c349f

    You do not need last line TARGET_BOOTANIMATION_RGB565 := true


    That is it, this will let you have a working legacy camera only thing that doesn't work is panorama. JB camera will not FC, can still take pictures and record but unusable due to the green tint on screen :(

    Hope this guide helps you all to bring more JB ROM's to the PLAY and will hopefully help the development of JB on our device.