Tag Archives: linux

gnome-shell missing characters and display corruption with Xorg and radeon

After connecting an external monitor to the HDMI port of my laptop (featuring an AMD/ATI Mobility Radeon HD 5470 graphics card with 512 MB video memory, interfaced by Xorg’s open-source radeon driver), the title bar of gnome-shell version 3.6.2 was missing letters

gnome-shell corrupted title bar radeon xorg

The gnome-shell’s title bar is missing letters on the external monitor.

Sometimes, even the entire display was heavilly corrupted. Interestingly, restarting the gnome-shell

ALT-F2 + 'r'

resolved the problems in all cases. Researching the problem turned out to be quite cumbersome, given that the zoo of graphic related bugs is quite tremendous. Finally, this post here brought me onto the right track.

Video Memory vs. GART/GTT Memory

Typically, a graphics card is equipped with memory, the so called video memory. In my case, this amounted to 512 MegaBytes. Apart from its internal memory, the graphics card is given direct access to system memory (RAM). The RAM assigned to the graphics card is called GART or GTT memory. Its size is set by the kernel module and can be obtained from dmesg,

dmesg | grep GTT

and is usually set to the video memory size by default:

[    2.3462] [drm] radeon: 512M of GTT memory ready.

The Xorg server inherits the kernel module’s settings (plus/minus epsilon), as the output of

cat /var/log/Xorg.0.log | grep gart

verifies,

[    24.201] (II) RADEON(0): mem size init: gart size :1fdff000 vram size: s:20000000 visible:fba0000

Please note that 0x1fdff000 / (1024*1024) = 510 MegaBytes.

A Solution to the Problem

Providing more GART/GTT memory to the graphics card solves the problem. This can be achieved by either adding

radeon.gartsize=1024

to the kernel boot command-line or by configuring a permanent parameter for the kernel’s radeon module. This is done by creating a file called radeon.conf or similar in

/etc/modprobe.d/

and adding a single line

options radeon gartsize=1024

to this file. Finally note that on Debian-based systems you must run

sudo update-initramfs -u

after adding a file to /etc/modprobe.d.

Dual-head Monitor Setup on Ubuntu Linux with Xorg and radeon

Let me briefly summarize two methods to configure a dual-head setup with an external monitor connected to a laptop’s HDMI port on Ubuntu Linux 12.10 Natty. My setup includes a Lenovo Z565 laptop with an AMD/ATI Mobility Radeon HD 5470 graphics card and a Samsung S24A650D monitor. We assume that we rely Xorg’s open-source radeon driver throughout the tutorial.

Dynamic Configuration

We will use xrandr to configure a temporary dual-head setup during runtime. After connecting the monitor to the laptop, obtain the labels the system assigned to the monitors by a

xrandr -q

In my case, the output read

Screen 0: minimum 320 x 200, current 1920 x 1848, maximum 8192 x 8192
LVDS connected 1366x768+0+1080 (normal left inverted right x axis y axis) 0mm x 0mm
   1366x768       60.0*+
   1280x720       59.9  
   1152x768       59.8  
 (...) 
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 531mm x 299mm
   1920x1080      60.0*+   50.0  
   1600x1200      60.0  
   1680x1050      59.9  
 (...)
VGA-0 disconnected (normal left inverted right x axis y axis)

The laptop’s internal monitor is called LVDS and the external monitor HDMI-0. By another call to xrandr, we activate the dual-head setup:

xrandr --output HDMI-0 --primary --left-of LVDS

The command line is to be understood literally: The HDMI monitor shall be the primary screen (e.g. displaying gnome’s titlebar) and shall be positioned left of the laptop’s internal monitor. For other placements, see xrandr’s –left-of, –right-of, –above and –below options or the very general –pos argument.

Permanent Configuration

For a permanent static configuration of a dual-head setup, we create a configuration file for the X server with an editor of your choice,

/etc/X11/xorg.conf

You will need root privileges for this. The contents of xorg.conf is as follows:

Section "Device"
        Identifier      "Mobility Radeon HD 5400 Series"
        Driver          "radeon"
        Option          "monitor-LVDS" "monitor_internal"
        Option          "monitor-HDMI-0" "monitor_external"
