[Port][App] GS3 TouchWiz camera app for all AOSP 4.2.2 ROMs [4.3 beta now available!]

Search This thread

Treeki

Member
Jan 10, 2013
25
133
Hi! This is my first mod for Android; a partially working attempt at getting the Samsung camera (from the leaked 4.2.2 ROM; XUFME7) to work on AOSP ROMs. Not a skin, this is the full camera along with most of the features!

Want to see it in action? No screenshot - it looks exactly the same as on TW ROMs - but here's a video. http://www.youtube.com/watch?v=mYX4PSVDiIU Apologies for the terrible quality, but it's hard to film a phone with the Nexus 7's front camera, and I couldn't find a decent screen capture app :<

--

Port for Android 4.3
Beta version NOW AVAILABLE, click here for details + download: http://xdaforums.com/showpost.php?p=46566446&postcount=135
It doesn't work as well as the 4.2.2 version - in particular, video recording is 100% broken, even in the AOSP camera - but you can still try it out if you don't mind this!

--

Port for Android 4.2.2

Working/Non-Working Features List:
What Works:
Front and back cameras
"Wand" Filters
Flash
Auto & Macro focus modes
Tap-to-focus
White Balance options
GPS tagging
Gallery shortcut (uses AOSP Gallery)

Shooting modes:
Single Shot
Best Photo
Face Detection
HDR
Beauty
Smile Shot
Low light

Possibly Working, depending on kernel:
(These features require that the mediaserver process can write to /sdcard (for burst shot/best face) and /data (for panorama). The only way to change this is using a modified kernel with an init.rc which gives it that access. In my experience, with Googy-Max kernel, Panorama works but the other two don't. Your mileage may vary.)
Burst shot
Best Face
Panorama

Not Working, may be fixed later:
Shutter sounds
Automatic mDNIe / screen brightness adjustment

Not Working, unlikely to be fixed:
Camcorder
Share Shot
Voice recognition
Weather/city photo tagging in the media database (what's this used for exactly?)

Untested:
Buddy Photo Share
External SD card

Download:

Download:
This patch is ONLY compatible with AOSP-based 4.2.2 ROMs running on the GT-I9300 and GT-I9300T; the international models of the Galaxy S3 (Exynos chip, no LTE)
CWM zip: http://d-h.st/sg8 (5.26 MB / MD5: f53d603f49de1bb0aba90546b9bbc1ce)

Notes:
This patch has only been tested on RootBox 4.1. Please let me know if you have trouble using it on any other ROM!



Disclaimer:
This is an experimental patch, and you install it at your own risk! I am not responsible for anything that occurs as a result of this. Always make backups.

Installation:
You need a recovery that allows you to install .zip files; most likely CWM or TWRP. But you probably already have one of these if you're running AOSP on this phone :p

1. Boot into recovery mode: turn the phone off, hold down VolumeUp+Home and then press the power button
2. Make a Nandroid backup (not obligatory, but recommended in case something goes wrong!)
3. Flash the camera mod zip
4. Wipe the Cache and Dalvik Cache - just in case

Hope you enjoy it! Now go out and take some awesome photos :D

Changelog:
20th July 2013: Released first version. Camera (+ most features) is functional. Camcorder appears but does not record successfully.
22nd July 2013: Released new version which should work on any AOSP ROM, instead of needing a custom built ROM.
17th October 2013: 4.3 beta release is out.
 
Last edited:

Eleve11

Senior Member
Oct 1, 2011
884
280
Stockholm
Hm, I'm guessing that the picture quality isn't different from the AOSP camera app and this tho there still is missing sources from Samsung that we'll never get.:confused:

Otherwise. Nice mod! :)
 
  • Like
Reactions: dboechat

Treeki

Member
Jan 10, 2013
25
133
Hm, I'm guessing that the picture quality isn't different from the AOSP camera app and this tho there still is missing sources from Samsung that we'll never get.:confused:

Otherwise. Nice mod! :)
Thank you :D

