[GSoC Weekly Overview]: First major milestones!

This week started exciting! First of all I couldn’t get any capture in my first attempt. And, if you see the reason for that, you will start laughing! I flipped the code such that when the video *should* be displayed it is not displayed, instead it is ‘displayed’ when it shouldn’t and when one cannot see it. Big #Facepalm

Messy Capture!

The first glimpse of anything sane or anything colorful right at the start of week instilled excitement. Although it was not as expected being quite messed up, it did mean that the AD9984A (my VGA capturing IC! remember?) was working fine. Also, from the captured output shown on HDMI I could think of few possible reasons for the message capture output. I’ve a recorded a sample for the benefit of blog readers :D


From the video, anyone with some knowledge of Digital Electronics can figure out that issue is mostly related to sync/clock. So my next target was to correct this.

Sane Output!

After 1.5 days of tinkering around with code, I got first output which closely resembled the VGA output. Remember how previously talked about that Blue and Red signals were interchanged in the PCB? Well, that showed up now, with Yellow being rendered as Cyan! Fixing this was simple one line code modification. Now, this was a time to rejoice! Hurray!

Once the jubilation settled, it was time to look closely. There was quite a large amount of flickering in the output. The default culprits I assumed once again to be an unstable clock and irregular HSYNCs & VSYNCs.  Also, I kept the possibility of a bug in my code open.

Once again for the readers, I have video captures of the results.


Period of frustration

Initially I thought that it would be easy to remove the flickering but it was not. I rewrote the whole code more than 20 times with different capture mechanisms thinking maybe the fault was with the code, but the output refused to budge. In some cases, flickering would reduce, in some case they would increase greatly. Even oversampling code didn’t work at all(no output). It was then that I decided to first check the clock in more detail. Driving the HDMI code with Jahanzeb’s test pattern with only pixel clock sourced from AD9984A gave at least one concrete evidence that Pixel Clock was not very stable. Maybe due to high frequency and long route from AD9984A to FPGA though the VHDCI connector? There were no flickering but the test image was shaking slightly.
Probing the AD9984A status registers revealed that number of HSYNCs per VSYNC were getting detected correctly.
Once again I thought of more tests (one test was even designed during a dream, one can imagine how frustrated I was!). Alas, all of them failed

Ray of hope!

I remembered my mentor Tim telling me about Ajit (a fellow GSoCer, his blog) having written a code for using the Atlys’ onboard USB-Serial interface. I pinged Ajit on IRC and he instantly replied. Incidentally I suppose, we happen to enjoy working all-night only :D Even Ayush(his blog) enjoys working all-night! Back to topic, Ajit replied quickly my doubts and told me to try his code on Windows (due to Exar’s old linux drivers not functioning properly). I switched to windows and used his code from here in a standalone project. Once working correctly, I added the code to my VGA capture project and modified my code to output debug value over UART. And, voila! I started getting some useful debug information from the board in real-time! Now, instead of firing in darkness, I could do systematic debugging. Head over to my blog snippet on some results from first run of UART debugging enabled code.

Upcoming Week:

I’ve some conflicting targets for upcoming week. On one hand I’m thinking of getting the capture right *perfectly* then proceeding to integration with current HDMI2USB code. On the other hand, I’m thinking of first integrating the code with current HDMI2USB code and then remove the flickering. My reason for even considering the second option is that, I think since the USB streaming happens at very slow rate 15-30fps max. compared to the HDMI output @60fps, the flickering would not be a major bottleneck. This would also make the project closer to the intended target of integrating with HDMI2USB.
But, other argument is that getting the capture perfect should be first priority, and then integrating with HDMI2USB code. I’ll have to discuss this with my mentor in this regard.

Posted in , . Bookmark the permalink. RSS feed for this post.

Leave a Reply

Search

Swedish Greys - a WordPress theme from Nordic Themepark. Converted by LiteThemes.com.