You are not logged in.

#1 2012-11-02 12:05:18

fruktstav
Member
Registered: 2012-10-31
Posts: 6

[xrandr] Cannot add desired custom resolution to the correct output

Hello revered Archians!

I recently bought a low end netbook with a broken monitor for a 40 bucks. I was planning on using my iPad as a monitor for this screen by using a VNC-viewer app on the iPad and a corresponding server on my Arch PC (well, actually I'm using Manjaro which is a prebuilt Arch with all necessities preinstalled, works great I recommend it for all your technically impaired friends who wants to get into linux without taking the same path as everyone else [Ubuntu]).

I have managed to get everything working perfectly with the x11vnc-server, except for one slight detail, namely getting the resolution right.

As I have the iPad 3 with the phenomenal resolution of 2048x1536 at 264 dpi which I obviously want to use the entirety of I start off by adding a custom resolution with xrandr.

Initial output of xrandr -q:

Screen 0: minimum 320 x 200, current 1024 x 600, maximum 4096 x 4096
LVDS1 connected 1024x600+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x600       60.0*+
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 disconnected (normal left inverted right x axis y axis)

So what I want to do now is to add the 2048x1536 resolution option to output 'LVDS1'.  This is accomplised by getting the modeline from gtf:

$ gtf 2048 1536 60.00

  # 2048x1536 @ 60.00 Hz (GTF) hsync: 95.34 kHz; pclk: 266.95 MHz
  Modeline "2048x1536_60.00"  266.95  2048 2200 2424 2800  1536 1537 1540 1589  -HSync +Vsync

Consequently, I run to xrandr --addmode command to add the desired configuration for use with xrandr like so:

$ xrandr --newmode "2048x1536_60.00"  266.95  2048 2200 2424 2800  1536 1537 1540 1589  -HSync +Vsync

No problems here, so I move on to adding this new configuration to output 'LVDS1':

$ xrandr --addmode LVDS1 2048x1536_60.00

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  149 (RANDR)
  Minor opcode of failed request:  18 (RRAddOutputMode)
  Serial number of failed request:  25
  Current serial number in output stream:  26

Ah shoot. What's this then? The weirdest part is that I don't get any errors when I exchange LVDS1 for VGA1, but when I run the x11vnc-server it renders the desktop as the current LVDS1-resolution and not the VGA1-resolution, which gives me a 1024x600 desktop in a 2048x1536 frame where the pixels not represented in the LVDS1 resolution only shows black.

So, what I need assistance with is either setting LVDS1 to  the right resolution or setting x11vnc to run from the VGA1 output (maybe set it as primary in some way? isHello revered Archians!

I recently bought a low end netbook with a broken monitor for a 40 bucks. I was planning on using my iPad as a monitor for this screen by using a VNC-viewer app on the iPad and a corresponding server on my Arch PC (well, actually I'm using Manjaro which is a prebuilt Arch with all necessities preinstalled, works great I recommend it for all your technically impaired friends who wants to get into linux without taking the same path as everyone else [Ubuntu]).

I have managed to get everything working perfectly with the x11vnc-server, except for one slight detail, namely getting the resolution right.

As I have the iPad 3 with the phenomenal resolution of 2048x1536 at 264 dpi which I obviously want to use the entirety of I start off by adding a custom resolution with xrandr.

Initial output of xrandr -q:

Screen 0: minimum 320 x 200, current 1024 x 600, maximum 4096 x 4096
LVDS1 connected 1024x600+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x600       60.0*+
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 disconnected (normal left inverted right x axis y axis)

So what I want to do now is to add the 2048x1536 resolution option to output 'LVDS1'.  This is accomplised by getting the modeline from gtf:

$ gtf 2048 1536 60.00

  # 2048x1536 @ 60.00 Hz (GTF) hsync: 95.34 kHz; pclk: 266.95 MHz
  Modeline "2048x1536_60.00"  266.95  2048 2200 2424 2800  1536 1537 1540 1589  -HSync +Vsync

Consequently, I run to xrandr --addmode command to add the desired configuration for use with xrandr like so:

$ xrandr --newmode "2048x1536_60.00"  266.95  2048 2200 2424 2800  1536 1537 1540 1589  -HSync +Vsync

No problems here, so I move on to adding this new configuration to output 'LVDS1':

$ xrandr --addmode LVDS1 2048x1536_60.00

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  149 (RANDR)
  Minor opcode of failed request:  18 (RRAddOutputMode)
  Serial number of failed request:  25
  Current serial number in output stream:  26

Ah shoot. What's this then? The weirdest part is that I don't get any errors when I exchange LVDS1 for VGA1, but when I run the x11vnc-server it renders the desktop as the current LVDS1-resolution and not the VGA1-resolution, which gives me a 1024x600 desktop in a 2048x1536 frame where the pixels not represented in the LVDS1 resolution only shows black.

So, what I need assistance with is either setting the correct resolution for LVDS1 or alternatively start the x11vnc-server wit the option of using VGA1 as the source instead of LVDS1 (maybe setting the VGA1-output as primary before starting the server?).

Any help would be greatly appreciated! Have a wonderful Friday!

Offline

#2 2012-11-02 12:17:18

Gusar
Member
Registered: 2009-08-25
Posts: 3,472

Re: [xrandr] Cannot add desired custom resolution to the correct output

The netbook's display is 1024x600, you can't expect it to switch to 2048x1536. You could play around with panning. But since the display doesn't work, I suggest you run Xvnc (from tigervnc) instead of a native X server. Xvnc will also be faster than x11vnc too. Simply install tigervnc, then start a server:

vncserver -geometry 2048x1536

Offline

#3 2012-11-02 14:32:37

fruktstav
Member
Registered: 2012-10-31
Posts: 6

Re: [xrandr] Cannot add desired custom resolution to the correct output

Thanks for your reply!

I have actually been looking at tigervnc, but I have no idea how to configure the ~/.vnc/xstartup
file properly. When using this config:

#!/bin/sh

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

exec startxfce4

I get a black screen on the vnc client when I connect.

I want it to be configured exactly the same way the regular x-server that runs at boot. Actually, I would preferrably have the vnc-server starting at boot with the same settings as the x-server that now starts at logon instead. How do I go about fixing that?

Offline

#4 2012-11-02 14:42:30

Gusar
Member
Registered: 2009-08-25
Posts: 3,472

Re: [xrandr] Cannot add desired custom resolution to the correct output

A new revision has just entered the Arch repository, tigervnc-1.2.0-8, it contains a systemd service to start the server at boot. Read the service file, adjust it to your liking (add the geometry option to the ExecStart line).

About xstartup, try with just the exec line and nothing else. If that won't do it, try with a simple "startxfce4".

Offline

#5 2012-11-02 15:05:03

fruktstav
Member
Registered: 2012-10-31
Posts: 6

Re: [xrandr] Cannot add desired custom resolution to the correct output

Thank you for replying so quickly!

I can't seem to find it in pacman.. Only the older (-7) version can be found..

Maybe there's a repository that I don't have installed hosting that version.

Can you direct me in adding all official Arch-repositories?

*EDIT*

Followed your instructions concering the xstartup-config without success;
I did however notice that there seems to be a problem with the xfce-session manager.

Here's the .log-file output:

Xvnc TigerVNC 1.2.0 - built Jul 17 2012 11:27:40
Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 11203000, The X.Org Foundation


Fri Nov  2 16:15:45 2012
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on all interface(s), port 5902
 vncext:      created VNC server for screen 0
/usr/bin/startxfce4: X server already running on display :2
xfce4-session: Another session manager is already running
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":2"
      after 112 requests (112 known processed) with 0 events remaining.

Would it work if I initate the xvnc-server by using killall xfce4*|vncserver -geometry xx:xx ?

Last edited by fruktstav (2012-11-02 15:20:18)

Offline

#6 2012-11-02 15:41:27

Gusar
Member
Registered: 2009-08-25
Posts: 3,472

Re: [xrandr] Cannot add desired custom resolution to the correct output

It seems you've made a mess playing around with stuff trying to get it working. It appears you have multiple Xvnc instances running, who knows what state each is in. I suggest you start fresh - kill all Xvnc instances, delete all log and pid files from ~/.vnc and reboot. Yes, reboot. This will clean up all the stuff in /tmp. Then, every time you want to change xstartup, shut down the server beforehand with "vncserver -kill :1"

About the tigervnc version, like I said, -8 is very new. Your mirror may not have it yet. But it will for sure in a few hours.

Offline

Board footer

Powered by FluxBB