yashsingh1/xdaforums huggingface dataset:
[Galaxy Ace S5830 Original Android Development] psyke83:
There are some differences in the initialized camera parameters. Attaching the files, here's the diff:

--- tass-param101.txt	2014-08-24 15:57:04.243271729 +0100
+++ tass-param11.txt	2014-08-24 15:56:59.271255070 +0100
@@ -1,7 +1,8 @@
[antibanding-values=off,50hz,60hz,auto
-antibanding=off
+antibanding=auto
auto-exposure-values=center-weighted,spot-metering,frame-average
auto-exposure=frame-average
+camera-mode=0
chk_dataline=0
contrast=2
effect-values=none,mono,negative,sepia
@@ -19,7 +20,7 @@
horizontal-view-angle=54.8
iso-values=auto,ISO_HJR,ISO50,ISO100,ISO200,ISO400,ISO800,ISO1600
iso=auto
-jpeg-quality=90
+jpeg-quality=85
jpeg-thumbnail-height=384
jpeg-thumbnail-quality=90
jpeg-thumbnail-size-values=512x288,480x288,432x288,512x384,352x288,320x240,0x0
@@ -29,37 +30,36 @@
luma-adaptation=3
max-contrast=4
max-exposure-compensation=12
-max-num-focus-areas=1
max-saturation=4
max-sharpness=4
max-zoom=60
+metering=frame-average
min-exposure-compensation=-12
mode=0
-orientation=landscape
picture-format-values=jpeg,raw
picture-format=jpeg
picture-size-values=2048x1536,1920x1080,1600x1200,1280x768,1280x720,1024x768,800x600,800x480,640x480,352x288,320x240,176x144
picture-size=2048x1536
-preferred-preview-size-for-video=320x240
+preferred-preview-size-for-video=480x320
preview-format-values=yuv420sp
preview-format=yuv420sp
preview-fps-range-values=(7000,15000)
preview-fps-range=7000,15000
preview-frame-rate-mode=frame-rate-auto
preview-frame-rate-values=25,24,15
-preview-frame-rate=25
+preview-frame-rate=15
preview-size-values=640x480,320x240,240x160,176x144
preview-size=320x240
recording-hint=false
+rotation=0
saturation=2
scene-detect-values=
scene-detect=off
-scene-mode-values=auto,action,portrait,landscape,night,night-portrait,theatre,beach,snow,sunset,steadyphoto,fireworks,sports,party,candlelight,backlight,flowers
+scene-mode-values=auto,action,portrait,landscape,night,night-portrait,theatre,beach,snow,sunset,steadyphoto,fireworks,sports,party,candlelight,back-light,flowers
scene-mode=auto
selectable-zone-af-values=
selectable-zone-af=auto
-sharpness=2
-shutter-speed=auto
+sharpness=0
skinToneEnhancement-values=
skinToneEnhancement=disable
strtextures=OFF
@@ -69,11 +69,11 @@
touch-index-af=-1x-1
vertical-view-angle=42.5
video-frame-format=yuv420sp
-video-size-values=640x480,384x288,352x288,320x240,240x160,176x144
-video-size=320x240
+video-size=480x320
video-zoom-support=false
whitebalance-values=auto,incandescent,fluorescent,daylight,cloudy-daylight
whitebalance=auto
zoom-ratios=100,102,104,107,109,112,114,117,120,123,125,128,131,135,138,141,144,148,151,155,158,162,166,170,174,178,182,186,190,195,200,204,209,214,219,224,229,235,240,246,251,257,263,270,276,282,289,296,303,310,317,324,332,340,348,356,364,373,381,390,400
zoom-supported=true
-zoom=0]
+zoom=0
+zsl=off]
[Galaxy Ace S5830 Original Android Development] Mm7:
Sorry for late. Your build work.

Logcat complain about missing (preview) frames, perhaps: "preview-frame-rate" or "preferred-preview-size-for-video"?
[Galaxy Ace S5830 Original Android Development] psyke83:
Good to know.

I'm attaching the logs of QualcommCameraHardware output on tass for comparison. On cm10.1, the preview-frame-rate is set to 25, but it's 15 on cm11. The preferred-preview-size-for-video is overridden by TARGET_CAMERA_SENSOR_MP_SIZE.

