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.

DM365 - Can the VPBE output to both LCD and TV composite at the same time ?

Other Parts Discussed in Thread: OMAP3530

Hi,

For the DM365, is it possible to output to both Digital LCD and TV composite at the same time ?

If possible, is there any modification needed to the drivers or example to show how to do this ?

I am using monta vista kernel 2.6.18 and dvsdk 2_10_00_13.

 

Thanks

 

Eric

 

  • Hi,

    Yes, you can get output on both TV as well as parallel digital out from DM365 backend. The driver code needs minor change for register configuration. We can do it in davinci_platform.c as shown below:

    Code in green is original. Code in red is added to support LCD digital output.

    if (cpu_is_davinci_dm365()) {
        if(enableParallelOut){
       /* LCD clock enable for DSUB, VENC Clock Enable */
       dispc_reg_out(VENC_CLKCTL, 0x11);
       /* VCLK Output Enable for DSUB, SYNC Direction is output, Y&C Output */
       dispc_reg_out(VENC_VIDCTL, 0x2000);
       /* TODO: what would be the magic number for DM365? */
       /* SD DAC -> 0x101941DC HD DAC -> 0x101941E7 */
       davinci_writel(0x101941E7, DM3XX_VDAC_CONFIG);
          /* Set REC656 Mode */
       dispc_reg_out(VENC_YCCCTL, 0x1);
       dispc_reg_out(VENC_VDPRO, 0);
      }else {
       dispc_reg_out(VENC_CLKCTL, 0x1);
       dispc_reg_out(VENC_VIDCTL, 0);
       davinci_writel(0x081141CF, DM3XX_VDAC_CONFIG);
         }
     }

    I hope this helps.

    Regards,

    Anshuman

    PS: Please mark this post as verified, if you think it has answered your question. Thanks.

  • Hi, Anshuman,

    Thanks for your reply.

    For this case, how do I set the bootargs in u-boot ?

    Currently, I set the bootargs to davinci_enc_mngr.ch0_output=LCD davinci_enc_mngr.ch0_mode=800x480 for my LCD to bootup.

     

    Also is it possible to do run time switching between LCD and COMPOSITE output ? What  registers or code need to be modify at runtime ?

     

    Thanks again.

     

    Eric

     

     

     

  • Eric,

    Just to clarify, you can get only one resolution out from DM36x. If you want NTSC on TVOUT, then the LCD will also give out 720x480, once you do the changes i mentioned.

    Your bootargs have to select ch0_output as ntsc or pal and not LCD.

    Regards,

    Anshuman

  • Eric,

    Anshuman is correct. VENC and DAC output exactly the same content. Are you thinking about outtputing diffferent content here?

  • Hi, paul,

    No, it is the same content. I actually also wanted to check if I can
    switch the output from LCD to TV out at run time with booting up from
    LCD mode. I am doing a videophone application whereby the user can
    choose to display on TV or LCD by touching a button. So there is also a
    camera involved in this case.

    In this case, is it possibe ? What changes to kernel or drivers needed ?

    However, now after the code modifcations, I only get the COMPOSITE out but not LCD output.

    Is there something that I must do to enable the LCD ?

     

    Thanks again for your help.

     

     

     

  • Eric,

    Maybe I have not understood what you meant exactly. You can get both out simulatenously, switching here really means enabling one and disabling the other at run time.

    DAC can certainly be turned on and off, but i think turning off venc will automatically turn off DAC. I am not 100% here, we should look into this.

    By LCD, you meant RGB output? I think by default, in NTSC, the VENC output will be YCC data. You will need to do more programming if you want to do RGB. I vaguely remember in the driver file, there was a mode like "   *NTSC_RGB   ", please look into that (grep NTSC_RGB)

     

  • Eric,

    Just to add, the changes that we did in the driver was to just switch on the parallel output port for LCD when NTSC out is on. The LCD driver has to be modified accordingly to support NTSC specific timing and BT656 signalling. I am not sure if you did that in the LCD driver.

    Regards,

    Anshuman

  • Hi, Anshuman,

     

    I think that I have not change the lcd driver. Do you have the NTSC specific timing and BT656 signalling values ? I am using the CHIMEI LW700AT9603 LCD (800x480x16).

    Actually the LCD is a Parallel RGB one. Will it work with your code modifications ?

     

     

    Thanks

    Eric

     

  • Hi Anshuman,

     

    Do you have some example code for changing LCD driver to support NTSC and BT656 Signalling ? I urgently needed it as I am not so familiar with modifying the LCD Driver.

     

    Thanks

     

    Eric

  • Eric,

    The implementation of the LCD driver will depend on the actual LCD that is being used. Generally, the LCD configuration registers will have support for using standard timing like NTSC or PAL and once you select that option, it will override the other timing settings that you have done. I cannot comment much on the LCD driver for your device. You might first want to check if the LCD controller supports NTSC/PAL timings and BT656 input mode.

    Regards,

    Anshuman

    PS: Please mark this post as verified, if you think it has answered your question. Thanks.

  • Hi, Anshuman,

     

    Thanks for your explanation. I am using the LCD controller on the dm365 itself in Parallel RGB mode.  In the code given by you,

    the line :

      /* SD DAC -> 0x101941DC HD DAC -> 0x101941E7 */
       davinci_writel(0x101941E7, DM3XX_VDAC_CONFIG);

    should be davinci_witel(0x101941DC, DM3XX_VDAC_CONFIG) for COMPOSITE Output ? Is there any other VENC registers that need to be configure ?

    Should I load my LCD driver by calling davinci_enc_set_prgb() before calling this routine davinci_enc_set_ntsc( ) in davinci_platform.c ?

    Thanks.

    Eric

     


     

  • Eric,

    Just to clarify...

    In order to be able to display on both the LCD and the TV output at the same time then the LCD resolution must be 720x480 (for NTSC) or 720x576 (for PAL).

    Most LCDs have a native resolution that you MUST supply to them, so if the LCD you have connected is not 720x480 then this will not work.

    You should, however, be able to switch between the two outputs by dynamically changing the resolution and configuration.

    I am not a software expert, so do not know the best way to do this through the current drivers.

    You do not want BT656 timing since your LCD cannot receive this data format. this is really only relevant for an external analog video encoder.

    Very few LCDs can receive timings that are not native to the LCD (Note, an LCD monitor is a different story since a monitor will have a scaler and frame rate converted etc... to convert to the native resolution of the integrated LCD panel)

    Bottom line here I think is that unless your native LCD panel resolution is 720x480 then there is no simple/direct way to display on both at the same time and you will need to switch between the two.

    OMAP3 class devices do allow not only different resolutions/formats but also different content, so if this is a hard requirement then you could look at the OMAP3 devices.

    BR,

    Steve

  • Hi, steve,

     

    Thanks for your clarification. So I will not be able to do simultaneous display if my LCD native resolution is 800x480. 

    If I am playing a video stream of 720x480  using ti gtreamer on the LCD,  can I switch to TV output in NTSC mode and vice-versa ?

    I have tried it but seems that the video playback is not correct (audio muffled, video slowed down and displayed at half the resolution).

    For this case, how can I do the switching if I am playing a video stream or camera self view ?

     

    BR,

     

    Eric

  • Eric,

    You will likely need to close the stream before making any changes, then re-open the stream once the new resolution has been configured.

    BR,

    Steve

  • Eric,

    Just to add, i know of LCDs like Toppoly and Casio that support inherent NTSC/PAL timings. If your LCD has support for such inherent timing support for NTSC/PAL, then you can probably have both standard definition analog out and digital output connected to your LCD. As Steve mentioned, you dont need BT656 as generally LCDs might not support that.

    Steve,

    Any comments?

    Regards,

    Anshuman

    Is that not

  • You can certainly find LCD modules that can accept NTSC/PAL timings but they will be more expensive and typically harder to find than displays which only accept their native, progressive, data.

    ALL LCD panels will require progressive and native data. LCD modules have additional processing on the front end, but you pay for this additional processing.

    BR,

    Steve

  • Hi, Steve,

    Does it mean if I want to do dynamic switching during video playback, I had to stop decoder, display and then reinitialise decoder, display and start playback

    from the beginning ?

     

    BR,

    Eric

     

     

  • Hi, Anshuman,

     

    For the TV output NTSC, there is flickering at some place on screen and quality is not so gd . Is there any registers to tweak ? Please enlighten me.

     

    Thanks

    Eric

     

  • I would expect so, yes. The decoder may need to know the output resolution and will likely configure itself at startup. If you then change things mid flight it will have no way of knowing things have changed.

    If the stream is coming from a file then you should be able to make a note of where you are in the stream before shutting down, then seek back to that location once you have re-started the display.

    BR,

    Steve

  • Eric,

    Can you send some pictures and/or video clips which show the issue?

    Without really knowing what the issue is I can't make any recommendations on registers.

    There are many places in the process where the issue could be introduced and it may not actually be the video output causing the issue.

    BR,

    Steve

  • Hi Steve,

    Below is the TV output after doing resize and encode to 720x480 from a 640x480 YUV422 camera. The display is in YUV420SP.

    From the picture,you can see some smudging and jagged edges on the windows.  What can be done to reduce the smudging and jagged edges.

     

    BR,

    Eric

     

  • Eric,

    Unfortunately I am not an ISP/software expert so can't comment too much.

    I will try to get an expert to comment.

    BR,

    Steve

  • Did you use x1.125 in VPBE?

    > Horizontal x1.5 (3/2)/x1.125 (9/8) Rescaling Filter

     

    Regards,

    Sang-Yong

  • Hi, Sang Yong,

     

    I use the resizer to resize the VGA to 704x480, send to video encoder  to encode to H2.64 and send out using RTP.

    This is the video data received by the video decoder and display on the TV.

     

    I think I used the default settings in the driver. Where do I set the Rescaling filter you mentioned ?

     

    Eric

     

  • OK. I thought you need resizer for display.

    Could you check whether you Down scale mode is On? It should be off for Zooming In.

    regards,

    Sang-Yong

     

    6.4.75 Down Scale Mode Enable (RZB_DWN_EN)
    The down scale mode enable (RZB_DWN_EN) register is shown in Figure 6-255 and described in
    Table 6-260.
    Figure 6-255. Down Scale Mode Enable (RZB_DWN_EN) Register
    31-16
    Reserved
    R-0
    15-1 0
    Reserved EN
    R-00 R/W-0
    LEGEND: R = Read only; -n = value after reset
    Table 6-260. Down Scale Mode Enable (RZB_DWN_EN) Field Descriptions
    Bit Field Value Description
    31-1 Reserved Any writes to these bit(s) must always have a value of 0.
    0 EN Down Scale Mode Enable
    0 down scale mode off
    1 down scale mode on
    406

  • Hi, sang yong,

    I  have check that the down scale mode is off. Is there a way to do the anti flickering on the TV screen and the deinterlacing ?

     

    Eric

     

     

  • hi, eric

              Have you  been able to use ti gstreamer to play a video output to  LCD base dm365 evm? I can only plaly video output to tv(ntsc mode). I'm doubt about whether the dm365 evm can support video stream output to LCD.

             If you have been carry out, give me some suggestion please.

    thanks

    robert

  • Robert,

    What exactly do you mean by "I'm doubt about whether the dm365 evm can support video stream output to LCD" ?

    gstreamer does not care where it sends its output video, it simply sends images to a frame buffer. If you have configured the output display driver for LCD output then gstreamer should display on the LCD. If you configure the output for TV then gstreamer will display on the TV.

    BR,

    Steve

  • Robert,

    To have output to LCD, you need to modify the gst_tidmaivideosink_convert_attrs(..) function in gsttidmaivideosink.c to support LCD output at the case VAR_VIDEOUTPUT.

    Add the line

    " else if (!strcmp(sink->videoOutput,"LCD"))

              return Display_Output_LCD;

    You also need to modify your DMAI to support LCD output in files linux/Display.c, linux/Display_v4l2.c etc dependiing on the LCD resolution you are using!

    The bootargs in the u-boot also need to change if you want to boot up to LCD display with the davinci_enc_mngr.ch0_output=LCD davinci_enc_mngr.ch0_mode=800x480 if your LCD is 800x480.

     

    Hope this helps.

     

    Eric

     

     

     

     

     

  • hi,Steve & Eric
    thanks for your reply.
    I'm using monta vista kernel 2.6.32 and dvsdk_3_10_00_19, and ti gstreamer is the newest version down from svn.
    my bootargs is 'mem=65M console=ttyS0,115200n8 root=/dev/mtdblock3 rootfstype=yaffs2 rw video=davincifb:vid0=OFF:vid1=OFF:osd0=800x480x16,4050K dm365_imp.oper_mode=0 davinci_enc_mngr.ch0_output=LCD davinci_enc_mngr.ch0_mode=800x480 vpfe_capture.cont_bufoffset=0 vpfe_capture.cont_bufsize=6291456'
    my gstreamer scripts like this
    gst-launch -v filesrc location=/opt/davincieffect_ntsc.mpeg4 ! TIViddec2 codecName=mpeg4dec engineName=codecServer ! dmaiperf print-arm-load=TRUE ! TIDmaiVideoSink useUserptrBufs=TRUE videoStd=D1_NTSC videoOutput=composite sync=false
    then, decode video stream display on TV,but when I use this scrpits:
    gst-launch -v filesrc location=/opt/davincieffect_ntsc.mpeg4 ! TIViddec2 codecName=mpeg4dec engineName=codecServer ! dmaiperf print-arm-load=TRUE ! TIDmaiVideoSink useUserptrBufs=TRUE videoStd=VGA videoOutput=LCD sync=false
    it decoded failed, and show the error message like this,
    .......................................
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    ERROR: from element /GstPipeline:pipeline0/GstTIDmaiVideoSink:tidmaivideosink0:
    Unable to initialize display
    .............................
    hence, I followed along with Eric's suggestion to modify gsttidmaivideosink.c to support LCD output at the case VAR_VIDEOUTPUT.
    The orignal code:
                #if defined(Platform_omap3530)
                else if (!strcmp(sink->videoOutput, "DVI"))
                    return Display_Output_DVI;
                else if (!strcmp(sink->videoOutput, "LCD"))
                    return Display_Output_LCD;
                #endif
    Does it mean that only omap3530 can support output to LCD?
    I commented define Platform_omap3530, and recompiled it, but when I use "videoStd=VGA videoOutput=LCD" , show the same error message.

    Any suggestion?
    thanks a lot.

    Robert


  • hi, Eric

    Another question, how to modify dmai to support LCD?

    Best Regards!

    Robert

  • Hi

    The start up log message and image can be display on the lcd use /dev/fb0 device, and use ti gstreamer to decode video stream output to TV with ntsc/pal mode succesful.

    but could not output to lcd with ti gstreamer.

    Best Regards

    Robert

     

  • Hi Eric

    this did not work for me.... I can not see any data - but the eav/sav codes coming out from the dm365!

    The vclk out is alive. Also the LCD_OE (that I have enabled) does not seem to come out

    Any ideas?

    Albert

  • Hi, Anshuman.

        Now I also want the TV out and the Digital Out output at the same time in dm365 platform. I modify the davinci_platform.c as you advised. And I set the PINMUX1 as the value 0x5555, VENC_CLKCTL as 0x11, VENC_VIDCTL as 0x2000, VENC_YCCCTL as 0x01, VENC_VDPRO as 0x00, DM3XX_VDAC_CONFIG as 0x101941E7. But the DM365's VCLK pin(B18) has no any signal, can you give me some more advise?

     

       Thank you.

     

    Regards,

     

    Liang 

  • Hi Anshuman,

    I am also working in this issue with IPNC DM368 Appro V2.6. I want to get output video on TV and VPFE on sub-board DM6437.

    I tried your code above but I got nothing on TV and green screen with VPFE on DM6437. Please share me your experiences in my situation.

    Thanks a lot. 

  • bioz said:

    I tried your code above but I got nothing on TV and green screen with VPFE on DM6437. Please share me your experiences in my situation.

    Can you please confirm if you were seeing the output on TV without making any changes in the code? I mean, if you use default IPNC codebase, did you see the display on TV? If not, then we need to look from that direction and then fix the dual output path.

    Regards,

    Anshuman

     

  • hi,

    I have already showed TV out with original code. And I also modified the function: davinci_enc_set_ntsc by my owned function as below:

    static void davinci_enc_set_ntsc_dout(struct vid_enc_mode_info *mode_info)

    {

    /* set VPSS clock */

    davinci_writel(0x18, SYS_VPSS_CLKCTL);

     

    /* VPBE PINMUX */

    {

    unsigned int temp = 0;

    void __iomem *pinmux1 = (void __iomem *) IO_ADDRESS(0x01C40004);

    temp = __raw_readl(pinmux1);  //select VCLKL and HVSYNC

    temp &= ~(0x01 << 22); //VCLK Enable

    __raw_writel(temp, pinmux1);

    printk("Ev NTSC out, GPIO PINMUX1 Set Value: 0x%08X\n", temp);

    }

    //YCC8 BT.656

    dispc_reg_out(VENC_CLKCTL, 0x11);

    //OSD Set

    davinci_writel(mode_info->left_margin,

      (DM365_OSD_REG_BASE + OSD_BASEPX));

    davinci_writel(mode_info->upper_margin,

      (DM365_OSD_REG_BASE + OSD_BASEPY));

     

    dispc_reg_out(VENC_VIDCTL, 0x6000);

     

    dispc_reg_out(VENC_DCLKCTL, 0x005);

    dispc_reg_out(VENC_DCLKPTN0, 0x13);

     

    davinci_enc_set_display_timing(mode_info);

     

    dispc_reg_out(VENC_SYNCCTL, (VENC_SYNCCTL_SYEV | VENC_SYNCCTL_SYEH | VENC_SYNCCTL_HPL | VENC_SYNCCTL_VPL));

    dispc_reg_out(VENC_VMOD, 0x1001);

    dispc_reg_out(VENC_YCCCTL, 0x13);

     

    /* test color bar */

    //dispc_reg_out(VENC_VDPRO, 0x00);

    //dispc_reg_out(VENC_VDPRO, (0x01 << 8));

    }

     

    After this modification I just can get the Video from VPBE but not TV out as before :)

     

    I really don't know what problem is. I need both VPBE and TV out video.

    Please show me how I am wrong.

    Thank you very much.

  • Hi,

    Can someone give me a hint, suggestion or some ideas here?

    thanks