Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[ROM][GT-I9100][4.0.4] CyanogenMod 9 nightly builds | DEVELOPMENT THREAD

OP codeworkx

30th March 2012, 02:46 PM   |  #2941  
espenfjo's Avatar
Recognized Developer
Flag Oslo
Thanks Meter: 2,259
 
392 posts
Join Date:Joined: Jul 2008
Donate to Me
More
Faking the earlier step does not work, even if you do width/height the correct way

Neither does it work to set cam->width instead of cam->window.width.
The Following 5 Users Say Thank You to espenfjo For This Useful Post: [ View ]
30th March 2012, 03:05 PM   |  #2942  
Junior Member
Thanks Meter: 286
 
17 posts
Join Date:Joined: Jun 2010
So if I got this straight, basically we have camera.exynos.so, which is a wrapper around the proprietary binary vendor-camera.exynos4.so, and that thing communicates with the fimc driver in the kernel. Is that right?

So the issue would be likely to be there. I have a question though, does the cm9 built-from-sources kernel works with the stock samsung ics rom? And if so, does hd video recording work in that setup?
Because it could be a good way to determine whether the problem actually comes from the interface between the camera module and the kernel's fimc driver, and not from something else.

(disregard all that if my assumptions are wrong, I'm currently at work and can't do much more than speculate based on greping things in the sources)
Last edited by Zlodo; 30th March 2012 at 03:17 PM.
The Following 12 Users Say Thank You to Zlodo For This Useful Post: [ View ]
30th March 2012, 04:22 PM   |  #2943  
Senior Recognized Developer
Flag Owego, NY
Thanks Meter: 24,758
 
13,519 posts
Join Date:Joined: Aug 2007
Donate to Me
More
Quote:
Originally Posted by Zlodo

So if I got this straight, basically we have camera.exynos.so, which is a wrapper around the proprietary binary vendor-camera.exynos4.so, and that thing communicates with the fimc driver in the kernel. Is that right?

So the issue would be likely to be there. I have a question though, does the cm9 built-from-sources kernel works with the stock samsung ics rom? And if so, does hd video recording work in that setup?
Because it could be a good way to determine whether the problem actually comes from the interface between the camera module and the kernel's fimc driver, and not from something else.

(disregard all that if my assumptions are wrong, I'm currently at work and can't do much more than speculate based on greping things in the sources)

There are some differences between CM kernels and Touchwiz-targeted kernels, mainly in initramfs.

If you want to play with a Touchwiz firmware and a source-built kernel, my repo at https://github.com/Entropy512/kernel_galaxys2_ics should be useful.

Instrumenting the fimc driver might be useful.

I might look at it later this weekend - but the cpufreq issues with all I9100/I777 ICS kernels have been my kernel priority lately.
The Following 3 Users Say Thank You to Entropy512 For This Useful Post: [ View ]
30th March 2012, 04:31 PM   |  #2944  
Junior Member
Thanks Meter: 286
 
17 posts
Join Date:Joined: Jun 2010
Quote:
Originally Posted by Entropy512

Instrumenting the fimc driver might be useful.

Yeah, I think it's the easiest way to go about it.

I've tried to figure out how exactly the fimc driver is supposed to receive the size from the userland code.
It's done through a standard interface called v4l2 (video for linux, version 2) (sorry if this is obvious, I never worked on that stuff, I'm discovering as I go)

Docs for it can be found there: http://v4l2spec.bytesex.org.

Of interest here are the ioctl() calls that are used to specify cropping and scaling: http://v4l2spec.bytesex.org/spec/x1904.htm
Those ioctl are received in the kernel by drivers/media/video/v4l2-ioctl.c, and dispatched to the actual driver through function pointers.

It means that the desired capture size should basically "enter" the fimc driver in the following functions:

fimc_s_crop() in fimc_v4l2.c (VIDIOC_S_CROP ioctl, cf http://v4l2spec.bytesex.org/spec/r9994.htm)
and
fimc_s_fmt_vid_capture() in either fimc_capture_u1.c or fimc_capture.c (i'm not sure which one is used) (VIDIOC_S_FMT ioctl, cf http://v4l2spec.bytesex.org/spec/r10944.htm)

Those should be interesting places to add some instrumentation, or to try and force it to another size.
Last edited by Zlodo; 30th March 2012 at 04:38 PM.
The Following 30 Users Say Thank You to Zlodo For This Useful Post: [ View ]
30th March 2012, 04:37 PM   |  #2945  
espenfjo's Avatar
Recognized Developer
Flag Oslo
Thanks Meter: 2,259
 
392 posts
Join Date:Joined: Jul 2008
Donate to Me
More
Code:
 
/* subdev handling macro */                                                                                                                                                                                     
#define subdev_call(ctrl, o, f, args...) \                                                                                                                                                                      
        v4l2_subdev_call(ctrl->cam->sd, o, f, ##args) 
..
..
ret = subdev_call(ctrl, video, enum_framesizes, &cam_frmsize); 
.
.
.
if (cam_frmsize.discrete.width > 0 && cam_frmsize.discrete.height > 0) {                                                                                                
                                                ctrl->cam->window.left = 0;                                                                                                                                     
                                                ctrl->cam->window.top = 0;                                                                                                                                      
                                                printk(KERN_INFO "<HACK> %s: non-rot camera width=%d, height=%d\n", __func__, ctrl->cam->width, ctrl->cam->height);                                             
                                                                                                                                                                                                                
                                                ctrl->cam->width = ctrl->cam->window.width = cam_frmsize.discrete.width;                                                                                        
                                                ctrl->cam->height = ctrl->cam->window.height = cam_frmsize.discrete.height;                                                                                     
                                                printk(KERN_INFO "<HACK> %s: non-rot camera frame width=%d, height=%d\n", __func__, cam_frmsize.discrete.width, cam_frmsize.discrete.height);                   
                                                printk(KERN_INFO "<HACK> %s: non-rot camera window width=%d, height=%d\n", __func__, ctrl->cam->window.width, ctrl->cam->window.height);                       
                                                                                                                                                                                                                
                                                fimc_info2("enum_framesizes width = %d, height = %d\n",                                                                                                         
                                                                ctrl->cam->width, ctrl->cam->height);                                                                                                           
                                        }
<6>[ 206.743748] <HACK> fimc_streamon_capture: non-rot camera width=1920, height=1080
<6>[ 206.743814] <HACK> fimc_streamon_capture: non-rot camera frame width=640, height=480
<6>[ 206.743884] <HACK> fimc_streamon_capture: non-rot camera window width=640, height=480


So some instrumentation in the v4l2 code might perhaps shed some light on where the kernel misses the Camera size
The Following 16 Users Say Thank You to espenfjo For This Useful Post: [ View ]
30th March 2012, 05:53 PM   |  #2946  
Skyline92's Avatar
Senior Member
Thanks Meter: 26
 
267 posts
Join Date:Joined: May 2011
Hi guys. Maybe it's not useful, but HD recording works with this app.

https://play.google.com/store/apps/d...ameraics&hl=de

Hope it helps.

Sent from my GT-I9100 using XDA
The Following 6 Users Say Thank You to Skyline92 For This Useful Post: [ View ]
30th March 2012, 05:54 PM   |  #2947  
espenfjo's Avatar
Recognized Developer
Flag Oslo
Thanks Meter: 2,259
 
392 posts
Join Date:Joined: Jul 2008
Donate to Me
More
Quote:
Originally Posted by Skyline92

Hi guys. Maybe it's not useful, but HD recording works with this app.

https://play.google.com/store/apps/d...ameraics&hl=de

Hope it helps.

Sent from my GT-I9100 using XDA

Yup, It is very helpful
We are looking into it now.
http://pastebin.com/R7VztYp5 - Kernel logs with CM Camera and Camera ICS app.
The Following User Says Thank You to espenfjo For This Useful Post: [ View ]
30th March 2012, 06:00 PM   |  #2948  
Skyline92's Avatar
Senior Member
Thanks Meter: 26
 
267 posts
Join Date:Joined: May 2011
Nice :).

Two more things:
There's always some background noise. Seems like the mic is a bit overtuned.

Second thing is, that the displayed resolution while filming is wrong (wrong aspect ratio?). The output is fine, though.

I'm outta here. Do your work, geeks ;)


Sent from my GT-I9100 using XDA
The Following User Says Thank You to Skyline92 For This Useful Post: [ View ]
30th March 2012, 07:50 PM   |  #2949  
codeworkx's Avatar
OP Senior Recognized Developer
Thanks Meter: 43,545
 
5,441 posts
Join Date:Joined: Nov 2010
Donate to Me
More
@Zlodo
i would say: nice teamwork! ;)
thanks for your help. we really need guys like you.
The Following 42 Users Say Thank You to codeworkx For This Useful Post: [ View ]
30th March 2012, 09:05 PM   |  #2950  
Junior Member
Thanks Meter: 286
 
17 posts
Join Date:Joined: Jun 2010
Quote:
Originally Posted by codeworkx

@Zlodo
i would say: nice teamwork! ;)
thanks for your help. we really need guys like you.

I'm too lazy to do that kind of stuff on a regular basis, but I'm glad I could help. Thanks for making CM9 happen in the first place

The Following 44 Users Say Thank You to Zlodo For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
alpha build, android 4.0, best sgs2 rom ever, bitte nicht stören codeworkx, cm9, cm9sgs2, development thread, epic winning, for experienced users, ics, not for user questions or discussion, schreiben sie keine scheiße, use the 'thanks' buttons - don't spam noobz0rz
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes