Scaler

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Sorgelig, Moderator Team

MartinW
Atari User
Atari User
Posts: 34
Joined: Thu May 09, 2019 9:28 pm

Re: Scaler

Postby MartinW » Mon May 27, 2019 11:13 pm

I am using the RGB out purely because I cannot get a picture that is as good by using the scaler (current monitor BenQ 702A). I was told on Facebook:
you can enable scaler only for menu core


Any tips as to how? Setting vga_scaler=1 in MiSTer.ini seems to apply to all cores. I mostly use Minimig so I tried to create a "minimig.ini" in the config directory and appeared to have no effect. I tried to create a [minimig] section in MiSTer.ini and that caused the DRAM to hang with stripes. I tried to create a default section in MiSTer.ini and actually I don't remember what that did but it didn't do what I wanted.

So I did try :)

Just my opinion incidentally but, as nice as a great looking menu is, it is a menu that needs to do a job. As long as it does that job?...

That said, my monitor displays fine at 1280x1024@60, it just goes wrong when I set sync_adjust > 0 (which I do for smooth scrolling) so as far as I'm concerned being able to enable vga_scaler for specific cores is a perfect solution. If the menu doesn't scale perfectly or look spot on it wouldn't bother me as long as it was visible and functional. For me personally the cores are far more important than the menu. just my opinion obviously.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5069
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Scaler

Postby Sorgelig » Mon May 27, 2019 11:15 pm

Code: Select all

[menu]
vga_scaler=1

MartinW
Atari User
Atari User
Posts: 34
Joined: Thu May 09, 2019 9:28 pm

Re: Scaler

Postby MartinW » Mon May 27, 2019 11:30 pm

!! The one thing I did not try. Thanks.

[EDIT] Key is, the section needs to be AFTER the main mister section. Putting it before didn't work.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5069
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Scaler

Postby Sorgelig » Tue May 28, 2019 6:51 am

yes.. As file is parsed from the bigining line by line, so later appearance overrides the previous one if section matches.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5069
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Scaler

Postby Sorgelig » Tue May 28, 2019 11:52 am

@Grabulosaure:
I found that R/B in 16bit mode are swapped. Also some bits offsets were wrong. I fixed it in my latest Menu commit together with 565 mode.
I've fixed it only in output part affecting the framebuffer. Probably input part also needs fixing, although 16bit modes aren't used for core video.

Grabulosaure
Atari maniac
Atari maniac
Posts: 89
Joined: Tue Sep 05, 2017 9:35 pm
Contact:

Re: Scaler

Postby Grabulosaure » Tue May 28, 2019 11:13 pm

Sorgelig wrote:@Grabulosaure:
I found that R/B in 16bit mode are swapped. Also some bits offsets were wrong. I fixed it in my latest Menu commit together with 565 mode.
I've fixed it only in output part affecting the framebuffer. Probably input part also needs fixing, although 16bit modes aren't used for core video.


I have updated the input part and optimised a bit burst read pipelining.
I can add a pipeline level for a 256 entries palette and colour swap. My first idea about the framebuffer mode was to allow bandwidth efficient high resolution on cores like Amiga RTG, PC SVGA, SS/5... (instead of using an additional FB wired to the scaler input), where a 256 indexed colour mode is needed.
But it's probably not reasonable to implement every colour depth, bit ordering and endianness unless it can be removed during HW synthesis.

I suppose the framebuffer device will have similar cabilities for all cores...

Is there any reason for the encodings of the various modes?
I'd like to change the config signal. Something like that :
CONFIG[2:0] : BPP 3=8bpp, 4=16bpp 5=24bpp, 6=32bpp
CONFIG[3] : Variant : 565 / 555, ARGB/RGBA...
CONFIG[4] : Swap B<->R
CONFIG[5] : TBD. byte endianness ?

The scaler input would only support modes 000100, 000101, 000110

As an alternative, or for the OSD, I'd like to finish a simple Avalon framebuffer. It is not directly derived from ASCAL because the scaler needs intermediate buffers, a simple FB can be much smaller.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5069
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Scaler

Postby Sorgelig » Wed May 29, 2019 8:51 am

Grabulosaure wrote:But it's probably not reasonable to implement every colour depth, bit ordering and endianness unless it can be removed during HW synthesis.

I suppose the framebuffer device will have similar cabilities for all cores...

Is there any reason for the encodings of the various modes?

There is no single standard in BGR vs RGB - both are pretty much equal. And while using Linux apps i found that some apps require RGB, some BGR. If i re,member right even LXDE linux has different "acceleration" for video depending on B/R order. So i don't want to stick just for single order. If at some point it will be found that order should be different for some usage, i would like to have this option for quickly swap instead of recompile ~80 cores.
it's also unclear if choose 1555 or 565 they both have usage and different support in different apps.
So 32bit, 1555 and 565 should be definitely supported with R/B swap option.
Also for future proof i would like to have wither RGB8 (332) or 256 palette mode. Both modes should be able to be used in terminal, and with only byte per pixel it saves the DDR3 bandwidth. And should be able to be used in some games. 256 palette mode is standard VGA/SVGA mode in the 80x/90x - so it's pretty much retro standard :)

Grabulosaure wrote:I'd like to change the config signal. Something like that :
CONFIG[2:0] : BPP 3=8bpp, 4=16bpp 5=24bpp, 6=32bpp
CONFIG[3] : Variant : 565 / 555, ARGB/RGBA...
CONFIG[4] : Swap B<->R
CONFIG[5] : TBD. byte endianness ?

i'm fine with this. When you will be able to finish new format?

Grabulosaure wrote:As an alternative, or for the OSD, I'd like to finish a simple Avalon framebuffer. It is not directly derived from ASCAL because the scaler needs intermediate buffers, a simple FB can be much smaller.

Yeah, separate module just for frame buffer with Alpha channel support working in slave mode, so it can take output from scaler and mix in its content on top of scaler. Just like osd.v module does.
So, in this case FB can be removed from scaler and will use this module where can be easily switched to either sole FB output or overlay on scaler.

Grabulosaure
Atari maniac
Atari maniac
Posts: 89
Joined: Tue Sep 05, 2017 9:35 pm
Contact:

Re: Scaler

Postby Grabulosaure » Wed May 29, 2019 11:24 pm

Sorgelig wrote:When you will be able to finish new format?

I have just uploaded a new version with an indexed 8bpp mode (palette).

Code: Select all

OLD FORMAT[2:0]             NEW FORMAT[4:0]
     "000" 16bits 1555 RGB => 01100
     "001" 24bpp       RGB => 00101
     "010" 32bpp       RGB => 00110
     "011" 16bits 565  RGB => 00100
     "100" 16bits 1555 BGR => 11100
     "101" 24bpp       BGR => 10101
     "110" 32bpp       BGR => 10110
     "111" 16bits 565  BGR => 10100
             8bits palette => x0011


The scaler input now uses RGB565 in 16bpp mode.
Any additional mode? Monochrome? Use of the palette for curves/gamma correction? Hardware cursor...

Sorgelig wrote:There is no single standard in BGR vs RGB - both are pretty much equal. And while using Linux apps i found that some apps require RGB, some BGR. If i re,member right even LXDE linux has different "acceleration" for video depending on B/R order.

Some framebuffers for X workstations even supported configurable colour depth for each pixel and several access strides. This allowed to display simultaneously windows configured with different X "visuals" : TrueColor, PseudoColor, DirectColor, Monochrome, ...

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5069
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Scaler

Postby Sorgelig » Thu May 30, 2019 7:15 am

Grabulosaure wrote:I have just uploaded a new version with an indexed 8bpp mode (palette).

that was quick!
But 8bpp palette implemented is not how i've expected.
Can you implement palette as block in DDR3 memory laying before the frame buffer?
So scaler will read this part in VS/VBL time every frame. This will avoid long and slow pipe of communication from driver to scaler.
As far as i know Scaler now accepts any FB address with 256byte of granularity? If so, then palette can lay in first 768bytes of frame buffer. Linux driver will set the fb address as 4096-768, so FB pixel data will start from 4096 boundary. Or scaler can choose other offset depending on FB address granularity. Just make sure it will be possible to place the start address of pixel data with 4096 granularity.

Grabulosaure wrote:Any additional mode? Monochrome? Use of the palette for curves/gamma correction? Hardware cursor...

monochrome can be simulated with 8bpp mode with specific palette. So, it's already there.
I don't see much use of gamma correction. At least it can be made outside of scaler if it will be required. So - no need :)
Hardware cursor: it''s not required for FB support. But for Amiga RTG probably it will be needed as far as i know. But it's not urgent - as far as i know no one working on RTG implementation now. If HW cursor will be added later, then it can be updated only in Minimig core - other cores won't get any benefit from it.
Another use of HW Cursor is ao486 core where VGA implementation can be moved to FB mode, so it will be possible to implement SVGA.
Since both usage are cores, cursor data can be supplied from outside to simplify scaler changes.

User avatar
kitrinx
Captain Atari
Captain Atari
Posts: 166
Joined: Wed Sep 26, 2018 6:03 am

Re: Scaler

Postby kitrinx » Thu May 30, 2019 1:52 pm

I have been playing a bit with weston. It is very responsive. Rather than making everything based out of console TTY, have you considered having the menu core simply run fully within this compositor? It would make managing features, the UI, and input much more coordinated I think. A few general purpose libraries for it like SDL would make development a breeze.

It seems like the menu core is becoming more of a "home" screen/ultility core. With all these changes, maybe it also would be worth considering a "home" menu option to reload the menu core rather than forcing a soft reboot to return to menu.

amadama
Atariator
Atariator
Posts: 29
Joined: Fri Jun 27, 2014 12:00 am
Location: USA

Re: Scaler

Postby amadama » Thu May 30, 2019 5:23 pm

Will these new features such as the Weston compositor work on the native output via I/O board (RGB or component)? or will we need to keep an HDMI monitor connected simultaneously for menu and other things?

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5069
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Scaler

Postby Sorgelig » Thu May 30, 2019 6:37 pm

kitrinx wrote:I have been playing a bit with weston. It is very responsive. Rather than making everything based out of console TTY, have you considered having the menu core simply run fully within this compositor? It would make managing features, the UI, and input much more coordinated I think. A few general purpose libraries for it like SDL would make development a breeze.

It seems like the menu core is becoming more of a "home" screen/ultility core. With all these changes, maybe it also would be worth considering a "home" menu option to reload the menu core rather than forcing a soft reboot to return to menu.

I would rather have 2 versions. The simple one - it's the current menu look. In 99% of cases you just need to run the core from menu.
For advanced control it's possible to switch to GUI. But it still need to think how to use it on traditional TV where are ~200-240 active lines only.

User avatar
kitrinx
Captain Atari
Captain Atari
Posts: 166
Joined: Wed Sep 26, 2018 6:03 am

Re: Scaler

Postby kitrinx » Thu May 30, 2019 7:00 pm

Sorgelig wrote:I would rather have 2 versions. The simple one - it's the current menu look. In 99% of cases you just need to run the core from menu.
For advanced control it's possible to switch to GUI. But it still need to think how to use it on traditional TV where are ~200-240 active lines only.


For such low resolutions there is not much you can do other than dedicated pixel graphics. Any kind of scaled UI will be a mess at such low res, and any kind of 240p pixel graphics will look low very pixelated at 720p+.

Since there is two camps of people, 720p+ and 240p people, so maybe just make a hard divide there. Scaling if above, and some simple thing if below (the old thing).

Grabulosaure
Atari maniac
Atari maniac
Posts: 89
Joined: Tue Sep 05, 2017 9:35 pm
Contact:

Re: Scaler

Postby Grabulosaure » Sun Jun 02, 2019 7:25 pm

Sorgelig wrote:8bpp palette implemented is not how i've expected.
Can you implement palette as block in DDR3 memory laying before the frame buffer?

I can make a thingy that does DMA copies to fill palette registers. It could even be used for setting the framebuffer size, format, base address... or anything else.
But it would be outside the scaler. And with an Avalon mux for bus sharing.

I already have a core that uses 1024x768x256c...
I'd like to compare performance between using the original framebuffer and scaling it, and using the scaler as a framebuffer.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5069
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Scaler

Postby Sorgelig » Mon Jun 03, 2019 5:22 am

Well, i've implemented palette reading through slow DMA (don't want to stress DDR3 more).

spidersfrommars
Atariator
Atariator
Posts: 27
Joined: Mon Nov 20, 2017 3:39 am

Re: Scaler

Postby spidersfrommars » Fri Jun 07, 2019 3:45 pm

video_mode=video_mode=320,16,30,34,240,2,3,22,6400 ;240p
It used to make the scaler work on my component crt, but after the new scaler it stopped working. Any idea how to change it to work with my crt?

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5069
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Scaler

Postby Sorgelig » Fri Jun 07, 2019 5:24 pm

spidersfrommars wrote:video_mode=video_mode=320,16,30,34,240,2,3,22,6400 ;240p
It used to make the scaler work on my component crt, but after the new scaler it stopped working. Any idea how to change it to work with my crt?

it's unclear what version you've used before. Which core you're talking about? How it's "not working": do you see anything on screen? can you open OSD menu?

spidersfrommars
Atariator
Atariator
Posts: 27
Joined: Mon Nov 20, 2017 3:39 am

Re: Scaler

Postby spidersfrommars » Fri Jun 07, 2019 6:16 pm

Sorgelig wrote:
spidersfrommars wrote:video_mode=video_mode=320,16,30,34,240,2,3,22,6400 ;240p
It used to make the scaler work on my component crt, but after the new scaler it stopped working. Any idea how to change it to work with my crt?

it's unclear what version you've used before. Which core you're talking about? How it's "not working": do you see anything on screen? can you open OSD menu?

I get double picture, and when i go in to the framebuffer i lose all picture. I tried with:
video_mode=320,8,32,24,240,4,3,16,6048
and it works so it my 240p setting must be remade, as there must be a problem with it.

JamesF
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 146
Joined: Sat Dec 15, 2018 6:46 am

Re: Scaler

Postby JamesF » Thu Jul 25, 2019 12:10 pm

@Grabulosaure, Sorgelig

Regarding forced_scandoubler, this option lets people play 240p games in 480p on PC CRT monitors which looks great, but 480i modes are not converted to 480p and there is no image on monitors that do not support interlaced signal.
Bob deinterlacing is the simplest way to convert 480i to 480p,, OSSC, RetroTink2x, and many more use it, just display the odd 240 lines and then 240 even lines in total of 480 lines.
Will it be possible do implement this to the analog output when forced_scandoubler=1, or maybe there is some other more efficient way converting 480i signal to 480p for the scandoubler analog output?

PsyFX
Atari nerd
Atari nerd
Posts: 46
Joined: Tue Oct 23, 2018 7:51 pm

Re: Scaler

Postby PsyFX » Fri Sep 06, 2019 1:22 am

@ Grabulosaure, Sorgelig

Is it possible to run the HDMI & VGA Scaler at different resolutions simultaneously?
Ex:
HDMI @ 1920x1080@60
VGA @ 1280x1024@60

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5069
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Scaler

Postby Sorgelig » Fri Sep 06, 2019 12:26 pm

PsyFX wrote:@ Grabulosaure, Sorgelig

Is it possible to run the HDMI & VGA Scaler at different resolutions simultaneously?
Ex:
HDMI @ 1920x1080@60
VGA @ 1280x1024@60

No, you can't. Cores have only one scaler. Different resolutions will require 2 scalers. There are no resources for second scaler.

PsyFX
Atari nerd
Atari nerd
Posts: 46
Joined: Tue Oct 23, 2018 7:51 pm

Re: Scaler

Postby PsyFX » Fri Sep 06, 2019 8:03 pm

Sorgelig wrote:No, you can't. Cores have only one scaler. Different resolutions will require 2 scalers. There are no resources for second scaler.


Alight, would it be possible in a future build of the Mister Menu?
To be able to set in the .ini , independence resolutions for HDMI / VGA Scalers.
And have a switch (setting, w/e) in the gui to select between the scalers, reboot for the changes to take effect or change in real time with 10 second test with revert if fail.

Started testing some of my various monitors and found I was constantly changing resolutions and scalers. Hence my inquiry.
Incidentally I found some situations where I was preferring to use a 19" monitor over my 55" hdtv :-?

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5069
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Scaler

Postby Sorgelig » Fri Sep 06, 2019 8:18 pm

MiSTer is not a computer..
What is essential for PC, is not easy on MiSTer.

User avatar
Newsdee
Atari God
Atari God
Posts: 1461
Joined: Fri Sep 19, 2014 8:40 am

Re: Scaler

Postby Newsdee » Fri Sep 06, 2019 11:01 pm

Just run a second MiSTer for your other display.

PsyFX
Atari nerd
Atari nerd
Posts: 46
Joined: Tue Oct 23, 2018 7:51 pm

Re: Scaler

Postby PsyFX » Fri Sep 06, 2019 11:05 pm

Sorgelig wrote:MiSTer is not a computer..
What is essential for PC, is not easy on MiSTer.


How about using scripts to make MiSTer.ini changes ?
Ex:
(VGA Script / Details or Specific Monitor Model, etc)
Set vga_scaler=1
Set forced_scandoubler=1
Set 4 - 1280x1024@60
Reboot


Return to “MiSTer”

Who is online

Users browsing this forum: No registered users and 5 guests