EndSection

Section "Monitor"
        Identifier      "monitor_internal"
        Option          "RightOf" "monitor_external"
EndSection

Section "Monitor"
        Identifier      "monitor_external"
        Option          "Primary" "true"
EndSection

In the device section, we specify to use Xorgs’s open source radeon driver and setup two aliases for the monitors. Please note that the monitor ID is composed of the static prefix monitor- and the monitor label as returned by xrandr -q (see above). The remaining configuration places the laptop’s internal monitor right of the external monitor. The latter is configured to be the primary screen.

Further Information

For more information, have a look at

  • Xorg’s documentation of the radeon driver
  • An article at Intel about configuring dual-head setups
  • and the man pages for the radeon driver (man radeon) and xrandr (man xrandr)

SVN over SSH with multiple svn users and a single unix account without shell access (Unix / Linux client configuration)

Our goal in this three part tutorial is to provide multiple users access to a SVN server running a recent version of Ubuntu Linux through the SSH protocol. In SVN language, this combination of protocols is called svn+ssh. The straight forward way would be to create a unix user account for every SVN user and let them tunnel to the SVN server. However, giving all these users shell access to the server is a potential security issue and goes far beyond the initial purpose of just giving access to the SVN server. As a solution, we will create a single unix user account, that is not allowed to have any shell access, and let the SVN users connect through this user account to the SVN server.

This second part of the tutorial focusses on the configuration of a Unix / Linux client. It is fairly distribution independant and will work on all of Ubuntu, Fedora, Suse, Debian, Mint and beyond. The first part of the tutorial managed the server-side configuration whereas the last and thrid part illustrates the client-side configuration on Windows platforms.

Client-side configuration on Unix / Linux systems

As stated in the server-side configuration, the private key file id_rsa needs to be distributed to the user on the client side. He or she will use the private key to connect to the SVN server. As the private key is enough to establish the connection, it needs to be stored in a safe place on the computer (and may be additionally secured by a password, see ssh-keygen above).

In general, the server’s URL in the svn command configures the protocol to be used. So

svn list svn+ssh://sshsvn@SERVER_ADDRESS/@

will establish a connection to the SVN server at SERVER_ADDRESS via the combination of SSH and SVN protocols for SSH user sshsvn (remember that we connect to the server as user sshsvn and distinguish different SVN users by the used private key). Please note the trailing @ that is necessary to access the SVN server’s root level. If you get

svn: Syntax error parsing revision 'SERVER_ADDRESS'

errors, you forget the trailing @.

But how to tell the svn command to use the provided private key? There are two solutions for this. First, we may add the private key to the SSH authentication agent,

ssh-add /path/to/id_rsa

Please note that this adds the private key only temporarily. For permanant solutions, see here for example.

The second and preferred way for me is to set the SSH command to be used by SVN with the SVN_SSH environment variable,

SVN_SSH="ssh -i /path/to/id_rsa" svn list svn+ssh://sshsvn@SERVER_ADDRESS/@

Summary

We have seen how to connect from a Unix / Linux system to a SSH/SVN server with a private key for the SSH connection. The server will decide upon the matching public key which SVN user account is used for the SVN connection.

Further Reading

Apart from the man pages of the referenced commands, the main sources for this tutorial have been

This is part two in a series of three tutorials:

Ubuntu 12.04 LTS Precise Pangolin – gnome-shell does not start

After activating the Screen Keyboard in the Typing tab of the Universal Access dialog in System Settings, my Gnome Shell display freezed. After restarting the X server and logging into my account, the Gnome Shell refused to load. I ended up staring at the default background image and after a while, apport proposed to submit a bug report about a crash in gnome-shell (due to XML input).

In .xsession-errors, I found another hint, that gnome-shell crashed (mind the last line!)

gnome-session[2146]: WARNING: Application 'gnome-shell.desktop' killed by signal
gnome-session[2146]: WARNING: Application 'gnome-shell.desktop' killed by signal
gnome-session[2146]: WARNING: App 'gnome-shell.desktop' respawning too quickly
gnome-session[2146]: CRITICAL: We failed, but the fail whale is dead. Sorry....

