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.

DM8148 + EZSDK 5.05.02.00: DVO2 Display "glitching"

Other Parts Discussed in Thread: TMS320DM8148

I've been chasing my tail on this issue for a couple months now...I'm wondering if the issue resides somewhere in the display portion of the EZSDK firmare.

On our  boards, we're driving /dev/fb1 to a VGA monitor on DVO2, at 1280x1024 (60Hz). We see that periodically (once or twice within 1 minute), the display image "glitches" -- it's as if a display frame buffer is momentarily off by some number of row/columns.  We are also driving the HDMI (/dev/fb0) and SD (/dev/fb2) simultaneously, but see no issues on those displays. Aside from the recurring "glitch," the video out DVO2 looks great.

It *seems* like this glitch only occurs while the OpenMax video pipeline is running... I don't seem to see "glitches" on the GUI if the OpenMax application isn't running.

I've looked at the HS and VS signals on an  oscilloscope and saw no anomalies, which makes me thing somethings getting corrupted in memory, either on the ARM side or on the M3 buffers. (i.e. that it's not a board or hardware level issue.)

Any chance someone else has observed this or that someone from TI could look into this?   (I do not have access to the EZSDK VPSS M3 source code to investigate this further from my side, unfortunately.)

Currently, we're using EZSDK 5.05.00.02, with Qt 4.8.4 for displaying a user interface overlay on top of live video. /dev/fb1 uses R=0, G=0, B=0x255 for color-keyed transparency. An OpenMax program (using the OpenMax IL API) paints a scaled 480x480 video in the center of the display, which is show in the "transparent" region of the GUI.

---

Below are some sysfs items denoting the configuration of display1:

# cat /sys/devices/platform/vpss/display1/clksrc                               
aclk

# cat /sys/devices/platform/vpss/display1/mode
1280x1024@60

# cat /sys/devices/platform/vpss/display1/source
dvo2

cat /sys/devices/platform/vpss/display1/timings
108000,1280/48/248/112,1024/1/38/3,1

cat /sys/devices/platform/vpss/display1/output
triplediscrete,rgb888,0/0/0/0

# cat /sys/devices/platform/vpss/display1/order
0,0


Below is some information about how the /dev/fb1 is configured:
Fixed Info:
----------------
line_len=5120
smem_start=0xB2000000
buf_len=0x01000000


Screen Info:
----------------
res_x=1280
res_y=1024
virt_res_x=1280
virt_res_y=1024
non_std=0
bits_per_pixel=32
blue_len=8, msb=0, offset=0
red_len=8, msb=0, offset=16
green_len=8, msb=0, offset=8
trans_len=8, msb=0, offset=24


Region Info: 
----------------
region=0
pos_x=0
pos_y=0
priority=1
first=1
last=1
scalar_enabled=0
stenciling_enabled=0
tranparency_enabled=1
transparency_type=0
key_color=0x0000FF00
blend=0
alpha=0
bb_en=0
alpha=0


Scaler Info: 
----------------
in_width=0
in_height=0
out_width=0
out_height=0
coeff=0



Below is my /proc/cmdline, to show how my memory is configured:
rootwait rw earlyprintk console=ttyO0,115200n8 rw rootwait=1 ubi.mtd=5,2048 rootfstype=ubifs root=ubi0:rootfs2 noatime mem=364M@0x80000000 mem=320M@0x9FC00000 vmalloc=500M notifyk.vpssm3_sva=0xBF900000 vram=50M

Here's how we're loading display drivers:
modprobe vpss sbufaddr=0xBFB00000 mode=hdmi:720p-60 i2c_mode=0 debug=0
modprobe ti81xxfb vram=0:24M,1:16M,2:6M
modprobe ti81xxhdmi


Below are some snippets showing display setup from the OMX side of things, which should reiterate the configuration I described in the problem statement. I can provide additional info here as needed.


        ...

        OMX_INIT_PARAM(&mode_cfg);

        mode_cfg.width          = 480;
        mode_cfg.height         = 480;
        mode_cfg.scanFormat     = OMX_SF_PROGRESSIVE;
        mode_cfg.pixelClock     = 108000;
        mode_cfg.hFrontPorch    = 48;
        mode_cfg.hBackPorch     = 248;
        mode_cfg.vFrontPorch    = 1;
        mode_cfg.vBackPorch     = 38;
        mode_cfg.hSyncLen       = 112;
        mode_cfg.vSyncLen       = 3;

        ret = OMX_SetParameter(d->common.handle,
                               OMX_TI_IndexParamVFDCCustomModeInfo,
                               &mode_cfg);

        ...

        ret = OMX_SetParameter(d->handle_ctrl,
                OMX_TI_IndexParamVFDCCustomModeInfo,
                &mode_cfg);

        ...


              OMX_INIT_PARAM(&layout);

        layout.sMosaicWinFmt[0].winStartX   = (1280 - 480) / 2;
        layout.sMosaicWinFmt[0].winStartY   = (1024 - 480) / 2;
        layout.sMosaicWinFmt[0].winWidth    = 480;
        layout.sMosaicWinFmt[0].winHeight   = 480;
        layout.sMosaicWinFmt[0].pitch[VFDC_YUV_INT_ADDR_IDX] = 480 * 2;
        layout.sMosaicWinFmt[0].dataFormat  = VFDC_DF_YUV422I_YUYV;
        layout.sMosaicWinFmt[0].bpp         = VFDC_BPP_BITS16;
        layout.sMosaicWinFmt[0].priority    = 0;
        layout.nDisChannelNum               = 0;
        layout.nNumWindows                  = 1;


        ret = OMX_SetParameter(d->common.handle,
                OMX_TI_IndexParamVFDCCreateMosaicLayout, &layout);


  • This may be related to a known issue. What version of silicon do you have on your system?

    Please check advisory 2.1.68 in the silicon errata on the product folder (http://www.ti.com/product/tms320dm8148) for more information,

    BR,

    Steve

  • Hi Steve,

    I really appreciate your quick response!

    I believe we're on Silicon Rev. 2.1 currently, given:

    • Package number is TMS320DM8148BCYE0
    • Contents of register  0x48140600: 0x3B8F202F

    With that said, please let us you what your recommendation is.  I've talked to our HW team, and they're willing to obtain and repopulate a unit with Rev 3 silicon, so that's 1 viable test for us. 

    In the meantime, I'll further review the recommendations for that errata item.  Any advice on applying the L2 cache workaround would be appreciated... I see that the L2 cache aux ctrl register can't be programmed from the OS, so I'll have to look into doing that from U-Boot min I assume...

    It's interesting that you mention a bandwidth-related errata item.... I've witnessed a few other anomalies that "felt" like bandwidth issues, such as the live video momentarily becoming corrupted in a way that looked a buffer being interpreted as luma data when it's chroma. (The symptom being the image momentarily splits and becomes purple and green.)  It seems like these anomalies appear more frequently with increased RAM usage.

    For our intended product, we'll be running the DDR3 at 400 MHz, as this is what is specified in the TRM as the 8148's max supported value. (Oddly, I've seen recommendations from TI about running up at 533 MHz to support 1080P...) For what it's worth, after having tuned some DDR3 timing parameters, I had tested running the DDR3 up to 666MHz, and still saw this issue. 

    (Note the "seem" and "felt" -- as these items are hard for me to reproduce in a consistent manner and prove with absolute certainty, take this information with a grain of salt.)


    Thank you,

    Jon

  • Jon,

    I am not a software guy, so will be of limited help there. I would think that the Kernel should be able to make these changes, but you might need to add them to u-boot and re-build u-boot.

    I should be able to supply a few PG3 devices to you for re-population. Private message me with your contact details and I will start the process.

    It did take us a while ourselves to be able to somewhat reliably re-produce the issue so I can understand your difficulty catching it.

    BR,

    Steve

  • Steve -- thank you! Will be sending you the requested info shortly!

  • I finally received a board with the PG3 device populated.

    Unfortunately, I'm still seeing the same exact behavior with this "glitch" on the RGB display.  Again, it only seems to occur once I start pushing video data (as opposed to just the GUI frame buffers). See the end of this post for a description of what the "glitch" looks like.

    However, I'm operating under the assumption that no changes to the EZSDK 5.05.02.00 kernel or bootloader are required for the Rev 3 CPU. Please let me know if this assumption is incorrect.

    It looks like I'll be diving back into debugging on the OpenMax side of things.  I'll certainly do my best to provide additional information as needed, and try to identify the simplest possible way to reproduce this, so that I can post some code up here.

    If I hear back that someone can look into this, I can put together a diagram of our OpenMax pipeline, and will be happy to dump registers as needed.  I do *not* have access to the M3 firmware, so I can't enable any sort of debug logs there. However, I'll do what I can to provide sufficient info from the ARM side of things.

    Just for a quick idea of the video path:

    • YUV422 (400x400 or less) into VIP0
    • VIP0 output goes to the following components. Given that I have one output and 3 inputs,  I have to do a little bit of manual buffer tracking here to ensure buffer coherency.  Basically, I just ensure each of these components is "done" with a buffer before allowing VIP0 to use the buffer again:
      • DEI Scalar
      • SC5 Scalar
      • H.264 Encode
    • The DEI scalar scales up the video (to 600x600 or less), an drives the following displasy, both of which center the video:
      • HDMI
      • VGA
    • SC5 scales up the video (to 480x480) and centers it on:
      • The SD0 display (NTSC)
    • The H.264 encode is fairly straight forward...just writing the buffer contents to a file

    All the while this is going on, I've got a 1280x720 GUI cloned to /dev/fb0 and /dev/fb1.  Note that since My VGA display is running at 1280x1024, /dev/fb1 is set to 1280x720 and offset, which effectively letterboxes the GUI output on the VGA display; the HDMI and VGA display are clones of one another, but the VGA has "black bars" on the top and bottom.

    Correction: After reviewing my notes, I remembered I had reproduced this with a simpler use case-- please ignore the crossed out portion above and refer to the configuration in my original post. 

    As you'll see from my first post, I had simplified my use case to only drive the GUI to /dev/fb1, and made the dimensions of /dev/fb1 the full VGA display resolution. I did this to rule out any concerns that I was doing something strange from the GUI & Linux Framebuffer device side of things.

    The video output is the only thing on the SD2 display.

    To reiterate, I *only* see an intermittent "glitch" in the VGA display output when all of this is running at once. It does *not* occur:

    • When running only the GUIs on the framebuffer devices
    • When only running the OMX pipeline

    The "glitch" appears as maybe 20-40 rows of torn VGA display data, and it always occurs in the same spot, at the bottom of the GUI (which is overlaid atop the OpenMax video.) 

    Thank you Steve and to anyone else that might be able to assist on this one; your assistance is greatly appreciated.

    Jon

  • Jon,

    When the glitch occurs are you seeing a totally different frame? Or is the glitch visible during moving video? If you are seeing the first case, then its a possible bug in HDVPSS driver. Sometime back we've solved a similar issue for one of our customers. 

    As a immediate workaround, you may be able to reduce this behavior by queueing in more buffers in the beginning. Based on our analysis what we found is that it caused by higher interrupt latency between M3<->A8 communication under higher system load.

  • Hi Renjith,

    The symptoms of the glitch aren't appearing in the video from OMX pipeline, but on the GUI layer that's overlaid atop of the video. As there's not really any movement in the GUI, I can't say with certainty just yet if I'm seeing data from a previous frame.

    As described in my earlier post, our configuration looks like this:



    The video is from our OMX pipeline, and the GUI is atop the video layer, using color keying transparency to make the lower video layer visible.

    When the glitch occurs, it only corrupts a region of the GUI, as shown above by the dark green. It's hard to tell, as it happens so quickly, but I think a row is becoming shifted and wrapping around -- I see some text wrap and the position of some GUI widgets shift.

    However, when this glitch appears, I don't see any noticeable change in the OMX video stream.

    I do not believe it's an issue with the GUI data being corrupted, as I'm able to clone the data to both /dev/fb0 and /dev/fb1 -- the data on dev/fb0 looks fine, while /dev/fb1 glitches.   If I remember correctly, I've also tried switching them; the problem follows the VGA output.

    As mentioned in my above posts, this seems to occur when I have both my GUI and OMX stream running. I don't see anything anything out of the ordinary on the HDMI, VGA, or SD outputs when running just one.

    Any chance you could share a patch of the HDVPSS driver that I could take a look at?  It seems to me that something's not keeping up when compositing the video and GUI layers...that's just a hunch though.  However, my suspicion seems to somewhat plausible, given your mention of having seen interrupt latency issues.

    I'd be more than happy to try to collect more diagnostic info or try to answer your original questions a bit better.

    With regard to the workaround associated queuing more buffers -- where would you suggest adding more buffers?  Per the description of my pipelines, I could allocate more buffers for:
      - The VIP Capture output (and scaler inputs)
      - The scaler outputs and display inputs

    I'll look to experiment with allocating additional buffers in either or both cases and look to post back by the end of the day tomorrow.

    For what it's worth, I appear to have VPSS FW version 0x1000145. I'm using the kernel from the linux-omap3 repo, with the last commit in the drivers/video/ti81xx/video/vpss being 458b09a73526dec5cb4757adcfa02dd8db87b08d.


    Thank you very much for your time and help,
    Jon

  • Hi Jon,

    Jon S. said:
    Any chance you could share a patch of the HDVPSS driver that I could take a look at?  It seems to me that something's not keeping up when compositing the video and GUI layers...that's just a hunch though.  However, my suspicion seems to somewhat plausible, given your mention of having seen interrupt latency issues.

    I cannot share the patch as there are license agreement issues to be sorted out. Also we've fixed the same of another customer. We can discuss in detail offline. Please send me an email. 

    Jon S. said:
    With regard to the workaround associated queuing more buffers -- where would you suggest adding more buffers?  Per the description of my pipelines, I could allocate more buffers for:
      - The VIP Capture output (and scaler inputs)
      - The scaler outputs and display inputs

    Here I recommend to queue in scalar/display inputs. One more question, are you using M2M scalar?

  • Hello Renjith,


    Thanks you, I'll follow up with you shortly.

    With regard to the scalars we're using -- we're using the DEI SC (both outputs) and SC5, as they're provided in the EZSDK OMX implementation.  I seem  to recall the term "M2M" being used with the RDK McFW....just wanted to note that we hopped on this processor before that was available, and are somewhat stuck with the OMX.

    Not sure if that answer suffices... If not, let me know and I'll try to provided a more. For what it's worth, I'll repost the OMX pipeline configuration we implemented via the OpenMax IL API:

    • YUV422 (400x400 or less) into VIP0
    • VIP0 output goes to the following components. Given that I have one output and 3 inputs,  I have to do a little bit of manual buffer tracking here to ensure buffer coherency.  Basically, I just ensure each of these components is "done" with a buffer before allowing VIP0 to use the buffer again:
      • DEI Scalar
      • SC5 Scalar
      • H.264 Encode
    • The DEI scalar scales up the video (to 600x600 or less), an drives the following display, both of which center the video:
      • HDMI
      • VGA
    • SC5 scales up the video (to 480x480) and centers it on:
      • The SD0 display (NTSC)
    • The H.264 encode is fairly straight forward...just writing the buffer contents to a file


    Thank you,

    Jon