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.

About IPNC‘s stream

Hi all,

        using IPNC project to build our camera.  we meeted this problem when try to realize the function of reconnect net.  The error is:

av_data.serial <= audio_lock!!!
av_data.serial <= audio_lock!!!
Cache Error: pFrame->realsize = 84253
Cache Error: CacheMng_Video_Cache: CacheMng_Find_Freeblk Fail
Cache Error: CacheMng_Video_Cache: CACHE_FAIL
Encode Error: Error code: -100 at 228
func:stream_write line:228
RET_ERROR_OP: serial: 194591
Cache Error: pFrame->realsize = 84253
Cache Error: CacheMng_Video_Cache: CacheMng_Find_Freeblk Fail
Cache Error: CacheMng_Video_Cache: CACHE_FAIL
GOP Error: Lock Gop fail from 194566 to 194591
Cache Error: pFrame->realsize = 84253
Cache Error: CacheMng_Video_Cache: CacheMng_Find_Freeblk Fail
Cache Error: CacheMng_Video_Cache: CACHE_FAIL
GOP Error: Lock Gop fail from 194566 to 194592
Cache Error: pFrame->realsize = 84253
Cache Error: CacheMng_Video_Cache: CacheMng_Find_Freeblk Fail
Cache Error: CacheMng_Video_Cache: CACHE_FAIL
GOP Error: Lock Gop fail from 194566 to 194593
Cache Error: pFrame->realsize = 84253
Cache Error: CacheMng_Video_Cache: CacheMng_Find_Freeblk Fail
Cache Error: CacheMng_Video_Cache: CACHE_FAIL
GOP Error: Lock Gop fail from 194566 to 194594
Cache Error: pFrame->realsize = 84253
Cache Error: CacheMng_Video_Cache: CacheMng_Find_Freeblk Fail
Cache Error: CacheMng_Video_Cache: CACHE_FAIL
GOP Error: Lock Gop fail from 194566 to 194595
Cache Error: pFrame->realsize = 84253
Cache Error: CacheMng_Video_Cache: CacheMng_Find_Freeblk Fail
Cache Error: CacheMng_Video_Cache: CACHE_FAIL
GOP Error: Lock Gop fail from 194566 to 194595
Cache Error: pFrame->realsize = 17768


 It cannot  come back until restart av_server.out.

