Howto configure borderless 4:3 tv-out on n900?

Howto configure borderless 4:3 tv-out on n900?

Till Harbaum
Karma: 664
2010-03-18 19:36 UTC
Hi,

there seems to be an API to change the behaviour of the TV output on the n900. At least the media player uses it to e.g. display things with a different layout on the internal screen and the tv-out.

I am asking this because i think it's a great thing to add to all those 640x480 (4:3) programs and especially emulators. The problem these have is that the have a black border left and right to accomodate for the 800x480 main screen and on tv-out they get another top and bottom border to display the entire internal display contents on the tv-out. The result is a 4:3 image on the 4:3 tv-out with black borders on all four sides and with pixels being lost. This isn't useful at all.

I would be really cool if these applications could just request the tv.out to zoom/crop the 4:3 tv-output. That way most emulated games would run full screen and without any pixel loss.

How can this be achieved?

Till
  •  Reply

Re: Howto configure borderless 4:3 tv-out on n900?

Frantisek Dufka
Karma: 642
2010-03-19 08:16 UTC
I don't know if there is some high level api but a lot of things can be
done either via framebuffer ioctl or via changing stuff in
/sys/dev/ices/platform/omapdss/ see

http://gitorious.org/linux-omap-dss2/linux/blobs/master/Documentation/arm/OMAP/DSS

Having full PAL or NTSC with no translation/scaling would be good both
for games and video playback too.

So far I have only succeeded to change the default 800x480 -> TV scaling
to be a bit better so it is no longer fuzzy due to extra downscaling. On
my TV I can get exactly 480 lines visible in PAL mode which makes
reading text much better.
http://talk.maemo.org/showthread.php?p=461660#post461660


For NTSC output (640x480) it would be enough to render to part of the
screen and set the size and offset accordingly. For full PAL it would
need resizing framebuffer to get more lines (ioctl?).

I wonder how OMAP3 display controller features (gfx,vid1,vid2 planes,
scaling, mirroring, rotation, tv-out) are mapped to Xv and other X APIs.

Frantisek
  •  Reply

RE: Howto configure borderless 4:3 tv-out on n900?

<roope.jarvinen at nokia.com>

2010-03-19 08:31 UTC
Hi,

I suggest you play around with xvattr (http://freshmeat.net/projects/xvattr/), which you can use to set various Xv extension attributes, like XV_OMAP_TVOUT_SCALE and XV_OMAP_TVOUT_WIDESCREEN. I'm not sure if you can find it any maemo repository, but you can compile it from source as it is freely available in fresmeat.

--Roope



>-----Original Message-----
>From: maemo-developers-bounces@maemo.org
>[mailto:maemo-developers-bounces@maemo.org] On Behalf Of ext
>Till Harbaum / Lists
>Sent: 18 March, 2010 21:37
>To: maemo-developers@maemo.org
>Subject: Howto configure borderless 4:3 tv-out on n900?
>
>Hi,
>
>there seems to be an API to change the behaviour of the TV
>output on the n900. At least the media player uses it to e.g.
>display things with a different layout on the internal screen
>and the tv-out.
>
>I am asking this because i think it's a great thing to add to
>all those 640x480 (4:3) programs and especially emulators. The
>problem these have is that the have a black border left and
>right to accomodate for the 800x480 main screen and on tv-out
>they get another top and bottom border to display the entire
>internal display contents on the tv-out. The result is a 4:3
>image on the 4:3 tv-out with black borders on all four sides
>and with pixels being lost. This isn't useful at all.
>
>I would be really cool if these applications could just
>request the tv.out to zoom/crop the 4:3 tv-output. That way
>most emulated games would run full screen and without any pixel loss.
>
>How can this be achieved?
>
>Till

  •  Reply

Re: Howto configure borderless 4:3 tv-out on n900?

Attila Csipa
Karma: 1430
2010-03-19 10:51 UTC
On Friday 19 March 2010 09:16:14 Frantisek Dufka wrote:
> I don't know if there is some high level api but a lot of things can be
> done either via framebuffer ioctl or via changing stuff in
> /sys/dev/ices/platform/omapdss/ see
>
> http://gitorious.org/linux-omap-dss2/linux/blobs/master/Documentation/arm/O
>MAP/DSS
>
> Having full PAL or NTSC with no translation/scaling would be good both
> for games and video playback too.

Can you (or anyone with intimate knowledge) chip in with some comments of how
playing with these can (not) affect the devices (or what gets attached to
them) ? I would like to play with this a bit, but don't want to burn down my
DDP N900 with some weird video sync setting (been bitten by some unrelated
hardware happily setting parameters that burned the video out down :)

Regards,
Attila
  •  Reply

Re: Howto configure borderless 4:3 tv-out on n900?

Frantisek Dufka
Karma: 642
2010-03-19 11:54 UTC
Attila Csipa wrote:

> Can you (or anyone with intimate knowledge) chip in with some comments of how
> playing with these can (not) affect the devices (or what gets attached to
> them) ?

Well as long as you only write 'pal' or 'ntsc' to
/sys/devices/platform/omapdss/display1/timings nothing should go wrong.
It is not needed to mess with tv-out signal timings. It is only about
what pixel data gets sent via tv-out (setting data source, position,
size, scaling).
  •  Reply

Re: Howto configure borderless 4:3 tv-out on n900?

Till Harbaum
Karma: 664
2010-03-20 19:57 UTC
Hi,

thanks for your reply. I fiddled a little bit around with this.

It's pretty easy to stretch the image vertically to full screen. You just
need to set
echo 640,480 > /sys/devices/platform/omapdss/overlay2/output_size
and
echo 42,30 > /sys/devices/platform/omapdss/overlay2/position
The media player does the same.

The problem is the horizontal stretch. You can't write to /sys/devices/platform/omapdss/overlay2/input_size and by checking
what the media player does i found out that it actually changes this
to 640x480 when playing a 4:3 video. Unfortunately the /sys interface
doesn't allow to write these, so i'll have a look at the ioctls next.

Till

Am Freitag 19 März 2010 schrieb Frantisek Dufka:
> I don't know if there is some high level api but a lot of things can be
> done either via framebuffer ioctl or via changing stuff in
> /sys/dev/ices/platform/omapdss/ see
>
> http://gitorious.org/linux-omap-dss2/linux/blobs/master/Documentation/arm/OMAP/DSS
>
> Having full PAL or NTSC with no translation/scaling would be good both
> for games and video playback too.
>
> So far I have only succeeded to change the default 800x480 -> TV scaling
> to be a bit better so it is no longer fuzzy due to extra downscaling. On
> my TV I can get exactly 480 lines visible in PAL mode which makes
> reading text much better.
> http://talk.maemo.org/showthread.php?p=461660#post461660
>
>
> For NTSC output (640x480) it would be enough to render to part of the
> screen and set the size and offset accordingly. For full PAL it would
> need resizing framebuffer to get more lines (ioctl?).
>
> I wonder how OMAP3 display controller features (gfx,vid1,vid2 planes,
> scaling, mirroring, rotation, tv-out) are mapped to Xv and other X APIs.
>
> Frantisek
>

  •  Reply