yashsingh1/xdaforums huggingface dataset:
[Galaxy Ace S5830 Original Android Development] madman:
logcat error seems pretty famous on google as many app developers seems to have this errors.. are you guys using aosp camera application or you have modded it for adapting changes ?? so that people can refer directly to cm repo for camera code
[Galaxy Ace S5830 Original Android Development] Wayland_ACE:
CM9/CM10 Camera application. Problem is related to hal/kernel/liboemcamera modes.
[Galaxy Ace S5830 Original Android Development] dragonnn:
Did the kernel have enabled:

CONFIG_UACCESS_WITH_MEMCPY: │
│ │
│ Implement faster copy_to_user and clear_user methods for CPU │
│ cores where a 8-word STM instruction give significantly higher │
│ memory write throughput than a sequence of individual 32bit stores. │
│ │
│ A possible side effect is a slight increase in scheduling latency │
│ between threads sharing the same address space if they invoke │
│ such copy operations with large buffers. │
│ │
│ However, if the CPU data cache is using a write-allocate mode, │
│ this option is unlikely to provide any performance gain. │
│ │
│ Symbol: UACCESS_WITH_MEMCPY [=y] │
│ Prompt: Use kernel mem{cpy,set}() for {copy_to,clear}_user() (EXPERIMENTAL) │
│ Defined at arch/arm/Kconfig:1474 │
│ Depends on: MMU [=y] && EXPERIMENTAL [=y] │
│ Location: │
│ -> Kernel Features

?
[Galaxy Ace S5830 Original Android Development] Wayland_ACE:
Disabled
[Galaxy Ace S5830 Original Android Development] lagloose:
Because i've created a 'debug' msm_camera.c' and spit out to dmesg, what copy_to_user returned. If copy_to_user fails, it returns the amount of bytes, it could not transfer from kernel to userspace. If it succeeds, it returns 0. And it did not return 0 ...:)
[Galaxy Ace S5830 Original Android Development] dragonnn:
Small suggestion, try to enable it, I am using it in my kernel and It doesn't make problems, maybe it will help??
[Galaxy Ace S5830 Original Android Development] rohan007:
There is definitely some problem with the kernel..

which kernel are u using?? try rebuilding kernel using whisp sources if you can and porting the drivers (if needed) for ace..
[Galaxy Ace S5830 Original Android Development] Shapeshift:
Kernel prob for sure
[Galaxy Ace S5830 Original Android Development] daredj:
case MSM_CAM_IOCTL_GET_PICTURE:

rc = msm_get_pic(pmsm->sync, argp);

Maybe non-related to issue, but that method should receive this args?

Only a doubt for understand more this error...
[Galaxy Ace S5830 Original Android Development] CallMeVentus:
I saw the logcat and saw

can_write = 0

Is that the problem

Sent from a Samsung Galaxy Ace
[Galaxy Ace S5830 Original Android Development] madman:
that might be case as i saw on google groups that camera app was not having write permissions to external media / cache
[Galaxy Ace S5830 Original Android Development] TheWhisp:
What happens when you take pictures with 3MP, not 5 ?
[Galaxy Ace S5830 Original Android Development] hdiablo:
Its not problem with karnel Fit has same problem, And only thing that is the same for Fit and Ace is 5MP camera i realy dont know why that is problem. Gio and Mini work without problem (both 3MP).
[Galaxy Ace S5830 Original Android Development] lagloose:
:confused: What do you mean by 'Whisp sources' ?

In first post i have written which kernel source we use. Don't get me wrong, but you should know better because you are a member of 'jellaxy' on github ? :)
[Galaxy Ace S5830 Original Android Development] TheWhisp:
I'll upload new libcamera later
[Galaxy Ace S5830 Original Android Development] rohan007:
I wasn't online for a few days so I didn't knew u were using the same sources ;)