Who can give some advice? Thanks!

 

  • Form the log it looks like you are running short of memory and you GOP is getting overwritten.

    Please increase the memory at mem_mng.c or mem_mng.h based on your usecase.

     

    Regards,

     

    Raghu

     

  • Hi Raghu,

           Thanks your reply at first!

           The size of memory settings are following in the file mem_mng.h:

      #define MJPG_CACHE_SIZE (0x200000)
    /* size of 3 GOP */
    #define MP4_CACHE_SIZE (0x600000)
    #define MP4_EXT_CACHE_SIZE (0x300000)
    #define AUDIO_CACHE_SIZE (0x80000)


    #define MJPG_CACHE_BLK_SIZE (100*1024)
    #define MP4_CACHE_BLK_SIZE (30*1024)            
    //enlarge to     30*1024 *10
    #define MP4_EXT_CACHE_BLK_SIZE (10*1024)
      //enlarge to     10 *1024 *10
    #define AUDIO_CACHE_BLK_SIZE (1*1024)

    #define CACHE_MEM_SIZE (MJPG_CACHE_SIZE+MP4_CACHE_SIZE+MP4_EXT_CACHE_SIZE+AUDIO_CACHE_SIZE)


    #define MJPG_MEM_SIZE (0x200000)
    #define MP4_MEM_SIZE (0x600000)
    #define MP4_EXT_MEM_SIZE (0x300000)
    #define AUDIO_MEM_SIZE (0x80000)

    #define MJPG_BLK_SIZE (100*1024)        
    #define MP4_BLK_SIZE (30*1024)                //enlarge to    
    30*1024 *10
    #define MP4_EXT_BLK_SIZE (10*1024)     
    //enlarge to     10*1024 *10
    #define AUDIO_BLK_SIZE (1*1024)


    #define MP4_1_EXTRA_SIZE (256)            
    //enlarge to     256 *10
    #define MP4_2_EXTRA_SIZE (256)            
    //enlarge to     256 *10
    #define TOTAL_EXTRA_SIZE (MP4_1_EXTRA_SIZE+MP4_2_EXTRA_SIZE)

    #define TOTAL_MEM_SIZE (MJPG_MEM_SIZE+MP4_MEM_SIZE+MP4_EXT_MEM_SIZE+AUDIO_MEM_SIZE+CACHE_MEM_SIZE+TOTAL_EXTRA_SIZE)

    And In our camera, we have 256M memory and use  h.264 encode, and so I  enlarge all the MP4* memory size as show above.

    We test two camera to reconnect continually at tonight. and will stick on the result tomorrow.

  • 1. Firstly, you can modify the av_capture_load.sh for more memory, since you have 256 Mb.

    Change the line from :

    insmod cmemk.ko phys_start=0x83000000 phys_end=0x88000000 allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672

    to

    insmod cmemk.ko phys_start=0x85000000 phys_end=0x90000000 allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672

     

    After this, change the bootargs mem=48M to mem=80M.

     

    2. Please change in mem_mng.c file, please check what usecase you are using

    for ex: MEM_LAYOUT_2 is used for MEGAPIXEL JPEG,

    you change cache_size and mem_size like you can double the existing value

    What is the usecase you are running like H264+JPEG or H264+H264+JPEG

     

    Regards,

     

    Raghu

     

  • Hi Raghu,

                  Thanks your reply again!

      we used the parameters are following:         

    ~# cat /proc/cmdline 
    mem=96M console=ttyS0,115200n8 root=/dev/ram0 rw initrd=0x82000000,10M ip=192.168.0.231:192.168.0.2:192.168.0.2:255.255.255.0:::off eth=00:21:49:00:00:35

    insmod cmemk.ko phys_start=0x86000000 phys_end=0x90000000 allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672
     

     MEM_LAYOUT mem_layout_setting[MEM_LAYOUT_NUM] = {
    [0] = {

    .profiles[VIDOE_INFO_MJPG] =
    {
      .cache_size = MJPG_CACHE_SIZE * 2,
    .cache_blk_size = MJPG_CACHE_BLK_SIZE,
    .mem_size = MJPG_MEM_SIZE * 2 ,
    .mem_blk_size = MJPG_BLK_SIZE,
    .ext_size = 0,
    },

    .profiles[VIDOE_INFO_MP4] =
    {
    .cache_size = MP4_CACHE_SIZE * 2 ,
    .cache_blk_size = MP4_CACHE_BLK_SIZE,
    .mem_size = MP4_MEM_SIZE * 2 ,
    .mem_blk_size = MP4_BLK_SIZE,
    .ext_size = MP4_1_EXTRA_SIZE,
    },
    .profiles[VIDOE_INFO_MP4_EXT] =
    {
    .cache_size = MP4_EXT_CACHE_SIZE * 2 ,
    .cache_blk_size = MP4_EXT_CACHE_BLK_SIZE,
    .mem_size = MP4_EXT_MEM_SIZE * 2 ,
    .mem_blk_size = MP4_EXT_BLK_SIZE,
    .ext_size = MP4_2_EXTRA_SIZE,
    },
    .profiles[AUDIO_INFO_G711] =
    {
    .cache_size = AUDIO_CACHE_SIZE  ,
    .cache_blk_size = AUDIO_CACHE_BLK_SIZE,
    .mem_size = AUDIO_MEM_SIZE   ,
    .mem_blk_size = AUDIO_BLK_SIZE,
    .ext_size = 0,
    },
    .totalsizes = 0,
    },
    [1] = {
    .profiles[VIDOE_INFO_MJPG] =
    {
    .cache_size = 0x100000 * 2 ,
    .cache_blk_size = 50*1024,
    .mem_size = 0x100000 * 2 ,
    .mem_blk_size = 50*1024,
    .ext_size = 0,
    },
    .profiles[VIDOE_INFO_MP4] =
    {
    .cache_size = 0x500000 * 2 ,
    .cache_blk_size = 30*1024,
    .mem_size = 0x500000 * 2 ,
    .mem_blk_size = 30*1024,
    .ext_size = MP4_1_EXTRA_SIZE,
    },
    .profiles[VIDOE_INFO_MP4_EXT] =
    {
    .cache_size = 0x500000 * 2 ,
    .cache_blk_size = 30*1024,
    .mem_size = 0x500000 * 2 ,
    .mem_blk_size = 30*1024,
    .ext_size = MP4_2_EXTRA_SIZE,
    },
    .profiles[AUDIO_INFO_G711] =
    {
    .cache_size = AUDIO_CACHE_SIZE,
    .cache_blk_size = AUDIO_CACHE_BLK_SIZE,
    .mem_size = AUDIO_MEM_SIZE,
    .mem_blk_size = AUDIO_BLK_SIZE,
    .ext_size = 0,
    },
    .totalsizes = 0,

    }

    };

     I delete the modify of mem_mng.h, and double all the size of  mem_cache and mem_size as show above. I will test again.

  • Hi Raghu,

                  using above setting (double all the mem_cache and mem_size of size), the   cache error is not exist.

                  But I meet another problem about network connect. I have modified the win-streamer  listenning client number(LISTEN_BACKLOG_SIZE set to 10). And still do reconnect testing(broke network, and conncet again). And after sometimes, the stream client cannot connect the stream through RTSP, at this time, the PC can find the camera and ping the camera.

                 Through the terminal, we see the camera net state:

    Active Internet connections (w/o servers)

    Proto Recv-Q Send-Q Local Address Foreign Address State


    tcp 0 0 192.168.42.215:8557 192.168.42.94:1423 SYN_RECV 
    tcp 0 0 192.168.42.215:8557 192.168.42.94:1426 SYN_RECV 
    tcp 0 0 192.168.42.215:8557 192.168.42.94:1424 SYN_RECV 
    tcp 0 0 192.168.42.215:8557 192.168.42.94:1425 SYN_RECV
    tcp 0 0 192.168.42.215:8557 192.168.42.94:1427 SYN_RECV
    tcp 113 0 192.168.42.215:8557 192.168.42.94:1360 CLOSE_WAIT 
    tcp 113 0 192.168.42.215:8557 192.168.42.94:1377 CLOSE_WAIT
    tcp 113 0 192.168.42.215:8557 192.168.42.94:1370 CLOSE_WAIT
    tcp 0 0 192.168.42.215:8557 192.168.42.94:1355 ESTABLISHED
    tcp 113 0 192.168.42.215:8557 192.168.42.94:1363 CLOSE_WAIT 
    tcp 113 0 192.168.42.215:8557 192.168.42.94:1379 CLOSE_WAIT
    tcp 113 0 192.168.42.215:8557 192.168.42.94:1372 CLOSE_WAIT
    tcp 113 0 192.168.42.215:8557 192.168.42.94:1365 CLOSE_WAIT
    tcp 113 0 192.168.42.215:8557 192.168.42.94:1381 CLOSE_WAIT
    tcp 113 0 192.168.42.215:8557 192.168.42.94:1374 CLOSE_WAIT
    tcp 113 0 192.168.42.215:8557 192.168.42.94:1367 CLOSE_WAIT
    tcp 113 0 192.168.42.215:8557 192.168.42.94:1383 CLOSE_WAIT

       BTW,  192.168.42.215 is the camera IP address,  192.168.42.94 is the PC IP address.

    The PC cannot connect stream until  kill win-streamer and restart,  Anybody can help me?

     Thanks a lot!

     

  • About this problem, anybody have good idea?

    guoyongj said:

    Hi Raghu,

                  Thanks your reply again!

      we used the parameters are following:         

    ~# cat /proc/cmdline 
    mem=96M console=ttyS0,115200n8 root=/dev/ram0 rw initrd=0x82000000,10M ip=192.168.0.231:192.168.0.2:192.168.0.2:255.255.255.0:::off eth=00:21:49:00:00:35

    insmod cmemk.ko phys_start=0x86000000 phys_end=0x90000000 allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672
     

     MEM_LAYOUT mem_layout_setting[MEM_LAYOUT_NUM] = {
    [0] = {

    .profiles[VIDOE_INFO_MJPG] =
    {
      .cache_size = MJPG_CACHE_SIZE * 2,
    .cache_blk_size = MJPG_CACHE_BLK_SIZE,
    .mem_size = MJPG_MEM_SIZE * 2 ,
    .mem_blk_size = MJPG_BLK_SIZE,
    .ext_size = 0,
    },

    .profiles[VIDOE_INFO_MP4] =
    {
    .cache_size = MP4_CACHE_SIZE * 2 ,
    .cache_blk_size = MP4_CACHE_BLK_SIZE,
    .mem_size = MP4_MEM_SIZE * 2 ,
    .mem_blk_size = MP4_BLK_SIZE,
    .ext_size = MP4_1_EXTRA_SIZE,
    },
    .profiles[VIDOE_INFO_MP4_EXT] =
    {
    .cache_size = MP4_EXT_CACHE_SIZE * 2 ,
    .cache_blk_size = MP4_EXT_CACHE_BLK_SIZE,
    .mem_size = MP4_EXT_MEM_SIZE * 2 ,
    .mem_blk_size = MP4_EXT_BLK_SIZE,
    .ext_size = MP4_2_EXTRA_SIZE,
    },
    .profiles[AUDIO_INFO_G711] =
    {
    .cache_size = AUDIO_CACHE_SIZE  ,
    .cache_blk_size = AUDIO_CACHE_BLK_SIZE,
    .mem_size = AUDIO_MEM_SIZE   ,
    .mem_blk_size = AUDIO_BLK_SIZE,
    .ext_size = 0,
    },
    .totalsizes = 0,
    },
    [1] = {
    .profiles[VIDOE_INFO_MJPG] =
    {
    .cache_size = 0x100000 * 2 ,
    .cache_blk_size = 50*1024,
    .mem_size = 0x100000 * 2 ,
    .mem_blk_size = 50*1024,
    .ext_size = 0,
    },
    .profiles[VIDOE_INFO_MP4] =
    {
    .cache_size = 0x500000 * 2 ,
    .cache_blk_size = 30*1024,
    .mem_size = 0x500000 * 2 ,
    .mem_blk_size = 30*1024,
    .ext_size = MP4_1_EXTRA_SIZE,
    },
    .profiles[VIDOE_INFO_MP4_EXT] =
    {
    .cache_size = 0x500000 * 2 ,
    .cache_blk_size = 30*1024,
    .mem_size = 0x500000 * 2 ,
    .mem_blk_size = 30*1024,
    .ext_size = MP4_2_EXTRA_SIZE,
    },
    .profiles[AUDIO_INFO_G711] =
    {
    .cache_size = AUDIO_CACHE_SIZE,
    .cache_blk_size = AUDIO_CACHE_BLK_SIZE,
    .mem_size = AUDIO_MEM_SIZE,
    .mem_blk_size = AUDIO_BLK_SIZE,
    .ext_size = 0,
    },
    .totalsizes = 0,

    }

    };

     I delete the modify of mem_mng.h, and double all the size of  mem_cache and mem_size as show above. I will test again.

  • Gomo,

    Whats is the issue you are refering here?

    Is it more memory allocation for streaming?

    Regards,

    Raghu

  • Hi Raghu,

             I modify the mem_cache and mem_size in mem_mng.h, It's no exist.

    #define MP4_CACHE_SIZE      (0x1200000) //  modify by gomo 2012-03-22 to 18M
    #define MP4_EXT_CACHE_SIZE     (0x240000) //  modify by gomo 2012-03-22 to 2.4M

    #define MP4_CACHE_BLK_SIZE     (128 *1024)  //  modify by gomo 2012-03-22 to 128K
    #define MP4_EXT_CACHE_BLK_SIZE    (16 *1024) //  modify by gomo 2012-03-22 to 16K

    #define MP4_MEM_SIZE     (0x1200000) //  modify by gomo 2012-03-22 to 18M
    #define MP4_EXT_MEM_SIZE    (0x240000) //  modify by gomo 2012-03-22 to 2.4M

    #define MP4_BLK_SIZE    (128 *1024)   //  modify by gomo 2012-03-22 to 128K
    #define MP4_EXT_BLK_SIZE   (16 *1024) //  modify by gomo 2012-03-22 to 16K

       Because we want to get dual stream(1080P & CIF) at the same time, maybe the cache  and memory value of default is very small.

      And if it have problem, I will post the issue continue.

  • Hi all:

        I have the same problem, can anyone give me some advise?

    I want to use two streaming (dual D1 resolution) and save them as AVI file(appro_avi_save) into SD Card.

    I try to modify the size but the error is the same.

    My size is as follow:

    .profiles[VIDOE_INFO_MP4] =                                   //for first streaming
                        {
                            .cache_size         = 0x1000000,
                            .cache_blk_size     = (100*1024),
                            .mem_size             = 0x1000000,
                            .mem_blk_size         = (100*1024),
                            .ext_size             = MP4_1_EXTRA_SIZE,
                        },
                        .profiles[VIDOE_INFO_MP4_EXT] =   //for sec. streaming
                        {
                            .cache_size         = 0x1000000,
                            .cache_blk_size     = (100*1024),
                            .mem_size             = 0x1000000,
                            .mem_blk_size         = (100*1024),
                            .ext_size             = MP4_2_EXTRA_SIZE,
                        },

    when two appro_avi_save run about one minutes. the error occur:

    FileName = /mnt/mmc/normal/Normal_F_19700101_080027.avi interval = 999999999 sec  Msg_id = 15
      Is_audio = 0 Is_chkcard = 1 stream_id = 4 nBitRate = 0
    Space on /mnt/mmc = 5766704 Kbyte
    ApproDrvInit: 15
    queue id:163845
    Output #0, avi, to '/mnt/mmc/normal/Normal_F_19700101_080027.avi':
        Stream #0.0: Video: libx264, yuv420p, 720x480, q=10-51, 3000 kb/s, 90k tbn, 24 tbc

     FileName = /mnt/mmc/normal/Normal_R_19700101_080027.avi interval = 999999999 sec  Msg_id = 15
      Is_audio = 0 Is_chkcard = 1 stream_id = 3 nBitRate = 0
    Space on /mnt/mmc = 5766704 Kbyte
    ApproDrvInit: 15
    queue id:163845
    Output #0, avi, to '/mnt/mmc/normal/Normal_R_19700101_080027.avi':
        Stream #0.0: Video: libx264, yuv420p, 720x480, q=10-51, 3000 kb/s, 90k tbn, 24 tbc

    RET_ERROR_OP: serial: 234
    RET_ERROR_OP: serial: 278
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 265
    RET_ERROR_OP: serial: 295
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 289
    RET_ERROR_OP: serial: 395
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385
    RET_ERROR_OP: serial: 385

    RET_ERROR_OP: serial: 420
    RET_ERROR_OP: serial: 409
    RET_ERROR_OP: serial: 409
    RET_ERROR_OP: serial: 409
    RET_ERROR_OP: serial: 409
    Cache Error: pFrame->realsize = 24828    blk_index = -97 102400 1
    Cache Error: CacheMng_Video_Cache: CacheMng_Find_Freeblk Fail
    Cache Error: CacheMng_Video_Cache: CACHE_FAIL
    GOP Error: Lock Gop fail from 420 to 449
    RET_NO_MEM
    RET_ERROR_OP: serial: 457

  • You can try in following way.

    1) Using memory to save avi. Test the SD write performace. 6MBytes/s ?

    2)Using different Msg_id to start two appro_avi_save at same time.

  • Hi gomo:

        Thanks for your advise, It can work now. I try to use different Msg_id.

    the error log disappear.

  • Hi Raghu,

    This is with regards to the post e2e.ti.com/.../530031.

    I tried the above mentioned fix, but I got the error CMEM Error: allocHeap: ioctl CMEM_IOCALLOCHEAP failed: -1.

    My RAM size is 256 MB.

    Is there something similar I can try ?

    My use case is to just capture a single stream of PAL and encode using H264/MJPEG and save onto SD card using Appro_Avi_save.

    Any Suggestion will be very helpful.

    Thanks in Advance,

    Regards,
    Swathi