i.mx6ull csi with tw9900

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.mx6ull csi with tw9900

Jump to solution
6,278 Views
tkcheng01
Contributor III

I am working with i.mx6ull csi with tw9900 over bt.656. My camera is NTSC format.

I patch mx6s_capture.c file following guidance(0001-Enable-CSI...) from below link.

imx6ul tw9990 issue 

However, I am unable to get the correct image format. This is what I can capture so far.

Attached herwith the source code on mx6s_capture.c as well as tw9900.c

 

208584_208584.jpgpastedImage_3.jpg

Tags (3)
1 Solution
4,656 Views
igorpadykov
NXP Employee
NXP Employee

Hi tk

had you got it working with adv7180, unfortunately I am not aware

of tw9900 patches. In general one can try with various modes, like pal,

interlace.and progressive modes of sensor.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
25 Replies
3,916 Views
hoanganh
Contributor III

Hi tk,

Can you sent me your tw9900 source code? I need that like an example

0 Kudos
3,916 Views
tkcheng01
Contributor III

Please find the file in below link.

tw9900.c

3,916 Views
hoanganh
Contributor III

Hi Tk,

So lucky, i use i.mx6ull too. That is: MYC-Y6ULX CPU ModuleMYC-Y6ULX CPU Module | NXP i.MX 6UL, 6ULL ARM Cortex-A7-Welcome to MYIR 

But i have problem with my understand

My camera out put is bt.656, have 8 wire data and 1 wire clock. I think only "mx6s_capture.c" can capture data frame, no need "tw9900.c".

Please help me with 2 problem:

             - have need tw9900.c? if yes, how to modify tw9900.c can use without i2c connection, because my camera no have i2c, that always push data to 8 wire data.

             - i use uvc_streamer usb camera to pc over ethernet. Can use it to show video? If you not fell bothered, can you share me your app can see video like you first post. I'm very new member with NXP's chip and something is too hard to understand!

Thanks so much!

0 Kudos
3,914 Views
tkcheng01
Contributor III

TW9900 is a video decoder to convert cvbs signal into bt.656 so that bt.656 digital signal can be receive by imx6. In your case I do not think you will tw9900 driver anymore, since you camera is output bt.656.

Imx6ull has some example code on receiving video, search of a yocto package name called: imx-test.

3,914 Views
hoanganh
Contributor III

i don't use your code mx6s_capture.c because can't compile it

My code can't capture frame :smileysad:

Can you help me?

I don't understand "how it work" because i see some macro not use on this code.

bt656.c 

0 Kudos
3,914 Views
tkcheng01
Contributor III

My advice is to use my mx6s_capture code since it is known to be working. Perhaps you can post your error while compiling this code.

0 Kudos
3,916 Views
hoanganh
Contributor III

I try modify mx6s_capture.c to capture bt656 without subdev device but not OK :smileysad:

0 Kudos
3,916 Views
tkcheng01
Contributor III

On your first error 'drivers/media/platform/mxc/subdev/656.c:296:27: error: field 'vb' has incomplete type'

struct vb2_v4l2_buffer vb;

It seems like the header file does not contain structure 'vb2_v4l2_buffer'. This structure is define in kernel_source/include/media/videobuf2-v4l2.h

One possible reason is you are using old kernel version. I am using version 4.9.11

0 Kudos
3,916 Views
hoanganh
Contributor III

Yes, i know that.

I modified mx6s_capture.c follow your source code. Seem it work!

But i only capture 1 frame, then "timeout when wait for SOF". If i reboot the imx6ull, i can capture again but only 1 frame.

Capture.PNG

0 Kudos
3,916 Views
tkcheng01
Contributor III

I seems to have similar problem before, but I can't be sure as it is quite some time ago.

I vaguely recall I have the SOF message. After that I recheck my bt.656 source and fix on my source. Then everything works. So at this moment, I can only suggest you to make sure your bt.656 source is no issues (e.g. perhaps connect to a receiver and prove working)

0 Kudos
3,916 Views
hoanganh
Contributor III

Thanks for response.

At first capture after power on, i have SOF interrupt. But with second capture (ioctl VIDIOC_STREAMON), can't detect SOF util restart system.

Now, do you have bt656's hardware (Camera, imx6ull)?

BT.656 

Can you compile my driver and app on user space. Help me testing to make sure software is OK. I thinks haven't problem with my hardware!

Below is first frame i captured.

Reagards.

Capture.PNG

0 Kudos
3,916 Views
tkcheng01
Contributor III

Your image, is very similar to my image in the first post. So I suggest you validate your bt.656 source to ensure the output is correct. At this moment I am unable to assist you by running your image on my hardware.

As for my latest tw9900, I had shared on above post (look for 12-july)

0 Kudos
3,916 Views
hoanganh
Contributor III

Yeah, look like vsync signal is lost. 