Meanwhile me and whisp have been trying to change many things in libcamera and hopefully it would make camera work.. let's hope for the best ;) :D
[Galaxy Ace S5830 Original Android Development] lagloose:
I'm curious what you did, and hope it, works :)
[Galaxy Ace S5830 Original Android Development] lagloose:
Latest suggestion...

Perhaps it has something to do with the fact that only cooper does different sensor_config. See msm_camera.c lin 2424:

...

case MSM_CAM_IOCTL_GET_CAMERA_INFO:

rc = msm_get_camera_info(argp);

break;

#if defined(CONFIG_MACH_TASS) || defined(CONFIG_MACH_BENI) || defined(CONFIG_MACH_LUCAS) || defined (CONFIG_MACH_GIO) || defined(CONFIG_MACH_CALLISTO)

case MSM_CAM_IOCTL_PCAM_CTRL_8BIT:

sensor_rough_control(argp);

rc = 0;

break;

#elif defined(CONFIG_MACH_COOPER)

case MSM_CAM_IOCTL_PCAM_CTRL_8BIT:

sensor_ext_config(argp);

rc = 0;

break;

#endif

default:

rc = msm_ioctl_common(pmsm, cmd, argp);

break;

}

...

can't check this out now, i'm too tired after a lot of source code inspection..

Greetz
[Galaxy Ace S5830 Original Android Development] CJCord:
1.) Im no dev, but would it be possible to use another encoder for vids to improve performance? one that maybe gives a bigger output file, but nice resolution and fps? (so less computing power will be required. if thats the problem) most people have quite big SDcards and without one Ace is even on stock nearly useless. so bigger vids shouldnt be a problem.

2.) since (afaik) CM10 ("our" version) uses same kernel as CM7 (and so stock i think), wouldnt it be possible to just copy the nessecary files and "recycle" them for this cam-app? (but i guess that would have been far too easy...)

just my 2 cents...

...sitting in my bathtub...
[Galaxy Ace S5830 Original Android Development] daredj:
Well this is the results:

-> 320p, 70% quality: goes 15-20fps average. not too slow

->480p, 80% quality: 5-15fps average, slower

->640p, 100% quality: 2-10fps av. SLOWEST AS HELL

->320p, 50% quality: 8-15fps can escape if you record without too much movements...

->240p, 50%quality: 10-20fps, faster, quality is weird... in the bad side :S

->140p CRASHES

So... winer is... 240p 50% quality, at least we can say "it's something"
[Galaxy Ace S5830 Original Android Development] Lijop:
That's directly related with codecs so the default camcorder will work if wayland tries hard, but without codecs, it's no use, we will have to find out another way.
[Galaxy Ace S5830 Original Android Development] Jonboy2011:
what about camera on ics? works deep sleep and video recording in ics too?
[Galaxy Ace S5830 Original Android Development] Lijop:
No video recording, rest all works
[Galaxy Ace S5830 Original Android Development] Wayland_ACE:
Probably can be intersting: https://github.com/CyanogenMod/android_external_opencore
[Galaxy Ace S5830 Original Android Development] Lijop:
@wayland what is this ?
[Galaxy Ace S5830 Original Android Development] Nolep28:
for what i understood its kind an alternative for video codecs ? and if im right that maybe means that we could have fully working cam corder and HQ video playback

repeat i dont know if im rigth jeje :p
[Galaxy Ace S5830 Original Android Development] winxuser:
ayland you are doing such a great job, keep it up,,, if you can could you contact Ron G and help him with lg p350 camera,, i know you dont have the device, but seeing that you have gotten it almost wokring on this phone could you give them pointers on how you have done it
[Galaxy Ace S5830 Original Android Development] Mardon:
Maybe this will help

http://xdaforums.com/showthread.php?t=1960117

Gesendet von meinem GT-S5830 mit Tapatalk 2
[Galaxy Ace S5830 Original Android Development] winxuser:
lagloose,, cm10 b1 had a working camera, how come u didnt use that so ur rom would have a wokring camera,, just a question
[Galaxy Ace S5830 Original Android Development] gabrielking9:
???? You mean it's based on Cm10 beta 1???
[Galaxy Ace S5830 Original Android Development] Blekota:
CM10 b1 by Maclaw didn't have a working camera. Maclaw said the camera will be working in CM10 b2 (never released).

Press Thanks button if I helped you...
[Galaxy Ace S5830 Original Android Development] dart123:
del
[Galaxy Ace S5830 Original Android Development] Kattra:
Maclaw used a different kernel, that's why he got the camera working.
[Galaxy Ace S5830 Original Android Development] Wayland_ACE:
He is not :) Anyway. In JB people use opensource libcamera, instead of closed-source, used in Maclaw's CM9
[Galaxy Ace S5830 Original Android Development] lagloose:
Hey folks,

Because of this spanish user who showed video recording on galaxy ace, it might be a question of memory management in kernel. Here's what i found out:

As far as i understand this: http://xdaforums.com/showpost.php?p=30778519&postcount=531, our MSM_FB_SIZE for tripplebuffer should be 320 x 480 x 4 x 3 for MDPI and 240 x 320 x 4 x 3 fpr LDPI. Where '4' is the colordepth. But what i don't get right now is why 4 ? AFAIK 4 Bits would be 65536 colors. The Xperia Play has 16 Mio colors, like we have ??? Additional, if i do a 'cat /sys/devices/virtual/graphics/fb0/bits_per_pixel' i get '32' ... ????

So shouldn't it be 320 x 480 x 8 x 3 than ?

Any suggestions ?
[Galaxy Ace S5830 Original Android Development] Wayland_ACE:
I will try 320 * 480 * 32 * 2
[Galaxy Ace S5830 Original Android Development] lagloose:
Wayland ? Any results ?
[Galaxy Ace S5830 Original Android Development] mark0a:
Why 8? Isn't 24b actually 16M colors? 2^24 = ~16M, or maybe I'm missing something?
[Galaxy Ace S5830 Original Android Development] Wayland_ACE:
First I need solve problems with wifi - without it I cant test camera :)))
[Galaxy Ace S5830 Original Android Development] xxxMADxxx:
Camera and camcorder work on miui jb from nims..can u take a look for that? Hope this help..
[Galaxy Ace S5830 Original Android Development] ilarrain:
Isn't it RGB565 (16 bits)? That's what I remember from porting CWM recovery long time ago.
[Galaxy Ace S5830 Original Android Development] lagloose:
Last information on this....

This kernel problem really drives me/us crazy. Although we know exactly where and what the problem is, we still haven't found out how to fix it. Meanwhile i'm in contact with 'Pixeleone' who is IMHO a very good and experienced kernel developer. (OP's if you read this, you should give him write access to development sections...) Additionally we've found out that Galaxy FIT has the same kernel/camera problems as we have. So there's more than a good chance that camera works on FIT also when we fix that problem.

Despite the camera problem, at the moment i will releaese new versions only, if there are significant changes and bugfixes.

Last but not least; if you've not already read it, please read announcement in post 2 of Jellaxy thread in 'Original Development section'. Erik is one of the most important members of the team and we will all benefit from his activities if he has a cooper device...

Greetz
[Galaxy Ace S5830 Original Android Development] biswatmak:
Deleted Post
[Galaxy Ace S5830 Original Android Development] lagloose:
Hey people,

latest on this....

For nearly two weeks now, i tried to get camera working. Nearly nothing i didn't try. I checked a whole bunch of different libs, compiled HAL's from many different gitrepos, but nothing worked. Pixeleone supported me in every way he could to get the kernel driver to work. Thanks for that... :) Probbaly this is in future the way to go and get it finally working.

Anyway, as you can see, this is the first post in this thread after more than 10 days. So it seems that there isn't another one who has an idea or is willing to try things out for himself.

So i decided to stop working on camera until erikcas or Whisp has a device with our 's5k4egx' camera chip and the possibility to work together with me on that problem.

