LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-05-2010, 04:24 PM   #1
epsilon72
Member
 
Registered: Mar 2007
Posts: 124

Rep: Reputation: 17
[SOLVED] Aspect ratio scaling with Intel GPU's and Linux


All of my computers have nvidia cards, so I'm not quite sure how to do this.

I have a friend who runs Ubuntu 9.10 on a laptop that has a 16:9 screen (1366x768) and an Intel 4500m GPU. I'm trying to figure out how to get 4:3 resolutions to display in their proper aspect ratio (black bars on either side of the image), rather than stretching to fill the whole screen. This is mostly for playing older games in fullscreen.

I've tried messing with xorg.conf and xrandr a bit, but I didn't have much luck and I don't know where to get started

(I posted this in the Ubuntu forums about a month ago...I guess no one knew the answer because I got no replies..)

I'd appreciate any input anyone can provide!

Last edited by epsilon72; 03-19-2010 at 06:45 PM.
 
Old 03-05-2010, 04:55 PM   #2
Tuttle
Senior Member
 
Registered: Jul 2003
Location: Wellington, NZ
Distribution: mainly slackware
Posts: 1,291

Rep: Reputation: 52
Interesting question: if the graphics output is of the correct aspect ratio (1280x1024) then your monitor may fix it!

My monitor has a feature called "optimal aspect ratio", yours may have a similar function.

Hope this helps.
 
Old 03-05-2010, 05:34 PM   #3
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 2,530

Rep: Reputation: 614Reputation: 614Reputation: 614Reputation: 614Reputation: 614Reputation: 614
You may have to specify a monitor aspect somewhere.
To get mplayer to output correctly on a 16x9 monitor start it with
Code:
mplayer -monitoraspect 1.77 /file/...
You can use 16x9 1.77 etc.
If you don't want to do that every time put an entry in ~./mplayer/config
Then it will open a 4x3, 1.33 video correct aspect every time.

I know you did not ask about players but rather games, I'm giving you the info I have. See if you can specify an aspect ratio of the monitor somewhere.
 
Old 03-06-2010, 12:15 AM   #4
epsilon72
Member
 
Registered: Mar 2007
Posts: 124

Original Poster
Rep: Reputation: 17
@Tuttle: Yes LCD monitors are usually nice enough to do that, but this is a laptop monitor

@teckk: Unfortunately most of these 4:3 games (like starcraft, for one) only run in one resolution and don't have aspect ratio controls.