Last question: what's SFR in your tw9900?

Thanks,

0 Kudos
3,913 Views
tkcheng01
Contributor III

You can refer to the source file to know the SFR settings

3,913 Views
hoanganh
Contributor III

Sorry, i can't find any things with "sfr" in tw9900.c

0 Kudos
3,913 Views
tkcheng01
Contributor III

I must have misunderstand your questions. What do you mean when you mentioned: what's SFR in your tw9900?

I was assuming you want to know what register settings in tw9900. Thats why I point you to tw9900.c driver file.

0 Kudos
3,913 Views
hoanganh
Contributor III

Hi Tk,

i had go back after swap to another camera project. I stucked in here, can't decode bt656 from camera :smileysad:

0 Kudos
3,913 Views
theodorebelogia
Contributor II

Hi Vu Anh

I have exactly the same scenario. imx6ull from myirtech with adv7180.

Can you help with device tree file and/or anything you have achieved ?

Regards

0 Kudos
3,916 Views
hoanganh
Contributor III

Hi TK, this is log when i compile module kernel

vu@VuHoangAnh:~/Desktop/1.IMX6ULL/build/04-Source/MYiR-iMX-Linux$ make modules
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
CHK include/generated/bounds.h
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
CC [M] drivers/media/platform/mxc/subdev/656.o
drivers/media/platform/mxc/subdev/656.c:296:27: error: field 'vb' has incomplete type
struct vb2_v4l2_buffer vb;
^
drivers/media/platform/mxc/subdev/656.c: In function 'mx6s_videobuf_queue':
drivers/media/platform/mxc/subdev/656.c:743:33: error: implicit declaration of function 'to_vb2_v4l2_buffer' [-Werror=implicit-function-declaration]
struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
^
drivers/media/platform/mxc/subdev/656.c:743:33: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
In file included from include/asm-generic/bug.h:13:0,
from ./arch/arm/include/asm/bug.h:61,
from include/linux/bug.h:4,
from include/linux/thread_info.h:11,
from include/asm-generic/current.h:4,
from arch/arm/include/generated/asm/current.h:1,
from include/linux/mutex.h:13,
from include/linux/notifier.h:13,
from include/linux/busfreq-imx.h:12,
from drivers/media/platform/mxc/subdev/656.c:24:
include/linux/kernel.h:812:48: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
^
drivers/media/platform/mxc/subdev/656.c:745:28: note: in expansion of macro 'container_of'
struct mx6s_buffer *buf = container_of(vbuf, struct mx6s_buffer, vb);
^
include/linux/kernel.h:812:48: note: (near initialization for 'buf')
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
^
drivers/media/platform/mxc/subdev/656.c:745:28: note: in expansion of macro 'container_of'
struct mx6s_buffer *buf = container_of(vbuf, struct mx6s_buffer, vb);
^
drivers/media/platform/mxc/subdev/656.c: At top level:
drivers/media/platform/mxc/subdev/656.c:1050:21: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
.queue_setup = mx6s_videobuf_setup,
^
drivers/media/platform/mxc/subdev/656.c:1050:21: note: (near initialization for 'mx6s_videobuf_ops.queue_setup')
drivers/media/platform/mxc/subdev/656.c: In function 'mx6s_csi_frame_done':
drivers/media/platform/mxc/subdev/656.c:1097:5: error: 'struct vb2_buffer' has no member named 'timestamp'
vb->timestamp =ktime_get_ns();
^
drivers/media/platform/mxc/subdev/656.c:1098:25: error: invalid type argument of '->' (have 'int')
to_vb2_v4l2_buffer(vb)->sequence = csi_dev->frame_count;
^
cc1: some warnings being treated as errors
scripts/Makefile.build:264: recipe for target 'drivers/media/platform/mxc/subdev/656.o' failed
make[4]: *** [drivers/media/platform/mxc/subdev/656.o] Error 1
scripts/Makefile.build:403: recipe for target 'drivers/media/platform/mxc/subdev' failed
make[3]: *** [drivers/media/platform/mxc/subdev] Error 2
scripts/Makefile.build:403: recipe for target 'drivers/media/platform' failed
make[2]: *** [drivers/media/platform] Error 2
scripts/Makefile.build:403: recipe for target 'drivers/media' failed
make[1]: *** [drivers/media] Error 2
Makefile:947: recipe for target 'drivers' failed
make: *** [drivers] Error 2

Thanks for your help!

0 Kudos
3,916 Views
tkcheng01
Contributor III

Hi Igor,

No, I have not tried with adv7180. Do you suggest me to modified from adv7180? I only saw this file in drivers/media/platform/mxc/capture

From my understanding, i.mx6ull does not have ipu, thus it should not use files from drivers/media/platform/mxc/capture, but use drivers/media/platform/mxc/subdev instead.

0 Kudos