and dmesg hinted at a problem in XML input just as apport suggested,

gnome-shell: segfault at 0 ip 00007f5aefcda85e sp 00007fff17afac60 error 4 in libxml2.so.2.7.8[7f5aefc8d000+151000]
gnome-shell: segfault at 1f730a0 ip 0000000001f730a0 sp 00007fffce54ffc8 error 15

Suspecting that the activated screen keyboard is the problem, start a Gnome Classic (No Effects) session. For this, click on the small wheel icon in the top right corner of your login box. In Gnome Classic, revert your screen keyboard settings in the system settings dialog and deactivate the screen keyboard.

This will let you login to the Gnome Shell again.

drwright – A typing break application for Gnome and Unity on Ubuntu 12.04

Having worked on computers for years, I learned to appreciate typing break applications that remind me regularly of focussing my eyes on something else than the screen in front of me. Moreover, giving the hands a break from typing is a recommended prevention from Repetitive strain injuries (RSI). As break remainders popping up dialogs turned out to be ineffective for me, I soon started to use applications blocking the entire screen for a certain amount of time. This post shortly describes how to install such a typing break application for Gnome 3 and Unity on Ubuntu 12.04.

On Gnome 2, a native typing break plugin included in gnome’s core did a wonderful job. This plugin did not make it into gnome 3, and I have used good old xwrits as a replacement for nearly a year now. With Ubuntu 12.04, I was having another look around: I have used workrave  before on Windows, and as it still does not support locking the entire screen, workrave is not an option. The more I was excited to learn about drwright. This is the original Gnome 2 typing break plugin that is now continued as actively developed and separate component for Gnome 3 and Unity.

Drwright is not included in the main Ubuntu distribution but is availble through a PPA.
I shortly repeat the installation steps here to install and configure drwright.

Add the PPA’s package source to your sources list:

sudo add-apt-repository ppa:drwright/stable

(This step requires root privileges, so enter your superuser password when asked to do so)

Update your system’s list of available packages:

sudo aptitude update

Install drwright

sudo aptitude install drwright

Log out and log back into gnome to finally find a new icon in the Personal section of your gnome system settings (Applications -> System Settings) called Typing Break.

And in case you ever need back screen access during a typing break, change to the console (ctrl alt F1), login and kill the drwright process,

sudo killall /usr/lib/drwright/drwright/gnome-typing-monitor.

TeX Live on Ubuntu – Why fontspec does not work with LuaLaTeX on Ubuntu 12.04

Recently, I was catching up with developments in the TeX world. With xetex and luatex being serious replacements for good old pdftex by now, I wanted to give them a try on a recent Ubuntu machine. Trying to compile this minimalistic lualatex code

\documentclass{article}
\usepackage{fontspec}
\begin{document}
The quick brown fox jumps over the lazy dog.
\end{document}

I ended up with the error message

********************************************
* XeTeX is required to compile this document.
* Sorry!
********************************************

Wondering, what the problem might be, I learned that fontspec was originally developped for XeTeX. lualatex support was added with version 2.0 released in 2010.

When it comes to LaTeX support, Debian (and with it Ubuntu) include the TeX Live distribution. Being one of the most popular LaTeX distributions, TeX Live included the new fontspec packages from version 2010 onwards. However, as of Ubuntu 12.04 LTS Precise, the TeX Live packages are
still at version 2009.

As reasons for this, the immense packaging work necessary to get TeX Live into Debian is quoted, see here for example. This means that without further ado, LuaLaTeX on Ubuntu will not work with fontspec (and will be pretty outdated anyway).

The good news is that things are about to change. In March 2012, the latest TeX Live packages entered Debian experimental and started their way through the Debian package queue. At the time of writing, they made it to unstable; unfortunately too late to enter Ubuntu 12.04. From what I know about the Debian to Ubuntu package updates, chances are good a recent TeX Live version will make it into the next Ubuntu version 12.10.

In the meantime, you will find instructions on how to directly install TeX Live on Ubuntu or, if you are using an i386 system, may use the TeX Live backports from this Ubuntu PPA.