This doesn't mean of course that there won't be any releases of CM10 or AOKP. It's just that you should live with the fact that there will be no complete working STOCK camera for Ace and Fit in the near future...

But i'm of coures open for any new idea :)

Thanks, lagloose
[Galaxy Ace S5830 Original Android Development] diegonnc:
Can you tell me where exactly the problem is ?, im willing to try some things
[Galaxy Ace S5830 Original Android Development] daredj:
You can give some information:

-Camera chip (well you said now s5k4egx)

-Routes (hal, driver,.C that we can use to try to help)

-General info about our camera

Maybe with that info, we can go deeper and who knows, maybe someone can find something usefull

Greetings!
[Galaxy Ace S5830 Original Android Development] CallMeVentus:
Is this supposed to happen ?

Sent from Sven's sword.
[Galaxy Ace S5830 Original Android Development] lagloose:
Yep, Good question, but this has nothing to do with camera... :)
[Galaxy Ace S5830 Original Android Development] diegonnc:
Thanks for the info lagloose, gonna try some stuff later
[Galaxy Ace S5830 Original Android Development] hdiablo:
did you try contat deveopers with similar hardware like Xperia mini i think they have working camera same processor and 5MP camera or some other phone with ARMv6 with 5MP that has working camera on JB
[Galaxy Ace S5830 Original Android Development] Whippopotamus:
Anyone find the copy_to_user definition? just searching the source tree brings back tonnes of stuff... Just thinking if we knew what the function was actually trying to do, then it might help us find and fix the issue...

Its not in that file & I don't have much time to look around since I'm going to uni tomorrow! :)

Also, please excuse my ignorance, but a couple of questions:

"<4>[ 643.077959] [S5K4ECGX] s5k4ecgx_set_sensor_mode : 1

<4>[ 643.081486] [S5K4ECGX] s5k4ecgx_get_lux, s5k4ecgx_status.current_lux is 2004

<4>[ 643.084359] [S5K4ECGX] s5k4ecgx_sensor_burst_write : s5k4ecgx_Capture_Start_EVT1

<4>[ 643.120561] [S5K4ECGX] wait time for capture frame : 10ms

<4>[ 643.160926] msm_release_frame: frame0

<4>[ 643.160951] __msm_release, open count =2

<4>[ 643.160963] msm_release_frame: draining queue frame

<4>[ 643.160974] msm_release_frame, completed

<4>[ 643.166438] __msm_pmem_table_del: type 15, vaddr 0x41a74000

<4>[ 643.166571] __msm_pmem_table_del: type 15, vaddr 0x41a9d000

-> Here's the problem: <3>[ 643.216311] msm_get_stats(1137): copy to user

<4>[ 643.370814] pc_clk_set_rate id : 8, rate : 128000000

<4>[ 643.370914] pc_clk_set_rate id : -1, rate : 128000000

<4>[ 643.370941] , rc : 0

... and failed: <3>[ 648.070358] msm_get_pic, failed

<4>[ 648.074716] __msm_pmem_table_del: type 3, vaddr 0x42ac8000

<4>[ 648.078774] __msm_pmem_table_del: type 4, vaddr 0x41c68000"

"Here's the problem" is the reason you think this is the problem the <3> rather than the <4>? (What does this mean)

Also, the failure is in a different function... where "failed" is... msm_get_pic is line 1941, (note no __ at start) and the error gets printed at 1955 I think... I wonder if the copy_to_user calls msm_get_pic somehow, and that failure comes from there? Seems copy_to_user is returning false rather than true, so we might be able to track down where the failure comes from, by looking for return false...

The error at 1955 comes from __msm_get_pic returning < 0, if someone could add some more log tags and record literally everything which is done to the rc value and recompile the kernel, then maybe we could find whats going wrong in that function - to be honest, logging everything might be the best way to find a solution, pinpoint exactly what goes wrong!

