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.

Building DVSDK 2.0

Other Parts Discussed in Thread: TVP5146

Can anyone tell me where the expression dm350mmap_reply_mutex is supposed to be defined?  Should it be somewhere in the kernel source?

While trying to build the DVSDK 2.0 with kernel version 2.6.32, I get the following errors building dm355mm:

/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:82: warning: type defaults to ‘int’ in declaration of ‘DECLARE_MUTEX_LOCKED’
/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c: In function ‘irq_handler’:
/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:100: error: ‘dm350mmap_reply_mutex’ undeclared (first use in this function)
/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:100: error: (Each undeclared identifier is reported only once
/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:100: error: for each function it appears in.)
/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c: In function ‘ioctl’:
/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:151: error: ‘dm350mmap_reply_mutex’ undeclared (first use in this function)
/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:149: warning: unused variable ‘retval’
/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c: In function ‘dm350mmap_init’:
/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:265: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type
make[3]: *** [/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.o] Error 1
make[2]: *** [_module_/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module] Error 2
make[2]: Leaving directory `/home/jim/linux-davinci'
make[1]: *** [release] Error 2
make[1]: Leaving directory `/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module'
make: *** [dm355mm] Error 2

This appears only to be referenced only in dm350mmap.c, but I don't find it defined anywhere.

Thanks,

