Updates on URandR

A few days ago I decided to have a deeper look at the API of the Python bindings for Xrandr (pyxrandr) written by Sebastian Heinlein and Michael Vogt. While I must admit that they did a good work with the bindings I’m still not completely satisfied with what I can do with them. This is not a complaint, actually I’m quite happy since it will give me a reason to learn C and complete the bindings myself (when I have the time). In the meantime I will use such bindings in URandR in at least 2 ways:

1) To achieve compatibility with drivers which support only RandR 1.1 (such as “nvidia”, “fglrx”, etc.)
2) To drop hardcoded names of the outputs for the sake of a more dynamic detection

As regards point 1, this screenshot shows how URandR works with NVIDIA’s proprietary driver as well:
URandR with the NVIDIA driver

If a driver doesn’t support RandR 1.2 you will only be able to change its resolution, refresh rate and to rotate the screen. This means that I won’t have to check which driver you’re using by reading your “/proc/$(pidof X)/maps”, which requires having root permissions. If URandR can get the current rotation of the screen through the xrandr bindings then the driver supports RandR 1.2, otherwise URandR will use compatibility mode.

Thanks to point 2 I won’t have to worry about the names by which each driver refers to output connections. For example this table contains the names of the outputs used by the ATI (radeon) driver and by the Intel driver:

Ati
(radeon)
Intel
VGA-0 VGA
LVDS LVDS
DVI-0 TMDS-1
S-video TV

I assume that drivers such as radeonhd, nouveau, etc. which support RandR 1.2 use other names. Fortunately I’ll no longer have to deal with their idiosyncrasies (directly) since the xrandr python bindings give URandR access to such names at runtime. Another thing I won’t have to worry about is the number of monitors, tvs, etc. that you connect to your graphic card. If you can connect 20 screens at the same time (provided that such thing is possible and that the driver supports it) URandR will detect them all. Thanks to these changes I was able to improve my own detection library (which is *a bit* more readable) and to make it much more dynamic as well.

Here are my plans for the next release of URandR:

* Support for RandR 1.x (DONE)
* Support for any driver which supports RandR 1.2 (DONE)
* PolicyKit integration – so that you don’t have to
be root in order to run URandR and that if the
framebuffer is not enough URandR can ask your
root password only to set the virtual resolution
in your xorg.conf
* When you apply your settings, things can go wrong,
therefore URandR will show a dialog with a countdown
and a button which, if not clicked in time (if for example
you disabled your main screen by mistake), will revert to
your previous settings.

When the new URandR is ready I will work on an alternative interface in QT4.

Here are a two screenshots of URandR with the Intel driver with my laptop screen (LVDS) (virtually) positioned to the left of an external monitor (VGA):

Multiple screens

URandR

As you can see, each output has its own place in the treeview instead of having its own tab.

When will all this be available? I don’t know, however I’m going to graduate (yes, again…) next week therefore I guess I’ll have (relatively, as usual…) plenty of time to work on URandR.

22 thoughts on “Updates on URandR

  1. I’m glad to hear from this project again. I’ve been using the previous version with Intel GMA 945 on a laptop (i810 driver) and could manage well the laptop & tv separate resolutions.

    Could be possible to add an “overscan” feature for the tv-out with i810 driver?

    I tried nvtv with no success.

  2. Can we get a “testing” release? 😀

    I’m ‘desperate’ to get this tool working for nVidia cards 😉

  3. wow this will be very useful for intel video cards owner… it was very difficult to get an external monitor working fine in clone mode with KDE’s default tool!!!

  4. nvidia-settings fails a lot for me ( multihead ). If I setup a second monitor, I get low-res on the main one ( Laptop ).

    Any chance that this new version helps nvidia users?

  5. @Carlos
    Unfortunately (currently) the NVIDIA (proprietary) driver doesn’t support RandR 1.2 (only 1.1, I guess) therefore you won’t be able to set up multiple screens with my program. You will only be able to change the resolution and the refresh rate.

    The nouveau driver, however, supports RandR 1.2 and so does the “nv” driver (but only with Geforce 8xxx or higher).

  6. So, if I want decent multihead with nvidia 8XXX, should I use nv instead on nvidia? I don’t do 3D ( only desktop effects ), so I prefer multihead, rather than 3D perfomance.

  7. I’m using URandR with an intel gma 945 card. I can get dual head laptop + crt but then I lose aiglx.

    Am I doing something wrong or it’s supposed to be that way?

  8. @Alejandro
    It’s likely that framebuffer was not enough to contain both screens therefore a virtual resolution was set and this made you lose direct rendering. It depends on the card and there’s nothing I can do about it.

    To get direct rendering back just remove the virtual resolution (you can use the button in URandR to clear your settings) and restart the Xserver. You will lose dual head though.

    @Carlos
    Desktop effects require 3D acceleration.

  9. I tried your application and it already works fine!!
    I’ve got only one problem (I don’t know if it depends to my Intel X3100 video card, to RandR or to your app).
    I tried to connect my lcd monitor (Max res. 1280×1024) to my laptop (Max res. 1280×800) in clone mode: well I can’t get the same resolution for both, because when i tried to set 1024×768 (which is supported by both screens) I got a 1280×1024 res, which causes a cut of the desktop in the laptop screen!!

    P.S.:I succesfully installed the Ubuntu debian package in Debian Sid, great!

  10. I’m using ATI 8.3 installed by envyng, so randr 1.2, so I can’t connect an other monitor on my laptop.

    Release ! Release !
    I expect this will happen very soonly !

    Thx for EnvyNG and Urandr !

  11. I am trying to get an HP L1706 to work as an external monitor on my Latitude C610 running Gutsy 7.10 with ATI Mobility Radeon. Downloaded and tried to install urandr and I keep getting:

    Error: Dependency is not satisfiable: python-support

    If I try to install python-support it states python-support is already installed!

    Any ideas?

  12. I’m having lots of problems using my nvidia 6800gs with my Samsung HDTV (720p) I’m getting lots of overscan at the top and bottom of the screen.I’m running Ubuntu Hardy and am connected DVI-HDMI.Will URandR help with this? I don’t want to go down the modeline route!!!!

  13. @Darth_Bane
    Sorry but the NVIDIA driver doesn’t support RandR 1.2

    @Baz
    what’s the output of this command?
    sudo aptitude search python-support

  14. Hi!
    I have exactly the same problem as Baz:
    “Error: Dependency is not satisfiable: python-support”
    Everything is installed. Any ideas?
    Thanks for all the contribution!

  15. oh – I just saw your reply fro Baz:
    my output of
    sudo aptitude search python-support is:

    i python-support – automated rebuilding support for python modules

    cheers,
    bh

  16. I’m trying to add another monitor to my laptop, and use an “extendend desktop”

    but always the external monitor is taken as “Display 1”

    There is a way that my laptop screen will be the “Display 1” and the external monitor will be the “Display 2” ?

Leave a Reply

Your email address will not be published. Required fields are marked *

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