Hope this helps!
[Galaxy Ace S5830 Original Android Development] lagloose:
Hey,

thanks for your reply.... :)

copy_to_user is an atomic linux kernel function and not android specific. See here: http://www.gnugeneration.com/mirrors/kernel-api/r4299.html.

The exact position of the 'copy_to_user' that fails is in line 1133 of this: https://github.com/Jellaxy/android_...lykernel/drivers/media/video/msm/msm_camera.c. If you like, you can download this file and add more logging code. Then send it back to me. I will compile and post results here.

However, pixeleone and me have already found out that the problem is most probably a 'memory allocation' problem. But we didn't find out yet where exactly the memory 'get's lost'...

Greetz, lagloose
[Galaxy Ace S5830 Original Android Development] bibomen33:
hey... I'm searching for a solution too but could the fails be in line 1133 cause there is another mistake somewhere else? or the mistake is just there and the line of code is wrong and we dunno why?
[Galaxy Ace S5830 Original Android Development] lagloose:
Another mistake somewhere else; ABSOULTELY... But i don't think that code is wrong because Gio and Mini use same code and it works for them. It is also possible that mistake is in s5k4ecgx source. But at the moment i have no good idea on how to debug the whole process from opening camera through HAL and camlib to kernel...
[Galaxy Ace S5830 Original Android Development] diegonnc:
From line 1133 to 1139,try this

if (copy_to_user((void *)(se.stats_event.data),
&stats,
sizeof(struct msm_stats_buf))) {
ERR_COPY_TO_USER();
rc = -EFAULT;
goto failure;
}

I cannot build anything from source right now XD.But i think you will need libcamera.so from stock.
[Galaxy Ace S5830 Original Android Development] Mardon:
Libcamera.msm7x27.so is maybe the wron name for hal loading try libcamera.cooper.so

Gesendet von meinem PASCAL2 mit Tapatalk 2
[Galaxy Ace S5830 Original Android Development] CallMeVentus:
libcamera.msm7x27.so is the MSM7227 Camera sensor whereas libcamera.cooper.so is the cooper Camera sensor

Sent from Ursa's claws.
[Galaxy Ace S5830 Original Android Development] Wayland_ACE:
HAL library must be without lib prefix. For example: camera.cooper.so
[Galaxy Ace S5830 Original Android Development] Whippopotamus:
Looking at the gnu generation link, and what you say about pixel one, it'll either be the from or to fields surely?

"

Synopsis

unsigned long copy_to_user (void __user * to, const void * from, unsigned long n);

Arguments

to Destination address, in user space.

from Source address, in kernel space.

n Number of bytes to copy."

These are the arguments:

((void *)(se.stats_event.data),

data->evt_msg.data,

data->evt_msg.len)

So, if they're followed, then that might help..

I assume the length field is right, since its the len property (I think)...

either way, I would love to look at the minute, but... freshers :P
[Galaxy Ace S5830 Original Android Development] lagloose:
With release of new CM10 and camerapatch for AOKP some information on this...

Due to the fact that it was absolutely frustrating to get the kernel driver working together with our 'old' HAL, i decided to use a different implementation of the camera HAL, which has the advantage that it uses libcamera.so from STOCK ROM.

With help from Wayland_Ace (thanks buddy :)) i finally manged to get it working (without preview) for Ace. Look into 'Jellaxy' AOKP thread for download of camera patch to see, which libs are relevant for this. The HAL i used for this can be found here:https://github.com/arco/android_device_samsung_ariesve/tree/ics/camerahal More than that, i managed to get a working camera WITH preview using Wayland's HAL from here: https://github.com/WaylandAce/libcamera But i decided to take arco's HAL because it does release camera in a 'clean' way when ending camera app. Unfortunately Wayland's HAL leaves camera service in 'busy' state when ending which leads to a restart of mediaserver. This would not be so dramataic, but unfortunately audio in Jellaxy get's messed up than...

