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.

CMEM Error: init: major version mismatch between interface and driver

Other Parts Discussed in Thread: OMAP3530

Hello,
    
    I have happened a  error to use DSP played video.
    Error:
         "CMEM Error: init: major version mismatch between interface and driver.
          CMEM Error: needs driver version 0x2300000, got 0x40395b20"



My environment is :

    The linux kernel version is 2.6.32(OMAP3 PSP kernel integration) ,form "http://arago-project.org/git/projects/?p=linux-omap3.git;a=summary".

    The DVSDK version is dvsdk_3_00_02_44 (build date:20100114),form "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/dvsdk/DVSDK_3_00/latest/index_FDS.html".
     
    Cross Complier is CodeSourecy 2009Q3.

    MY board is ICETEK-OMAP3530-MINI-v3. Memory size is 256M.
    
 
Run ismod commond:
    /snscp/sns # insmod /snscp/player/dsp/omap3530/cmemk.ko phys_start=0x8c900000 phys_end=0x8d8fffff pools=1x5250000,7x829440,1x345600,1x1
    /snscp/sns # insmod /snscp/player/dsp/omap3530/dsplinkk.ko
    /snscp/sns # insmod /snscp/player/dsp/omap3530/lpm_omap3530.ko
    /snscp/sns # insmod /snscp/player/dsp/omap3530/sdmak.ko
       

Terminal message:

/snscp/sns # gst-launch filesrc location=/etc/X11/bgmp3/bg.mp3 ! mad ! audioconv
ert !audioresample ! alsasink &  
/snscp/sns # CMEM Error: init: major version mismatch between interface and driver.
CMEM Error:     needs driver version 0x2300000, got 0x40395b20

(snsplayer:900): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed

(snsplayer:900): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed

(snsplayer:900): GStreamer-CRITICAL **: gst_bin_add_many: assertion `GST_IS_ELEMENT (element_1)' failed

(snsplayer:900): GStreamer-CRITICAL **: gst_element_link_pads_filtered: assertion `GST_IS_ELEMENT (src)' failed

(snsplayer:900): GStreamer-CRITICAL **: gst_element_link_many: assertion `GST_IS_ELEMENT (element_1)' failed

(snsplayer:900): GStreamer-CRITICAL **: gst_element_link_many: assertion `GST_IS_ELEMENT (element_2)' failed

(snsplayer:900): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(snsplayer:900): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(snsplayer:900): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(snsplayer:900): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(snsplayer:900): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed

(snsplayer:900): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed

(snsplayer:900): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed

 

     
    Hope you to help me !


    Thanks.

 

  • While your version matching failed, it did so with an "insane" number ("got 0x40395b20"), which says to me that you're insmod'ing a Linux Utils 2.25 cmemk.ko but using it for an app that was linked with pre-2.25 Linux Utils (probably 2.24).  What console messages do you receive when insmod'ing cmemk.ko?

    The reason I say this is because the CMEM ioctl() command bitmasks changed in LinuxUtils 2.25, causing incompatibility between the user library before 2.25 and the kernel module in 2.25.  The value that you got back from the CMEM_getVersion() command is not even close to the right form, and looks like some virt addr, which suggests to me that some *other" cmem.ko ioctl() was interpreted and that ioctl()'s value returned.

    I would suggest that you relink your app after ensuring that your build environment contains Linux Utils 2.25.

    Regards,

    - Rob

  • Thanks, Robert Tivy
            
         But no resolved this problem ,when I changed Linux Utils 2.24 to Linux Utils 2.25.

         when insmod'ing cmemk.ko,no any  messages  in console.

         I guess the reason ,using the kernel of 2.6.32  caused the problem?

     

         Where could download DVSDK 3.01.00.03 ?

     

     

  • Linux Utils 2.25 supports 2.6.32 Linux, but there are so many "rc" releases of 2.6.32 so I couldn't say for sure that it's not because of 2.6.32.

    However, you should be getting some CMEM console messages when you insmod it.  Are you sure you're looking for them on the "console" and not in some other telnet where you might be issuing the insmod?  It would help to know the output so we can deduce which version you are insmod'ing.

    Have you relinked your application after switching to Linux Utils 2.25?

    Do you still see "needs driver version 0x2300000"?  If you have switched to Linux Utils 2.25 than I would expect that you would be seeing instead "needs driver version 0x3000000".

    Regards,

    - Rob

  • I 'm sorry  ,Robert Tivy

         I forgot to open printk() of kernel . Now I got some CMEM console messages when insmod cmem.ko.

         when insmod CMEM ,Console messages:

         CMEMK module: built on Mar 24 2010 at 10:56:10
      Reference Linux version 2.6.32
      File /mnt/clouds/dvsdk_3_01_00_03/linuxutils_2_25_02_08/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
    allocated heap buffer 0xce000000 of size 0x51b000
    cmemk initialized
    DSPLINK Module (1.64) created on Date: Mar 24 2010 Time: 10:41:00
    SDMAK module: built on Mar 24 2010 at 10:56:11
      Reference Linux version 2.6.32
      File /mnt/clouds/dvsdk_3_01_00_03/linuxutils_2_25_02_08/packages/ti/sdo/linuxutils/sdma/src/module/sdmak.c

     

    when run playing  commond,ERROR messages:

    /snscp/sns # SDMAK Error: ioctl(): bad command type 0x0 (should be 0xfb)
    CMEM Error: init: major version mismatch between interface and driver.
    CMEM Error:     needs driver version 0x2300000, got 0x40395b20

    (snsplayer:815): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed

    (snsplayer:815): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed

    (snsplayer:815): GStreamer-CRITICAL **: gst_bin_add_many: assertion `GST_IS_ELEMENT (element_1)' failed

    (snsplayer:815): GStreamer-CRITICAL **: gst_element_link_pads_filtered: assertion `GST_IS_ELEMENT (src)' failed

    (snsplayer:815): GStreamer-CRITICAL **: gst_element_link_many: assertion `GST_IS_ELEMENT (element_1)' failed

    (snsplayer:815): GStreamer-CRITICAL **: gst_element_link_many: assertion `GST_IS_ELEMENT (element_2)' failed

    (snsplayer:815): GLib-GObject-WARNING **: invalid (NULL) pointer instance

    (snsplayer:815): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

    (snsplayer:815): GLib-GObject-WARNING **: invalid (NULL) pointer instance

    (snsplayer:815): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

    (snsplayer:815): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed

    (snsplayer:815): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed

    (snsplayer:815): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed

     

    Thank you to reply!

     


  • Thanks Robert Tivy,

              I resovled the problem of "needs driver version 0x2300000, got 0x40395b20" ,the reason is no building gstreamee-ti for new "DVSDK".

             But  when I run below  commond,I can not got  image  and  voice on the lcd. No  any error messages  on the console :


    gst-launch --gst-debug-no-color --gst-debug=TI*:2 filesrc location=
    /snscp/snstemp/share/md5efc8d4255ae0f55347b869b95a782e39.mkv ! matroskademux nam
    e=demux demux. ! queue max-size-buffers=4000 max-size-bytes=20971520 ! TIAuddec1
     ! audioconvert ! alsasink demux. ! queue max-size-buffers=50 max-size-bytes=131
    072 ! TIViddec2 genTimeStamps=TRUE codecName=h264dec ! xvimagesink synchronous=T
    RUE force-aspect-ratio=TRUE double-buffer=FALSE &


  • I've got a very resembling error while trying to run gstreamer on a beagleboard. gstreamer-ti was compiled as a part of  beagleboard-demo-image. The ti-cmem-module package and cmemk.ko were compiled together and I don't know what's wrong. The  Linux version is 2.6.32 armv7l , it was compiled with SDK version 3.01.00.02.

    CMEMK initialisation message (at dmesg) is

    CMEMK module: built on Apr  1 2010 at 14:28:58
      Reference Linux version 2.6.32
      File /home/oe/build/arm/tmp/work/angstrom-linux-gnueabi/ti-cmem-module-2241-r51a/codec_engine_2_24_01/cetools/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
    allocated heap buffer 0xc6000000 of size 0x53d000
    cmemk initialized

    DSPLINK Module (1.61.03) created on Date: Mar 28 2010 Time: 12:50:41
    SDMAK module: built on Mar 29 2010 at 12:52:06
      Reference Linux version 2.6.32

     

    The error itself:

              CMEM Error: init: major version mismatch between interface and driver.
              CMEM Error: needs driver version 0x3000000, got 0x2300000

    What and how do I need to recompile? What exactly doesn't match?

    Thanks a lot, Yulia

  • The banner printed by CMEM shows it comes from CE 2.24.01.  The error "says" that the application was built with LinuxUtils 2.25, which comes with CE 2.25, but that the driver it is communicating with is LinuxUtils 2.24.  You need to use a cmemk.ko built from LinuxUtils 2.25, which will have a CMEM version of 0x03000000.

    Regards,

    - Rob

  • I am getting exactly opposite message as from Yu Vi,

    CMEM Error: init: major version mismatch between interface and driver.
              CMEM Error: needs driver version 0x2300000, got 0x3000000

    uname -a: Linux beagleboard 2.6.32 #1 PREEMPT Thu Apr 15 12:05:47 CEST 2010 armv7l GNU/Linux

    I read whole post, but still i have a doubt that, How can i built CMEM module with ver. 0x2300000 for 2.6.32 kernel

    Thanks,

     

     

  • This error says that you have a later version of the CMEM kernel module installed in your system but your application is linked with an earlier incompatible CMEM user library (it's incompatible because the user-kernel interface definition has changed).  Instead of building an earlier CMEM kernel module for 2.6.32 you would be better off updating your application to build with a later Linux Utils that matches your CMEM kernel module, mostly because you would likely face some porting issues in the earlier CMEM that have already been addressed in the later CMEM kernel module.

    I would suggest rebuilding your app with a later Codec Engine (2.25) so it matches your CMEM kernel module (which, I assume, is Linux Utils 2.25).  It's probably not enough to just relink your app against a later Linux Utils, since Code Engine has compiled-in the incompatible earlier CMEM interface.

    Regards,

    - Rob

  • okay, the problem is resolved. thank you TI

     

  • Hi Rob,

      I got version 0xFFFFFFFF ... where will be the problem ?

    root@overo:~# gst-launch -v v4l2src num-buffers=1000 ! video/x-raw-yuv,width=480
    ,height=272,framerate=30/1 ! TIVidenc1 codecName=h264enc engineName=codecServer
    ! avimux ! filesink location=sample4.h264
    CMEMK Error: ioctl(): bad command type 0x9e (should be 0xfe)
    CMEMK Error: Unknown ioctl received.
    CMEM Error: getVersion: Failed to retrieve version from driver: -1.
    CMEM Error: init: major version mismatch between interface and driver.
    CMEM Error:     needs driver version 0x3000000, got 0xffffffff
    Setting pipeline to PAUSED ...
    ERROR: Pipeline doesn't want to pause.
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate format
    Additional debug info:
    gstbasesrc.c(2778): gst_base_src_start (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    Check your filtered caps, if any
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@overo:~#

     

    root@overo:~# uname -a
    Linux overo 2.6.36 #6 Fri Jul 22 19:24:11 IST 2011 armv7l GNU/Linux
    root@overo:~#

     

    Thanks and regards,

    Ananth.

  • Anantha padmanaban said:

      I got version 0xFFFFFFFF ... where will be the problem ?

    root@overo:~# gst-launch -v v4l2src num-buffers=1000 ! video/x-raw-yuv,width=480
    ,height=272,framerate=30/1 ! TIVidenc1 codecName=h264enc engineName=codecServer
    ! avimux ! filesink location=sample4.h264
    CMEMK Error: ioctl(): bad command type 0x9e (should be 0xfe)
    CMEMK Error: Unknown ioctl received.

    This error looks like another "insane" situation (I say "another" because one of the previous posts in this thread reflected very strange behaviour).  I checked old and recent Linux Utils releases, and none of them would produce a "command type" of 0x9e ("command type" is reflected in bits 8-15 of the ioctl() cmd).

    Linux Utils releases 2.25 and up use a command type of 0xfe.  The command type reported from your run is 0x9e, which seems close but since the command type is not a bitmask it is as different from 0xfe as any value.  Linux Utils before 2.24 didn't really use a command type, which implies its command type was, by default, 0x00.

    The 0xffffffff that is printed as the version number at the user level API is kind of bogus, in that the user layer API CMEM_init() is misinterpreting a -1 failure return as the version number.  The cmemk.ko device driver is returning -EINVAL and not a real version.

    I don't really have anything useful to suggest, since I don't have any idea how that command type (0x9e) can be seen at the cmemk.ko device driver layer, given that you're accessing the device driver through the CMEM user API layer.  It would certainly be conceivable if you were directly calling the CMEMK ioctl() from your application and didn't get the cmd construct right, but I see from your traces that you're not accessing it directly.

    Perhaps running under control of the system trace utility, strace, would help here.  It intercepts and prints Linux system call information, and since this is a system call it would print the ioctl() issuance.  Just a thought, though not sure how helpful it will be here.  Something seems amiss with your Linux.

    Regards,

    - Rob

  • Hi Rob,

     Thanks, Your last line gave me a big hint and discussed with oe developer guys and got information that currently 2.6.34 version of kernel have cmem support in repo and i was trying with 2.6.36. Now i downgraded by kernel from 2.6.36 to 2.6.34 and it works. Thanks for your quick reply.

    Thanks and regards,

    Ananth.

  • Hi Ananth

    Thank you for your post. Actually i am also building the angstrom os on gumstix overo fire with openembedded recipes and came across with similar problems:

    "CMEMK Error: ioctl(): bad command type 0x9b (should be 0xfe)                  
    CMEMK Error: Unknown ioctl received.                                          
    CMEM Error: getVersion: Failed to retrieve version from driver: -1.           
    CMEM Error: init: major version mismatch between interface and driver.        
    CMEM Error:     needs driver version 0x3000000, got 0xffffffff                
    @0x00052379:[T:0x4007d000] ti.sdo.ce.examples.apps.image1_copy - main> ti.sdo.y
    @0x000525fa:[T:0x4007d000] ti.sdo.ce.examples.apps.image1_copy - App-> Applica.
    @0x00052637:[T:0x4007d000] ti.sdo.ce.examples.apps.image1_copy - app done.    
    "

    The output of lsmod:

    "root@overo:/usr/share/ti/ti-codec-engine-examples# ./loadmodules.sh
    CMEMK module: built on Jul 22 2011 at 12:24:05
      Reference Linux version 2.6.38
      File /root/overo-oe/tmp/work/overo-angstrom-linux-gnueabi/ti-linuxutils-1_2_25_05_11-r100d/linuxutils_2_25_05_11/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
    allocated heap buffer 0xcc000000 of size 0xcac000
    cmemk initialized
    DSPLINK Module (1.65.00.03) created on Date: Jul 21 2011 Time: 12:14:25"

    So we must downgrade our kernel version to 2.6.34 to make this work? In that case,i need to rebuild the whole image and ti related tools? Thank you.

    Eric

     

  • Hi Eric,

    Clean the repo:

    bitbake -c clean ti-dsplib ti-dsplink ti-dmai ti-dspbios ti-local-power-manager ti-linuxutils virtual/kernel dsp-console-image

     

    Clean the cache

    rm -r $OVEROTOP/tmp/cache/*

     

    Add your kernel preferred in conf file

    gvim $OVEROTOP/bulld/conf/local.conf PREFERRED_VERSION_linux-omap3="2.6.34"

     

    Build your recipe file after that

    Thanks and regards,

    Ananth.

  • Thank you, Ananth.

    I am doing what you suggested now. So basically, all the bb files in the build will be changed and all the previous build processes need to go through again? Means all the resources need to be downloaded and recompile again? Hope the rebuild process is less tough than the first one : )

    Regards,

    Eric

  • Hi Ananth,

    Failed to make it happen with the new build. Just came a thought that since dsplink, lpm, cmem and bios already working fine (i hope so), so do i need to fix this problem is i am just gonna play with OpenCV on the dsp? Seems i cannot do some dsp programming without touching the codec engine stuff. In this case, could you please suggest how should i program and then download the application to the dsp side? 

    Thanks,

    Eric