How to test TV-IN ( ADV7180) for IMX53 ARD board

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

How to test TV-IN ( ADV7180) for IMX53 ARD board

10,293 Views
Swamy
Contributor III

Hi All,

I am using IMX53 ARD board with android 2.3.4.

I enabled the driver under Device Drivers > Multimedia device > Video Capture Adapters > MXC Camera/V4L2 PRP Features, and now my .config file is updated with "CONFIG_MXC_TVIN_ADV7180=y"...

Please let me know how shall I verify the video in? I have connected the camera to J42 connector of the ARD board.

Regards,

Swamy

Labels (1)
43 Replies

3,124 Views
visakh
Contributor III


I am trying to use an analog camera in imx53_ard using android.Can anyone suggest me the steps to get video displayed on screen.I am not able to use the mknod command and kindly tell me how to build the out file for mxc_v412_tvin.c and run it.


Swamy said:

Thanks for all the support. Now I was able to resolve the issue. I am attaching the modified file here.

Now Video In functionality works fine.

But I have one issue here...When I go to "Video In" page and come back and play the Gallery->Video from USB, the status bar and the movie progress bar does not appear. If I wont come from the "Video In" page it always works fine.

Have I missed something to clear the framebuffer or some memory? is that the reason why i am not able to see the progress bar coming.

Please suggest.

Regards,

Swamy

0 Kudos

3,124 Views
rogerio_silva
NXP Employee
NXP Employee

I'm not sure if the procedure on Android is exactly the same on Linux, but on Linux you can load the modules:

modprobe mxc_v4l2_capture

modprobe adv7180_tvin

And run the unit test located on your rootfs /unit_test:

cd /unit_test

./mxc_v4l2_tvin.out -ow 480 -oh 480

Rgds

Rogerio

0 Kudos

3,124 Views
daiane_angolini
NXP Employee
NXP Employee

I'm not familiar with the app level. But maybe you have used the wrong "video container".

Android will need to display both your content and his content, so Android will need to be able to "overlay" this.

Take a look how Gallery use the "video container" and try to use the same....

0 Kudos

3,124 Views
Swamy
Contributor III

Thanks for all the support. Now I was able to resolve the issue. I am attaching the modified file here.

Now Video In functionality works fine.

But I have one issue here...When I go to "Video In" page and come back and play the Gallery->Video from USB, the status bar and the movie progress bar does not appear. If I wont come from the "Video In" page it always works fine.

Have I missed something to clear the framebuffer or some memory? is that the reason why i am not able to see the progress bar coming.

Please suggest.

Regards,

Swamy

0 Kudos

3,124 Views
daiane_angolini
NXP Employee
NXP Employee


As I undestand, your TV input has 720X500, and you want to resize it to fit your display.

So you should configure IPU to resize.

There should be another unit_test which could help you determinate how resize your input, but I have never looked at it.


Swamy said:

Hi Angolini,

Thanks for the input, Now we were able to get the Video input on the screen.

However the video works fine with display size is 720x500, if I try to increase to 1023x659 to match my display size, the video will come as 2 different screens(interlaced video) and scrolls and gets stuck at single frame, continously video is not played.

please tell me how to modify the application to suit my display size

Please find the attached application file for reference

Regards,

Swamy

0 Kudos

3,124 Views
Swamy
Contributor III

Dmesg Error for 1023x659::

mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_5 = 0x00200000
mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_10 = 0x01000000

0 Kudos

3,124 Views
Swamy
Contributor III

Hi Angolini,

Thanks for the input, Now we were able to get the Video input on the screen.

However the video works fine with display size is 720x500, if I try to increase to 1023x659 to match my display size, the video will come as 2 different screens(interlaced video) and scrolls and gets stuck at single frame, continously video is not played.

please tell me how to modify the application to suit my display size

Please find the attached application file for reference

Regards,

Swamy

0 Kudos

3,124 Views
bikash
Contributor II

hii MahadevaSwamy, how did u solve the following erro:


error at

