Page 1 of 1

Square sqaures, Circular circles

Posted: Sun Jan 05, 2014 3:44 pm
by AllenBarnett
My Pi is connected via the composite output to one of these tiny TVs: http://www.adafruit.com/products/946. I'm working on an application using OpenVG. I'm trying to find a combination of /boot/config.txt attributes, DISPMANX/EGL buffer size, and OpenVG view matrix such that drawing fills the TV screen and squares are square and circles are, well, circular. Does anybody have a suggestion for sdtv_mode|aspect, src/dst rect arguments to vc_dispmanx_element_add, and maybe vgLoadMatrix for this TV?

Thanks,
Allen

Re: Square sqaures, Circular circles

Posted: Mon Jan 06, 2014 3:14 am
by AndyD
Hi Allen,

I don't have one of these displays, but here is my thoughts. The display has 480x272 pixels and then displays either a NTSC or PAL analog signal from the Raspberry Pi. The composite signal will always be 720x480 @ 60Hz for NTSC and 720x576 @ 50Hz for PAL. So the display will re-sample the analog signal anyway. I had a look at sdtv_aspect in config.txt. Assuming the pixels in your display are square, I would assume that the best setting for sdtv_aspect would be sdtv_aspect=2 (giving a 16:9 aspect ratio) as this is the closest to the ratio 480/272. However, from my brief testing of sdtv_aspect it would appear that the setting only affects the framebuffer and has no effect on other DispmanX layers.

I think your idea of using the src and dst rectangles in vc_dispmanx_element_add() is a good one. Keep the src rect to the size of the actual element you are adding and then adjust the height in the dst rect until you achieve the required result. As I say I don't have the display, so I think your best bet is to draw a single square that takes up most of the screen and measure it. Adjust, the height of the dst rect until you get the desired result.

Hope that helps.

Re: Square sqaures, Circular circles

Posted: Mon Jan 06, 2014 12:29 pm
by AllenBarnett
Thanks for tip, Andy. I'll break out the tape measure.

(Still getting the hang of this forum interface.)

Re: Square sqaures, Circular circles

Posted: Mon Jan 06, 2014 3:56 pm
by ajstarks
AllenBarnett wrote:My Pi is connected via the composite output to one of these tiny TVs: http://www.adafruit.com/products/946. I'm working on an application using OpenVG. I'm trying to find a combination of /boot/config.txt attributes, DISPMANX/EGL buffer size, and OpenVG view matrix such that drawing fills the TV screen and squares are square and circles are, well, circular. Does anybody have a suggestion for sdtv_mode|aspect, src/dst rect arguments to vc_dispmanx_element_add, and maybe vgLoadMatrix for this TV?

Thanks,
Allen
you may want to try a high-level library to help you: https://github.com/ajstarks/openvg

Re: Square sqaures, Circular circles

Posted: Mon Jan 06, 2014 5:40 pm
by AllenBarnett
ajstarks wrote: you may want to try a high-level library to help you: https://github.com/ajstarks/openvg
I was already looking at your rshapes example from another thread. The openvg library is very easy to use. I've now discovered that the TFT panel is not square to the TV's plastic frame :-) Thanks!