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.

DVSDK 4.00 Encode Application Frame Rate Drops Periodically

TI Support Team,

Using the out-of-the-box encode application, I'm having the same problem as zhifei zhang describes in his post 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 that shows the problem (of course, the video "stutters" when video frames are dropped at the offending point in time):

First we execute loadmodules.sh script:

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 

Now we execute the encode application:

 

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

  • HI Chuck,

    When using high bitrates, performance becomes more tied to data write performance since the the amount of data to be written  out is larger. In our internal testing NFS performance does seem poorer when compared with e.g. SD I/O in the latest kernel. Instead of writing the output file to NFS, can you try writing the output file to an SD card? This should help, though if you crank up the bitrate high enough you will still be able to cause it to drop below 30 fps. Hopefully this would at least match the performance you were seeing with the older kernel that came with DVSDK 2.10.

    Best regards,

    Vincent

  • Vincent,

       Thank you for your reply and explaining that writing to the NFS at higher encoding bit rates is a know issue.  As you suggest, I plan to create an SD card file system so that I can direct the encode application's writer thread to the card instead of the NFS - I'll let you know my results.

     

    Thanks again,

    --Chuck

  • Hi ,chuck,

          Have you solved the problem? Does the nfs file system in deed cause the problem as Vincent says? If so,please let me know.

     Thank you

  • Zhifei,

       Yes, while encoding 1280x720 30 fps, we have confirmed that Vincent is indeed correct: for an NFS filesystem, the video file writer - or in our case, the dv streamer - cannot always send very large I-frames or P-frames across the Ethernet link before the video thread is called again.  Most of the bottleneck for this operation is the Ethernet link so, in our case, we use UDP on the link to get faster response plus we are in the process of modifying the Ethernet drivers both within the Arago kernel and the Ubuntu host.  We believe this approach will allow us to stream 1280x720 30 fps at bit rate up to 7Mbps with no loss of dv streamer data.

    I hope this helps,

    --Chuck