if (!wait_event_interruptible_timeout(cam->enc_queue,
cam->enc_counter != 0, 10 * HZ)) {
pr_err("ERROR: v4l2 capture: mxc_v4l_dqueue timeout "
"enc_counter %x\n",
cam->enc_counter);
return -ETIME;



I am also stuck at this point. how did u fixed this issue

and one more thing I want to know is how u implemented HAL for adv7180?

does the HAL for CSI cam work or we have to write different HAL?

If we have to write different HAL, the ioctl call seq in the mxc_v4l2_tv_in application will work in android ?


regrads,

Bikash


0 Kudos

3,124 Views
daiane_angolini
NXP Employee
NXP Employee

if in a pure linux enviroment it works, I would care only about the application layer.

You can create another application based on mxc_v4l2_tvin.c, but only uses its input chain.


For output (I mean, the display code) you should do it for Android environment.

0 Kudos

3,124 Views
Swamy
Contributor III

Thanks for the reply.

Yes in the linux environment it worked. Please let me know if the file myandroid\kernel_imx\drivers\media\video\mxc\capture\mxc_v4l2_capture.c needs to be modified?

as it is throwing error at 

if (!wait_event_interruptible_timeout(cam->enc_queue,
cam->enc_counter != 0, 10 * HZ)) {
pr_err("ERROR: v4l2 capture: mxc_v4l_dqueue timeout "
"enc_counter %x\n",
cam->enc_counter);
return -ETIME;

Regards,

Swamy

0 Kudos

3,124 Views
daiane_angolini
NXP Employee
NXP Employee

I have no idea if you will need to modify mxc_v4l2_tvin.c I think, at least, you will need to adapt the video output to fit Android, but it should be done by application.

Have you tried to run the same on a pure linux environment? Does it works?

0 Kudos

3,124 Views
Swamy
Contributor III

Hi Angolini/Charles,

Do I need  to modify the mxc_v4l2_tvin.c file of linux to make it work for Android. please suggest.

As I directly write the video file on to the /dev/graphics/fb0 from the command prompt, a distorted image is seen on the display. This shows that atleast fb0 is taking the input. However it is not getting initiated if I run ./mxc_v4l2_tvin -ow 1024 -oh 768 -ol 10 -ot 20 -f YU12


Regards,

Swamy

0 Kudos

3,124 Views
daiane_angolini
NXP Employee
NXP Employee

OK,

do you know where, from the source code, this error has been called?

Can you, please debug and determinate which is the cause of the error?

I mean, error is on v4l2 capture, so it should be under v4l2_capture.c, and it´s a VIDIOC_DQBUF, from mxc_v4l_dqueue

What I want to know if the adv is not responding or if your device is nor responding.

Can you, please, add some printk into the code and determinate where is the break point?

0 Kudos

3,124 Views
Swamy
Contributor III

sorry my mistake, the fb0 is located in /dev/graphics/...Now i changed the path in the file..

Now, I have a different output,

bash-3.2# ./mxc_v4l2_tvin -ow 1024 -oh 768 -ol 10 -ot 20 -f YU12
TV decoder chip is adv7180_decoder
start time = 88222 s, 404958 us

It waits for sometime here....then throws following error message..

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
VIDIOC_DQBUF failed.
mxc_ipu mxc_ipu: warning: disable ipu dma channel 0 during its busy state
mxc_v4l_close: release resource

bash-3.2#

please suuggest

Regards,

Swamy

0 Kudos

3,124 Views
Swamy
Contributor III

I dont have a root permission in android. Any alternative to check whether fb0 is working properly?

0 Kudos

3,124 Views
daiane_angolini
NXP Employee
NXP Employee

I don´t know.

Maybe

have you given it a try?

0 Kudos

3,124 Views
Swamy
Contributor III

crw-rw-rw- root     log       29,   0 1970-01-02 00:04 fb0

is this something because it is created not as a root?

0 Kudos

3,124 Views
daiane_angolini
NXP Employee
NXP Employee

And regarding ERROR: unrecognized std! ffffff (PAL=ff, NTSC=b000?



I suppose adv driver should create the /dev nod. Maybe it´s not running properly

0 Kudos

3,124 Views
Swamy
Contributor III

Now we created the fb0 using mknod,

#mknod /dev/fb0 c 29 0

# ls -l /dev/fb0

crw-rw-rw- root     log       29,   0 1970-01-02 00:08 fb0

Now by running,

#./mxc_v4l2_tvin.out -ow 1024 -oh 768 -ol 10 -ot 20 -f YU12


TV decoder chip is adv7180_decoder
start time = 87403 s, 302469 us


ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
VIDIOC_DQBUF failed.
mxc_ipu mxc_ipu: warning: disable ipu dma channel 0 during its busy state
mxc_v4l_close: release resource


Please suggest

Regards,

Swamy

0 Kudos

3,124 Views
Swamy
Contributor III

Hi Daiane,

Now we were able to generate all the required kernel modules i.e. ipu_prp_enc.ko,ipu_prp_vf_sdc.ko,ipu_prp_vf_sdc_bg.ko..... as per Linux.

We loaded the modules using insmod (as we dont have modprobe in command prompt) and we got following output when we did lsmod,

bash-3.2# lsmod
mxc_v4l2_capture 19229 1 - Live 0xbf025000
adv7180_tvin 4370 0 - Live 0xbf01e000
ipu_csi_enc 2537 1 mxc_v4l2_capture, Live 0xbf018000
ipu_still 1687 1 mxc_v4l2_capture, Live 0xbf012000
ipu_prp_vf_sdc_bg 3372 1 mxc_v4l2_capture, Live 0xbf00c000
ipu_prp_vf_sdc 3440 1 mxc_v4l2_capture, Live 0xbf006000
ipu_prp_enc 3925 1 mxc_v4l2_capture, Live 0xbf000000

But when we run the ./mxc_v4l2_tvin.out -ow 1024 -oh 768 -ol 10 -ot 20 -f YU12 (as charles suggested)
we get,

TV decoder chip is adv7180_decodERROR: unrecognized std! ffffff (PAL=ff, NTSC=b000
er
ERROR: unrecognized std! ffffff (PAL=ff, NTSC=b000

Unable to open frame buffer

mxc_v4l_close: release resource

And in DMESG we are getting the following messages....


<3>ERROR: unrecognized std! ffffff (PAL=ff, NTSC=b000
<6>mxc_v4l_close: release resource

I found that framebuffer 'fb0' is not getting created under /dev/....It is failing here..under mxc_v4l2_tvin.c(attached)....Please tell us how to create the /dev/fb0?

video0 and video16 are getting created.

   if ((fd_capture_v4l = open(v4l_capture_dev, O_RDWR, 0)) < 0)
        {
                printf("Unable to open %s\n", v4l_capture_dev);
                return TFAIL;
        }

Please suggest,

Regards,

Swamy

0 Kudos