For everyone who wants to try, download this: http://jellaxy.googlecode.com/files/camera.msm7x27.so and replace in /system/lib/hw.

So here's my call to all people who have the programming knowledge: Use arco's HAL source as base and try to fix preview (Maybe you can use parts of Wayland's HAL)

Come on and do something on you're own people and don't let me do it all alone :) Get a place in the hall of fame :)
[Galaxy Ace S5830 Original Android Development] lagloose:
Some people asked me to update sources. Sorry, forgot that. Will do today or tomorrow.
[Galaxy Ace S5830 Original Android Development] lagloose:
Sorry people, problems with github....

Will update ASAP.
[Galaxy Ace S5830 Original Android Development] CallMeVentus:
Ever tried the GitHub Windows app ? I find it much more convenient

Sent from Ursa's claws.
[Galaxy Ace S5830 Original Android Development] lagloose:
First post updated...
[Galaxy Ace S5830 Original Android Development] bieltv3:
That cameraHAL you updated is the one without preview right?
[Galaxy Ace S5830 Original Android Development] lagloose:
The archive contains both HAL's. From arco (without preview) and from Wayland (with preview) Look into '/home/theo/android/jellaxy/device/samsung/msm7x27-common/libcamera/' of zip. Just copy the one you want to try one level up into libcamera dir...
[Galaxy Ace S5830 Original Android Development] CallMeVentus:
Sorry if that sounds like a noob question.....but where do I get libcamera source for Gingerbread ?

Sent from Ursa's claws.
[Galaxy Ace S5830 Original Android Development] lagloose:
Anyone succeeded compiling HAL ?
[Galaxy Ace S5830 Original Android Development] bieltv3:
I'm compilign it right now, with what you told me yesterday.
[Galaxy Ace S5830 Original Android Development] nims11:
yep I had compiled it

and preview works fine :)

video recording not working
[Galaxy Ace S5830 Original Android Development] lagloose:
You have preview working ? With HAL from arco or wayland ?
[Galaxy Ace S5830 Original Android Development] nims11:
with wayland as you told preview works fine with wayland's camerahal
[Galaxy Ace S5830 Original Android Development] lagloose:
Ahhh ok, but you still got the 'Cannot connect to camera' bug when reopening camera app, Correct ?

Did you check if deep sleep breaks after using camera ?
[Galaxy Ace S5830 Original Android Development] nims11:
yes cant connect to camera is still there

and deep sleep is break after using camera is also there but cant say correctly of deep sleep will test it again

Edit deep sleep is not working after camera use
[Galaxy Ace S5830 Original Android Development] bieltv3:
HI guys, I'm having a problem when compiling with Wayland's sources, compilation goes good, but when the compilation ends, no libcamera.so and no hw/camera.cooper.so are on the rom. That could be because an error of android.mk inside the libcamera folder, I can't found any solution, and I can't compile, I followed all the steps mentioned and I use the msm7x27-common folder that lagloose send me, please if someone knows anything, pleas help me... thanks.
[Galaxy Ace S5830 Original Android Development] Wayland_ACE:
My hal does not compile libcamera.so. Even you must put libcamera.so to cameraHAL by hand! after you can run command:

make camera.cooper -j17 and camera.cooper.so can be found on: ./out/target/product/cooper/system/lib/hw/camera.cooper.so

---------- Post added at 05:34 PM ---------- Previous post was at 05:32 PM ----------

And my sources are updated, but issues not fixed yet. But probably reason is found!
[Galaxy Ace S5830 Original Android Development] Wayland_ACE:
barcode scanner in my hal is fixed
[Galaxy Ace S5830 Original Android Development] erikcas:
Wayland, what problem did you have with libseccameraadaptor? I see on your github you tried it but reverted it
[Galaxy Ace S5830 Original Android Development] Wayland_ACE:
No any problems, but no any benefit for me too and a little bit slower (probably not :) )
[Galaxy Ace S5830 Original Android Development] erikcas:
:p oke