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.

Framerate drops suddenly when running encode demo on dm6467

Other Parts Discussed in Thread: TVP7002

Hi,

   When I run encode demo on dm6467, I find a strange problem. There is a sudden drop of framerate  in the process of encoding.

The output information is as follow:

# ./encode -v 1.264 -a 1.aac
Encode demo started 

...

Encode demo ARM Load: 9% DSP Load: 70% Display Type: 720P 50Hz Video Codec: H.264 BP Video fps: 30 fps Video bit rate: 684 kbps Video resolution: 1280x720 Sound codec: N/A Sound bit rate: 62 kbps 

Encode demo ARM Load: 3% DSP Load: 71% Display Type: 720P 50Hz Video Codec: H.264 BP Video fps: 30 fps Video bit rate: 620 kbps Video resolution: 1280x720 Sound codec: N/A Sound bit rate: 63 kbps 

Encode demo ARM Load: 5% DSP Load: 70% Display Type: 720P 50Hz Video Codec: H.264 BP Video fps: 30 fps Video bit rate: 718 kbps Video resolution: 1280x720 Sound codec: N/A Sound bit rate: 64 kbps 

Encode demo ARM Load: 9% DSP Load: 43% Display Type: 720P 50Hz Video Codec: H.264 BP Video fps: 26 fps Video bit rate: 563 kbps Video resolution: 1280x720 Sound codec: N/A Sound bit rate: 54 kbps 
Sound
Encode demo ARM Load: 2% DSP Load: 55% Display Type: 720P 50Hz Video Codec: H.264 BP Video fps: 15 fps Video bit rate: 432 kbps Video resolution: 1280x720 Sound codec: N/A Sound bit rate: 69 kbps 

Encode demo ARM Load: 5% DSP Load: 72% Display Type: 720P 50Hz Video Codec: H.264 BP Video fps: 30 fps Video bit rate: 644 kbps Video resolution: 1280x720 Sound codec: N/A Sound bit rate: 64 kbps 

Encode demo ARM Load: 8% DSP Load: 71% Display Type: 720P 50Hz Video Codec: H.264 BP Video fps: 30 fps Video bit rate: 720 kbps Video resolution: 1280x720 Sound codec: N/A bit rate: 64 kbps 
...

...

Encode demo ARM Load: 4% DSP Load: 70% Display Type: 720P 50Hz Video Codec: H.264 BP Video fps: 30 fps Video bit rate: 618 kbps Video resolution: 1280x720 Sound codec: N/A Sound bit rate: 64 kbps 

Encode demo ARM Load: 9% DSP Load: 70% Display Type: 720P 50Hz Video Codec: H.264 BP Video fps: 31 fps Video bit rate: 629 kbps Video resolution: 1280x720 Sound codec: N/A Sound bit rate: 64 kbps 

Encode demo ARM Load: 3% DSP Load: 64% Display Type: 720P 50Hz Video Codec: H.264 BP Video fps: 28 fps Video bit rate: 592 kbps Video resolution: 1280x720 Sound codec: N/A Sound bit rate: 62 kbps 

Encode demo ARM Load: 5% DSP Load: 55% Display Type: 720P 50Hz Video Codec: H.264 BP Video fps: 16 fps Video bit rate: 448 kbps Video resolution: 1280x720 Sound codec: N/A Sound bit rate: 66 kbps 

Encode demo ARM Load: 9% DSP Load: 69% Display Type: 720P 50Hz Video Codec: H.264 BP Video fps: 30 fps Video bit rate: 675 kbps Video resolution: 1280x720 Sound codec: N/A Sound bit rate: 64 kbps 

 

This is quite strange as the dspload goes down at the same time.

Who can explain this?

I want to get a stable framerate of encoding. Can anyone help me?

  • No one can help me?  too bad!

  • I have already forwarded your query to the appropriate person in TI. You should get a reply very soon!

     

    Regards,

    Kapil

  • Kapil,

    Using the out-of-the-box encode application, I'm having the same problem as zhifei zhang but with a twist i.e., the sudden drop in frame rate seems to be correlated to encoding bit rate in that at low encoding bit rates e.g., 800 kbps the encode frame rate wonders around the nominal 30fps (as it should) but as I increase the encoding bit rate to 1500 kbps then to 3000 kbps (and so on) the periodic drop in frame rate becomes more pronounced.  In addition, the problem is independent of the encoder used i.e., the H264, MPEG4, and MPEG2 encoders all exhibit the same problem.

    I suspect that the problem is in encode application (and not in the codecs) in the way the video file is written out to the NFS as I have checked the video source, video I/O, and Ethernet link and all seem to be working just fine with no anomalies e.g., when I run the encodedecode application with the codec bypassed, all is well.  Also, I did not see this problem using the same HW set-up when running from DVSDK 2.10 for the DM365 EVM.

    So here are the details:

       1. Target is the DM365 EVM rev E

       2. EVM video in is component running a video

           source that is running a 1280x720p movie

       3. EVM video out is component displayed on an HDTV

       4. Host computer is running Ubuntu 10.04 Linux with

           the DVSDK 4.00 from a default install done by

           running the install script i.e., NFS, TFTP (although

           the IP address is manually assigned), etc.

       5. U-Boot environment and bootargs are:

           printenv

           bootdelay=4

           baudrate=115200

           ethaddr=00:0e:99:02:cc:7a

           ipaddr=10.0.1.22

           nfshost=10.0.1.21

           serverip=10.0.1.21

           bootcmd=tftp;bootm

           rootpath=/home/cimarron/DVSDK_4_00/targetfs

           nfsroot=10.0.1.21:/home/cimarron/DVSDK_4_00/targetfs

           bootargs=console=ttyS0,115200n8 rw mem=48M video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0

           davinci_capture.device_type=4 davinci_display.cont2_bufsize=6291456 vpfe_capture.cont_bufoffset=6291456 vpfe_capture.cont_bufsize=6291456

           davinci_enc_mngr.ch0_output=COMPONENT davinci_enc_mngr.ch0_mode=480P-60 root=/dev/nfs nfsroot=10.0.1.21:/home/cimarron/targetfs

           ip=10.0.1.22:10.0.1.21:10.0.1.1:255.255.255.0:::off

           bootfile=uImage-dm365-evm.bin

           stdin=serial

           stdout=serial

           stderr=serial

           ver=U-Boot 1.3.4 (Mar  2 2009 - 11:50:39)

    Here is a trace at low encoding bit rate without the problem:

    root@dm365-evm:/usr/share/ti/dvsdk-demos# ./loadmodules.sh

    cmemk unregistered

    irqk unregistered 

    CMEMK module: built on Oct 14 2010 at 18:09:45  

    Reference Linux version 2.6.32

    File /sdk/build/DVSDK_4_00/4_00_00_22/arago-install/arago-tmp/work/dm365-evm-none-linux-gnueabi/ti-linuxutils-1_2_25_05_11-r44d/linuxutils_2_25_05_11/packages/ti sdo/linuxutils/cmem/src/module/cmemk.c 

    allocated heap buffer 0xc8000000 of size 0x43b000  

    CMEM Range Overlaps Kernel Physical - allowing overlap    

    CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x83000000)     

    cmemk initialized  

    IRQK module: built on Oct 14 2010 at 18:10:06     

    Reference Linux version 2.6.32     

    File /sdk/build/DVSDK_4_00/4_00_00_22/arago-install/arago-tmp/work/dm365-evm-none-linux-gnueabi/ti-linuxutils-1_2_25_05_11-r44d/linuxutils_2_25_05_11/packages/ti/sdo/linuxutils/irq/src/module/irqk.c 

    irqk initialized    

    EDMAK module: built on Oct 14 2010 at 18:09:56                    

    Reference Linux version 2.6.32        

    File /sdk/build/DVSDK_4_00/4_00_00_22/arago-install/arago-tmp/work/dm365-evm-none-linux-gnueabi/ti-linuxutils-1_2_25_05_11-r44d/linuxutils_2_25_05_11/packages/ti/sdo/linuxutils/edma/src/module/edmak.c   

     root@dm365-evm:/usr/share/ti/dvsdk-demos# ./encode -v Avatar.264 -r 1280x720 -b 800000 

    EVM: switch to tvp7002 HD video input   

    Encode demo started. 

    davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124   

    davinci_previewer davinci_previewer.2: ipipe_set_preview_config       

    vpfe-capture vpfe-capture: IPIPE Chained                         

    vpfe-capture vpfe-capture: Resizer present                      

    EVM: switch to tvp7002 HD video input       

    vpfe-capture vpfe-capture: width = 1280, height = 720, bpp = 1         

    vpfe-capture vpfe-capture: adjusted width = 1280, height = 720, bpp = 1, bytesperline = 1280, sizeimage = 1382400        

    vpfe-capture vpfe-capture: width = 1280, height = 720, bpp = 1           

    vpfe-capture vpfe-capture: adjusted width = 1280, height = 720, bpp = 1, bytesperline = 1280, sizeimage = 1382400       

    davinci_v4l2 davinci_v4l2.1: Before finishing with S_FMT:            

    layer.pix_fmt.bytesperline = 1280, 

    layer.pix_fmt.width = 1280,           

    layer.pix_fmt.height = 720,        

    layer.pix_fmt.sizeimage =1382400          

    davinci_v4l2 davinci_v4l2.1: pixfmt->width = 1280,          

    layer->layer_info.config.line_length= 1280         

    ARM Load: 5% Video fps: 30 fps Video bit rate: 1297 kbps Sound bit rate: 0 kbps Time: 00:00:01 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                            

    ARM Load: 3% Video fps: 30 fps Video bit rate: 776 kbps Sound bit rate: 0 kbps Time: 00:00:02 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                             

     ARM Load: 5% Video fps: 31 fps Video bit rate: 831 kbps Sound bit rate: 0 kbps Time: 00:00:03 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                             

     ARM Load: 4% Video fps: 29 fps Video bit rate: 465 kbps Sound bit rate: 0 kbps Time: 00:00:04 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                             

    ARM Load: 5% Video fps: 30 fps Video bit rate: 1371 kbps Sound bit rate: 0 kbps Time: 00:00:06 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                            

     ARM Load: 7% Video fps: 31 fps Video bit rate: 378 kbps Sound bit rate: 0 kbps Time: 00:00:07 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                             

    ARM Load: 5% Video fps: 30 fps Video bit rate: 1144 kbps Sound bit rate: 0 kbps Time: 00:00:08 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                            

    ARM Load: 7% Video fps: 30 fps Video bit rate: 834 kbps Sound bit rate: 0 kbps Time: 00:00:09 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                             

    ARM Load: 8% Video fps: 30 fps Video bit rate: 774 kbps Sound bit rate: 0 kbps Time: 00:00:10 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A  

    ...

    Here is a trace that shows the problem (of course, the video "shudders" when video frames are dropped at the offending point in time):

    ***** ran loadmodules.sh here *****

    root@dm365-evm:/usr/share/ti/dvsdk-demos# ./encode -v Avatar.264 -r 1280x720 -b 3000000    

    Encode demo started.          

    EVM: switch to tvp7002 HD video input   

    davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124          

    davinci_previewer davinci_previewer.2: ipipe_set_preview_config               

    vpfe-capture vpfe-capture: IPIPE Chained                  

    vpfe-capture vpfe-capture: Resizer present                 

    EVM: switch to tvp7002 HD video input      

    vpfe-capture vpfe-capture: width = 1280, height = 720, bpp = 1            

    vpfe-capture vpfe-capture: adjusted width = 1280, height = 720, bpp = 1, bytesperline = 1280, sizeimage = 1382400  

    vpfe-capture vpfe-capture: width = 1280, height = 720, bpp = 1                  

    vpfe-capture vpfe-capture: adjusted width = 1280, height = 720, bpp = 1, bytesperline = 1280, sizeimage = 1382400              

    davinci_v4l2 davinci_v4l2.1: Before finishing with S_FMT: 

    layer.pix_fmt.bytesperline = 1280,   

    layer.pix_fmt.width = 1280,     

    layer.pix_fmt.height = 720,              

    layer.pix_fmt.sizeimage =1382400 

    davinci_v4l2 davinci_v4l2.1: pixfmt->width = 1280,     

    layer->layer_info.config.line_length= 1280 

    ARM Load: 24% Video fps: 31 fps Video bit rate: 4269 kbps Sound bit rate: 0 kbps Time: 00:00:01 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                           

    ARM Load: 9% Video fps: 29 fps Video bit rate: 2932 kbps Sound bit rate: 0 kbps Time: 00:00:02 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                            

    ARM Load: 11% Video fps: 30 fps Video bit rate: 3063 kbps Sound bit rate: 0 kbps Time: 00:00:03 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                           

    ARM Load: 12% Video fps: 30 fps Video bit rate: 3022 kbps Sound bit rate: 0 kbps Time: 00:00:04 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                           

    ARM Load: 11% Video fps: 30 fps Video bit rate: 3276 kbps Sound bit rate: 0 kbps Time: 00:00:06 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                           

    ARM Load: 11% Video fps: 30 fps Video bit rate: 2795 kbps Sound bit rate: 0 kbps Time: 00:00:07 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                           

    ARM Load: 13% Video fps: 30 fps Video bit rate: 2776 kbps Sound bit rate: 0 kbps Time: 00:00:08 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                           

    ARM Load: 11% Video fps: 30 fps Video bit rate: 3052 kbps Sound bit rate: 0 kbps Time: 00:00:09 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                           

    ARM Load: 12% Video fps: 30 fps Video bit rate: 3128 kbps Sound bit rate: 0 kbps Time: 00:00:10 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                           

    ...                          

    ARM Load: 35% Video fps: 11 fps Video bit rate: 1258 kbps Sound bit rate: 0 kbps Time: 00:00:23 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                           

    ARM Load: 32% Video fps: 30 fps Video bit rate: 2877 kbps Sound bit rate: 0 kbps Time: 00:00:24 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                           

    ARM Load: 22% Video fps: 30 fps Video bit rate: 3003 kbps Sound bit rate: 0 kbps Time: 00:00:25 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                           

    ARM Load: 26% Video fps: 31 fps Video bit rate: 3008 kbps Sound bit rate: 0 kbps Time: 00:00:26 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                           

    ARM Load: 22% Video fps: 29 fps Video bit rate: 2965 kbps Sound bit rate: 0 kbps Time: 00:00:27 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                           

    ARM Load: 21% Video fps: 30 fps Video bit rate: 3038 kbps Sound bit rate: 0 kbps Time: 00:00:29 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A                           

    ARM Load: 21% Video fps: 30 fps Video bit rate: 3051 kbps Sound bit rate: 0 kbps Time: 00:00:30 Demo: Encode Display: 720P 60Hz Video Codec: H.264 HP Resolution: 1280x720 Sound Codec: N/A Sampling Freq: N/A

    ...

    The sudden drop in frame rate is periodic with the frequency show in the trace above, is independent of the video program being encoded but is highly dependent on the encoding bit rate.

    Any help solving this problem will be much appreciated...

    --Chuck

     

  • Kapil,

    Has the TI team made any progress understanding this issue?  

    I have done some additional investigating regarding this issue - here is my data.

    I performed the following steps.  I:

       1. Compared the current demo encode application's write.c to that of

           the DVSDK 2.18 version and found no difference whatever but I did

           note that NUM_WRITE_BUFS (the number of buffers in the file writer 

           pipe) was set to 9 in both cases;

       2. Recompiled DVSDK 4.00 on my host system;

       3. Increased demo encode application's write.c NUM_WRITE_BUFS to 18;

       4. Compiled/installed the new encode application into my targetfs; and

       5. Ran the new encode application as follows:

           root@dm365-evm: ./encode -v Avatar.264 -r 1280x720 -b 1500000

           results: the encoder performance was normal at a 30 +/- 1 fps

       6. Ran the new encode application as follows:

           root@dm365-evm: ./encode -v Avatar.264 -r 1280x720 -b 2000000

           results: the encoder performance was not normal in that the frame

           rate was 30 +/- 1 fps most of the time but about once per minute

           the frame would drop to 15-25 fps for 1 or to 2 seconds.

     

    Since we plan to develop a custom application based, at least in part, on the demo encode application, can the TI team offer any suggestions for a fix to this issue?

     

    Thanks,

    --Chuck

  • Zhifei,

    Have you received a reply from the TI team regarding this issue?  If so, can you please post any information that they have provided?  Running DVSDK 4.00, I am seeing the same issue on the DM365 EVM when executing the sample encode application - please see my post on this issue.

    Thanks,

    --Chuck

  • Chuck,

                Well,there is not much progress on this issue. Only one engineer says that he has seen issues like this when the filesystem is in NFS.

    You think the bitrate may cause the problem.However in my case the framerate wll still drop even at a low bitrate.

  • Zhifei,

    I too see the problem even at low bit rates although for me it seems to be much better at low bit rates and much worse at high bit rates.  I've looked at the encode application code but do not see any errors so it seems to be a subtle issue.  So I'm not sure how to get this problem understood and then solved - do you have any ideas?

    --Chuck