I've seen people talk about how the camera on AOSP is worse because of missing sources, but I'm not sure what sources these are. The Samsung kernel module is open source, and this mod replaces all the user space code related to the camera - as far as I know, anyway - with the TW versions. (Please correct me if I'm wrong on this :p)

This is purely anecdotal and rather hard to test accurately, but I never noticed much of a difference in picture quality between AOSP and TW, I just wanted the camera app because of the extra modes and options that are really useful.
 

iSasha

Member
Jun 30, 2012
13
0
Well, the full version method didn't work for me on todays' CM nightly build. I installed it following the procedures, and then opened the camera app. The screen went black, and then froze. I restarted the phone, and it kept looping on the boot animation :(

Luckily I don't delete the CM updater temporary files, so I was able to boot into recovery and re-install the 'stock' CM build. Also, despite the fact that I mostly understood the instructions, they were quite confusing!
 

Treeki

Member
Jan 10, 2013
25
133
Okay, so I just flashed the modified Rootbox rom, and the burst shot feature does not work properly. The little counter bar comes up, but doesn't shoot photos at all. Also breaks functionality after that, not even the close button works.
Just as I expected :( I'll have to figure out a fix for this somehow...

Writing to /data does seem to work, so maybe I can patch the Samsung lib to store burst shots there, and move them to the SD card from the camera apk :x

Well, the full version method didn't work for me on todays' CM nightly build. I installed it following the procedures, and then opened the camera app. The screen went black, and then froze. I restarted the phone, and it kept looping on the boot animation :(

Luckily I don't delete the CM updater temporary files, so I was able to boot into recovery and re-install the 'stock' CM build. Also, despite the fact that I mostly understood the instructions, they were quite confusing!
Apologies for the confusing instructions :< I think I got carried away a bit with the technical details!

You cannot use this mod with an existing build of another ROM (like the CM nightlies) unless it has been compiled with the source code patches I provided. Samsung's camera libs are not compatible with normal AOSP builds, but my patches change the interface in AOSP to fix that.

It's a bit of a lofty goal but I hope that other ROMs will some day include these patches, because it doesn't affect normal camera operation, and it allows you to use the Samsung camera if you flash the appropriate libs...

I would like to provide builds of other ROMs in the future, but this is difficult to do because it takes me 2-3 days to download the source code of each ROM and 8 hours to compile it from scratch - this is why I only have RootBox right now. So it would be extremely helpful if other developers would integrate this.

does hdr work? is it like the tw cam?
HDR works perfectly :D Exactly like in the TW 4.2 camera, you get an Options menu with Normal/Strong HDR effect and with the option to save original/HDR photo or just HDR.
 

iSasha

Member
Jun 30, 2012
13
0
Apologies for the confusing instructions :< I think I got carried away a bit with the technical details!

You cannot use this mod with an existing build of another ROM (like the CM nightlies) unless it has been compiled with the source code patches I provided. Samsung's camera libs are not compatible with normal AOSP builds, but my patches change the interface in AOSP to fix that.

It's a bit of a lofty goal but I hope that other ROMs will some day include these patches, because it doesn't affect normal camera operation, and it allows you to use the Samsung camera if you flash the appropriate libs...

I would like to provide builds of other ROMs in the future, but this is difficult to do because it takes me 2-3 days to download the source code of each ROM and 8 hours to compile it from scratch - this is why I only have RootBox right now. So it would be extremely helpful if other developers would integrate this.
Oups... I just copied over the lib and camera files over using a root explorer app. I doubt that I'll have the patience to wait days to build it form source myself, but I'll be looking forward to see these libs integrated in future versions of CM!
 

AvivEliyahu

Senior Member
Jun 22, 2012
763
109
"Not Working, unlikely to be fixed:
Camcorder"

is that a typo for "cam recorder" ? or cam recording is working just fine?
 

jimbo77

Inactive Recognized Contributor
Nov 2, 2010
2,191
2,948
Guatemala
Samsung Galaxy S23 Ultra
@Treeki would you continue to publish updated Rootbox Nightlies with this camera every time Rootbox is updated?

EDIT: I also think you should move this to Android Development forum instead of apps and games because you are working on a ROM based of Rootbox sources... Not just the app itself..


Sent from my GT-I9300 using Tapatalk 2
 
Last edited:

Code124Y

Senior Member
Oct 19, 2010
1,167
251
georgetown
sorry for quick quesrion...
if i merge this to rom, will it just replace the original cm camera or cm camera is still there and it make new icon for the sammy camera?

Sent from S3, power By Temasek'Rom and Kernel!
 

jimbo77

Inactive Recognized Contributor
Nov 2, 2010
2,191
2,948
Guatemala
Samsung Galaxy S23 Ultra
I'm quoting the answer provided on the Original Thread...


.

It's a bit of a lofty goal but I hope that other ROMs will some day include these patches, because it doesn't affect normal camera operation, and it allows you to use the Samsung camera if you flash the appropriate libs...
.

If I'm not wrong it doesn't break CM Camera, it just helps Sammy camera to Partially work...


Sent from my GT-I9300 using Tapatalk 2
 
Last edited:
  • Like
Reactions: Code124Y

Treeki

Member
Jan 10, 2013
25
133
@Treeki would you continue to publish updated Rootbox Nightlies with this camera every time Rootbox is updated?
Hm.. that's something I hadn't thought about yet :x

I will try and publish a new one every few days but I don't have the resources to make daily builds, unfortunately...



Now that I have some more experience with the Android build system and I know exactly what needs to be changed, I'm going to look again at modifying the Samsung binaries to work with any AOSP ROM instead of doing this the other way round. That was my intention when I first started the project, but I changed tactics because I wasn't sure exactly how much I would need to modify.

I don't know if I'll succeed at this but I'll give it a shot ... If I could get it to work, it would be a much better solution because it should work on practically any ROM with just a flashable zip. Can't promise anything yet though :<
 

jimbo77

Inactive Recognized Contributor
Nov 2, 2010
2,191
2,948
Guatemala
Samsung Galaxy S23 Ultra
Hm.. that's something I hadn't thought about yet :x

I will try and publish a new one every few days but I don't have the resources to make daily builds, unfortunately...

Well, the Rootbox Nightlies doesn't come out every day as well so I think it will be nicely timed with you, btw if you ever want a beta tester of some sort.. Shoot a PM and I'll be more than glad to help...

I'm a Rootbox user since long time so it will not affect me to try your builds...

Sent from my GT-I9300 using Tapatalk 2
 

Treeki

Member
Jan 10, 2013
25
133
Welp.

I was going to post a picture of myself facepalming... taken with the TW camera app, of course... but I figured XDA is just a bit too public for that. :p


It turned out that one single byte in mediaserver was all I needed to change for my original attempt from several days ago to work. I wish I had known that before I started all this stuff about compiling ROMs... I suppose it was a good learning experience, though. I really didn't expect the fix to be that simple.


So my final mod turns out to be much, much simpler:
- Use Samsung files, with one modified to add a version of Camera::connect that only takes one param
- Modify mediaserver to allocate a CameraService that is 12 bytes bigger than the AOSP version

I feel kinda dumb now. Oh well! Hindsight is 20/20. And... sometimes the simplest solutions turn out to be the right ones :p


I'll put together a CWM zip that should [hopefully] work on all ROMs and add it to the OP shortly! Now available. Please try it out and let me know how it goes, and what ROM you're using! Off to sleep now, at the very appropriate time of 9am... :D
 
Last edited:

shazzmania

Member
Jul 19, 2011
11
6
Wow if this could be optimised with AOSP it will be perfect! Flashing it now.

Sent from my GT-I9300 using xda premium
 

Top Liked Posts

  • There are no posts matching your filters.
  • 64
    Hi! This is my first mod for Android; a partially working attempt at getting the Samsung camera (from the leaked 4.2.2 ROM; XUFME7) to work on AOSP ROMs. Not a skin, this is the full camera along with most of the features!

    Want to see it in action? No screenshot - it looks exactly the same as on TW ROMs - but here's a video. http://www.youtube.com/watch?v=mYX4PSVDiIU Apologies for the terrible quality, but it's hard to film a phone with the Nexus 7's front camera, and I couldn't find a decent screen capture app :<

    --

    Port for Android 4.3
    Beta version NOW AVAILABLE, click here for details + download: http://xdaforums.com/showpost.php?p=46566446&postcount=135
    It doesn't work as well as the 4.2.2 version - in particular, video recording is 100% broken, even in the AOSP camera - but you can still try it out if you don't mind this!

    --

    Port for Android 4.2.2

    Working/Non-Working Features List:
    What Works:
    Front and back cameras
    "Wand" Filters
    Flash
    Auto & Macro focus modes
    Tap-to-focus
    White Balance options
    GPS tagging
    Gallery shortcut (uses AOSP Gallery)

    Shooting modes:
    Single Shot
    Best Photo
    Face Detection
    HDR
    Beauty
    Smile Shot
    Low light

    Possibly Working, depending on kernel:
    (These features require that the mediaserver process can write to /sdcard (for burst shot/best face) and /data (for panorama). The only way to change this is using a modified kernel with an init.rc which gives it that access. In my experience, with Googy-Max kernel, Panorama works but the other two don't. Your mileage may vary.)
    Burst shot
    Best Face
    Panorama

    Not Working, may be fixed later:
    Shutter sounds
    Automatic mDNIe / screen brightness adjustment

    Not Working, unlikely to be fixed:
    Camcorder
    Share Shot
    Voice recognition
    Weather/city photo tagging in the media database (what's this used for exactly?)

    Untested:
    Buddy Photo Share
    External SD card

    Download:

    Download:
    This patch is ONLY compatible with AOSP-based 4.2.2 ROMs running on the GT-I9300 and GT-I9300T; the international models of the Galaxy S3 (Exynos chip, no LTE)
    CWM zip: http://d-h.st/sg8 (5.26 MB / MD5: f53d603f49de1bb0aba90546b9bbc1ce)

    Notes:
    This patch has only been tested on RootBox 4.1. Please let me know if you have trouble using it on any other ROM!



    Disclaimer:
    This is an experimental patch, and you install it at your own risk! I am not responsible for anything that occurs as a result of this. Always make backups.

    Installation:
    You need a recovery that allows you to install .zip files; most likely CWM or TWRP. But you probably already have one of these if you're running AOSP on this phone :p

    1. Boot into recovery mode: turn the phone off, hold down VolumeUp+Home and then press the power button
    2. Make a Nandroid backup (not obligatory, but recommended in case something goes wrong!)
    3. Flash the camera mod zip
    4. Wipe the Cache and Dalvik Cache - just in case

    Hope you enjoy it! Now go out and take some awesome photos :D

    Changelog:
    20th July 2013: Released first version. Camera (+ most features) is functional. Camcorder appears but does not record successfully.
    22nd July 2013: Released new version which should work on any AOSP ROM, instead of needing a custom built ROM.
    17th October 2013: 4.3 beta release is out.
    18
    Well, I think my previous bootloop might not actually have been caused by the media stuff - I had edited my build.prop to add qemu.hw.mainkeys=1 but I hadn't changed permissions on it, and I think that was the issue. Really stupid bug!

    I tried swapping the libmedia.so/libaudioflinger.so and other required files from TW, but there's too many differences for it to work on AOSP :( Oh well.


    Anyhow...

    This isn't as good as I wanted it to be yet, but I wanted to keep my promise to release something, so here's a beta version for 4.3. Works on the I9300, and maybe also on the I9305 and/or N7100/Note 2 - it would be nice if someone could test it on those!

    The biggest issue at the moment is that installing this mod breaks video recording - in the AOSP camera app as well - so if you need to use that, you shouldn't install it yet!!

    Currently Working:
    Front and back cameras
    "Wand" Filters
    Flash
    Auto & Macro focus modes
    Tap-to-focus
    White Balance options
    GPS tagging
    Gallery shortcut (uses AOSP Gallery)

    Single Shot
    Face Detection
    HDR
    Smile Shot
    Low light
    Sound and Shot (saves file, but you cannot play it in the AOSP gallery)

    Not Working due to permissions issues:
    Burst shot
    Best Photo
    Panorama
    Beauty

    Not Working, may be fixed later:
    Shutter sounds
    Automatic mDNIe / screen brightness adjustment
    Camcorder in AOSP camera + other apps

    Not Working, unlikely to be fixed:
    Samsung Camcorder
    Share Shot
    Buddy Photo Share
    Voice recognition
    Weather/city photo tagging in the media database (what's this used for exactly?)

    To be added in future versions:
    Remove Low Battery warning
    Move bottom bar when softkeys/navbar is enabled (if I can figure out how to do it)

    Download:
    This patch is ONLY compatible with AOSP-based 4.3 ROMs running on the GT-I9300, and possibly also the GT-I9305 and GT-N7100
    Make a Nandroid backup before flashing!!

    CWM zip: http://d-h.st/rWJ (5.92 MB / MD5: 9345513dd93b8131740d3c0edaa92dc1)
    9
    I've been working on a 4.3 port since yesterday from the Note 2, and I have it somewhat working now but need to test + fix all features, disable shooting modes that don't work, launch AOSP gallery instead of TW, etc ...

    I think this means that the mod will also work on the Note 2, which would be quite cool - I don't have one so I can't test it, but it seems like it would work, because I'm now using the Note 2 libs on the S3 :p


    Anyhow, release in the next couple of days if everything goes well!
    7
    Welp.

    I was going to post a picture of myself facepalming... taken with the TW camera app, of course... but I figured XDA is just a bit too public for that. :p


    It turned out that one single byte in mediaserver was all I needed to change for my original attempt from several days ago to work. I wish I had known that before I started all this stuff about compiling ROMs... I suppose it was a good learning experience, though. I really didn't expect the fix to be that simple.


    So my final mod turns out to be much, much simpler:
    - Use Samsung files, with one modified to add a version of Camera::connect that only takes one param
    - Modify mediaserver to allocate a CameraService that is 12 bytes bigger than the AOSP version

    I feel kinda dumb now. Oh well! Hindsight is 20/20. And... sometimes the simplest solutions turn out to be the right ones :p


    I'll put together a CWM zip that should [hopefully] work on all ROMs and add it to the OP shortly! Now available. Please try it out and let me know how it goes, and what ROM you're using! Off to sleep now, at the very appropriate time of 9am... :D
    6
    Hm, I'm guessing that the picture quality isn't different from the AOSP camera app and this tho there still is missing sources from Samsung that we'll never get.:confused:

    Otherwise. Nice mod! :)
    Thank you :D

    I've seen people talk about how the camera on AOSP is worse because of missing sources, but I'm not sure what sources these are. The Samsung kernel module is open source, and this mod replaces all the user space code related to the camera - as far as I know, anyway - with the TW versions. (Please correct me if I'm wrong on this :p)

    This is purely anecdotal and rather hard to test accurately, but I never noticed much of a difference in picture quality between AOSP and TW, I just wanted the camera app because of the extra modes and options that are really useful.