Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,770,471 Members 42,769 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
espenfjo
Old
#2941  
espenfjo's Avatar
Recognized Developer
Thanks Meter 2258
Posts: 391
Join Date: Jul 2008
Location: Oslo

 
DONATE TO ME
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.
Android and CyanogenMod fan
Using Mako with CM10.1
Using N8000 with CM10.1
Using GT-I9100 with CM10.1
Using N8000 with CM10.1
Not using Maguro

Gplus: http://gplus.to/espenfjo
Twitter: http://twitter.com/espenfjo
IRC: Espenfjo @ Freenode

CyanogenMod device maintainer
The Following 5 Users Say Thank You to espenfjo For This Useful Post: [ Click to Expand ]
 
Zlodo
Old
(Last edited by Zlodo; 30th March 2012 at 02:17 PM.)
#2942  
Junior Member
Thanks Meter 286
Posts: 17
Join Date: 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)
The Following 12 Users Say Thank You to Zlodo For This Useful Post: [ Click to Expand ]
 
Entropy512
Old
#2943  
Senior Recognized Developer
Thanks Meter 24186
Posts: 13,192
Join Date: Aug 2007
Location: Owego, NY

 
DONATE TO ME
Quote:
Originally Posted by Zlodo View Post
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.
*so much sig updating needed*

My Github profile - Some Android stuff, some AVR stuff

An excellent post on "noobs vs. developers"

A few opinions on kernel development "good practices"

Note: I have chosen not to use XDA's "friends" feature - I will reject all incoming "friend" requests.

Code:
<MikeyMike01> Smali is a spawn of hell
<shoman94> ^^^ +!
Code:
<Entropy512> gotta be careful not to step on each other's work.  :)
<Bumble-Bee> thats true
<jerdog> compeete for donations
The Following 3 Users Say Thank You to Entropy512 For This Useful Post: [ Click to Expand ]
 
Zlodo
Old
(Last edited by Zlodo; 30th March 2012 at 03:38 PM.)
#2944  
Junior Member
Thanks Meter 286
Posts: 17
Join Date: Jun 2010
Quote:
Originally Posted by Entropy512 View Post
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.
The Following 30 Users Say Thank You to Zlodo For This Useful Post: [ Click to Expand ]
 
espenfjo
Old
#2945  
espenfjo's Avatar
Recognized Developer
Thanks Meter 2258
Posts: 391
Join Date: Jul 2008
Location: Oslo

 
DONATE TO ME
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
Android and CyanogenMod fan
Using Mako with CM10.1
Using N8000 with CM10.1
Using GT-I9100 with CM10.1
Using N8000 with CM10.1
Not using Maguro

Gplus: http://gplus.to/espenfjo
Twitter: http://twitter.com/espenfjo
IRC: Espenfjo @ Freenode

CyanogenMod device maintainer
The Following 16 Users Say Thank You to espenfjo For This Useful Post: [ Click to Expand ]
 
Skyline92
Old
#2946  
Skyline92's Avatar
Senior Member
Thanks Meter 26
Posts: 267
Join Date: 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: [ Click to Expand ]
 
espenfjo
Old
#2947  
espenfjo's Avatar
Recognized Developer
Thanks Meter 2258
Posts: 391
Join Date: Jul 2008
Location: Oslo

 
DONATE TO ME
Quote:
Originally Posted by Skyline92 View Post
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.
Android and CyanogenMod fan
Using Mako with CM10.1
Using N8000 with CM10.1
Using GT-I9100 with CM10.1
Using N8000 with CM10.1
Not using Maguro

Gplus: http://gplus.to/espenfjo
Twitter: http://twitter.com/espenfjo
IRC: Espenfjo @ Freenode

CyanogenMod device maintainer
The Following User Says Thank You to espenfjo For This Useful Post: [ Click to Expand ]
 
Skyline92
Old
#2948  
Skyline92's Avatar
Senior Member
Thanks Meter 26
Posts: 267
Join Date: 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: [ Click to Expand ]
 
codeworkx
Old
#2949  
codeworkx's Avatar
Senior Recognized Developer - OP
Thanks Meter 43530
Posts: 5,441
Join Date: Nov 2010

 
DONATE TO ME
@Zlodo
i would say: nice teamwork! ;)
thanks for your help. we really need guys like you.
Currently inactive CyanogenMod Developer
Twitter: http://twitter.com/codeworkx

Current devices:
Google Nexus 5: Google Android 4.4, Stock Recovery
Google Nexus 4: 3.4.y, CWM6, CM11
HTC One: 3.4.y, CWM6, CM11
Sony Xperia Tablet Z: 3.4.y, CWM6, CM11
Sony Xperia T: 3.4.y, CWM6, CM10.2

BBQLinux - An Arch based Linux distribution for Android developers
Website: http://www.bbqlinux.org | Screenshots | Downloads | IRC: #bbqlinux @ irc.freenode.net
The Following 42 Users Say Thank You to codeworkx For This Useful Post: [ Click to Expand ]
 
Zlodo
Old
#2950  
Junior Member
Thanks Meter 286
Posts: 17
Join Date: Jun 2010
Quote:
Originally Posted by codeworkx View Post
@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: [ Click to Expand ]
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes