Project

General

Profile

Actions

Emulator Issues #12684

closed

Incorrect emulation of aspect ratio in Sonic Adventure 2: Battle

Added by ShadyGuyJose over 2 years ago. Updated over 2 years ago.

Status:
Working as intended
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

Game Name?

Sonic Adventure 2: Battle
But really any game that renders with non-square pixels

Game ID? (right click the game in the game list, Properties, Info tab)

GSNE8P
Again, not limited to this game

MD5 Hash? (right click the game in the game list, Properties, Verify tab, Verify Integrity button)

9ef5fadf4b8756af820df997468a5a16

What's the problem? Describe what went wrong.

The aspect ratio is off. The game I used as an example renders in 636×524, expecting a stretch to a 4:3 aspect ratio, which does happen on a real CRT, as seen below. However, as long as we're using a 480i resolution/60 Hz refresh rate (NTSC or PAL60) Dolphin displays square pixels. In 576i/50 Hz PAL mode, this doesn't happen (I assume the game uses square pixels internally when running in that mode).
I'd like to add that playing on a modern 16:9 LCD (Wii through component cables) and then setting the aspect ratio to "Original"/"Pixel Perfect" on the TV itself gives me a similar result to Dolphin, which means this really is done on purpose, to compensate for the expected CRT stretch of the time. Dolphin outputs the same signal as a GameCube/Wii, we're simply not seeing it how we would on an old CRT.

What steps will reproduce the problem?

Just boot the game and look for anything that should be a circle.

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

Yes. 5.0-15236

Is the issue present in the latest stable version?

I'm using Android, so there aren't really any stable builds.

If the issue isn't present in the latest stable version, which is the first broken version? (You can find the first broken version by bisecting. Windows users can use the tool https://forums.dolphin-emu.org/Thread-green-notice-development-thread-unofficial-dolphin-bisection-tool-for-finding-broken-builds and anyone who is building Dolphin on their own can use git bisect.)

Not applicable.

If your issue is a graphical issue, please attach screenshots and record a three frame fifolog of the issue if possible. Screenshots showing what it is supposed to look like from either console or older builds of Dolphin will help too. For more information on how to use the fifoplayer, please check here: https://wiki.dolphin-emu.org/index.php?title=FifoPlayer

I've attached the following pictures:

  • A dumped texture, showing a circle that serves as a menu option
  • A screenshot of how it appears in Dolphin in 60 Hz mode (very squished)
  • A photo of how it looks on my CRT TV (stretched to an almost perfect circle)

What are your PC specifications? (CPU, GPU, Operating System, more)

Intel Core i7-4770K (overclocked to 4.4 GHz)
nVidia GeForce RTX 3080
32 GB RAM (DDR3, 1600 MHz)
Windows 10 Pro 21H1

Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)

I've noticed this issue, to varying degrees, in several games. "Sonic Adventure 2: Battle" is the most egregious example, but "Medabots Infinity" has it too, to a noticeable degree, and "Pokémon Colosseum" has a slight squish. All look right in real hardware, or when stretched to 4:3.


Files

tex1_128x128_44cea5eaabf42269_14.png (15.2 KB) tex1_128x128_44cea5eaabf42269_14.png ShadyGuyJose, 09/23/2021 11:20 AM
IMG_20210921_125956 (1).jpg (91.6 KB) IMG_20210921_125956 (1).jpg ShadyGuyJose, 09/23/2021 11:20 AM
GSNE8P_2021-09-21_13-04-35.png (244 KB) GSNE8P_2021-09-21_13-04-35.png ShadyGuyJose, 09/23/2021 11:20 AM
VID_20210924_052725.mp4 (4.88 MB) VID_20210924_052725.mp4 50 Hz ShadyGuyJose, 09/24/2021 04:28 AM
VID_20210924_050903.mp4 (4.42 MB) VID_20210924_050903.mp4 ShadyGuyJose, 09/24/2021 04:28 AM
IMG_20210924_192656_262.jpg (254 KB) IMG_20210924_192656_262.jpg ShadyGuyJose, 09/24/2021 06:30 PM
IMG_20210924_192657_733.jpg (263 KB) IMG_20210924_192657_733.jpg ShadyGuyJose, 09/24/2021 06:30 PM
IMG_20210924_194346_829.jpg (77.6 KB) IMG_20210924_194346_829.jpg ShadyGuyJose, 09/24/2021 06:45 PM
IMG_20210924_194345_433.jpg (73.3 KB) IMG_20210924_194345_433.jpg ShadyGuyJose, 09/24/2021 06:45 PM
Actions #1

Updated by phire over 2 years ago

Thanks for the clear and concise bug report.

I'd like to add that playing on a modern 16:9 LCD (Wii through component cables) and then setting the aspect ratio to "Original"/"Pixel Perfect" on the TV itself gives me a similar result to Dolphin, which means this really is done on purpose, to compensate for the expected CRT stretch of the time. Dolphin outputs the same signal as a GameCube/Wii, we're simply not seeing it how we would on an old CRT.

No, that's not true. Modern TVs do a near-perfect good job of replicating "the CRT stretch". Actually they are more accurate than a typical CRT, which would often be slightly off due to analog electronics.

If it's showing up the same in both Dolphin and a LCD tv, then it's not going to show up any differently on a real CRT.

Actions #2

Updated by ShadyGuyJose over 2 years ago

They do replicate that, when set to 4:3. However, my LCD TV has a pixel perfect option that deliberately ignores that. It looks right when set to 4:3 on the LCD, and it looks right (at 4:3) on my CRT.

Actions #3

Updated by ShadyGuyJose over 2 years ago

(the picture shows as much)

Actions #4

Updated by ShadyGuyJose over 2 years ago

I've also tested it in 14:9 (LCD), as suggested by @eckso in the other post, and it looks very wrong. It only looks right in 4:3 mode, on both LCD and CRT.

Actions #5

Updated by ShadyGuyJose over 2 years ago

@phire what I'm looking for here isn't even a game fix. Just an option to stretch to 4:3 in the emulator itself. The current "Force 4:3" option doesn't force 4:3, it forces square pixels. When using custom shaders to force 4:3, these games look perfect.

Actions #6

Updated by phire over 2 years ago

  • Subject changed from Wrong aspect ratio in some games to Incorrect emulation of aspect ratio in Sonic Adventure 2: Battle
  • Status changed from New to Questionable
  • Assignee set to phire

I can't tell from your description if this is an actual bug in dolphin's emulation, or if the game is just a bad port with bad aspect ratio on real hardware too.

I'm going to have to aquire a copy from somewhere like eBay and check myself. That might take a while.

Actions #7

Updated by ShadyGuyJose over 2 years ago

@phire It's neither, in my opinion. Dolphin is correctly emulating the internal signal of the GameCube, likely what you'd get if you used a capture card, and also what I get when I use pixel perfect mode on my LCD. However, as shown by the photo, circles show up as circles on a CRT, which I believe means the game was developed with stretching in mind. I can snap more pictures of circular elements in the UI (the ring icon in gameplay, for example, copyright symbols in text, I've shown all of these in the forum topic I linked to earlier today) to show how it looks on the CRT. And, as I've said earlier, I have two more games that behave in exactly the same way (ovals in Dolphin and pixel-perfect mode LCD, proper circles on my CRT). I just want an emulator-wide option in Dolphin to stretch games to 4:3 (and maybe rename the current "Force 4:3" option to "Internal aspect ratio" or "1:1 pixel aspect ratio").

Actions #8

Updated by phire over 2 years ago

  • Status changed from Questionable to Working as intended
  • Assignee deleted (phire)

I have confirmation that dolphin is emulating this correctly.

I don't know what you are talking about with this displaying correctly on a real CRT, it doesn't (at least not the GameCube version, the Dreamcast version does)

(and maybe rename the current "Force 4:3" option to "Internal aspect ratio" or "1:1 pixel aspect ratio").

It does neither. All the Force 4:3 aspect ratio button does is override automatic switching between 4:3 and 16:9 aspect ratios.

Because dolphin automatically crops black bars from the border, the actual rendered picture resolution from dolphin is never actually 4:3 or 16:9. But it is correct to what the hardware does. If dolphin was ever to an an option to insert the black bars, the resulting picture would actually be 4:3. But nobody wants actually wants that feature.

Actions #9

Updated by ShadyGuyJose over 2 years ago

Look at the photos I posted, then. The CRT one clearly shows a circle where Dolphin displays an oval, and the dumped texture is also a perfect circle. That's why I raised the issue in the first place: because I felt the ovals I was seeing in Dolphin weren't the same as what I saw when I originally played this game, so I went back to the GameCube, confirmed and photographed it. I'm less peeved about it now because another user gave me a custom shader that stretches the picture to 4:3 and makes everything circular, but I still thought it should be fixed in the emulator itself (or at least give users the choice). If the devs think this is the proper behavior, though, I won't insist any longer.

Actions #10

Updated by phire over 2 years ago

The CRT one clearly shows a circle where Dolphin displays an oval

Because on your CRT, you are using the PAL version of the game.

While you apparently have an NTSC version of the game running in dolphin. Did you mix up the versions while dumping?

The game is broken. In 50Hz mode (which is the default for PAL) it has the correct aspect ratio, the menu items appear circular. But in 60Hz, it has the incorrect aspect ratio with non-circular menu items.

If you boot the PAL version of the game into PAL60 mode (hold B while booting to get a video mode selection menu), it also replicates dolphins result of the NTSC version of the game. If you correctly dump the PAL disc and load it into dolphin, you will find that replicates the result of the PAL disc on real hardware, with circular menu items.

Actions #11

Updated by ShadyGuyJose over 2 years ago

Nope. It's PAL60. I always use 60 Hz. And I checked. All pictures were captured at 480i

Actions #12

Updated by ShadyGuyJose over 2 years ago

The Dolphin version is NTSC because I tried that one after noticing the issue in the PAL version initially. I tried NTSC because I suspected it may be a regional issue, but it wasn't

Actions #13

Updated by ShadyGuyJose over 2 years ago

When I get home, I'll photograph both modes on my TV, to dispel any doubts. But both display the same picture, despite being different resolutions

Actions #14

Updated by ShadyGuyJose over 2 years ago

All right, I'm home, and I took a measuring tape to the TV. In PAL60 mode, on a 15" CRT, the circles are exactly 5.7×5.7 cm. In regular 50 Hz PAL, on the same TV, they are 5.8×5.6 cm, very slightly wider than they are tall, not enough of a difference for me to have noticed with the naked eye. So, the fact remains that my CRT is stretching the 480i signal to proper 4:3. I have two videos showing very similar circles with noticeably different flickering rates to prove it (attached). Dolphin, on the other hand, gives us ovals that are 9–10% taller than they are wide in PAL60 or NTSC, as you can see in the original screenshots. I'm sorry for being such a pain, but I'm still seeing circles on my CRT in 60 Hz mode, now backed up by actual measurements.

Actions #15

Updated by ShadyGuyJose over 2 years ago

The video attached to the previous post was 50 Hz, this one is 60.

Actions #16

Updated by JosJuice over 2 years ago

Do you know what the technical differences are between your modern TV's 4:3 mode and pixel perfect mode? (Perhaps the manual has a description of the modes?) Since lines of analog video don't contain pixels, I was assuming that the name of this "pixel perfect" mode couldn't be referring to how the lines are stretched and that it thus probably was some kind of setting that controls overscan, but if the wideness of things looks different between the two there must be some sort of difference.

Actions #17

Updated by ShadyGuyJose over 2 years ago

JosJuice wrote:

Do you know what the technical differences are between your modern TV's 4:3 mode and pixel perfect mode? (Perhaps the manual has a description of the modes?) Since lines of analog video don't contain pixels, I was assuming that the name of this "pixel perfect" mode couldn't be referring to how the lines are stretched and that it thus probably was some kind of setting that controls overscan, but if the wideness of things looks different between the two there must be some sort of difference.

I do. Pixel-perfect mode was originally meant for DVD playback. It assumes analog signals use the full 720-point spatial resolution limit of old analog signals, resulting in a digitized 720×480 image for NTSC or PAL60 signals and 720×576 for PAL. It then scales this signal to a 1440×1080 space in the center of the display, meaning horizontal resolution is fully preserved, as pixels are doubled with no blur, whereas vertical resolution is scaled normally (with bilinear filtering). This yields a perfect 4:3 image for DVDs that use the full SD resolution. Other sources, which leave blank horizontal space on either side of the picture (analog-converted 704×480 was common, for example, for SD digital camcorders), have that blank space treated as black pixels, which means images appear squeezed vertically. CRTs would often ignore that blank space and stretch whatever was left to 4:3, even before overscan. Developers would often rely on that (or predict that) and make games slightly anamorphic to compensate. My LCD's 4:3 mode replicates that effect. It ignores blank space, stretches whatever's left to 4:3, and then slightly crops the picture. I assume some CRTs would treat the blank signal as black too, which would explain @phire having confirmation that there are ovals on CRTs as well. But I've provided photo and video proof that mine doesn't, and in 60 Hz mode.

Actions #18

Updated by phire over 2 years ago

I'm sorry... Your TV does what? Can you please provide the brand/model number so I can look up the details.

CRTs would often ignore that blank space and stretch whatever was left to 4:3, even before overscan

This is simply not true. No TV in the gamecube era did anything like this. You are just making wild speculation that is competly untrue. I've done extensive research into the operation of CRT TVs in order to get dolphin's aspect ratio implementation correct.

Developers would often rely on that (or predict that) and make games slightly anamorphic to compensate.

While your modern TV might have such a mode, your TV didn't exist in the gamecube era. Nothing that behaved like that existed.

No developer was making decisions on what might result in the best image quality on some weird "pixel perfect" mode on some futuristic TV.

What happened instead is that some developers made mistakes and assumed square pixels. Or simply didn't care due to rushed deadlines on low-quality ports.

Actions #19

Updated by ShadyGuyJose over 2 years ago

I'm sorry if I wasn't clear enough. I'll try to organize and break it down better:

1 - I meant devs optimized for CRTs, obviously. I may have faith in their skills, but not to the point where I think they predict the future.

2 - My CRT TV is OLD. It's been in my house for at least 15 years, likely more. It has no adjustable display modes besides typical 4:3 and 16:9, and it's the one in the videos (always set to 4:3, of course, it's a 4:3 TV and the 16:9 mode is letterboxed). It's the one I took the tape measurements in, showing perfect circles in PAL60 mode (5.7×5.7 cm) and unnoticeably wider circles in PAL mode (5.8×5.6 cm). As seen in the videos I attached. I can find a way to test the NTSC version as well if you think it might not look the same as PAL60.

3 - My "modern" (early 2013, probably manufactured in 2012) LCD is the one with the two different scaling modes. I don't have the model number on hand, but it's a 40" 3D 1080p Sony BRAVIA. I can check the proper model later. It has 5 scaling modes: pixel-perfect, 4:3 optimized, zoomed 4:3, 14:9, 16:9. Language settings can make names vary (mine's not in English). It produces the same result as the CRT in optimized 4:3 mode (circles) and the same result as Dolphin in pixel-perfect mode (ovals that are ~10% stretched).

I am not in any way devaluing your research, and you probably know a lot more than I do about the inner workings of video signal. But the fact remains that I have a CRT showing circles in PAL60 mode, and that I can replicate both that and Dolphin's output on my LCD. And I have sent you video proof.

I really hope I'm not coming across as harsh in any way, and I'm trying to back up my statements with video proof whenever possible to avoid doubts and confusions.

Actions #20

Updated by phire over 2 years ago

Can you check the Linearity Test Pattern from the 240p test suite?

https://artemiourbina.itch.io/240p-test-suite

Make sure it shows the correct thing in both NTSC and PAL modes.

https://files.extremscorner.org/gamecube/screenshots/linearity.png

Actions #21

Updated by ShadyGuyJose over 2 years ago

Of course. I'll test everything when I get back home, on CRT and both LCD scaling modes, snap pictures/videos of everything, and I'll get back to you.

Updated by ShadyGuyJose over 2 years ago

phire wrote:

Can you check the Linearity Test Pattern from the 240p test suite?

https://artemiourbina.itch.io/240p-test-suite

Make sure it shows the correct thing in both NTSC and PAL modes.

https://files.extremscorner.org/gamecube/screenshots/linearity.png

Here's the CRT test. 480i and 576i. 480i is the one where a bit of overscan is noticeable. Circles look right on both.

I'll make separate posts for the LCD tests.

Updated by ShadyGuyJose over 2 years ago

I got something weird on the LCD. When running the test suite, the 4:3 optimized option is disabled (in the same way everything except 16:9 is disabled when I feed it a 1080p signal). It only allows for pixel-perfect or 16:9. In this case, I get a 4:3 picture with perfect circles with pixel-perfect mode. 480i again overscans a little.

Actions #24

Updated by phire over 2 years ago

From what I can see measuring your photos:

CRT PAL: 1.04:1
CRT NTSC: 1.03:1

So your CRT is out of calibration by 3-4% in both modes. The distortion isn't even across the screen, the grid view would probably show that better.

LCD PAL: Almost exactly 1:1
LCD NTSC: 1.04:1

Well... I don't know what is going on with your LCD's NTSC handling, and weird that it almost matches the CRT

Actions #25

Updated by ShadyGuyJose over 2 years ago

phire wrote:

From what I can see measuring your photos:

CRT PAL: 1.04:1
CRT NTSC: 1.03:1

So your CRT is out of calibration by 3-4% in both modes. The distortion isn't even across the screen, the grid view would probably show that better.

LCD PAL: Almost exactly 1:1
LCD NTSC: 1.04:1

Well... I don't know what is going on with your LCD's NTSC handling, and weird that it almost matches the CRT

It could be camera distortion, couldn't it?
I also find it weird that the test suite signal is recognized as different from the game signal by the LCD, even when both say 480i (it locks me out of some scaling options, as I said above).
I honestly don't know what to make of this. I understand that you don't want to implement a game fix based on my report alone, especially without fully understanding what's going on here. However, would it hurt to have a global 4:3 stretch option on the emulator? So users could try the current one and that one and decide which one looks better? As I've said before, I've noticed a few games that suffer from this, and even if I can't fully prove that they display properly on old CRTs (I accept that photos/videos of my CRT alone aren't enough), it would be a harmless option to have, no?
Thank you for all your trouble.

Actions #26

Updated by phire over 2 years ago

It could be camera distortion, couldn't it?

well, if it's camera distortion, then the same camera distortion would be impacting photos of Sonic Adventure 2: Battle. Feel free to bring out a tape measure if you are unsure.

I also find it weird that the test suite signal is recognized as different from the game signal by the LCD

Make sure you are setting the video mode inside 240p test suite to "480i scaled 240p assets (NTSC)" and "576i scaled 264/240p assets (PAL)" video modes. By default it does 240p/288p.

However, would it hurt to have a global 4:3 stretch option on the emulator

It does slightly the wrong thing in most games, and it can get very wrong in the extremes. For examples the widescreen cutscenes in Rogue Squadron 3 get stretched all the way from 2:1 to 4:3 and look ridiculous.

This is more a topic for i9024. I think eckso's suggestion of a post-processing shader to fix it is a good way to go for now.

Actions #27

Updated by ShadyGuyJose over 2 years ago

phire wrote:

It could be camera distortion, couldn't it?

well, if it's camera distortion, then the same camera distortion would be impacting photos of Sonic Adventure 2: Battle. Feel free to bring out a tape measure if you are unsure.
True. I'll measure everything tomorrow to be sure. I might've been holding the camera wrong or something. The test suite's circles looked good to me, but I may not be noticing a 4% stretch (like I hadn't noticed the small difference — nowhere as big as in Dolphin — between the circles in PAL and PAL60 SA2:B).

I also find it weird that the test suite signal is recognized as different from the game signal by the LCD

Make sure you are setting the video mode inside 240p test suite to "480i scaled 240p assets (NTSC)" and "576i scaled 264/240p assets (PAL)" video modes. By default it does 240p/288p.
I used those options. Which makes it even weirder.

However, would it hurt to have a global 4:3 stretch option on the emulator

It does slightly the wrong thing in most games, and it can get very wrong in the extremes. For examples the widescreen cutscenes in Rogue Squadron 3 get stretched all the way from 2:1 to 4:3 and look ridiculous.
I get that. As a user, I'd like to be given the choice, but I understand that many people would probably enable it and then complain when faced with those extreme examples.

This is more a topic for i9024. I think eckso's suggestion of a post-processing shader to fix it is a good way to go for now.
Yeah, another user sent me a custom-made shader and most problematic games I've come across look fine with it, so I have my fix for now.
Thank you again for all your help/attention/trouble!

Actions #28

Updated by ShadyGuyJose over 2 years ago

Sorry, the quotes came out wrong. I'm on my phone and must have missed some ">" signs. But it should be understandable. Thanks again!

Actions

Also available in: Atom PDF