Kasperian Moving Parts

kinda like Batman, but with a wife and 3 kids

Modeline Generation and Xinerama Info

| 9 Comments

So, I’m trying to think positively about the 3-hour battle I just had with X. I learned 2 new things today, which I didn’t really want to learn but yay nonetheless.

First, Xinerama. I’m going to be doing multiple monitor stuff for work, which should be really interesting if I can keep my self-imposed stress level down. I have never had more than a single monitor to use on any given desktop or laptop until I started working at VMware, and as such I am currently less than clueful with how all of this stuff works in X. (As an aside, if anyone can refer me to some really good documentation or multi-head/multi-screen/multi-monitor/multi-display Linux/X resources, I’d greatly appreciate it!) So today I was looking into a bug report that had to do with a Twinview side-by-side display configuration, and I discovered that “xdpyinfo -ext XINERAMA” will tell you what the screen topology looks like currently. For example, my normal Twinview cloned 1680×1050 setup looks like this:

XINERAMA version 1.1 opcode: 158
head #0: 1680×1050 @ 0,0

… whereas if I change it to a side-by-side 1680×1050 configuration, I believe it will show this:

XINERAMA version 1.1 opcode: 158
head #0: 1680×1050 @ 0,0
head #1: 1680×1050 @ 1600,0

(I can’t be certain since apparently in all of my fiddling, I disabled Xinerama in my /etc/X11/xorg.conf file and currently, it shows me this: XINERAMA version 1.1 opcode: 158 head #0: 3360×1050 @ 0,0 *sigh*) This is coolness that I’m sure I’ll be needing to use frequently in the coming months.

Secondly, Modelines. Now, honestly, it’s been years since I’ve had to worry about manually putting Modelines into my XF86Config/xorg.conf files. X has gotten much better since those bad old days and things have pretty much Just Worked (TM). Although I still do fondly remember the days of working with some hard-core X hackers in trying to get my laptop display drivers working (like 10 years ago??) But somewhere between my Ubuntu 8.04 installation and my current OpenSUSE 11 installation, X no longer thinks that it should allow me to output a 1680×1050 resolution to my external monitor (a Dell 2007FPb). I disagree strongly. =;D Unfortunately, my Lenovo T61 laptop looks like crap unless it displays in its native resolution of 1680×1050, so in Ubuntu Hardy, I became accustomed to doing the cloned twinview 1680×1050 thing. Like I said, something broke this when I went to OpenSUSE 11. I’m guessing it’s a newer X version. But anyway, after a whole lotta Google action, I came across a post that suggested another dude use the “gtf” command to find a good X11 Modeline. Wow, cool!! Here’s what it does:

$ gtf 1680 1050 60

# 1680×1050 @ 60.00 Hz (GTF) hsync: 65.22 kHz; pclk: 147.14 MHz
Modeline “1680x1050_60.00”   147.14   1680 1784 1968 2256    1050 1051 1054 1087   -HSync +Vsync

Awesome!!! I don’t know if this little tool didn’t exist back in the bad old days when X required you to enter this or if I just didn’t know about it, but this would have saved me lots of agony over the years had I known about it. =:) I copied/pasted that into my /etc/X11/xorg.conf inside the Monitor section for my Dell 2007FP, restarted X, and now nvidia-settings will kindly let me use 1680×1050 resolution again. YAY!

Author: Jason 'vanRijn' Kasper

My name is Jason 'vanRijn' Kasper. I am the ring leader of the amazing Kasper family. I am unashamedly a Christian Nerd. These are our stories....

9 Comments

  1. Part of your problems come from using an nvidia card, which provides the non-standard twinview rather than xrandr 1.2 ( http://www.thinkwiki.org/wiki/Xorg_RandR_1.2 ).

    Since xrandr 1.2, I haven’t had to fiddle around with xorg.conf anymore, and switching from single head to dual head to clone mode is as simple as entering a single xrandr command. And the great thing about xrandr is that the two monitors don’t have to have the same size. My laptop has a resolution of 1440×900, and I regularly combine it into an extended desktop with an external monitor of resolution 1400×1050.

    xrandr also allows you to add modelines in case they should be missing; but if you are running your external monitor at its native resolution, that shouldn’t be necessary.

  2. Hey AC! Hm. Unfortunately, I don’t have a choice about the nvidia card being that this is a laptop and I can’t swap it out. =:(

  3. I’m using the nvidia driver on my Ubuntu desktop too but I get a flood of output when I run `xdpyinfo -ext XINERAMA`, not just the few lines you get.

  4. When I run 2x 1680×1050 Monitors side by side I used to do the following (I think this may be what you are after, though my memory of it is a bit flaky, sorry!)

    sudo apt-get install nvidia-settings
    sudo nvidia-settings

    enable xinerama in nvidia-settings, then switch to twinview (from what I remember xinerama was a checkbox in earlier versions)

    That would give me 2x 1680×1050 side by side, without opening a new session per screen, and without the toolbar spanning both screens.

  5. @Tony: Yeah, me too. Sorry to be confusing. I get a whole lot of info, but then the Xinerama info at the end. The stuff in front of it is the standard xdpyinfo output that you get without adding a -ext. =:)

    @Tom Mann: Yeah you’re right. Either that or just manually change

    Option “Xinerama” “0”

    to

    Option “Xinerama” “1”

    manually. =:)

  6. I was introduced to gtf some years ago, yes in the ‘bad old days’, and thought it wonderful. Sadly memory failure has caused me to give hours to trying to remember its name. Your blog has given one of my monitors a new lease of life 🙂

  7. @Anne Wilson: YAY!! =:) Glad to hear it helped. I was pretty stoked to hear about this little tool too!!

  8. I just upgraded from Ubuntu 8.04 to 8.10 and found out a crucial modeline disappeared in the process from my xorg.conf.

    Thanks to this post, I was able to generate it with gtf and add it back manually.

    Thanks!

  9. Hey Marlon! Glad to hear it helped!! =:)

Leave a Reply

Required fields are marked *.


 

This site uses Akismet to reduce spam. Learn how your comment data is processed.