I've updated the changes to ensure that these parameters, as well as KEY_SUPPORTED_VIDEO_SIZES, are a closer match to the older branch. Finally, I've gotten rid of BOARD_CAMERA_HAVE_ISO, as it's inconsistent with the configuration on older branches.

New builds that need testing:

tass: http://jenkins.androidarmv6.org/job/cm-experimental/1105/

gio: http://jenkins.androidarmv6.org/job/cm-experimental/1106/
[Galaxy Ace S5830 Original Android Development] force_close:
build failed for tass
[Galaxy Ace S5830 Original Android Development] HerroYou:
Camera didn't work for gio, still black, no auto focus, and can't take picture
[Galaxy Ace S5830 Original Android Development] psyke83:
Please don't forget to provide a logcat from these builds, especially when the camera isn't working.
[Galaxy Ace S5830 Original Android Development] HerroYou:
Sorry but I don't know how to logcat, can you provide me with a guide or tutorial?
[Galaxy Ace S5830 Original Android Development] Venkatesh:
[MENTION=985241]erikcas[/MENTION], you mean this?

http://review.androidarmv6.org/#/c/349/
[Galaxy Ace S5830 Original Android Development] erikcas:
Yup that is the (initial) fix. But I remember it was redone later but not sure

Verstuurd vanaf mijn GT-I9505 met Tapatalk
[Galaxy Ace S5830 Original Android Development] psyke83:
tass build (as the previous one failed): http://jenkins.androidarmv6.org/view/Developers/job/cm-experimental/1107/
[Galaxy Ace S5830 Original Android Development] psyke83:
I don't think this will help, as this macro isn't enabled on CM10.x (at least, I can't find it). Additionally, I think it fixed a FC when taking a picture - it didn't affect the functionality of the preview itself.
[Galaxy Ace S5830 Original Android Development] erikcas:
Yup. Thought I read there is a fc om click besides no preview.

You have proper logs yet? If I can find my good old gio I could do some testing and debugging tomorrow night

Verstuurd vanaf mijn GT-I9505 met Tapatalk
[Galaxy Ace S5830 Original Android Development] psyke83:
No good logs yet, but it may not matter, as I don't think that the last builds will work.

Look at this: https://github.com/androidarmv6/and...-common/blob/cm-10.2/libcamera/Android.mk#L34

In CM10.2, the camhal is importing the HAL functions from the beni/cooper version of libcamera in vendor/samsung/msm7x27-common, even though the actual libcamera installed to /system/lib/ is different. This seems suspicious to me...

The recent CM11 builds that have patch set 8 of change #7447 should have a camhal that uses dlopen in the proper way (i.e. no specific libcamera version is integrated into the camhal as a shared library or ldflags). This means that you can push any version of libcamera.so onto the device and the camhal should be able to load it properly.

Perhaps if you do dust off your gio to test this, you could try manually pushing some some different libcamera.so versions onto the last experimental build ("adb shell restart media" is enough to fully reload the camera hal). Perhaps the version shared by beni/cooper really can work on gio/tass as well...
[Galaxy Ace S5830 Original Android Development] force_close:
camera stopped working, even when I didnt press shutter http://pastebin.com/7MPcGBzg
[Galaxy Ace S5830 Original Android Development] Venkatesh:
Conn, you really should work with samsung. Amazing, beni libcamera is loaded. I can see preview, amazing quality. Look at attachement.

Coming to full details, i installed [MENTION=5051035]Mm7[/MENTION] (Marco locally compiled build, see his previous posts) build and took camera libs from latest tass build(thnx to force_close for providing zip). Camera din't work with his zip, then i pushed beni libcamera.so into system and rebooted. Preview is working, but when i click shutter, it stays there like in picture and after 3-5 sec i can hear shutter sound, (camera stopped error after that) but there isn't any picture saved in gallery.

Edit: OMG, Video recording is working and it is saved too.

Conn, one more request, After everything gets fixed, please trigger a cm10.2 build for tass and gio with all camera fixes. (last cm10.2 is having source built camera)
[Galaxy Ace S5830 Original Android Development] psyke83:
OK, that's where the change that [MENTION=985241]erikcas[/MENTION] was talking about can help. But first, I need someone to test these builds:

tass: http://jenkins.androidarmv6.org/view/Developers/job/cm-experimental/1108/

gio: http://jenkins.androidarmv6.org/view/Developers/job/cm-experimental/1109/

I've adjusted the vendor config to use the cooper libcamera.so for all GB devices, and got rid of the QCOM legacy params change (I don't think it's needed). These builds should have working camera preview/recording, but FC on taking a picture (as Venkatesh experienced). Once we've confirmed that preview works, then we can try the the CAMERA_FC_FIX to see if it fixes the FC on taking a picture.
[Galaxy Ace S5830 Original Android Development] blugonjic:
Not to piss on your parade guys but wouldn't it make more sense to post all that stuff in gio/tass sections if there are any? I mean, you obviously need testers so there is a chance you'll find more there, I figure
[Galaxy Ace S5830 Original Android Development] psyke83:
We don't need an army of testers for something like this - one tester (who knows how to capture logs) per device is enough. I think we already have a sufficient audience watching the thread.
[Galaxy Ace S5830 Original Android Development] force_close:
as you've said, preview is working but fc on taking a picture, log attached.

effect also working.
[Galaxy Ace S5830 Original Android Development] Venkatesh:
what about video recording?
[Galaxy Ace S5830 Original Android Development] force_close:
it works!

so on the first boot camera will fc few seconds after I press shutter button, but on the second boot it will fc as soon as I press the shutter
[Galaxy Ace S5830 Original Android Development] psyke83:
OK, I uploaded a new change to reintroduce the camera shutter hack. I also brought back the config to set the 3MP camera configuration in the cameraHAL; hopefully that won't cause trouble.

Fingers crossed, but these builds should have fully working camera:

gio: http://jenkins.androidarmv6.org/view/Developers/job/cm-experimental/1110/

tass: http://jenkins.androidarmv6.org/view/Developers/job/cm-experimental/1111/

callisto: http://jenkins.androidarmv6.org/view/Developers/job/cm-experimental/1112/

I'd appreciate if you can double-check the video recording again. The 3MP config may cause recording issues, so that might need to be fixed.
[Galaxy Ace S5830 Original Android Development] Mm7:
[MENTION=4523093]Venkatesh[/MENTION] [MENTION=4546059]force_close[/MENTION]

I have a suspicion, but I need your help to verify. You need adb in your pc!

Unzip the zip attached to this comment

Put "camera_test" in phone's sd card

Connect your phone to your computer

Run the following commands in your computer:

adb shell
mount -o rw,remount /
cp /sdcard/test_camera /
chmod 755 /test_camera
su media
/test_camera

Now you shuld see something like this:

fi: 0x40072d64

I'm interested in this line, please post it here

optional for cleanup: Run the following commands in your computer

exit
rm /test_camera /sdcard/test_camera

Now you can close the adb session
[Galaxy Ace S5830 Original Android Development] erikcas:
logcat on gio

also tried several different libcamera.so from different stock roms. No luck so far.

Now check some sources
[Galaxy Ace S5830 Original Android Development] Mm7:
[MENTION=985241]erikcas[/MENTION] can you try this, please?: http://xdaforums.com/showpost.php?p=55066975&postcount=85
[Galaxy Ace S5830 Original Android Development] erikcas:
on gio

fi: 0x0
[Galaxy Ace S5830 Original Android Development] Mm7:
omg! Can you restart the mediaserver with root permission (set mediaserver uid to 0) and try to take a picture?
[Galaxy Ace S5830 Original Android Development] erikcas:
still FC but value is changed

fi: 0x40072d64
[Galaxy Ace S5830 Original Android Development] erikcas:
edit: logcat is different now

Will check code some more tomorrow. Too late for now
[Galaxy Ace S5830 Original Android Development] Mm7:
Uhm Are you sure you restarted mediaserver with root uid?

If you run this command:

adb shell "ps |grep mediaserver"

The output must be:

root 1853 101 20324 6056 ffffffff 4008f5a0 S /system/bin/mediaserver
[Galaxy Ace S5830 Original Android Development] erikcas:
you are right. strange whatever I do, it keeps being run with media uid.
[Galaxy Ace S5830 Original Android Development] Mm7:
A simple way to set it:

adb shell
stop media
/system/bin/mediaserver

It will hang here. In another shell you can check:

ps |grep mediaserver
[Galaxy Ace S5830 Original Android Development] psyke83:
If the property ro.secure=1 is set, "adb shell" will open a shell with user privileges by default (if you didn't run "adb root"). You may need to elevate via "adb root" or su if you see "$" instead of "#" as the terminal prompt, before running any of those commands.
[Galaxy Ace S5830 Original Android Development] force_close:
I'm on RC9 and the value is

fi: 0x40072d64
[Galaxy Ace S5830 Original Android Development] force_close:
for camera http://pastebin.com/xZCxf6SZ camera fc when taking a picture

for video recording log attached. video recording didn't work, it just did nothing when I press that red button

btw, the build before this, build #1108 is already have 3MP in camera setting
[Galaxy Ace S5830 Original Android Development] erikcas:
:) I was running as root. Anyway after a reboot I managed to run mediaserver as root.

Still a fc. No log as I am not on pc atm

Verstuurd vanaf mijn GT-I9505 met Tapatalk
[Galaxy Ace S5830 Original Android Development] Ansh2000:
[MENTION=3877378]psyke83[/MENTION] Camera preview is working but when i click shutter , it stay there for 4, 5 seconds, camera got fc and there is no picture saved in gallery. Video recording is not working do nothing when i press red button. I am unable to provide log at this moment due to unavailability of pc.
[Galaxy Ace S5830 Original Android Development] Mm7:
[MENTION=3877378]psyke83[/MENTION] [MENTION=985241]erikcas[/MENTION]

The video recording crash is caused by missing quality in media_profiles.xml with size 480x320. But we can't fix it because there isn't a quality with size 480x320, look at this: https://github.com/CyanogenMod/andr...m/android/camera/CameraSettings.java#L880-934

About taking picture, look at this:

E/QualcommCameraHardware( 2134): ********SplitFrame Start********
E/AudioSink( 2379): received unknown event type: 1 inside CallbackWrapper !
E/QualcommCameraHardware( 2134): Save jpeg file open error
E/QualcommCameraHardware( 2134): ********THERE IS NO JPEG EOI MARKER********

small part of this log http://xdaforums.com/showpost.php?p=55069720&postcount=86

It seems that mediaserver can't open /data/camera_dump.jpeg....

camera_test try to open this file and print the handle (FILE *), if it is 0x0 the opening failed else it is OK

force_close reported the value to be !=0x0, so libcamera should be able to open it.. but logcat seems to say otherwise

However running mediaserver with root uid workaround at this problem as root can open/write everything it want

[MENTION=4546059]force_close[/MENTION]:

Thank you for testing my program.

In your logcat there is a out of memory error. Maybe next time you should try with swap enable
[Galaxy Ace S5830 Original Android Development] force_close:
actually, at first I got 0x0 (I thought I did something wrong so I reboot the phone) and after reboot I got that value
[Galaxy Ace S5830 Original Android Development] Venkatesh:
[MENTION=4546059]force_close[/MENTION] said, he is using rc9 which is having source built camera. Is it okay for testing or he should be using prebuilt libcamera.so?
[Galaxy Ace S5830 Original Android Development] force_close:
I'll try with the new build #1111. reinstalling now, will provide in about 15min.

perhaps I'm doing it wrong [MENTION=5051035]Mm7[/MENTION]

←7←[r←[999;999H←[6nroot@tass:/ # su media
su media
←7←[r←[999;999H←[6nmedia@tass:/ $ /test_camera
/test_camera
fi: 0x0
media@tass:/ $ exit
exit
root@tass:/ # test_camera
test_camera
/system/bin/sh: test_camera: not found
127|root@tass:/ # /test_camera
/test_camera
fi: 0x40072d64
root@tass:/ #

btw, fyi tass users, tomorrow(in about 20hrs from now) I'll be leaving town, I don't have data plan on my phone so I hope someone could download and provide logs if there's a build for testing. I'll test if I found some wifi
[Galaxy Ace S5830 Original Android Development] Mm7:
[MENTION=4523093]Venkatesh[/MENTION] [MENTION=4546059]force_close[/MENTION]

Well, now try this:

adb shell
su
stop media
/system/bin/mediaserver

Now open camera and try to take a picture.
[Galaxy Ace S5830 Original Android Development] force_close:
still fc, and I got these feedback from shell command above when I'm openning the camera

bind failed: Address already in use
[Galaxy Ace S5830 Original Android Development] belyava:
did the command, the camera refused to launch, just a black screen, then fc. Without this command the camera launches, but doesn't take pictures
[Galaxy Ace S5830 Original Android Development] Mm7:
You must be doing something wrong.

Probably you closed adb session after running: "/system/bin/mediaserver" You have to keep that command running when you try to take a picture
[Galaxy Ace S5830 Original Android Development] belyava:
sorry, man :) didn't know that. OK, I've tried another time. This time the cam launched ok, I pressed the shutter button, but after focusing the app fc'ed. Log attached
[Galaxy Ace S5830 Original Android Development] psyke83:
[MENTION=5051035]Mm7[/MENTION],

What if they were to test the GB gio/tass libcamera.so versions with mediaserver running as root? The latest build that has working camera preview is using the cooper lib, and the crash on snapshot may not be possible to solve (as it's not intended for these devices). The latest build will load any libcamera.so that is pushed to the device, as the dlopen code has been fixed.

Another possibility to try is to use all proprietary libraries from a gio/tass rom that are needed for the camera, rather than mixing them with cooper versions.
[Galaxy Ace S5830 Original Android Development] erikcas:
And that is the case :)

With gio libcamera.so I have preview but fc on taking pic. Also on mediaserver running as root.

I will check on some things tomorrow night as weekend arrived then. Also will check if Davis is willing to take a look with us. He usually has some refreshing ideas.

Verstuurd vanaf mijn GT-I9505 met Tapatalk
[Galaxy Ace S5830 Original Android Development] Mm7:
I reverse engiennered this function: _ZN7android22QualcommCameraHardware9save_jpegEPhi [QualcommCameraHardware::save_jpeg(unsigned char *arg1, int arg2)]

This is the first part:

FILE *handle = fopen("/data/camera_dump.jpeg", "wb");
if (handle == NULL) {
log("Save jpeg file open error");
return(x);
}

In erikcas's logcat I found this:

E/QualcommCameraHardware( 2134): Save jpeg file open error

This seems a permission problem, running as root avoid it. Unfortunately this is not enough... logcats with mediaserver runnig as root don't show this error but something is still wrong.
[Galaxy Ace S5830 Original Android Development] psyke83:
OK, looks similar to Samsung's crespo save_jpeg libcamera function: https://android.googlesource.com/de...ad-release/libcamera/SecCameraHWInterface.cpp

To workaround this specific issue, we could hex-edit libcamera.so and replace "/data/camera_dump.jpeg" with something like "/data/media/camera.jpg" (providing that mediaserver has sufficient write access to this folder). I wonder why this is not a problem for cooper and beni, though?

Actually, the crespo code gives us a clue as to what's wrong. Look at line 1025 onwards - the SplitFrame function is used only for a certain sensor type in this code (S5K4ECGX). I presume that the qcom library does something similar, so I guess that beni/cooper doesn't need this function due to the sensor type. One way to test that is to hex-edit the lib and change the name of the sensor to something else, so it doesn't execute that function (but of course, that's probably not going to fix the problem, but it can help us to troubleshoot further).
[Galaxy Ace S5830 Original Android Development] Mm7:
Yes, we can hexedit. I hope that that path is not hardcoded somewhere else!

From cooper logcat:

E/QualcommCameraHardware( 139): ********SplitFrame Start********
E/QualcommCameraHardware( 139): ********SplitFrame end********

EDIT:

I can't find pictureThread() symbol, instead splitFrame seems to be called by QualcommCameraHardware::receiveRawSnapshot.

EDIT2:

Furthermore on cooper (with media uid) I can create/read/write /data/camera_dump.jpeg:

root@cooper:/ # su media
media@cooper:/ $ id
uid=1013(media) gid=1013(media) context=kernel
media@cooper:/ $ touch /data/camera_dump.jpeg
media@cooper:/ $ ls -la /data/camera_dump.jpeg
-rw-rw-rw- root root 0 2014-08-28 10:56 camera_dump.jpeg
media@cooper:/ $ echo "Hello World!" > /data/camera_dump.jpeg
media@cooper:/ $ cat /data/camera_dump.jpeg
Hello World!
media@cooper:/ $ ls -la /data/camera_dump.jpeg
-rw-rw-rw- root root 13 2014-08-28 10:56 camera_dump.jpeg
media@cooper:/ $
[Galaxy Ace S5830 Original Android Development] psyke83:
I can't shake the feeling that the cooper/beni libcamera won't work on gio/tass, even if we workaround the permission issue. The SplitFrame and save_jpeg function output is not shown in the older cm10.1 logs for those devices. It's possible that the code path is simply broken (as that library was not intended to be used on other devices), and the functions won't - or can't - work properly for other sensors types.

[MENTION=985241]erikcas[/MENTION] and others, regardless of what happens with [MENTION=5051035]Mm7[/MENTION]'s work on these functions, I think it'd also be productive to get some strace output from the mediaserver.

You could try this with the cooper as well as the tass/gio libcamera.so:

adb shell
su
stop media
strace -Ff -o /sdcard/camtrace.log /system/bin/mediaserver

Keep the terminal session open, then open the camera and try to take a picture. Hopefully the log may give us some more clues as to what the problem could be.

Cleanup:

[Ctrl+C]
adb pull /sdcard/camtrace.log
adb shell
su
start media
[Galaxy Ace S5830 Original Android Development] erikcas:
I did not have time to strace yet. I am sure it will help as it helped finding the shutter issue in an earlier stage.

Will perform tonight.

Verstuurd vanaf mijn GT-I9505 met Tapatalk
[Galaxy Ace S5830 Original Android Development] Mm7:
You're right. In gio libcamera I can't find any reference to SplitFrame.
[Galaxy Ace S5830 Original Android Development] erikcas:
strace attached. Finally sleep (hope to have solved screen not waking up and unexpected freezes on mini2 kernel so did not analyse it :P)
[Galaxy Ace S5830 Original Android Development] psyke83:
Thanks - that appears to be the cooper libcamera (that came with the experimental build). Can you also capture a log with the gio version of the GB libcamera.so when you have the chance?

This one should be OK: https://github.com/androidarmv6/and...mmit/625ccf611e867d51919b17079d0884c34e632f85
[Galaxy Ace S5830 Original Android Development] erikcas:
Ah did not realize that. Sure will give it a try as soon as I am home again

Verstuurd vanaf mijn GT-I9505 met Tapatalk
[Galaxy Ace S5830 Original Android Development] Mata99:
Any news about camera?
[Galaxy Ace S5830 Original Android Development] psyke83:
If you want to be helpful rather than asking for news (when there clearly isn't any), then help us by posting strace logs, just as I asked.
[Galaxy Ace S5830 Original Android Development] force_close:
I'm on RC9 and camera fc
[Galaxy Ace S5830 Original Android Development] adenant:
Camtrace.log

I'm using gio and here's may camtrace.log. I hope this will help too.

I'm using cm-11-20140906-NIGHTLY-gio.zip version
[Galaxy Ace S5830 Original Android Development] Venkatesh:
Proprietary gio libcamera.so strace

This one is Proprietary gio libcamera.so strace log.
[Galaxy Ace S5830 Original Android Development] Venkatesh:
Sir, Could you please check this?
[Galaxy Ace S5830 Original Android Development] Venkatesh:
[MENTION=5051035]Mm7[/MENTION], When you are free check these camera parameters attached.
[Galaxy Ace S5830 Original Android Development] Venkatesh:
Here's another update. Fast burst camera app is working with ace libcamera. [MENTION=5051035]Mm7[/MENTION], [MENTION=3877378]psyke83[/MENTION] , I am able to take pictures with fast burst camera app(640*480 resolution). My above post contains camera parameters used by fast burst camera app. I'll upload cm11 camera parameters used by fast burst camera app later.