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.

OMAP ISP Interface

Hi,

for my project I wrote a kernel module, which connects OMAP's ISP and DISPC to generate a video stream.

I get very strange artifacts in some pictures and I hope to get some new ideas for a solution.

My module reserves several frame buffers and handles ISP IRQ VDINT0 at the last line (line 480 when the vertical resolution is 480).

The handler writes to ISP register CCDC_SDR_ADDR the new buffer address (say buffer 1) and writes to the DISPC register DISPC_VID1_BA0 the address of the current buffer (lets say buffer 0).

But somehow I do get a lot of pictures in my stream which are sometimes cut in half, sometimes a line is missing, or an extra line appears in the picture and so on.

To see these strange effects I saved three buffers as jpeg image files (sorry for the weird colors, but for now I am only processing luminance data).

Can someone tell me what is going on in my stream?

If you want to have a look at my code, please ask for it.

Best regards

Sebastian

original (good) image:

cut image:

image with an extra line:


  • Sebastian,

    Make sure that you trigger the GOLCD bit (or GODIG if using the TV output) to ensure that the BA0 register write is copied to the controller.

    Note, the update will occur during the vertical blanking of the output. This really means that you should have three buffers in your cyclic buffer management (more does not give any additional benefit, less means you will get more stutter and/or tearing).

    You should write to the BA register with the address of the input buffer you have just completed reading and not the one you are about to write. (You are probably doing this, but I just want to make sure).

    If this does not help then we can try some tests to see if it is an input issue or an output issue.

    BR,

    Steve

  • Hi Steve,

    thank you for the quick answer. Well you are right.

    >> Make sure that you trigger the GOLCD bit (or GODIG if using the TV output) to ensure that the BA0 register write is copied to the controller.

    Setting the GOLCD bit did solve most of my tearing problem. Now the DISPC gets the latest buffer and the frame delay is down to 1~2 frames, and thats just fine.

    Unfortunately the picture is still stuttering (every 10 to 15 frames) and sometimes a tearing effect appears (every 100 frames) I hope you can help me out there, too.

    >> Note, the update will occur during the vertical blanking of the output. This really means that you should have three buffers in your cyclic buffer management (more does not give any additional benefit, less means you will get more stutter and/or tearing).

    Yes, three buffers they are. There are actually four because I need one extra to do the extraction of single frames to jpeg image files.

    >> You should write to the BA register with the address of the input buffer you have just completed reading and not the one you are about to write. (You are probably doing this, but I just want to make sure).

    Well, in my module, I am trying to tell ISP its new buffer (buffer 1) when it has finished to write to the current ISP buffer (buffer 0). The right time for that, in my opinion, is the event ISP_IRQ_VDINT0 at the last line of my picture. And this should be also a good time to tell DISPC about the new buffer address.

    Do you have a suggestion for a different event at which ISP and DISPC should be notified about a new buffer?

    >> If this does not help then we can try some tests to see if it is an input issue or an output issue.

    I am curious, what kind of tests do you have in mind?

    With best regards,

    Sebastian

  • Sebastian,

    If you are seeing tearing then the output and input buffers are overlapping. If possible (and since you have 4 buffers) try separating the input and output buffer addresses by 2 frames instead of 1. It is possible that there is some other frame delay occurring which is making them overlap.

    Unfortunately I don't know enough about the software stacks to know what the best interrupts to use are, sorry.

    For testing you could try setting up four additional buffers and pointing the display sub-system to these buffers instead of the ISP buffers. At the point where you receive the ISP interrupt manually fill the fake buffer with a solid color fill to mimic what the ISP would do if it were writing to the buffer. If you change the color each time you should see good clear flashing colored screens with no tearing. This will help identify if the issue is overlap. If you see tearing then you are reading from the wrong buffer (BA set to point to the wrong buffer). If you do not see tearing then it is likely the ISP is not writing to the buffer where/when you think it is, hence the additional buffer address delay should help.

     

    It may be that you just need to experiment a little with the buffer address index you read. If you have your 4 buffer addresses in an array, then you can do something like...

    BA = BufferAddress[(WriteToBufferIndex + Offset) & 0x03];
    GoLCD();

    then experiment changing Offset from 0 to 3. Note, this should be done in the ISP interrupt and not in any DSS related routines.

    Kind regards,

    Steve

  • Sebastian,

    Just to add... If the input frame rate and output frame rates are not very very close (or multiples of each other), then you will see stuttering. This will actually be more obvious with slower frame rates.

    What are your input and output frame rates?

    Kind regards,

    Steve

  • Hi Steve!

    Thanks again for the answers! Your suggestions sounds like a good idea and I am going to have a try...

    Well, as a pre-message. I, at last, found out  what stuttering realy means in the case of a video stream, and yes, my stream stutters a little sometimes (maybe every two seconds a little delay).

    My camera produces progressive VGA frames at NTSC rate about 29.9 Hz, and the DISPC is currently running at 58Hz. I can see from the idea that DISPC should usally display each ISP frame two times, but it is possible that DISPC sometimes displays a frame up to three times before it gets a new one. Thus a little stutter.

    I am going to try to get exactly "two times 29.9Hz" as DISPC frame rate to minimize stutter.

    So far so good.

    Greetings from snowwhite Bavaria,

    Sebastian

  • Excellent.

    Let me know how you get on.

    Kind regards,

    Steve

  • Hi Steve,

    I just wanted to let you know, that my kernel module and the video application is now working. The most significant bug seemed to be the missing Dispc_go register bit, and on the other hand we had a lot of faulty pixels and sync loss due to a bad power source, wich is fixed now.

    So, thanks again for your support

    Sebastian

  • Excellent.

    Please don't hesitate to let me know of any other issues or questions you have.

    Kind regards,

    Steve

  • Hi Steve,

    I need OMAP's CBUFF capability, but I have some problems with it.

    Can you help me out?

    OMAP, ISP, CBUFF configuration / handling

    Thanks,

    Sebastian

  • Sebastien,

    Unfortunately I don't know much about that :( Sorry.

    I would post the question as a new thread so that it will appear in the support list.

    BR,

    Steve

  • Hi Sebastian,

    It seems like old thread but I also now need to configure OMAP3 ISP CBUFF for captured image rotation. Can you give me information on that if you have?

    Thanks,

    Srinivas