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 Resizer Problem

Other Parts Discussed in Thread: TVP5158

I have set up the resizer in single shot mode to upscale an mpeg file being decoded at 1280x720 to 1920x1080 using the dmai interface in dvsdk_2_10_01_18.  It appears to be working, but eventually the video output freezes due to the thread getting stuck inside the Resize_execute() call.  It never returns with an error, just hangs.  I've searched on the forums for some ideas, and I found some posts referencing a clock divider for the resizer module.  When I adjust the clock divider to slow down the clock, I can improve the reliability, but the frame rate goes down, as I would expect.

I would like to get to the bottom of why my thread is getting hung up, as I've seen it happen even when I slow down the clock.  If this is a memory bandwidth issue as I suspect, I could deal with some dropped frames every once in a while, but getting completely stuck is not a good way to fail.  Has anyone else experienced similar behavior?

 

  • This solved my problem.

    Anshuman Saxena said:

    One very simple check that we should put before calling RESIZE ioctl is that we confirm that IPIPEIF Mode.Enable bit and RSZA, RSZB enable bit - all are cleared to 0. This means the previous resize operation is indeed completed.

    The problem which we tried to solve earlier was that the user had configured IPIPEIF to have very large blanking etc and the resizer completed its operation but IPIPEIF Enable was not cleared (due to elongated blanking). So when the user was again calling RESIZE ioctl, he was seeing that everything else go programmed but the IPIPEIF enable that he was programming in second resize IOCTL was really not making a difference. The enable bit was set due to first ioctl and got cleared when the operation of IPIPEIF for first ioctl got over.

    So resizer was always waiting for getting some input from IPIPEIF. The delay helped there but cleaner way is to verify the enable bits of the modules before calling the resize operation.

    Hope this helps.

    Regards,

    Anshuman

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

  • Hi Anshuman,

    I am a beginner in this area. I am facing similar problem of application hang in the resizer. Your answer is very helpful but can you please explain this in more detail?

    I have some questions as follows --

    1. Can you explain in brief the concept of blanking?

    2. If I put the checks for enabled bits then wont it reduce the frame rate?

    Regards,

    Rohan

  • Hi Anshuman,

    I will put my query in a more elaborated way..

    DM368 does not have a resizer on Rx path. We utilized the IPIPE resizer for TX (i.e. encoder and PIP) and Rx(decoder) path by making IPIPE to single shot mode..

    a) We are introducing a small delay of 5 ms in between calls to IPIPE resizer. i.e.

    while()

    {

        Transmit(Tx Path)

          camera--->CCDC----->mem----->ipipe--|-->mem----->channel 1----->Encoder      

                                                                                 |--->mem----->channel2----->PIP(display local image)

                         5 ms sleep

    Receiver(Rx Path)

         Decoder o/p---->mem---->ipipe---->memory

                        5 ms sleep

    }

    It seems that IPIPE hangs if we do not introduce the sleep between forward and reverse path. Please note that IPIPE is configured for Tx and Rx path for every frame and ipipe i/p and o/p formats are different between Tx and Rx path. Because of the sleep the frame rate is reduced. Why is it required to put sleep before performing operations? Can it be avoided? How?

    Regards,

    Rohan

  • Also how to check the IPIPEIF Mode.enable bit and RSZA and RSZB enable bits in the application?

    Regards,

    Rohan

  • I'd also like an answer regarding the resizer.

    In my application, I am using mcvip / tvp5158.  As such, I must run every frame through the resizer to convert from the format the tvp5158 outputs into the format the dm36x encoder can process.  Because of this, I might be resizing frames more often than most dm36x applications normally do.

    I also hang somewhere in the DMAI Resize_execute call. I've traced it down into the kernel, but I've not gone any further since reading this message.  I'm guessing that I should check if the bit is enabled (somewhere) in dm365_ipipe_hw.c?

    
    

    Since this topic is pretty old, I figured that it would be resolved by now, but it is apparently not.  I'm using DVSDK 4.02.

    Mark

  • Hi Mark.

    The hang problem can be resolved by using the solution provided by Anshuman in the previous replies. You can reset the RSZA abd RSZB bits by calling the function rsz_src_enable()  in "dm365_ipipe_hw.c". And IPIPEIF bit can be reset by modifying the function ipipeif_set_enable() in vpss.c. i have tried this and the hang problem is resolved. No need to use delays if these bits are disabled. But the frame rate did not increase.

  • Rohan,

    I cleared these bits in the RSZ_RESIZE ioctl, right before calling rsz_start.  It appears to have made no difference.

    Let me insert a small delay between clearing the bits and calling rsz_start and see if that makes a difference.

  • Nope.  No difference.  Let me slow the clock and see where that gets me.

  • Hi,

    Did you clear the IPIPEIF bit? I am clearing these bits in "dm365_dma_complete_interrupt()"   by calling "rsz_src_enable(0)" and "ipipeif_set_enable(0,1)" . After this I could remove the delays and the application does not hang.

  • Rohan,

    Yes, clearing the interrupt flags in that ISR appears to have worked properly.   Thanks!

    Mark

  • I spoke too soon.  It still hangs, even when resetting those bits.

    For now, I've modified dmai to set the clk settings on the resizer.

  • Rohan Babtiwale said:
    Did you clear the IPIPEIF bit? I am clearing these bits in "dm365_dma_complete_interrupt()"   by calling "rsz_src_enable(0)" and "ipipeif_set_enable(0,1)" . After this I could remove the delays and the application does not hang.

    I know I'm guilty of lots of thread necro lately, but I ran into this problem too and the above solution seems to be working for me, although I call rsz_src_enable(0) and ipipeif_set_enable(0,1) in the RSZ_RESIZE ioctl of imp_resizer.c, just before imp_common_start_resize(), rather than in dm365_dma_complete_interrupt().

    I had to modify ipipeif_set_enable() since it was hard-coded to ignore the arguments and write 1 to the IPIPEIF_ENABLE register.

    I should also mention that I have my clk div set up as 10/60 and DMA_RZA and DMA_RZB registers both at 0x20 (although only using RZA for the moment), though I'm not sure if any of that makes a difference.  I also have a 1.5ms delay in my application between resizes which I haven't removed yet.

  • Ian,

    This worked for me:

    http://e2e.ti.com/support/embedded/linux/f/354/p/320460/1136237.aspx#1136237