How to enforce an aspect ratio for full screen apps via graphics card control panel (nvidia) or otherwise?

I’m back… :cry:

The issues I asked about previously are mostly resolved. My newest problem(s):

On my Windows system, I can run older / retro games, many of which are obtained from GOG. These apps allow the user to set the screen resolution, some of which are the older 4:3 vs 16:9 (widescreen) aspect ratio.

In Windows, you can browse to the nvidia control panel and select from three options: 3D Settings, Display and Video. There is a sub-option ‘Adjust desktop size and position’ → ‘Apply the following scaling’ → ‘Aspect Ratio’ (apply to Display, not GPU). This makes widescreen apps display as normal, but also presents native 4:3 apps in full-screen with black side bars.

These options do not seem to be available on Ubuntu? How to get this same functionality?

I installed the Ubuntu approved drivers:

nvidia driver: 580.65.06
nvidia-settings: 510.47.03

I read about a way of force-installing the latest nvidia driver / settings, but it warns that kernel updates could render the system inoperable. Would installing a driver this way even help me?

Gnome Settings > Screen Display > Resolution

Any joy?

tea-for-one, I appreciate the reply but no, that doesn’t help.

My widescreen monitor which I prefer to run with aspect ratio 16:9 most of the time simply stretches the image to fit the screen and so a smaller 4:3 aspect ratio image is distorted. The exact problem I want to avoid.

Further, setting the desktop resolution manually every time I want to switch between one aspect app and another would be cumbersome.

I don’t understand why the nvidia control panel doesn’t have the same aspect ratio / scaling options as on Windows. With that setting I described previously, the resolution and aspect ratio is simply accounted for, with no user action required once it’s set.

I understand the problem …

What has surfaced for you is the improper specification of format or codec embedded in your input stream for display (video file or stream).

Unfortunately, I do NOT have an answer that would address the need to

  • correctly recognize the problematic files, and
  • dynamically substitute a correct codec at time of play.

I am not sure, but I think there might be tools out there that

  • are “aware” of those problematic formats, and
  • can repair the video file header with a correct CODEC reference, or
  • convert the video file to a well-formed video file.


[EDIT]
You might want to look at this posting. It may offer some insights.

Hi ericmarceau,

You may be onto something, I do not know. :-/ But this problem is occurring while I am trying to run games. Not playing videos or streaming. ?

The game’s graphical display is technically a “video stream”.

Sometimes, the games might have an option for defining the video display command.

It might be worth looking at for the game’s video streaming. :slight_smile:

1 Like

I have found a command which somewhat relates to this problem. My desktop res: 1920x1080. My game res: 1280 x 1024. DVI-D-0 (my graphics output) was obtained with the xrandr -q command.

nvidia-settings --assign CurrentMetaMode=“DVI-D-0: 1920x1080+0+0 { ViewPortIn = 1280x1024+0+0, ViewPortOut = 1280x1024+320+28 }”

The above command changes my desktop to a 1280x1024 window centred with black bars → 320 pixels at the left and right sides, 28 pixels at the top and bottom. This is what I thought changing the res through Display settings would do.

Using this, I have been able to run one of the games I am testing in full screen and it fits to the adjusted window perfectly. The other game does not seem to handle this viewport stuff at all and just shows a black screen. :-/

Revert back to 16:9 on the desktop:

nvidia-settings --assign CurrentMetaMode=“DVI-D-0: 1920x1080+0+0”

While the aspect ratio is not switching on the fly as it does on Windows, this is at least a workaround which might be scripted, albeit not working with every single app I have tried.

Have you considered asking in the Nvidia site itself, to see if anyone can assist with your specific issue?