I think there may be some magic xrandr or xorg trick out there to do this, but I can't find anything in the documentation for this. Nvidia, for instance, has it's own special option (at least I think it's nvidia only)
Code:
Option "FlatPanelProperties" "Scaling=aspect-scaled"
That you can set in your xorg.conf and you won't even need to mess with nvidia-settings to make it work.

I'm wondering if Intel has a similar option, and if not, if there's some funky setting for xrandr to make letterboxed resolutions.
 
Old 03-08-2010, 06:59 PM   #5
epsilon72
Member
 
Registered: Mar 2007
Posts: 124

Original Poster
Rep: Reputation: 17
Bump?
 
Old 03-09-2010, 02:10 AM   #6
Tuttle
Senior Member
 
Registered: Jul 2003
Location: Wellington, NZ
Distribution: mainly slackware
Posts: 1,291

Rep: Reputation: 52
I'm afraid there's not a lot you can do unless you can find an argument to add to the game's executable

Anyone else have any thoughts?
 
Old 03-09-2010, 02:32 AM   #7
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 593

Rep: Reputation: 140Reputation: 140
Maybe you can add displaysize to your xorg.conf size in mm.
Code:
Section "Monitor"
        DisplaySize  400 295
        Identifier   "Monitor0"
        VendorName   "NEC"     
        ModelName    "MultiSync XP21"
        HorizSync    31.0 - 89.0     
        VertRefresh  55.0 - 160.0
        Option       "DPMS"
EndSection
 
Old 03-09-2010, 09:06 PM   #8
epsilon72
Member
 
Registered: Mar 2007
Posts: 124

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by whizje View Post
Maybe you can add displaysize to your xorg.conf size in mm.
Code:
Section "Monitor"
        DisplaySize  400 295
        Identifier   "Monitor0"
        VendorName   "NEC"     
        ModelName    "MultiSync XP21"
        HorizSync    31.0 - 89.0     
        VertRefresh  55.0 - 160.0
        Option       "DPMS"
EndSection
I'll give that a try. I've also come across
Code:
  Setting scaling mode

This can be useful for some full screen applications.

xrandr --output LVDS1 --set PANEL_FITTING param

where param can be

    * center: resolution will be kept exactly as defined, no scaling will be made,
    * full: scale the resolution so it uses the entire screen or
    * full_aspect: scale the resolution to the maximum possible but keep the aspect ratio. 

If it does not work, you can try

xrandr --output LVDS1 --set "scaling mode" param

where param is one of "Full", "Center" or "Full aspect".
on a random intel man page somewhere on the net. I think I may have tried this before, but I'm not sure. I won't be able to try it out until friday.
 
Old 03-11-2010, 03:03 AM   #9
slimjimmy
LQ Newbie
 
Registered: Jan 2008
Posts: 1

Rep: Reputation: 1
I, too, was wondering how to enable this feature for my Intel graphics chipset.
I tried the first option, and it gave me this error in response:

Code:
[root@james-laptop James]# xrandr --output LVDS1 --set PANEL_FITTING full_aspect
X Error of failed request:  BadName (named color or font does not exist)
  Major opcode of failed request:  148 (RANDR)
  Minor opcode of failed request:  11 (RRQueryOutputProperty)
  Serial number of failed request:  27
  Current serial number in output stream:  27
Trying the second option, however, did work:
Code:
xrandr --output LVDS1 --set "scaling mode" "Full aspect"
My Urban Terror game correcly scales to the right aspect ratio when going fullscreen. I'm running Fedora 12, though, so your results may vary.
 
Old 03-11-2010, 03:59 PM   #10
epsilon72
Member
 
Registered: Mar 2007
Posts: 124

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by slimjimmy View Post
...
Trying the second option, however, did work:
Code:
xrandr --output LVDS1 --set "scaling mode" "Full aspect"
My Urban Terror game correcly scales to the right aspect ratio when going fullscreen. I'm running Fedora 12, though, so your results may vary.
Cool! That's nice to know that it at least works for someone! I'll get to try it out tomorrow and I'll report back. I think I mentioned it earlier, but the machine in question is running Ubuntu 9.10.

If it does work, it'll also mean that I don't have to shy away from an intel gpu on any laptops I buy in the future. I don't need the latest games, but the games I do play damn well better display correctly
 
Old 03-13-2010, 03:24 AM   #11
epsilon72
Member
 
Registered: Mar 2007
Posts: 124

Original Poster
Rep: Reputation: 17
@slimjimmy:
So, I tried it out today.
The good news is: the command you used didn't throw out any sort of error message.

The bad news is: changing resolution to a 4:3 one using the gnome display option still showed a stretched desktop. I didn't get very much of a chance to do much more than that though...hopefully within the next few days I will get to tinker some more with it.

Did you do anything besides enter that command and start the game? Like restart X or anything?

Also, does anyone know if you can include xrandr options in xorg.conf (or for newer xorg, an fdi file) somehow?
 
Old 03-14-2010, 04:47 PM   #12
epsilon72
Member
 
Registered: Mar 2007
Posts: 124

Original Poster
Rep: Reputation: 17
I can't get this thing to work. As I said the command executes without any errors, but it doesn't seem to be doing anything.

I'm going to try a live cd of fedora this week hopefully, and see if I can get it to work there. It may just be buggy ubuntu causing the problem.

Seriously, Ubuntu has always been a buggy mess for me every time I try it...makes me wish I would've installed Debian, suse, or fedora on my friend's computer Even changing resolutions with xrandr makes X totally explode.
 
Old 03-15-2010, 03:09 AM   #13
Tuttle
Senior Member
 
Registered: Jul 2003
Location: Wellington, NZ
Distribution: mainly slackware
Posts: 1,291

Rep: Reputation: 52
Quote:
Originally Posted by epsilon72 View Post
I can't get this thing to work. As I said the command executes without any errors, but it doesn't seem to be doing anything.

I'm going to try a live cd of fedora this week hopefully, and see if I can get it to work there. It may just be buggy ubuntu causing the problem.

Seriously, Ubuntu has always been a buggy mess for me every time I try it...makes me wish I would've installed Debian, suse, or fedora on my friend's computer Even changing resolutions with xrandr makes X totally explode.
I agree to some degree, their X management is too dumb for me, I like to be able to CTRL+ALT+backpace, go to lower runlevels (without things respawning) and use the command line occasionally!
 
Old 03-18-2010, 06:47 PM   #14
epsilon72
Member
 
Registered: Mar 2007
Posts: 124

Original Poster
Rep: Reputation: 17
I've just confirmed that
Code:
xrandr --output LVDS1 --set "scaling mode" "Full aspect"
DOES indeed work with this machine and Fedora 12. This leads me to think that:

1)Ubuntu's Intel driver needs to be more up-to-date to support this,
or
2)Ubuntu's modifications to the kernel, driver, or programs break this functionality.

I really hope it is 1), and not 2), because then Lucid might provide a fix.
 
Old 03-19-2010, 06:45 PM   #15
epsilon72
Member
 
Registered: Mar 2007
Posts: 124

Original Poster
Rep: Reputation: 17
After a failed attempt at upgrading the computer to Lucid (and pissing my friend off in the process ) I've switched this machine over to Debian Sid.

Using the xorg intel driver of version 2.9.1 rather than 2.9.0 seems to be the key.

Marking as solved.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MPlayer 16:10 Aspect Ratio Linkhiei Linux - Software 9 01-18-2012 06:26 PM
Aspect ratio problems! genderbender Linux - Laptop and Netbook 1 04-13-2005 11:24 PM
16/9 aspect ratio abby_normal Linux - Software 4 11-03-2003 04:40 PM
16:9 aspect ratio resolution possible? rikw Linux - Software 0 09-04-2001 10:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration