Search This thread

Zlodo

Member
Jun 30, 2010
17
284
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:

Entropy512

Senior Recognized Developer
Aug 31, 2007
14,088
25,086
Owego, NY
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.
 

Zlodo

Member
Jun 30, 2010
17
284
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:

espenfjo

Senior Member
Jul 24, 2008
396
2,239
Oslo
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
 

Skyline92

Senior Member
May 13, 2011
269
26
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
 
  • Like
Reactions: Goku80

D4rKn3sSyS

Inactive Recognized Developer
Jan 12, 2011
3,800
16,278
Medellín
Hello guys. Im having a issue while building from sources, maybe stupid for you, but well, not much used to build CM from sources (i'm more into app developing)

Code:
build/core/dynamic_binary.mk:112: atención: se imponen comandos para el objetivo «.so»
build/core/dynamic_binary.mk:95: atención: se ignoran las instrucciones viejas para el objetivo «.so»
build/core/shared_library.mk:54: atención: se imponen comandos para el objetivo «.so»
build/core/dynamic_binary.mk:112: atención: se ignoran las instrucciones viejas para el objetivo «.so»
find: «src»: No existe el archivo o el directorio
[B]build/core/base_rules.mk:166: *** platform/external/android-mock: MODULE.TARGET.JAVA_LIBRARIES.android-mock-runtimelib already defined by external/android-mock.  Alto.[/B]

If you need translated to english just tell me.
Thanks

PS. Didnt post on discussion thread because it gets full of spam and my post will get lost surely
 

alangrig

Senior Member
Oct 15, 2010
1,169
231
Riga
After applying the camera patch, modding in media_profiles.xml doesn't take effect?!

<EncoderProfile quality="high" fileFormat="3gp" duration="30">
<Video codec="h264"
bitRate="20000000"
width="1920"
height="1080"
frameRate="30" />


Video recording bitrate still lower up to 9.5mbit at 1080p or 5.7mbit at 720p, despite changes in media profile.xml

Is video bitrate with latest patch being embedded in camera.apk?

In addition changed as well

VideoEditorCap maxInputFrameWidth="1920"
maxInputFrameHeight="1080" maxOutputFrameWidth="1920"
maxOutputFrameHeight="1080" maxPrefetchYUVFrames="5"/>

So now its possible in movie studio to export project in 1080p, but only from recorded 720p, exporting 1080p fails. Logcat will be uploaded later.

Sent from my GT-I9100 using xda premium
 
Last edited:

espenfjo

Senior Member
Jul 24, 2008
396
2,239
Oslo
Hello guys. Im having a issue while building from sources, maybe stupid for you, but well, not much used to build CM from sources (i'm more into app developing)

Code:
build/core/dynamic_binary.mk:112: atención: se imponen comandos para el objetivo «.so»
build/core/dynamic_binary.mk:95: atención: se ignoran las instrucciones viejas para el objetivo «.so»
build/core/shared_library.mk:54: atención: se imponen comandos para el objetivo «.so»
build/core/dynamic_binary.mk:112: atención: se ignoran las instrucciones viejas para el objetivo «.so»
find: «src»: No existe el archivo o el directorio
[B]build/core/base_rules.mk:166: *** platform/external/android-mock: MODULE.TARGET.JAVA_LIBRARIES.android-mock-runtimelib already defined by external/android-mock.  Alto.[/B]

If you need translated to english just tell me.
Thanks

PS. Didnt post on discussion thread because it gets full of spam and my post will get lost surely
It seems like your checkout is missing something
find: «src»: No existe el archivo o el directorio

Try to run a new repo sync.
 
  • Like
Reactions: D4rKn3sSyS

tsubus

Senior Member
Dec 1, 2010
1,310
1,102
plus.google.com
I've noticed that there is an issue when using adb from recovery (can't su, no root permissions). Where would I look in the source code to see what the issue is?

Code:
adb shell

shell@android:/ $ su
su
Segmentation fault
 
Last edited:

cdesai

Inactive Recognized Developer
Jan 16, 2011
2,296
4,089
IN YOUR HEAD

tsubus

Senior Member
Dec 1, 2010
1,310
1,102
plus.google.com
Last edited:

cdesai

Inactive Recognized Developer
Jan 16, 2011
2,296
4,089
IN YOUR HEAD
I did run repo sync, firstly got some calendar issues, then deleted /packages/apps/calendarm and sync went fine. But im still having exactly the same issue I wrote before. Should I try downloading the whole source again?
First try just checking out the whole source again

Delete everything in your source dir but .repo, then re-run repo sync
 
  • Like
Reactions: brajesh.sharma87

Zlodo

Member
Jun 30, 2010
17
284
After applying the camera patch, modding in media_profiles.xml doesn't take effect?!

<EncoderProfile quality="high" fileFormat="3gp" duration="30">
<Video codec="h264"
bitRate="20000000"
width="1920"
height="1080"
frameRate="30" />


Video recording bitrate still lower up to 9.5mbit at 1080p or 5.7mbit at 720p, despite changes in media profile.xml

Is video bitrate with latest patch being embedded in camera.apk?

No, but it seems that the codec doesn't pass the bitrate along to the mfc driver (the driver for the hardware video encoder) properly. Probably some more issues with the interface between the codecs and that driver (it was an issue with that which prevented the camera to record anything in the first place)
 

kurdt19

Member
Sep 1, 2010
28
1
I really don't know if this is the best place to put this, but all builds, stuck the phone requiring a hardreset when I scroll a ListView, nothing in the Logcat...
 

Top Liked Posts