Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: latest SwitchRes source  (Read 3953 times)

0 Members and 1 Guest are viewing this topic.

ZoOl007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
  • Last login:August 02, 2020, 12:03:38 pm
    • RGBcommander
latest SwitchRes source
« on: January 14, 2018, 09:34:24 am »
Hi,

I just compiled the latest SwitchRes I could find v0.152 but there should be a  SwitchRes v0.017f ? I am a bit confused by the version numbering difference.
Where can I download the real latest version and what's up with the version difference please?

I compiled a 15khz kernel last night. It runs but I still need to test its 15khz capability.
I am compiling groovy mame 0.193 atm. It is correct that groovymame uses the SwitchRes binary to switch resolutions? It is also correct that I can use SwitchRes to switch resolutions for other emulators?

Forgive me if I ask stupid questions but I am discovering things as I go along...

Thanks

EDIT:

ok, in the mean time I've compiled GroovyMame 0.193 but I'm confused. Whenever I start it I get a mostly black screen on the crt. It doesn't matter if I select generic_15 or pal, it is just black.
But it sure does something because I have my desktop extended on the crt with xrandr. If after I start groovymame set the mode I added with xrandr I have my desktop again.

xrandr --newmode "640x480-15khz" 13.218975 640 672 736 840 480 484 490 525 -HSync -VSync interlace
xrandr --addmode DVI-0 "640x480-15khz"
xrandr --output DVI-0 --mode "640x480-15khz"

makes this pal tv work. Now, how do I need to proceed with the groovymame binary?

