Best way to output SCART (RGB) from Pi 3?
-
@Dochartaigh Could this not be configured using a custom config for every emulator in the runcommand before you start a game for that particular system?
-
@Dochartaigh
The config.txt I use is very similar to the one you posted apart for slightly different hdmi_timings.
Once the PI resolution is set there is no way (or none that I know of...) to stretch a lower resolution to fill a 4:3 screen if you want a pixel-perfect image. If you want to display SNES and NES fullscreen you have to set 256x240 on config.txt and the TV/monitor will "analogically" stretch the image horizontally to fill the screen.I tried to take some picture of my PVM hooked up to a real MegaDrive and to a RPi3 running retropie. The pictures don't do justice to the real image, it's really hard to photograph a CRT!
RPi3-Retropie:
MegaDrive:
-
@Rion said in Best way to output SCART (RGB) from Pi 3?:
@Dochartaigh Could this not be configured using a custom config for every emulator in the runcommand before you start a game for that particular system?
I really don't know - that's why I'm turning to the forum for help! All I want is to have whatever game I load fit to the 4:3 ratio TV's screen.
@maxriptide said in Best way to output SCART (RGB) from Pi 3?:
Once the PI resolution is set there is no way (or none that I know of...) to stretch a lower resolution to fill a 4:3 screen if you want a pixel-perfect image. If you want to display SNES and NES fullscreen you have to set 256x240 on config.txt and the TV/monitor will "analogically" stretch the image horizontally to fill the screen.
Thanks for the pics. I'm not looking for pixel perfect at all - even on my PVM monitor I have to mess with the V and H space to get it to fit to screen perfectly (which I'm assuming is slightly stretching the image). What was wrong with the "custom_viewport" settings you used? What would you suggest for the easiest way to get each system (in my case NES, SNES, Genesis, and Arcade) to stretch to that 4:3 monitor? (with hopefully no large area of unused pixels around the edges - I do like edge to edge so it fills the screen).
-
@HiScoreBob Posted a great guide and comparison screenshots using the far more superior Pi2Scart from Arcadeforge.net on the libretro forums.
-
@Rion said in Best way to output SCART (RGB) from Pi 3?:
@HiScoreBob Posted a great guide and comparison screenshots using the far more superior Pi2Scart from Arcadeforge.net on the libretro forums.
how can PI2SCART be "far more superior" when I get the exact same image quality of a real Mega Drive?
-
@maxriptide The comparison was to show the difference in video output quality using the onboard pi composite RCA vs Pi2Scart.
-
@Dochartaigh said in Best way to output SCART (RGB) from Pi 3?:
What would you suggest for the easiest way to get each system (in my case NES, SNES, Genesis, and Arcade) to stretch to that 4:3 monitor?
The only way I can think of, is to set the PI to a 480i resolution, then in the retroarch.cfg in each single emulator set video_scale_integer = "false"
and video_smooth = "true", doing so, every game, no matter the original resolution, will be stretched to 640x480 filling the screen. The downside of it is that you'll get a manipulated image not different than the one you get hooking up the PI to an hdmi monitor or tv. Worse than that, in a 15KHz monitor (as a PVM/BVM is) this resolution (640x480) will be interlaced so the screen will be flickery.
I think that the only point of using a 15 Khz CRT monitors is to feed them with an RGB progressive signal (240p or 224p) so that the games may be displayed in their full glory as they were meant to be displayed by their programmers.
Personally, I'd go with the multiple SD solution, you could have one for Mega Drive and another one for NES and SNES switching them before turning the PI on.
As regards Arcade games, the situation is even worse since the arcade games have a lot of different native resolutions (320x240; 288x240; 256x224; 320x224 ; 384x224 and others). -
@Rion OK, I got it, composite video output is really awful
-
@Dochartaigh said in Best way to output SCART (RGB) from Pi 3?:
What was wrong with the "custom_viewport" settings you used?
There is nothing wrong with the custom_viewport setting I used, it is the solution I come up with to display different systems using a fixed resolution in the config.txt. Resolutions lower than the config.txt can be "framed" inside that one, I sketched the following image to explain this
So, let's say you set 320x240 in the config.txt and you want to display SNES games (256x224), you have to edit the SNES retroarch.cfg file adding the following lines:
custom_viewport_width = "256"
custom_viewport_height = "224"and, if needed, custom_viewport_x and custom_viewport_y to center the image. As I wrote before, the final image will have black borders, that may be thin or thick depending on the h-size and v-size settings on your monitor.
-
Thanks for the diagram.
Is there really no "fit to screen" setting anywhere?
Via HDMI, which is set to 1080p (1920x1080), how does every single system properly stretch top to bottom (with of course black bars on the left and right since 1080p is widescreen/16:9, and these systems are mostly 4:3 ratio), without doing anything special to the setup files. Same thing happens when my system config.txt is set to 720p - and it does all this automatically. Is it a function of a modern flat-screen LCD TV and that's why these CRT's can't do that without complex settings?
I'm just not understanding what the problem is....
-
@Dochartaigh I think that's the Pi/retroarch video scaler's doing, similar to what was mentioned a few posts back about the integer scale.
That's the video renderer scaling the image to fill the 1920x1080 pixels based on the source image. You may get artifacts and it won't be quite perfect.
What you are looking for is getting the Pi to only output exactly the pixels you want and get the PVM to do the scaling (well, to just tender that image on its full screen).
Sorry if it isn't clear, writing on my phone.
-
@pjft said in Best way to output SCART (RGB) from Pi 3?:
@Dochartaigh I think that's the Pi/retroarch video scaler's doing, similar to what was mentioned a few posts back about the integer scale.
That way you get lots of flickering thought they said because of the progressive signal (or not at the right hZ frequency or something?) - that wouldn't be good.
I am looking for NES, SNES, and Genesis, mostly, but I also LOVE arcade game too (and Doom and Quake through Ports, and The 7th Guest through ScummVM, bunch of MS-DOS games) so even the multiple SD card solution which was mentioned won't work for arcade games with all those resolutions which were listed as well...
-
Right - I was exactly not suggesting that. I was answering to your question around "Via HDMI, which is set to 1080p (1920x1080), how does every single system properly stretch top to bottom (with of course black bars on the left and right since 1080p is widescreen/16:9, and these systems are mostly 4:3 ratio), without doing anything special to the setup files". That's because of the software scaler from RetroArch. It has nothing to do with the TV.
-
This post is deleted! -
@Dochartaigh said in Best way to output SCART (RGB) from Pi 3?:
Via HDMI, which is set to 1080p (1920x1080), how does every single system properly stretch top to bottom (with of course black bars on the left and right since 1080p is widescreen/16:9, and these systems are mostly 4:3 ratio), without doing anything special to the setup files. Same thing happens when my system config.txt is set to 720p - and it does all this automatically. Is it a function of a modern flat-screen LCD TV and that's why these CRT's can't do that without complex settings?
It's a matter of math.
I'll try to explain it but English is not my mother language so sorry if I don't make myself clear.In order to make an image fit a screen bigger (in terms of pixels) than the image itself, the CPU has to perform an interpolation, a mathematical algorithm which spreads out the original pixels into a bigger "surface" and generates new pixels in order to fill the blank spaces.
If you have a small image, let's say 256x224, and want to display it onto a big screen, let's say 1280x720, the interpolation algorithm has a really great number of blank pixels to fill (as you can see in the following image):The algorithm will "create" all the new pixels and you'll get this:
if you don't like pixel look you may also want to use a bilinear filtering algorithm which smooths out the edges by blurring the image:
Instead, when you want to resize an image into a "surface" only slightly bigger than the image itself (e.g. from 256x224 to 320x240), the interpolation algorithm has very few blank pixels to fill:
the algorithm will not be able to generate a perfect slightly-bigger copy of the original image and artifacts will be present:
please take a look at the text characters at the bottom of the image and at the jagged lines of the writing "super mario world" which are are not uniformly shaped. And it gets even worse watching a scrolling background!
I hope I made myself clear :-)
A final note: I know that this is the retropie forum and we are supposed to talk only about retropie and Raspberry PI but the solution to your problem may be using a different machine. A softmodded PAL Nintendo Wii coupled with a SCART RGB cable with WiiMednafen installed is perfectly capable to display all the 16-bit consoles in their fullscreen glory on your PVM without any artifacts and without the need to fiddle with config files and video hardware add-ons.
-
I have managed to output 240p RGB to a scart socket connected to my CRT TV. I used an HDMI>VGA connector and a custom homemade cable to convert to RGB. The cable was actually very easy to make using instructions found on the web, the worse part was getting all the wires inside the connector. Effectively VGA outputs RGB but with separate horizontal and vertical sync signals. Using a couple of resistors it is possible to combine those sync signals into a composite sync signal which works on my old CRT. There are more elaborate circuits that use logic chips to combine the signals but the simple resistor approach works for me. A 5v supply, which can be taken from the Pi usb socket, tells the TV it is receiving RGB signal. If your PVM monitor accepts RGB you probably don't need 5v as the monitor can probably be told it is receiving RGB. I found the image was outside the display so used overscan settings to bring it to the edges of the display. Image quality is very good and gives an authentic arcade experience with no horrible flicker from interlaced composite.
If trying to get an authentic experience on LCD I would suggest the best route is to use a scanline generator i.e. HDMI to VGA with a scanline generator to blank out the lines.
-
I received the PI2SCART today and used these settings in boot/config.txt:
disable_audio_dither=1 dtparam=audio=on dtoverlay=vga666 enable_dpi_lcd=1 display_default_lcd=1 dpi_group=2 dpi_mode=87 hdmi_timings=320 1 16 30 34 240 1 2 3 22 0 0 0 60 0 6400000 1 #240p
So far it's pretty good. Everything is fitting to screen automatically for the most part. Pixel-TFT theme is working nicely for the small 240p space (well, if you like things pixelated at least ;)
Couple questions:
1.) The picture is cut off around 5-10% of the top/bottom/left/right on 3x different monitors. Can I change this in that hdmi_timing line? I'm only seeing documentation from Raspberry Pi foundation on hdmi_cvt parameters...
2.) SNES (and some NES) is having the characters in the foreground move smoothly, but the backgrounds seem like they're getting some lag - like the background movement isn't smooth and a little jagged as you run by. My brother even noticed it when I had him compare it to a real SNES. Genesis seems fine (maybe because it's running in the exact 240p the config.txt is setup for).
What config.txt settings would I use to put the system into 256x240 mode for SNES and NES? I want to see if the problem is because the system is setup in 320x240 where SNES/NES are 256x240.
3.) Similar to the above, how would I test a 480i mode (which is the max res of these monitors)?
4.) The color looks pretty good but it's a little washed out and brighter than it should be (ironically Genesis is closer than SNES/NES/Arcade). I even reset my monitors to their default factory-calibrated settings (which are usually a little dark), and have compared 4 different actual console systems. –– Just trying to get a good defacto baseline before I start tweaking the settings on the monitors themselves.
-
@Dochartaigh said in Best way to output SCART (RGB) from Pi 3?:
What config.txt settings would I use to put the system into 256x240 mode for SNES and NES?
You should put the following hdmi timings in the config.txt:
hdmi_timings=256 1 8 17 21 224 1 7 10 24 0 0 0 60 0 4800000 1and also add the following lines in the retroarch.cfg files:
for NES:
aspect_ratio_index = "22"
custom_viewport_width = "240"
custom_viewport_height = "224"for SNES:
aspect_ratio_index = "22"
custom_viewport_width = "256"
custom_viewport_height = "224" -
Thanks Max! Is there a primer for what all those numbers mean? I would like to know what I'm doing instead of copying and pasting (which I do appreciate!!!). I can tell it's going to make the overall size 256x244 (maybe 60 hz, 48khz for sound, maybe front and back porch settings whatever the heck those are...), but have no clue what the other numbers mean.
Are some of those numbers the margins so I can get this picture to fill up the screen more properly (instead of like a quarter of it cut off)?
Last, won't the NES be letterboxed on the top and bottom if I edit the /opt/retropie/configs/nes/retroarch.cfg to be 240 when the overall size is 256? Or does something prevent that? (would totally LOVE to learn how to start tweaking these...but can't find much on the hdmi_timing setting).
-
@Dochartaigh
The meaning of the hdmi parameters is:
hdmi_timings=<h_active_pixels> <h_sync_polarity <h_front_porch> <h_sync_pulse> <h_back_porch> <v_active_lines> <v_sync_polarity> <v_front_porch> <v_sync_pulse> <v_back_porch> <v_sync_offset_a> <v_sync_offset_b> <pixel_rep> <frame_rate> <interlaced> <pixel_freq> <aspect_ratio>I found these information on the Raspberry Pi forum: https://www.raspberrypi.org/forums/viewtopic.php?t=24679
For an explanation of the parameters affecting the screen position take a look at this thread on the neo-arcadia forum:
http://www.neo-arcadia.com/forum/viewtopic.php?f=58&t=37718&sid=234b0e9379b081851bd78589af7ba599it's in French but the image is self-explanatory.
Please notice that it is not that easy to "play" with these parameters, if you try (like I did) you will come up with with video signals which may be out of your monitor specifications. In most cases you will get a distorted image but you may also damage your monitor, that's why during my attempts to find the correct parameters for the pc engine emulator, I did most of my tests with an old SCART TV instead of my monitors.
@Dochartaigh said in Best way to output SCART (RGB) from Pi 3?:
won't the NES be letterboxed on the top and bottom if I edit the /opt/retropie/configs/nes/retroarch.cfg to be 240 when the overall size is 256?
We are talking about the horizontal resolution here so you might get left and right black bars (not top and bottom) but, as I wrote before, there's no way to prevent this at the moment. The difference in terms of number of pixels between 256 and 240 is really low so you may adjust the overscan parameters on your monitor to avoid letterboxing.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.