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.

video capture using LI-5M03 camera card on bbxm/

When I attempt the video capture example found here http://v4l2spec.bytesex.org/spec/a16706.htm the program returns "VIDIOC_STREAMON error 22, Invalid argument".  The example program seems to be structured properly, all of the IOCTL calls seem proper, with query to confirm to video capture device.

Querying /dev/video1 with ioctl returns following:

Current input: camera                                                            (VIDIOC_ENUMINPUT.name)
vcap: driver name:  ispvideo                                                  (VIDIOC_QUERYCAP.driver)
vcap: device name:  OMAP3 ISP CSI2a output                    (VIDIOC_QUERYCAP.card)
vcap: businfo name: media                                                   (VIDIOC_QUERYCAP.bus_info)
vcap: version name: 0.0.1                                                     (VIDIOC_QUERYCAP.version)
vcap: capabilties: 4000001                                                    (VIDIOC_QUERYCAP.capabilities) - bitmask indicates V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE

I linked the kernel using the software in ti-sdk-beagleboard software tree installed with the file Graphic_SDK_setuplinux_4_00_00_01.bin.  I believe the driver for the 5M camera is installed in this version, kernel menu config->Device Drivers--->Multimedia support--->Video capture adapters--->Encoders/decoders and other helper chips--->Aptina MT9P031 support is selected.

uname -a: "Linux beagleboard 2.6.39 #1 Thu Dec 15 10:57:37 PST 2011 armv7l unknown".

The following kprintfs are from boot time:

[    3.897674] Linux media interface: v0.10
[    3.901947] Linux video capture interface: v2.00
[    3.907073] usbcore: registered new interface driver uvcvideo
[    3.913085] USB Video Class driver (v1.0.0)

(later)

[    4.337890] [<c001651c>] (omap_i2c_add_bus+0xa8/0xf8) from [<c00139b8>] (beagle_camera_init+0xa0/0xf4)
[    4.347595] [<c00139b8>] (beagle_camera_init+0xa0/0xf4) from [<c00423b8>] (do_one_initcall+0x94/0x15c)

(later)

[    4.555145] [<c001653c>] (omap_i2c_add_bus+0xc8/0xf8) from [<c00139b8>] (beagle_camera_init+0xa0/0xf4)
[    4.564880] [<c00139b8>] (beagle_camera_init+0xa0/0xf4) from [<c00423b8>] (do_one_initcall+0x94/0x15c)
[    4.574584] [<c00423b8>] (do_one_initcall+0x94/0x15c) from [<c00083b4>] (kernel_init+0xa4/0x158)
[    4.583770] [<c00083b4>] (kernel_init+0xa4/0x158) from [<c00481dc>] (kernel_thread_exit+0x0/0x8)
[    4.592926] ---[ end trace 6c3447cdb7c778a6 ]---
[    4.598083] _regulator_get: omap3isp supply VDD_CSIPHY1 not found, using dumm
y regulator
[    4.606597] _regulator_get: omap3isp supply VDD_CSIPHY2 not found, using dumm
y regulator
[    4.615203] omap3isp omap3isp: Revision 15.0 found
[    4.620239] omap-iommu omap-iommu.0: isp: version 1.1
[    4.625640] omap3isp omap3isp: hist: DMA channel = 0
[    4.642395] omap3isp omap3isp: isp_set_xclk(): cam_xclka set to 21600000 Hz
[    4.659057] mt9p031 2-0048: Detected a MT9P031 chip ID 1801
[    4.673614] omap3isp omap3isp: isp_set_xclk(): cam_xclka set to 0 Hz

 

I included the kprintf's to attempt to help determine if the driver is installed.  I think that the example capture program should run on bbxm with proper video driver.  If anyone knows why it wouldn't I'd love to know too.  For now I'm going to attempt to install the kernel in DVSDK  4.02.00.06.

Thanks, Drake.

  • Hi Drake,

    I am new to panda board, and I faced the same issue on ubuntu 11.10

    "VIDIOC_STREAMON error 22, Invalid argument"

    Solution might be silly and the context to which I am answering might also be different , but I got the same issue so replying to it 

    /dev/video0,  /dev/video1, /dev/video2 devices are already created in 11.10, but when I plugged in my USB Camera device, it detected it as /dev/video3

    I changed the script and ran again it worked.

    Thanks, Samagana.

  • Thank you. For me, it was more complex, I had to use media-ctl to configure the pipeline with the following scipts:

    ./media-ctl -v -r -l '"mt9p031 2-0048":0->"OMAP3 ISP CCDC":0[1], "OMAP3 ISP CCDC":2->"OMAP3 ISP preview":0[1], "OMAP3 ISP preview":1->"OMAP3 ISP resizer":0[1], "OMAP3 ISP resizer":1->"OMAP3 ISP resizer output":0[1]'
    ./media-ctl -v -f '"mt9p031 2-0048":0[SGRBG12 720x480], "OMAP3 ISP CCDC":2[SGRBG8 720x480], "OMAP3 ISP preview":1[UYVY 720x480], "OMAP3 ISP resizer":1[UYVY 720x480]'

     

    I'm not sure what all the settings are.  Once the two calls to media-ctl run, then yavta will sample frames from /dev/video6:

    ./yavta  -f UYVY -s 720x480 --capture=600 --stdout /dev/video6 | nc 172.20.20.139 3000

    I modified my version of yavta to accept a flag --stdout, writes video to stdout.  nc connects to mplayer running on my x86 machine. Before starting yavta, start the following on x86 machine (172.20.20.139 in the yavta pipeline above):

    nc -l 3000 | sudo mplayer - -demuxer rawvideo w=720:h=480:format=uyvy:size=619200 -vo x11