I mean, if I just ./mame64 (mame64 is the binary's name with the groovy diffs) without a rom at the very least I would have expected to see the gui...

EDIT2:

it has something to do with the dual screens - if I run ./mame64 -verbose I can see SwitchRes detecting the 1920x1200 monitor and not the crt. But I have another issue.
I cannot boot the pc in 15khz although it has been configured as it should... I don't get it yet

EDIT 3 :  I've got it working to some degree... at least I saw some games but its far from what it should be... still checking...

EDIT 4: I got it to boot in 15khz but now I have the same problem as with GroovyArcade I once tried... the bottom and top from vertical games are chopped off... hmmm... I don't have that issue if I boot normally first and than fiddle around with xrandr... then the few games I tried are ok... That must have got something to do with the supplied edid for sure?
If anyone can explain don't hesitate  ???
My best guess is I need to make an edid based on these settings : "640x480-15khz" 13.218975 640 672 736 840 480 484 490 525 -HSync -VSync interlace ... makes sense?
« Last Edit: January 15, 2018, 02:44:53 pm by ZoOl007 »

Doozer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:June 12, 2023, 09:19:49 am
  • Z80 ERROR
Re: latest SwitchRes source
« Reply #1 on: January 15, 2018, 03:13:07 pm »

When I made the migration to libdrm, I noticed that groovymame only addressed the first crt for 15kHz output under Linux. I kept the same limitation in my code set. The first VGA output linked to the activated crtc is used whatever video output order is considered by the graphic adapter. It means that with only 1 output connected, you should see a picture on your screen.

Where are you struggling with your setup now?

ZoOl007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
  • Last login:August 02, 2020, 12:03:38 pm
    • RGBcommander
Re: latest SwitchRes source
« Reply #2 on: January 15, 2018, 03:32:05 pm »
indeed I have an image if I only have the sony trinitron attached. My main issue is that the vertical games are chopped off top and bottom but I'll try custom modeline in mame.ini tomorrow as you suggest and post back.

If I have the tv connected to dvi-0 and the monitor to displayport-0 and then use xrandr with the settings above I have an image on the tv. I disconnect the displayport and have the image on the tv. If I run groovymame like that the test games all look fine - also the vertical ones.

If on the other hand I specify the edid_pal.bin as a kernel parameter and boot I have the chopped of vertical games.

I've got another panasonic tv as well but that one is having problems syncing 640*480 ? the mame gui is out of sync... but the games run fine. a beautiful image. Even better than the trinitron. I'll try to find some good resources about tv's and the modelines to understand how it all fits together.
« Last Edit: January 15, 2018, 03:38:07 pm by ZoOl007 »

Doozer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:June 12, 2023, 09:19:49 am
  • Z80 ERROR
Re: latest SwitchRes source
« Reply #3 on: January 16, 2018, 10:02:17 am »

You can try this sony trinitron setting inside mame.ini (15 Khz)

Code: [Select]
monitor                   custom
crt_range0                "15625-16200, 55.10-65.00,  2.000, 5.700, 8.000, 0.064, 0.192, 1.024, 0, 0, 192, 240, 0,   0"
crt_range1                "15625-16200, 49.50-54.253, 2.000, 5.700, 8.000, 0.064, 0.192, 1.024, 0, 0, 192, 256, 0,   0"
crt_range2                "15625-16200, 49.50-65.00,  2.000, 5.700, 8.000, 0.064, 0.192, 1.024, 0, 0, 0,   0,   448, 576"

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7411
  • Last login:March 14, 2024, 05:26:05 am
  • Quote me with care
Re: latest SwitchRes source
« Reply #4 on: January 16, 2018, 11:15:32 am »
Hi ZoOl007,

Many questions, let's go...

Swichres "standalone" latest version is 0.152. Since Switchres was merged in GroovyMAME it diverged from standalone source code. Now standalone is stalled. Switchres 0.017 is now part of GroovyMAME. You don't need standalone Switchres if you're running GroovyMAME.

Getting dual screen working in Linux is complicated. I tried it back when I was messing with GroovyArcade and failed miserably. Good luck with it. I doubt GroovyMAME will support that anyway in Linux. In theory it's impremented (check the -output option) but I doubt it works. Back then the issue was SDL 1 iirc. Now we have SDL 2.x but I don't know if anyone has succeeded with it.

In fact, your report of vertical games being affected by the output's assigned edid means Swichres is not working on that output. Otherwise the resolution selected would not depend on any specific edid, but chosen by GM instead.

Selecting PAL means 576i lines vs 480i lines of NTSC. That explains the chopped borders.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

ZoOl007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
  • Last login:August 02, 2020, 12:03:38 pm
    • RGBcommander
Re: latest SwitchRes source
« Reply #5 on: January 16, 2018, 02:46:07 pm »
Thank you both for the answers and your time.
I got a lot further though I must say I only tried 10 games I use to test my daemon so it is by no means conclusive yet and I do have to tune the tv. No more chopped boarders atm though  ;D.

The custom modelines didn't work for me. The image is distorted and sound is in slow motion. But I am curious how these custom modes work then. In our example you gave me three. Does that mean that GM can only use those three or does it try to approximate those in some way?

Also : is there a manpage as to what the GM specific options in mame.ini mean?

Using the edid's supplied in the 15khz diffs the tv identifies itself as SWR 24" - at least that's what it shows in gnome. And I did try both edid_ntsc.bin and edit_pal.bin and it matches the resolutions you specified. I expect that SWR 24" is coming from the edid - I'll figure that out. It has to show Trinitron  :P

All the games I tried are +- 60hz being SwitchRes-ed to 50hz... that means they don't run at correct speed? They run too slow yes? Having a pal set that means I better use 'european - 50hz roms' - should they exist yes? Or I could check if it also syncs ntsc... the majority are 60hz games yes? Or am I completely daft and seeing it wrong?

I didn't get dual screen working either - It sees the 1920*1200 as monitor two but for some reason it sees two SWR 24" screens. Truth be told I haven't really exhausted all the options... fiddling around might get me somewhere but I intend to only use the tv with the pc.

It surely looks way cool... very very nice work!

And how does one go about other emu's in 15khz land? using the latest standalone switchres or xrandr to set the mode for the given emulator?

EDIT : I just tried ntsc in the edid and GM and wonderboy and cabal are butter smooth but the vertical games are chopped of again... from the looks of it if I could force horizontal games to 60hz ntsc and the vertical ones to pal 50hz (or something along those lines) I'll have all I need it seems to me no?

EDIT2 : is it possible to make horizontal games use your ntsc preset and vertical games to use your pal preset? You have the rotational data at hand. How do I configure game specific overrides? (That might be related with the crt_range_x?)
just to make it clear the reason I ask is that for my example roms if I use ntsc the games fill up the whole screen and are geometrically correct. They run very smooth. That'll be because they are ntsc games. Now if I use pal for the vertical ones they are completely visible top to bottom. If I use ntsc for the vertical ones I lose a chunk of image at the top and the bottom so that doesn't cut it for me.

It's not that I don't search for info. It's just hard to find. I plan on documenting each step thoroughly and make it available in the linux section as a reference. (If I ever sort it out to my satisfaction that is).

« Last Edit: January 17, 2018, 03:45:44 am by ZoOl007 »

Doozer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:June 12, 2023, 09:19:49 am
  • Z80 ERROR
Re: latest SwitchRes source
« Reply #6 on: January 16, 2018, 03:00:17 pm »

I use 3 custom modeline due to some vsync issue at very specific rate (i.e. tron).

It is better if you start with arcade_15 default and check how groovymame behave before doing custom modeline. No need to play with xrandr, groovymane does it for you.

ZoOl007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
  • Last login:August 02, 2020, 12:03:38 pm
    • RGBcommander
Re: latest SwitchRes source
« Reply #7 on: January 17, 2018, 02:39:41 am »
and how does GM decide to select crt_range_0 1 or 2 the in case of tron then?

Doozer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:June 12, 2023, 09:19:49 am
  • Z80 ERROR
Re: latest SwitchRes source
« Reply #8 on: January 17, 2018, 05:21:02 am »
and how does GM decide to select crt_range_0 1 or 2 the in case of tron then?

Based on the specified vertical refresh rate range, see modeline construction.

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7411
  • Last login:March 14, 2024, 05:26:05 am
  • Quote me with care
Re: latest SwitchRes source
« Reply #9 on: January 17, 2018, 05:40:48 am »
Internally, GM will generate one modeline for each of the provided ranges. Then it will score each modeline, based on the "degradation" compared to the source mode. Based on that, it will pick the one with the best score. You can see the logic if you generate a log.

Doozer's ranges are divided by vertical refresh. When generating a modeline through each of the ranges, GM will force the refresh to fit within that range. Thus, only the ranges with certain refresh limits will score well. You can apply different criteria, such as total lines, etc. However because different values are interrelated it can be tricky.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

ZoOl007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
  • Last login:August 02, 2020, 12:03:38 pm
    • RGBcommander
Re: latest SwitchRes source
« Reply #10 on: January 17, 2018, 05:48:20 am »
ok, I see...

can I ask one last thing for the time being?

 is it possible to make horizontal games use your ntsc preset and vertical games to use your pal preset? You have the rotational data at hand. And perhaps related to that : How do I configure game specific overrides?

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7411
  • Last login:March 14, 2024, 05:26:05 am
  • Quote me with care
Re: latest SwitchRes source
« Reply #11 on: January 17, 2018, 06:13:28 am »
You can define horizont.ini and vertical.ini and place specific options in there. In the same way you create game specific .ini files (e.g. rtype.ini).

Using either pal or ntsc presets is a lame setup I have to say. You only use those for very picky hardware. Usually you use the generic_15 (supersafe) or arcade_15 presets. The vertical cropped borders issue is better targeted by using the interlace/progressive line limiters in the crt_range (as has been explained a million times).

That said I still doubt you're getting GM right on the secondary monitor. Only some logs would persuade me of the opposite.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

ZoOl007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
  • Last login:August 02, 2020, 12:03:38 pm
    • RGBcommander
Re: latest SwitchRes source
« Reply #12 on: January 17, 2018, 07:00:14 am »
Ok, clear. I'll go for the non-lame setup then. Thank you.
With regards to the 2nd monitor: as I wrote earlier in the post, no, it doesn't work at first try.


Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7411
  • Last login:March 14, 2024, 05:26:05 am
  • Quote me with care
Re: latest SwitchRes source
« Reply #13 on: January 17, 2018, 07:04:25 am »
I don't intend to be dogmatic. If you use PAL/NTSC you're limited to either 50 or 60Hz and you miss all the refresh rates in the middle (a lot). That's what I meant. Preset arcade_15 on the other hand allows all the range between 50-61 Hz.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

ZoOl007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
  • Last login:August 02, 2020, 12:03:38 pm
    • RGBcommander
Re: latest SwitchRes source
« Reply #14 on: January 17, 2018, 07:11:21 am »
nonono, no problem. I didn't interpret it that way at all. I appreciate you talking the time to answer. I'm starting to understand how it functions. I'll search for info on interlace/progressive line limiters this evening.

ZoOl007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
  • Last login:August 02, 2020, 12:03:38 pm
    • RGBcommander
Re: latest SwitchRes source
« Reply #15 on: January 19, 2018, 02:58:29 pm »
I got a bit further... I tested some more games and most horizontal ones displayed fine using the arcade_15 preset. They run at their native speed as I understand it.
I did have one - don't recall the name - that ran maybe on 1/3th of the speed... I don't yet fully 'get' the correlation between the speed and the refresh rate in this case.
I also managed to get vertical games such as dkong (almost) displaying fine and running at native speed by using a custom preset:
crt_range0  15625-16200, 49.50-65.00, 2.000, 4.700, 8.000, 0.064, 0.192, 0.064, 0, 0, 192, 288, 448, 576
The only value I changed from the arcade_15 preset is in bold.
dkong3 and dkong junior on the other hand still have bottom and top a bit chopped off but far less than before. It is common for all as dkong still is slightly stretched but I haven't yet figured out how I need to cope with that. Some other vertical games switch to interlaced but the picture on the tv is rock stable in interlaced mode - far from the 1084s I recall from my youth...

I did experiment with the last 4 values but that yields a degraded image.

Maybe it'll be better to make a system dedicated to vertical games and one for horizontal... I'd still like to tackle it though...
« Last Edit: January 19, 2018, 03:06:58 pm by ZoOl007 »