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.

DM814x EVM capture 1080P60 to display a horizontally down-scaled video

Other Parts Discussed in Thread: TVP7002

Hi,

To evaluate DM814x and DVR RDK, we plan to use the following listed hardware & software to capture 1080p60 resolution.

hardware: DM814x Evaluation Module, Expansion I/O board, rev D
software: dvr rdk 04.01.00.02
video source: 1080p60 YPbPr

The very first test program, a capture directly connects to a display, emulates previous posts in E2E community. (for example:
e2e.ti.com/.../261455)

The video seems scaled down horizontally and shifted a little bit vertically. (The attached picture "bad.JPG" was the HDMI output image from DM814x EVM, showing captured video from TVP7002. As a comparison,"normal.JPG" was a component video source connected to TV, showing what video originally should be.) Nevertheless, nowhere in the code seems relating to scaling.

normal.JPG:

bad.JPG:



We also tried to capture 720P60 with the very same code, except the fixed video standard was changed to 720P60. The video seemed normal, NOT scaled.

Later on, we thought software mosaic might be a key element to put the display to a proper windows position from (0,0) to (1920,1080). But the result was disappointing.

What we have done so far:
1. As other posts on E2E forum suggested, we added a capture device TVP7002. It works.
2. Following the flow of MCFW demo program, we added a case to do only capture--display. (and later capture--swms--display)

Please suggest how to fix. Thank you in advance.

  • Hi,

    First, can you please check if the scalar is enabled in the capture link? If it is enabled, you might be downscaling the image to 720p and then displaying it on 1080p display. Which is why you are getting downscaled image at the offset 0x0 on the display.
    Please disable scalar in the vip. There is some scBypass flag set to FALSE, to enable scalar. Set it to true and set the output frame size to 1920x1080. it should work then.

    Regards,
    Brijesh
  • Hi Brijesh,

    Thanks for your reply. In the capture link, (or say the source code uses functions of the capture link) there is not "scBypass" in DVR RDK version 04.01.00.02. However, I see a candidate "scEnable": My code, similar to DVRRDK in usecases, wrote:

    pCaptureOutPrm = & pCaptureInstPrm->outParams[0];
    pCaptureOutPrm->dataFormat = SYSTEM_DF_YUV422I_YUYV;
    pCaptureOutPrm->scEnable = FALSE;
    pCaptureOutPrm->scOutWidth = 0;
    pCaptureOutPrm->scOutHeight = 0;
    pCaptureOutPrm->outQueId = 0;

    Thus, at Linux side (Processor A8 side), the scaler in the vip should be in the state of being disabled.

    At Processor M3 side, I can see "DW_AT_TI_symbol_name("scBypass")". However, I can not find source code running on BIOS6 really writes "scBypass".

    I want to clarify a key point in my previous post: 720P60 seemed OK while 1080P60 did not. I did not see a 1080P60 video got shrinked to 720P60 and displayed on a screen resolution of 1080P60.

    Please confirm whether "scEnable" is what you want me to check. Please instruct other key issues that I can carefully examine.

    Thanks in advance.

    Warm regards,
    Joel Ding

  • Hi Brijesh,

    Further check "scEnable" in m3vpss is really FALSE.

    Use Vps_printf() to print pVipOutPrm->scEnable in function CaptureLink_drvCreateInst().

    This proves that scaling is not enabled in captureLink. However, when input video is 1080p60, the captured video is down-scaled.

    Please provide further information to check. Thanks in advance.


    Joel Ding

  • Hi Joel,

    What is your usecase? Is it just capture -> display? can you please share your usecase file?
    Also when the usecase is running, can you please share the value location 0x48105800 and 0x48105D00?

    Regards,
    Brijesh
  • Hi Brijesh,

    Sure. But I have trouble sending you source codes. Once I attached files to this website, Firefox crashed. The very same situation happened to Microsoft Internet Explorerer.

    I sent you a private message with my email account. Please reply that message, and I will return you with source files and a log file.

    Warm regards,
    Joel Ding
  • Hi Brijesh,

    Source files were sent to your mailbox. Please take a look.


    In your previous reply, you mentioned two locations at 0x48105800 and 0x41805D00 to check. Both consist of many registers relating to scalars. I just don't know how to dump the register values all at once.

    Please kindly show me how to dump the register values.

    Thanks in advance.

    Regards,
    Joel

  • Hi Brijesh,

    Values at addresses 0x48105800 and 0x48105D00 are shown below :

    root@dm814x:/opt/dvr_rdk/ti814x# devmem2 0x48105800 w
    /dev/mem opened.
    Memory mapped at address 0x400c2000.
    Read at address 0x48105800 (0x400c2800): 0x00004000
    root@dm814x:/opt/dvr_rdk/ti814x# devmem2 0x48105D00 w
    /dev/mem opened.
    Memory mapped at address 0x40081000.
    Read at address 0x48105D00 (0x40081d00): 0x00004000


    Those values seem being directly set in M3. Using the very same command to change the value to 0x00004004, as an online change CFG_SC_BYPASS bit in SC_M_cfg_sc0 register, does not improve this issue.

    root@dm814x:/opt/dvr_rdk/ti814x# devmem2 0x48105800 w 0x00004004
    /dev/mem opened.
    Memory mapped at address 0x40289000.
    Read at address 0x48105800 (0x40289800): 0x00004000
    Write at address 0x48105800 (0x40289800): 0x00004004, readback 0x00004004
    root@dm814x:/opt/dvr_rdk/ti814x# devmem2 0x48105800 w
    /dev/mem opened.
    Memory mapped at address 0x400d7000.
    Read at address 0x48105800 (0x400d7800): 0x00004004
    root@dm814x:/opt/dvr_rdk/ti814x# devmem2 0x48105d00 w 0x00004004
    /dev/mem opened.
    Memory mapped at address 0x40289000.
    Read at address 0x48105D00 (0x40289d00): 0x00004000
    Write at address 0x48105D00 (0x40289d00): 0x00004004, readback 0x00004004
    root@dm814x:/opt/dvr_rdk/ti814x# devmem2 0x48105d00 w
    /dev/mem opened.
    Memory mapped at address 0x402b7000.
    Read at address 0x48105D00 (0x402b7d00): 0x00004004
  • Hi Joel,

    In your usecase file, can you please set numSwMs variable to 0? This will make sure that the capture is directly connected to the display? 

    Also it looks like scalar is enabled in the VIP path. bit2 at the offset 0x5800 is set to 0, so scalar is enabled in the path. can you please make sure that the scalar is disabled by setting scEnable flag to FALSE? 

    Rgds,

    Brijesh

  • Hi Brijesh,

    Thanks for your reply.

    Though in the code numSwMs looks like being assigned value 1, the variable is actually optionally compiled. In the log file I sent you "putty_port0_1213161947.log" line 1176, numSwMs is 0 - meaning that I am not using a mosaic.

    You are right: it looks like some scaler takes effect so that the HDMI output looks like being scaled. Internally it might be coded as not accepting parameters from MCFW or LINK API layer. But I just can not find where. I have looked into Vps_captAllocPath(), Vps_captCreateVip(), Vps_captCreateVip() and used Vps_printf() to print scEnable value. All I see were FALSE - meaning scaler is disabled.

    Please inform me where to turn scalers off. Thanks in advance.

  • Hi Joel,

    Can you please print stats on the UART console? it should print the capture output frame size. Let's see if it is coming from the capture or not..

    Regards,

    Brijesh

  • Hi Brijesh,

    I see abnormal numbers out of VIP Parser. Log shows height=1080, which is alright; but width=1276, not 1920.

    I have no clue what could ever cause this width.

    The following prints detailed system information:

    -----------------------------------------------------------------
    DEMO: HDMI TV/Monitor connected !!!
    DEMO: TV Detected - HDMI interface !!!
    DEMO: INFO : Resolution set to 1080P60 !!!
    i
    Device_tvp7002GetVideoStatus@1046 isInterlaced=0, clocksPerLine=92, frameHeight=1125

    DEMO: 0: Detected video at CH [0,0] (2200x1125@62Hz, 0)!!!

    [m3vpss ]
    [m3vpss ] *** Capture Driver Advanced Statistics ***
    [m3vpss ]
    [m3vpss ] VIP Parser Reset Count : 0
    [m3vpss ]
    [m3vpss ] | Total Even Odd Total Even Odd Min / Max Min / Max Dropped Fid Repeat Frame Error Y/C
    [m3vpss ] CH | Fields Fields Fields FPS FPS FPS Width Height Fields Count (Desc Error Y/C)
    [m3vpss ] ------------------------------------------------------------------------------------------------------------
    [m3vpss ] 000 | 887 887 0 63 63 0 1276 / 1276 1080 / 1080 1 0 0/0 (0/0)
    [m3vpss ]
    [m3vpss ] VIP Capture Port 0 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0
    [m3vpss ]
    [m3vpss ] *** Capture List Manager Advanced Statistics ***
    [m3vpss ]
    [m3vpss ] List Post Count : 1851
    [m3vpss ] List Stall Count : 0
    [m3vpss ] List Post Time (ms) : Max = 0, Min = 0, Avg = 0, Total = 0
    [m3vpss ] INTC Timeout Count : (0, 0) (Min timeout value = 992, 1000)
    [m3vpss ] Descriptor miss found count : 0
    [m3vpss ]
    [m3vpss ]
    [m3vpss ] VIP and VPDMA registers,
    [m3vpss ] VIP0 : FIQ_STATUS : 0x4810551c = 0x00000000
    [m3vpss ] VIP1 : FIQ_STATUS : 0x48105a1c = 0x00000000
    [m3vpss ] VPDMA: LIST_BUSY : 0x4810d00c = 0x00020000
    [m3vpss ]
    [m3vpss ]
    [m3vpss ] 22875: CAPTURE: Fields = 885 (fps = 59, CPU Load = 0)
    [m3vpss ] 22875: CAPTURE: Num Resets = 0 (Avg 0 ms per reset)
    [m3vpss ] 22875: SYSTEM : FREE SPACE : System Heap = 244272 B, Mbx = 10238 msgs)
    [m3vpss ] 22875: SYSTEM : FREE SPACE : SR0 Heap = 2129920 B (2 MB)
    [m3vpss ] 22875: SYSTEM : FREE SPACE : Frame Buffer = 67511168 B (64 MB)
    [m3vpss ] 22876: SYSTEM : FREE SPACE : Bitstream Buffer = 82837376 B (78 MB)
    [m3vpss ] TILER_STATS: CNT :8BIT
    [m3vpss ] TILER_STATS: CNT RESOLUTION: 16384 x 5440
    [m3vpss ] TILER_STATS: BUCKET RESOLUTION: 16384 x 5436
    [m3vpss ] TILER_STATS: NUM FREE BUCKETS: 1
    [m3vpss ] TILER_STATS: NUM USED BUCKETS: 0
    [m3vpss ] TILER_STATS: TOTAL FREE AREA: 89063424 (99 %)
    [m3vpss ] TILER_STATS: TOTAL USED AREA: 0 (0 %)
    [m3vpss ] TILER_STATS: CNT :16BIT
    [m3vpss ] TILER_STATS: CNT RESOLUTION: 32768 x 1344
    [m3vpss ] TILER_STATS: BUCKET RESOLUTION: 32768 x 1344
    [m3vpss ] TILER_STATS: NUM FREE BUCKETS: 1
    [m3vpss ] TILER_STATS: NUM USED BUCKETS: 0
    [m3vpss ] TILER_STATS: TOTAL FREE AREA: 44040192 (100 %)
    [m3vpss ] TILER_STATS: TOTAL USED AREA: 0 (0 %)
    [m3vpss ] 22877: SYSTEM : FREE SPACE : Tiler 8-bit = 89063424 B (84 MB) - TILER ON
    [m3vpss ] 22877: SYSTEM : FREE SPACE : Tiler 16-bit = 44040192 B (42 MB) - TILER ON
    [m3vpss ] 22878: DISPLAY: HDDAC(BP0) : 59 fps, Latency (Min / Max) = ( 74 / 91 ), Callback Interval (Min / Max) = ( 16 / 17 ) DropCount:0 DispLatency (Min / Max) = ( 49 / 66 ) !!!
    [m3vpss ] 22878: DISPLAY DRV: HDDAC(BP0) : Q:[887] Display:[935], Repeat:[50], DQ:[884]
    [m3vpss ] 22878: DISPLAY: UNDERFLOW COUNT: HDMI(BP0) 933, HDDAC(BP0) 0, DVO2(BP1) 933, SDDAC(SEC1) 1853
    [m3vpss ] 22878: SYSTEM : FREE SPACE : System Heap = 244272 B, Mbx = 10239 msgs)
    [m3vpss ] 22878: SYSTEM : FREE SPACE : SR0 Heap = 2129920 B (2 MB)
    [m3vpss ] 22878: SYSTEM : FREE SPACE : Frame Buffer = 67511168 B (64 MB)
    [m3vpss ] 22879: SYSTEM : FREE SPACE : Bitstream Buffer = 82837376 B (78 MB)
    [m3vpss ] TILER_STATS: CNT :8BIT
    [m3vpss ] TILER_STATS: CNT RESOLUTION: 16384 x 5440
    [m3vpss ] TILER_STATS: BUCKET RESOLUTION: 16384 x 5436
    [m3vpss ] TILER_STATS: NUM FREE BUCKETS: 1
    [m3vpss ] TILER_STATS: NUM USED BUCKETS: 0
    [m3vpss ] TILER_STATS: TOTAL FREE AREA: 89063424 (99 %)
    [m3vpss ] TILER_STATS: TOTAL USED AREA: 0 (0 %)
    [m3vpss ] TILER_STATS: CNT :16BIT
    [m3vpss ] TILER_STATS: CNT RESOLUTION: 32768 x 1344
    [m3vpss ] TILER_STATS: BUCKET RESOLUTION: 32768 x 1344
    [m3vpss ] TILER_STATS: NUM FREE BUCKETS: 1
    [m3vpss ] TILER_STATS: NUM USED BUCKETS: 0
    [m3vpss ] TILER_STATS: TOTAL FREE AREA: 44040192 (100 %)
    [m3vpss ] TILER_STATS: TOTAL USED AREA: 0 (0 %)
    [m3vpss ] 22880: SYSTEM : FREE SPACE : Tiler 8-bit = 89063424 B (84 MB) - TILER ON
    [m3vpss ] 22880: SYSTEM : FREE SPACE : Tiler 16-bit = 44040192 B (42 MB) - TILER ON
    [m3vpss ]
    [m3vpss ] 31881: LOAD: CPU: 4.6% HWI: 0.8%, SWI:0.9%
    [m3vpss ]
    [m3vpss ] 31881: LOAD: TSK: CAPTURE : 1.3%
    [m3vpss ] 31881: LOAD: TSK: DISPLAY0 : 0.5%
    [m3vpss ] 31881: LOAD: TSK: MISC : 1.1%
    [m3vpss ]
    [m3video]
    [m3video] 32382: LOAD: CPU: 0.7% HWI: 0.4%, SWI:0.2%
    [m3video]
    [m3video] 32382: LOAD: TSK: MISC : 0.1%
    [m3video]
    [c6xdsp ]
    [c6xdsp ] 32282: LOAD: CPU: 0.2% HWI: 0.0%, SWI:0.0%
    [c6xdsp ]
    [c6xdsp ] 32282: LOAD: TSK: MISC : 0.2%
    [c6xdsp ]
    [HOST]
    ThreadName:Demo_run,ThreadID:673
  • Can you tell me the value at the location?

    0x48105530/0x48105A30/0x481055C0/0x481055C0/0x48105AC0/0x48105AC0?

    It looks like capture itself is getting 1276x1080 frame size. so want to check if cropping is enabled in VIP? or VIP itself is getting smaller frame size from decoder.

    Which decoder device are you using for 1080p frame size? Do you know how it is connected to VIP?

    Regards,
    Brijesh
  • Hi Brijesh,

    The values at the locations:
    reg 0x48105530 = 0x04FC0447 // 1276x1080 as we saw yesterday
    reg 0x48105A30 = 0x0
    reg 0x481055C0 = 0x0
    reg 0x48105AC0 = 0x0

    We are using TVP7002 on EXPANSION I/O BOARD REV D with DM8148 EVM. We are using 16bit YCbCr 422.

    Regards, Joel