This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM8148 V4L2 Video capture problem

Other Parts Discussed in Thread: TVP5158

when i test dm8148 v4l2 caputue driver ( /dev/video0)

the kernel crush during ti81xxvin_check_format(), report divided by zero

I checked the code ,found the reason is that user must fill fmt.pix.bytesperline and fmt.pix.sizeimage.

so I think this is a bug.

because my v4l2 example and ffmpeg both have problems in doing this.

other problems:,

2. when I call V4L2_S_STD with V4L2_STD_1080P_60, it will also failed., why?

3. when I wanna loop back /dev/video0 and /dev/video3,

   the V4L2 VIDEOC_STREAMON will failed. why?

  • Hi,

    Can  you please send the crash log and other details like which release you used, what are you trying to do etc. Also send the dump of commands you excuted on console for loading ti81xxvin.ko etc.

    Regards,

    Hardik Shah

  • 1. for some reason, the log is diffcult to copy.

       while I found the problem is near the line in function ti81xxvin_check_format(), :

      sizeimage = pixfmt.sizeimage;

      numlines = sizeimage /hpitch;

    it seems that inst->win.w is not correct, the hptich could be zero,  then kernel report devided by zero.

     When I call VIDEOC_S_FMT, if I just set fmt.pix.width, fmt.pix.heigth, fmt.pix.format, the problem will occur.

    but if I also set fmt.pix.bytesperline and fmt.pix.sizeimage, It will be ok. should set all these things every time?

    2. I modified the psp video examples, and still have problems with  /dev/video0 capture:

        user pointer method: when VIDEOC_QBUFFER, system crush.

       memmap method:  when mmap, report dma_alloc_coherent size xxx failed. (xxx is 4M at 1080p and 1M at 720p)

    could any one test the video capture and send me the test source code?

     the psp video example can not work. and it is not designed for DM8148.

    3. VIDEOC_S_STD and VIDEOC_ENUMSTD can not work

    4. I wanna a example loop back /dev/video0(HD capture) and /dev/video1(HDMI).

       Can I do this by overlay? resize input directly to display window!

       does DM8148 support following function in V4l2 video pipeline(without using OPENMAX, just using V4l2 and sysfile)

     a. video resize

     b. video overlay

     c. video overlay with resizer

      d. loopback V4L2 input to Framebuffer output

     

  • Hi,

    You can refer to sample applications provided with PSP to do all operations like scaling, capture to display etc.  Sample applications are located at $PSP_Package\src\examples\examples.tar.gz

    Regards,

    Hardik Shah

  • thanks a lot. I can run the saLoopback exmpale. but still has some questions:

    1. the kernel still core dump, when queue_buffer for the first time. but application can still run.

     stack as follows

    >   warn_slowpath_null.

     >local_bh_enable

    >omap_mobx_msg_send

    >notify_shm_drv_notify_event

    >vps_vid2_queue

    ...

    2. why the loopback exmample use  memory which mmaped from framebuffer?

       in order to use framebuffer (display1-vout2), I have to change a lot of parameters, because it is used to driver LCD with reselotion of 800*420.

      a. in the exmpale, I think the input video is displayed both in display0(hdmi) and display1(vout2), right?

     b. If I do not want to use mmap from framebuffer, can I use other method to malloc memory?

         b1: can I just use malloc or memalign?-- I test but kernel crush

         b2: can I just mmap with MAP_ANONYMOUS options, which do not require a file decriptor?-- I test but kernel crush

         b3: does the driver expected to use cmem memory?. Does the v4l2 driver/vpss require the memory must be physical continues?

    3. I test loopbackscale example, It's good.

       can I scale two video input into one video ouput window?

    4. I want to overlay the scaled input video with QT graphic application which leave a transparent window to fit video.

     qt application is in graphic pipeline and  using /dev/fb0, while video is in video pipline, and using /dev/video1  

    how can i do that?

      use V4l2 alpha blend command?

      because the qt application has a transparent window, 

    can I just overlay the video pipeline and graphic pipeline together without alpha blending? how?

  • Hi,

    Following are answer to your questions.

    1. This is know issue and it happens because we call udelay with spinlock taken. We are working to solve it and it may require some driver design change.

    2. Mmap is not supported for capture driver this is mainly because of the large buffer requirement. Hardware requires continuous buffer for operation and its nearly impossible to get that big size buffer using dma_alloc_coherent()

    3. You can do that by doing pointer manipulation while queuing of buffers. Currently we support single capture port only.

    4. I am not sure about QT but alpha blending is supported You can refer to video driver userguide for same.

    Regards,

    Hardik Shah

  • thanks very much for your reply.

    1. so, for the V4L2 memory,  V4L2 mmap method is not possible, regard userPointer method:

     the memory must using CMEM memory, or memory from framebuffer's memory, because the memory must be continus, right?

    2. I need two SD analog video capture.  below is the possible method,  

    a. split one HD input into two 8 bit capture..(does the M3 firmware/vpss_driver need to change besides v4l2 driver change?)

     b. downgrage two HD 16-bit input to 8 bit capture.(does the M3 firmware/vpss_driver need to change besides v4l2 driver change?)

     c. split one HD input to 4 channel by using tvp5158. (this is Video suvaillance configure. does it  support the v4l2 driver ?)

  • Hi,

    Answers,

    1. Yes,

    2. a is possible but you need to add your own decoder support in V4L2 driver.  No change require on M3 side. b will be useful to support 4 SD using 2 HD inputs, again this also doesn't require M3 change. c wont be supported on V4L2 because of multi channel scenario which is not best fit for V4L2.

    Regards,

    Hardik Shah