Jim

  • I am also getting what looks like a strange failure when I try to build the psp exaples.

    When the build gets to fbdev_loopback.c, the compiler issues the string of errors below.

    I think I can track down the undeclared identifiers, but I can't understand the first 3 errors.

    Here are the offending lines.

    First, lines 356-360:

    static void restore_config(void);
    static int initialize_capture(v4l2_std_id * cur_std);
    static int start_loop(void);
    static int init_capture_device(void);
    static int set_data_format(v4l2_std_id * cur_std);

    **********************************************

    Line 449 is the function definition for initialize_capture()

    static int initialize_capture(v4l2_std_id * cur_std)

    Line 609 is the function definition for set_data_format()

    static int set_data_format(v4l2_std_id *cur_std)

    These prototypes and function definitions look OK to me.  I assume that this code has been built sometime before, and I don't think that these lines should be dependent on the linux kernel.  In any case, I get the same errors if I try to build against the MV kernel from the DVSDK.  I'm using the codegen tools from DVSDK 2.0.

    **********************************************

    make[2]: Entering directory `/home/jim/dvsdk_2_00_00_22/PSP_02_00_00_140/examples/dm355/fbdev'
    /opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-gcc -Wall -I /home/jim/linux-davinci/include -c fbdev_loopback.c
    fbdev_loopback.c:357: error: expected ‘)’ before ‘*’ token
    fbdev_loopback.c:360: error: expected ‘)’ before ‘*’ token
    fbdev_loopback.c:449: error: expected ‘)’ before ‘*’ token
    fbdev_loopback.c: In function ‘start_loop’:
    fbdev_loopback.c:478: error: storage size of ‘buf’ isn’t known
    fbdev_loopback.c:528: error: ‘V4L2_BUF_TYPE_VIDEO_CAPTURE’ undeclared (first use in this function)
    fbdev_loopback.c:528: error: (Each undeclared identifier is reported only once
    fbdev_loopback.c:528: error: for each function it appears in.)
    fbdev_loopback.c:529: error: ‘V4L2_MEMORY_MMAP’ undeclared (first use in this function)
    fbdev_loopback.c:532: error: ‘VIDIOC_DQBUF’ undeclared (first use in this function)
    fbdev_loopback.c:546: error: ‘VIDIOC_QBUF’ undeclared (first use in this function)
    fbdev_loopback.c:488: warning: unused variable ‘r’
    fbdev_loopback.c:487: warning: unused variable ‘tv’
    fbdev_loopback.c:486: warning: unused variable ‘fds’
    fbdev_loopback.c:479: warning: unused variable ‘captFrmCnt’
    fbdev_loopback.c:478: warning: unused variable ‘buf’
    fbdev_loopback.c: In function ‘init_capture_device’:
    fbdev_loopback.c:557: error: storage size of ‘cap’ isn’t known
    fbdev_loopback.c:573: error: ‘VIDIOC_QUERYCAP’ undeclared (first use in this function)
    fbdev_loopback.c:578: error: ‘V4L2_CAP_VIDEO_CAPTURE’ undeclared (first use in this function)
    fbdev_loopback.c:585: error: ‘V4L2_CAP_STREAMING’ undeclared (first use in this function)
    fbdev_loopback.c:592: error: invalid use of undefined type ‘struct v4l2_cropcap’
    fbdev_loopback.c:592: error: ‘V4L2_BUF_TYPE_VIDEO_CAPTURE’ undeclared (first use in this function)
    fbdev_loopback.c:594: error: ‘VIDIOC_CROPCAP’ undeclared (first use in this function)
    fbdev_loopback.c:601: error: invalid use of undefined type ‘struct v4l2_cropcap’
    fbdev_loopback.c:601: error: invalid use of undefined type ‘struct v4l2_cropcap’
    fbdev_loopback.c:602: error: invalid use of undefined type ‘struct v4l2_cropcap’
    fbdev_loopback.c:602: error: invalid use of undefined type ‘struct v4l2_cropcap’
    fbdev_loopback.c:603: error: invalid use of undefined type ‘struct v4l2_cropcap’
    fbdev_loopback.c:603: error: invalid use of undefined type ‘struct v4l2_cropcap’
    fbdev_loopback.c:604: error: invalid use of undefined type ‘struct v4l2_cropcap’
    fbdev_loopback.c:604: error: invalid use of undefined type ‘struct v4l2_cropcap’
    fbdev_loopback.c:557: warning: unused variable ‘cap’
    fbdev_loopback.c: At top level:
    fbdev_loopback.c:609: error: expected ‘)’ before ‘*’ token
    fbdev_loopback.c: In function ‘init_capture_buffers’:
    fbdev_loopback.c:689: error: storage size of ‘req’ isn’t known
    fbdev_loopback.c:694: error: ‘V4L2_BUF_TYPE_VIDEO_CAPTURE’ undeclared (first use in this function)
    fbdev_loopback.c:695: error: ‘V4L2_MEMORY_MMAP’ undeclared (first use in this function)
    fbdev_loopback.c:697: error: ‘VIDIOC_REQBUFS’ undeclared (first use in this function)
    fbdev_loopback.c:717: error: storage size of ‘buf’ isn’t known
    fbdev_loopback.c:723: error: ‘VIDIOC_QUERYBUF’ undeclared (first use in this function)
    fbdev_loopback.c:717: warning: unused variable ‘buf’
    fbdev_loopback.c:689: warning: unused variable ‘req’
    fbdev_loopback.c: In function ‘start_streaming’:
    fbdev_loopback.c:749: error: storage size of ‘type’ isn’t known
    fbdev_loopback.c:752: error: storage size of ‘buf’ isn’t known
    fbdev_loopback.c:754: error: ‘V4L2_BUF_TYPE_VIDEO_CAPTURE’ undeclared (first use in this function)
    fbdev_loopback.c:755: error: ‘V4L2_MEMORY_MMAP’ undeclared (first use in this function)
    fbdev_loopback.c:759: error: ‘VIDIOC_QBUF’ undeclared (first use in this function)
    fbdev_loopback.c:752: warning: unused variable ‘buf’
    fbdev_loopback.c:764: error: ‘VIDIOC_STREAMON’ undeclared (first use in this function)
    fbdev_loopback.c:749: warning: unused variable ‘type’
    fbdev_loopback.c: In function ‘flip_video_buffers’:
    fbdev_loopback.c:913: warning: unused variable ‘dummy’
    fbdev_loopback.c: In function ‘vpbe_UE_1’:
    fbdev_loopback.c:1123: error: ‘v4l2_std_id’ undeclared (first use in this function)
    fbdev_loopback.c:1123: error: expected ‘;’ before ‘cur_std’
    fbdev_loopback.c:1127: warning: implicit declaration of function ‘initialize_capture’
    fbdev_loopback.c:1127: error: ‘cur_std’ undeclared (first use in this function)
    fbdev_loopback.c:1133: error: ‘V4L2_STD_NTSC’ undeclared (first use in this function)
    make[2]: *** [fbdev_loopback.o] Error 1
    make[2]: Leaving directory `/home/jim/dvsdk_2_00_00_22/PSP_02_00_00_140/examples/dm355/fbdev'
    make[1]: *** [fbdev] Error 2
    make[1]: Leaving directory `/home/jim/dvsdk_2_00_00_22/PSP_02_00_00_140/examples'
    make: *** [psp_examples] Error 2

     

  • After adding missing header files and correcting paths for headers I have been able to get everything except dm355mm to build without error, but wnen I try to build dm355mm, the build fails with a string of errors starting with:

    /home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:101: error: ‘dm350mmap_reply_mutex’ undeclared (first use in this function

    Can someone tell me how to resolve this?  dm350mmap.ko appears to be sort of necessary.

  • Jim,

    You are correct; dm350mmap.ko is necessary and you will need to rebuild it if using a different kernel source code than the one the pre-built binary was built from. 

    1.  cd into DVSDK directory

    2.  Edit Rules.make file for your installation.  Make sure the the LINUXKERNEL_INSTALL_DIR is set to the kernel directory that you built your kernel from.

    3.  cd into dm355_codecs_1_13_000/dm355mm/module

    4.  make clean

    5.  make

    As you can see from above, this module is not in the kernel source tree, making it hard to find.

  • Hi, Juan,

    thanks for the note.  The problem is that I get the same build errors whether I try to build from the top directory of dvsdk or if I go down to the dm350mmap directory per your instructions.

    jim@jims-laptop:~/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module$ make
    make -C /home/jim/linux-davinci M=`pwd` ARCH=arm CROSS_COMPILE=/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le- \
            EXTRA_CFLAGS="-DUSE_UDEV=0 -DMAX_POOLS=10" modules
    make[1]: Entering directory `/home/jim/linux-davinci'
      CC [M]  /home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.o
    /home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:83: warning: type defaults to ‘int’ in declaration of ‘DECLARE_MUTEX_LOCKED’
    /home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c: In function ‘irq_handler’:
    /home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:101: error: ‘dm350mmap_reply_mutex’ undeclared (first use in this function)
    /home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:101: error: (Each undeclared identifier is reported only once
    /home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:101: error: for each function it appears in.)
    /home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c: In function ‘ioctl’:
    /home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:152: error: ‘dm350mmap_reply_mutex’ undeclared (first use in this function)
    /home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:150: warning: unused variable ‘retval’
    /home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c: In function ‘dm350mmap_init’:
    /home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:266: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type
    make[2]: *** [/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.o] Error 1
    make[1]: *** [_module_/home/jim/dvsdk_2_00_00_22/dm355_codecs_1_13_000/dm355mm/module] Error 2
    make[1]: Leaving directory `/home/jim/linux-davinci'
    make: *** [release] Error 2

    At least  part of the problem is that "dm350mmap_reply_mutex" is not defined anywhere in the kernel source tree or in the DVSDK source.

    I assume that this should have been defined in a header file, but I can't find it anywhere.  If I try to build against the kernel from the DVSDK, I get the same errors, plus a lot more errors due to missing header files.

    Has DVSDK 2.0 ever been built for the DM355? 

    I think I mentioned that I'm using MV's gcc 4.2.0 from the DVSDK, but I don't think this is a compiler related problem.

    Thanks,
    Jim

  • I did not know you were building dvsdk tree as well.  I think the real issue is the warning on line 83, you may not hace DECLARE_MUTEX_LOCK in your kernel defined properly.  This is what I see when I try to rebuild dm350mmap with DVSDK kernel

    [root@lta0216953-156117095051 module]# make clean
    rm -rf *.o *mod* *.ko .cmem* .tmp*
    [root@lta0216953-156117095051 module]# make
    make -C /home/user/dvsdk_2_00_00_22/uimage M=`pwd` ARCH=arm CROSS_COMPILE=/home/user/dvsdk_2_00_00_22/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le- \
            EXTRA_CFLAGS="-DUSE_UDEV=0 -DMAX_POOLS=10" modules
    make[1]: Entering directory `/home/user/dvsdk_2_00_00_22/montavista/pro/devkit/lsp/ti-davinci/linux-2.6.18_pro500'
      CC [M]  /home/user/dvsdk_2_00_00_22/dvsdk/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.o
    /home/user/dvsdk_2_00_00_22/dvsdk/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c: In function 'ioctl':
    /home/user/dvsdk_2_00_00_22/dvsdk/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.c:142: warning: unused variable 'retval'
      Building modules, stage 2.
      MODPOST
      CC      /home/user/dvsdk_2_00_00_22/dvsdk/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.mod.o
      LD [M]  /home/user/dvsdk_2_00_00_22/dvsdk/dm355_codecs_1_13_000/dm355mm/module/dm350mmap.ko
    make[1]: Leaving directory `/home/user/dvsdk_2_00_00_22/montavista/pro/devkit/lsp/ti-davinci/linux-2.6.18_pro500'
    [root@lta0216953-156117095051 module]#

  • Juan,

    apparently something got trashed in my kernel source tree and/or my DVSDK source tree.  I cleaned both of them out and re-installed them, after which I was able to get the DVSDK to build against the 2.6.18 kernel.  I did have a few problems that I was able to resolve fairly quickly.  I'll pass them along in the hopes of saving someone else a little time:

    dmai_1_20_00_06/packages/ti/sdo/dmai/linux/Capture.c wants to find tvp5146 in include/media/davinci but the MV source tree has it in include/config/video

    dmai_1_20_00_06/packages/ti/sdo/dmai/linux/dm355/Resize.c uses macros that are defined in tvp514x.h and videodev2.h, but did not #include those headers

    Also for Resize.c, the version of dm355_ipipe.h from the MV source tree is missing some needed macros.  I copied dm355_ipipe.h from the git kernel, which satified those.

    Now I can move on to trying to rebuild the DVSDK for the 2.6.32 kernel.

    Thanks for the help.

  • Thank you for sharing this with our community Jim.

  • I think the problem "went away" when you downloaded the dvsdk again because the dvsdk ships with dm350mmap.ko prebuilt, It won't be built again unless you go into the directory and make clean.

    As far as I can tell, dm350mmap_reply_mutex is undefined. Has anyone resolved this?I'm building against the arago kernel.

     

    Thanks!

    Paul