Tuesday, 25 May 2010

Recording OpenGL applications

Recording software like Istanbul or recordMyDesktop are very useful when recording regular programs, but when it comes to recording OpenGL applications (like games) they are not good, and we need a real-time video capture tool designed to capture OpenGL applications efficiently. One of this applications is glc (another one I tried sometime ago was yukon).

So I gave glc a try, in order to record a car racing game called Speed Dreams. In Ubuntu 9.10 installation of both Speed Dreams and glc is very easy thanks to PlayDeb.net. Once the Speed Dreams was installed, the only problem with it was the sound, which is a known problem in Ubuntu 9.10 with some games. The best solution came from the Ubuntu Forums and involved adding these lines to the file /etc/pulse/daemon.conf:


default-fragments = 5
default-fragment-size =25


Previously I had "solved" the sound problem by creating a file named .alsoftrc, but with that solution no sound was recorded with glc, so I deleted that file.

Once this was in place, we can follow the glc instructions to record a new game, for instance:


angelv@vaiven:~$ glc-capture -o newspeed.glc -k 'F12' speed-dreams


And in order to encode it, we can do it with the encode.sh script (see http://nullkey.ath.cx/projects/glc/wiki/HowtoEncode), although I got a simpler script from http://ubuntuforums.org/archive/index.php/t-587935.html, that works as well:


angelv@vaiven:~$ cat glc-encode
#!/bin/bash
AUDIOFILE=$(echo $1 | sed 's/.glc/.mp3/')
RESULTFILE=$(echo $1 | sed 's/.glc/.avi/')

# Extract audio
glc-play $1 -o - -a 1 | lame -hV2 - $AUDIOFILE

# merge audio with .glc video file
glc-play $1 -o - -y 1 | mencoder -demuxer y4m - -audiofile $AUDIOFILE -oac copy -ovc x264 -x264encopts qp=18:pass=1 -of avi -o $RESULTFILE
angelv@vaiven:~$


With this script we just run


angelv@vaiven:~$ ./glc-encode newspeed.glc


and if all is well, this will create newspeed.avi file.

A demo of the result can be seen at Vimeo

Monday, 24 May 2010

Settings for a Tiled Display Wall

As I wrote in a previous post I built a tiled display wall from "scratch". I haven't tried to streamline the process, so there is plenty of room for improvement, but I write here all the notes I took while building it.

My test setting involves 3 PCs and six monitors (two per PC). The "head" node has two network cards, one connected to the "outside" world and the other one connected to a Gigabit router. The "render" nodes only have one network card, connected to the router. The three PC's have NVidia cards.

I decide to give a try to the 9.10 Ubuntu distribution (64 bits), so the first thing is to install Karmic Koala in the head node (vaiven). After an installation without any issues, it is time to configure a few things. First, the network cards. eth1 is identified as the outside card, so I change the DHCP setting for it, and assign it a fixed IP address at our institution. To eth0 I also assign a fixed address (now for the internal network), with IP 192.168.1.1, netmask 255.255.255.0 (no gateway, DNS, etc.). In /etc/hosts I change the line

127.0.1.1 vaiven
to

192.168.1.1 vaiven


I do all the recommended updates (as per 18/5/2010), and install openssh-server, synergy, and emacs.

In the first render node I install Karmic Koala with automatic login. I decide that I'm going to call the render nodes as dwall-XY where X will be the row and Y the column. So, the first one is dwall-11, and the IP address (eth0) will be: 192.168.1.11, with gateway 192.168.1.1, DNS servers and search domains as per eth0 in vaiven.

After the initial installation I want to change some important things:

* In order to access the Internet from the render nodes (hints from http://www.cyberciti.biz/tips/linux-as-router-for-dsl-t1-line-etc.html), in vaiven I modify the file /etc/sysctl.conf so that it contains the line

net.ipv4.ip_forward = 1


And I also modify /etc/rc.local to change the firewall policies:

angelv@vaiven:~$ tail /etc/rc.local
## In order to enable or disable this script just change the execution# bits.
## By default this script does nothing.
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT

exit 0
angelv@vaiven:~$


I restart vaiven, and test from dwall-11 that I can access the Internet. Then I also install all recommended updates (with the Update Manager), and I install openssh-server, synergy and emacs.

* A poor man's KVM

I only have one keyboard and a mouse, so I don't want to get up and change the USB connections all the time, and I don't want to buy a KVM, so I make sure that synergy is installed in both vaiven and dwall-11. I create the following config file in my home directory in vaiven

angelv@vaiven:~$ cat synergy.conf
section: screens
vaiven:
dwall-11:
end
section: links
vaiven:
left = dwall-11
dwall-11:
right = vaiven
end
angelv@vaiven:~$


I make sure that /etc/hosts in both machines have the lines
angelv@dwall-11:~$ cat /etc/hosts
127.0.0.1 localhost
192.168.1.1 vaiven
192.168.1.11 dwall-11[...]


And then I run:

angelv@vaiven:~$ synergys --config synergy.conf
angelv@dwall-11:~$ synergyc vaiven


With this I can move the mouse and use the keyboard in both computers without changing the USB connections.

I restart both computers and verify that dwall-11 logins automatically, that once synergys and synergyc are started I can move the mouse to dwall-11 and back to vaiven, and that I can access the Internet without problems from dwall-11.

One problem that I found with synergy is that some keys in my keyboard don't register (like th "ñ"), but for most purposes it works perfect.

* Share home folders in the cluster.

I install in vaiven nfs-kernel-server and modify the following files:


angelv@vaiven:~$ tail -n 5 /etc/exports
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/home 192.168.1.0/255.255.255.0(rw,sync)

angelv@vaiven:~$ tail -n 10 /etc/hosts.deny

# You may wish to enable this to ensure any programs that don't
# validate looked up hostnames still leave understandable logs. In past
# versions of Debian this has been the default.
# ALL: PARANOID
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL

angelv@vaiven:~$ tail -n 10 /etc/hosts.allow
# daemon name. Remember that you can only use the keyword "ALL" and IP
# addresses (NOT host or domain names) for the portmapper, as well as for
# rpc.mountd (the NFS mount daemon). See portmap(8) and rpc.mountd(8)
# for further information.
#
portmap: 192.168.1.0/255.255.255.0
lockd: 192.168.1.0/255.255.255.0
mountd: 192.168.1.0/255.255.255.0
rquotad: 192.168.1.0/255.255.255.0
statd: 192.168.1.0/255.255.255.0
angelv@vaiven:~$


In dwall-11 I install nfs-common and modify the following files:


angelv@dwall-11:~$ tail -n 5 /etc/fstab
UUID=c9035fea-00c9-4fac-9c41-56409248ffd6 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=c00e80b8-af40-45dc-9516-3c0e80449848 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
192.168.1.1:/home /home nfs rw,hard,intr 0 0
angelv@dwall-11:~$


* Cluster shell environment
In order to be able to control all the computers from a single terminal I install Omnitty. For this I install in vaiven libncurses5-dev and then follow the instructions at http://omnitty.sourceforge.net/.

I also need to link a library file:

sudo ln -s /usr/local/lib/librote.so* /usr/lib/


In a terminal I change the Edit->Keyboard Shortcuts Help->Contents from F1 to Alt-Shift-F1 (since we will need F1 inside Omnitty) and then I create the file dwall

angelv@vaiven:~$ cat dwall
vaiven
dwall-11
angelv@vaiven:~$


With this, when I start Omnitty, by pressing F5 and then typing @dwall, a connection to all the machines in the cluster will be made.

Then, to avoid typing the password everytime I do:

angelv@vaiven:~$ ssh-keygen -t rsa
angelv@vaiven:~$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys


* Removing Ubuntu panels from view.
When displaying in the complete wall, we don't want to see the Ubuntu panels, so in vaiven I remove the panel on the bottom of the screen, and I change the properties in the top one to Autohide. Since this information is stored in the home directory, when I login again in dwall-11, these settings are replicated in there.

* In dwall-11 and vaiven I download and configure the NVidia drivers (System->Administration->Hardware drivers)

* I don't want the monitors in the display wall to go to sleep or to lock, so in dwall-11 in the Screensaver preferences I uncheck "Activate screensaver ..." and "Lock screen when screensaver..." and inside the Screensaver Preferences in Power Management I put "Never" in "Put display to sleep when inactive".


Chromium



It is now time to start configuring Chromium http://chromium.sourceforge.net/, so I download it from http://sourceforge.net/projects/chromium/files/ (version 1.9). The instructions for installation are at: http://chromium.sourceforge.net/doc/chromium2.html

I create two directories in my home to hold de 32 and 64 bits versions. First we go for the 64 version. I enter in cr-1.9, and to compile it we will need first a few things:


angelv@vaiven:~$ sudo ln -s /usr/bin/make /usr/bin/gmake

angelv@vaiven:~/cr-1.9$ sudo apt-get install libglut3-dev libglut g++ libxmu-headers libxmu-dev libjpeg-dev zlib1g-dev libxi-dev


Then, we just run make.

To compile the 32 bits version, I go into cr-1.9-32 and modify the file options.mk so that it contains the line:


FORCE_32BIT_ABI=1


We will need some extra packages (libc6-dev-i386, g++-multilib, ia32-libs and lib32z1-dev) and then we can just run make.

To make Chromium work fine, we need to create some files (for this I follow my previous post my previous post).


angelv@vaiven:~$ cat enable_cr
#!/bin/bash
cd /home/angelv/cr-1.9/lib/Linux
ln -s libcrfaker.so libGL.so.1
ln -s libcrfaker.so libGL.so

cd /home/angelv/cr-1.9-32/lib/Linux
ln -s libcrfaker.so libGL.so.1
ln -s libcrfaker.so libGL.so

angelv@vaiven:~$ cat disable_cr
#!/bin/bash
cd /home/angelv/cr-1.9/lib/Linux
rm libGL.so.1
rm libGL.so

cd /home/angelv/cr-1.9-32/lib/Linux
rm libGL.so.1
rm libGL.so

angelv@vaiven:~$ tail -n 10 .bashrc
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi


export PATH="/home/angelv/cr-1.9/bin/Linux:$PATH"
export LD_LIBRARY_PATH="/home/angelv/cr-1.9/lib/Linux:/home/angelv/cr-1.9-32/lib/Linux:$LD_LIBRARY_PATH"
export CRMOTHERSHIP="vaiven"

angelv@vaiven:~$ cat .crconfigs
* /home/angelv/first_angel.conf %p

angelv@vaiven:~$ cat first_angel.conf
import sys
sys.path.append('/home/angelv/cr-1.9/mothership/server')
from mothership import *

TILE_WIDTH = 1280
TILE_HEIGHT = 2048

appnode = CRApplicationNode('vaiven')
tilesortspu = SPU('tilesort')
appnode.AddSPU(tilesortspu)
appnode.Conf( 'show_cursor', 1 )
cr = CR()
cr.AddNode(appnode)

renderspu = SPU('render')
renderspu.Conf('fullscreen', 1)
#renderspu.Conf('window_geometry', [0, 0, 512, 512])
renderspu.Conf( 'show_cursor', 1 )

node = CRNetworkNode('dwall-11')
node.AddTile(0, 0, TILE_WIDTH, TILE_HEIGHT)
node.AddSPU(renderspu)
node.AutoStart( ["/usr/bin/ssh",'-x',"dwall-11", "/home/angelv/start-crserver.sh 0.0 /home/angelv/cr-1.9/bin/Linux/crserver vaiven 10000 7000"] )

tilesortspu.AddServer(node, protocol='tcpip', port=7000)

cr.AddNode(node)

demo = sys.argv[1]

appnode.SetApplication(demo)

cr.Go()
angelv@vaiven:~$

angelv@vaiven:~$ cat start-crserver.sh
#!/bin/bash
export PATH="/home/angelv/cr-1.9/bin/Linux:$PATH"
export LD_LIBRARY_PATH="/home/angelv/cr-1.9/lib/Linux:/home/angelv/cr-1.9-32/lib/Linux:$LD_LIBRARY_PATH"

export DISPLAY=:$1
$2 -mothership $3:$4 -port $5
angelv@vaiven:~$


and in dwall-11 we install the necessary drivers:

angelv@dwall-11:~$ sudo apt-get install libgl1-mesa-dev


First, for testing, we try Chromium in just one PC (following its instructions:


% cd mothership/configs
% python crdemo.conf atlantis &
% crserver &
% crappfaker


and all is fine (when trying to run this in Ubuntu 10.04 we got problems like angelv@vaiven:~/cr-1.9/mothership/configs$ CR Warning(vaiven:14640): Render SPU: Display :0.0 doesn't have the necessary visual: RGB, Doublebuffer, Z)


Now it is time to try it properly.


angelv@vaiven:~$ ./enable_cr
angelv@vaiven:~$ glxgears
CR Warning(vaiven:22224): the OpenGL faker was loaded without crappfaker!
Defaulting to an application id of -1!
This won't work if you're debugging a parallel application!
In this case, set the CR_APPLICATION_ID_NUMBER environment
variable to the right thing (see opengl_stub/load.c)
CR Warning(vaiven:22224): Using Chromium configuration for * from /home/angelv/.crconfigs
This is Chromium, Version 1.9
Start a crappfaker on vaiven
Autostart for node dwall-11: ['/usr/bin/ssh', '-x', 'dwall-11', '/home/angelv/start-crserver.sh 0.0 /home/angelv/cr-1.9/bin/Linux/crserver vaiven 10000 7000']
Mothership signalling spawning process 22224
CR Info(dwall-11:7033): Total output dimensions = (1280, 2048)
26 frames in 5.1 seconds
26 frames in 5.1 seconds
26 frames in 5.1 seconds
24 frames in 5.1 seconds
24 frames in 5.1 seconds
27 frames in 5.1 seconds


No problems, although it is very slow. To make it work properly, we need to go to Appearance -> Visual Effects, and select None (I do it for both vaiven and dwall-11). With this we are back in business and glxgears works perfectly.

I install in vaiven stellarium (sudo apt-get install stellarium) and works with Chromium without issues.

I try Google Earth (which I download from http://earth.google.com/). No trouble installing it by running the script (although it complains about the cache everytime I start it). To solve the complaining about the cache I have to do:

angelv@vaiven:~$ sudo chown -R angelv:angelv .config/Google/
angelv@vaiven:~$ grep home .config/Google/GoogleEarthPlus.conf
KMLPath=/home/angelv/.googleearth
CachePath=/home/angelv/.googleearth/Cache


Now, in order to run GoogleEarth with Chromium I have to first make a symbolic link and create a couple of files:


angelv@vaiven:~$ ls -lt /usr/lib/libGL.so.1_32
lrwxrwxrwx 1 root root 29 2010-05-20 13:26 /usr/lib/libGL.so.1_32 -> /usr/lib32/libGL.so.185.18.36
angelv@vaiven:~$

angelv@vaiven:~$ cat gl_32.sh
#!/bin/sh

sudo rm /usr/lib/libGL.so.1
sudo ln -s /usr/lib/libGL.so.1_32 /usr/lib/libGL.so.1

angelv@vaiven:~$ cat gl_64.sh
#!/bin/sh

sudo rm /usr/lib/libGL.so.1
sudo ln -s /usr/lib/libGL.so.1_64 /usr/lib/libGL.so.1
angelv@vaiven:~$


And then it runs without issues (except that the we have to turn off the Atmosphere effect).


angelv@vaiven:~$ sudo ./gl_32.sh
angelv@vaiven:~$ googleearth


Adding render nodes

The idea was to use SystemImager to replicate the render nodes, but I found some problems, so for the time being I do it manually and will try to later on figure out a better way of cloning the render nodes.


In dwall-11 I open Synaptic Package Manager and File-> Save Marking As -> (Save full state, not only changes) -> Save (for instance: dwall.packages)

I install a new node (dwall-12) with the Ubuntu 9.10 CD. And then I proceed as follows:

* Configure the network to be 192.168.1.12 (as per dwall-11)
* Copy /etc/hosts and make sure is the same in all the machines (with all the stuff until now).
* Copy to /etc/fstab the line to share the home
* Get the dwall.packages file. Open Synaptic Manager -> Read Markings (dwall.packages) -> Apply
* Wait and reboot dwall-12

After rebooting I need to change a few things in order to include fully the new node in the display wall:

* Modify the dwall file for Omnity
* Modify the synergy.conf file
* System -> Administration -> Hardware drivers (to activate the Nvidia driver) (and copy the xorg.conf file from vavien to dwall-12)

* Modify first_angel.conf

angelv@vaiven:~$ diff first_angel.conf first_angel.conf.ORIGINAL
21,35d20
< node.AddTile(1280, 0, TILE_WIDTH, TILE_HEIGHT)
< node.AddSPU(renderspu)
< node.AutoStart( ["/usr/bin/ssh",'-x',"dwall-11", "/home/angelv/start-crserver.sh 0.0 /home/angelv/cr-1.9/bin/Linux/crserver vaiven 10000 7000"] )
<
< tilesortspu.AddServer(node, protocol='tcpip', port=7000)
<
< cr.AddNode(node)
<
<
< renderspu = SPU('render')
< renderspu.Conf('fullscreen', 1)
< #renderspu.Conf('window_geometry', [0, 0, 512, 512])
< renderspu.Conf( 'show_cursor', 1 )
<
< node = CRNetworkNode('dwall-12')
38c23
< node.AutoStart( ["/usr/bin/ssh",'-x',"dwall-12", "/home/angelv/start-crserver.sh 0.0 /home/angelv/cr-1.9/bin/Linux/crserver vaiven 10000 7000"] )
---
> node.AutoStart( ["/usr/bin/ssh",'-x',"dwall-11", "/home/angelv/start-crserver.sh 0.0 /home/angelv/cr-1.9/bin/Linux/crserver vaiven 10000 7000"] )
angelv@vaiven:~$


And all works excellently: glxgears, googleearth and stellarium. Googleearth working with the Atmosphere effect does not work (as expected).

Software to see images, and to watch videos

* For video, we can try VLC (as suggested in here), with its built-in wall filter. We install VLC (installation of packages always through omnitty, so that we keep all systems synchronized) and create two scripts:


angelv@vaiven:~$ cat vlc-wall_2x2.sh
#!/bin/sh

# cleanup
killall -9 vlc
ssh dwall-11 killall -9 vlc
ssh dwall-12 killall -9 vlc


vlc --aspect-ratio 5:4 --sout '#standard{scale=1,access=udp,mux=ts,dst=224.0.55.55:1234}' --ttl 1 $@ &
cvlc --novideo --vout dummy udp://@224.0.55.55 &


ssh dwall-12 'DISPLAY=:0 cvlc --aspect-ratio 5:4 --noaudio --vout-filter wall --wall-cols 2 --wall-rows 2 --wall-active 0 --fullscreen --xvideo-xineramascreen 0 udp://@224.0.55.55' &

ssh dwall-12 'DISPLAY=:0 cvlc --aspect-ratio 5:4 --noaudio --vout-filter wall --wall-cols 2 --wall-rows 2 --wall-active 2 --fullscreen --xvideo-xineramascreen 1 udp://@224.0.55.55' &

ssh dwall-11 'DISPLAY=:0 cvlc --aspect-ratio 5:4 --noaudio --vout-filter wall --wall-cols 2 --wall-rows 2 --wall-active 1 --fullscreen --xvideo-xineramascreen 0 udp://@224.0.55.55' &

ssh dwall-11 'DISPLAY=:0 cvlc --aspect-ratio 5:4 --noaudio --vout-filter wall --wall-cols 2 --wall-rows 2 --wall-active 3 --fullscreen --xvideo-xineramascreen 1 udp://@224.0.55.55' &


angelv@vaiven:~$ cat vlc-wall-kill.sh
#!/bin/sh

# cleanup
killall -9 vlc
ssh dwall-11 killall -9 vlc
ssh dwall-12 killall -9 vlc

angelv@vaiven:~$


I also modify the file /etc/rc.local and add the line

route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0


I reboot, I open VLC and do "Reset Preferences" and then to watch a video in the 4 monitors we just run the following (when trying to extend it to three computers it does not work OK. The image is shown, but the scales in each of the monitors is different. Apparently this is a known bug, so we should investigate more):


angelv@vaiven:~$ ./vlc-wall_2x2.sh


and when we are done

angelv@vaiven:~$ ./vlc-wall-kill.sh



* For an image viewer we are going to try the TerraServer Blaster

In order to compile it we install an old version of the g++ compiler (g++-4.2), which also installs libstdc++6-4.2-dev (otherwise, when compiling, it complains about not finding iostream.h), we also install the package libfltk-dev, and then change the compiler line in the Makefile to make use of g++-4.2, and then we just run make, which does its thing without problems:


angelv@vaiven:~/tsb-1.3$ file tsb
tsb: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped
angelv@vaiven:~/tsb-1.3$


After enabling Chromium (/home/angelv/enable_cr) TSB works perfectly. The program comes with a nice demo to verify that all is working, which we can call with:

angelv@vaiven:~/tsb-1.3$ ./tsb config-HiRISE.txt


With this in place, and after installing with the package manager Stellarium, Celestia and Paraview we have all we need for the moment working fine, as can be seen in this demo.

PADRE in Linux

This is the first year that the Spanish tax office has provided its tax helper program PADRE for Linux.

This is quite nice, since previous years I had to run it inside a Windows Virtual Machine (for which first I had to get the Windows CDs, etc.). The new version is in Java, and for some reason it didn't want to work properly in my Ubuntu 10.04 box (the first application form to fill in your ID number was not showing properly), but it run flawlessly in the machine with Ubuntu 9.10.

This year the program also includes something quite nice, which is the ability to change quickly from "declaración conjunta" to "declaración individual", so if you are married you can put the data for both of you, and effortlessly change from one version to the other one, so that you can easily see which one turns out better.

In a couple of hours I got all my tax data online, corrected a couple of things, added some that the tax office was not aware of, checked whether it was better for us to submit a "conjunta" or an "individual" one, and printed it off. Not bad at all. Doing your taxes is always a bit painful, but this year was a bit less so.

Thursday, 20 May 2010

Synchronizing newsgroups across different computers


Being a bit old-fashioned, I'm still stuck with newsgroups. I don't read too many of them, but I find them very useful sometimes. The problem is that the protocol seems to be quite old and not amenable for synchronization between different computers. After some time searching for solutions (and thinking about using something like leafnode with the spool option or similar), I'm afraid that the best I came out with is to run a terminal-based news reader at my work computer and connect to it when I'm away from my office. Perhaps not the solution I was looking for, but at least doable and without any trouble. Being an Emacs fan, I did it with Gnus. This is the second time I go back to Gnus... the first one I tried to read all my mail with it, but didn't like it too much... but for news, it looks like it could be quite nice. It was quite easy to set up (despite the documentation style), and this is how it looks when I'm reading one of my subscribed newsgroups (list of free NNTP news servers: here and here).

Wednesday, 19 May 2010

Free software replacement for Skype

Although I have previously posted about running Skype in Ubuntu, I want to follow the spirit of the Free Software Foundation and stay away from Skype, in favour of
free software.

So I have tried (in Ubuntu 9.10) Ekiga, Twinkle, and also Linphone, QuteCom and Kphone.

Ekiga is the one that I would like to use, since I like the interface, but in my netbook I got problems with the audio. First, sound is not produced in all calls. When dialing the "Echo Test" numbers, I get sound in some calls while not in others. Probably it has something to do with having PulseAudio running, but I'm not willing to turn PulseAudio off, so I'm afraid Ekiga for the moment is not ready for my netbook. Another annoying problem is that I cannot get the Front Mic to work.

I had better luck with Twinkle, although the problem with the Front Microphone is also there. It does work in the sense that I can hear part of what I say, but there is an incredible amount of echo, hissing and noises, so it is not usable. With a microphone headset there is no problem and it works rather well, although I haven't done much testing.

Linphone and Kphone did work in my workstation, but the interface was not very appealing, plus there was not (I think) chat capabilities, while QuteCom, while not complaining on installation, did simply not start at all.

So for the moment I'm dumping Skype and sticking with Twinkle. So far I have only tried the "Echo Test" call, but I will try it for a while for real calls and then report back later on.

Monday, 17 May 2010

Mathematica through ssh tunnel

Although I don't use Mathematica, a colleague asked me for help on this. In our setting the licence server for Mathematica listens on port 16286, so to get a PC with Mathematica installed (but without a license) to access that license server we just need to do:

* locate the "mathpass" file in the PC and add the line

!localhost


* then create a ssh tunnel where the local 16286 port is redirected to the 16286 port in the license server.

And that's all. Now Mathematica at home works fine, but using the Mathematica licenses at work.

Anobii: keeping track of what I read

Sadly my memory is not getting any better, and sometimes I even forget which books I have read in the past... In order to put some order in this area, I'm now adding to Anobii all the information about books that I read. I just started a few months ago, so there is not much yet, but the list will keep growing. My virtual shelf is at https://www.anobii.com/angelv/books

Friday, 14 May 2010

Pretending to be a luthier...



As a present I got a guitar building kit from the Renaissance Workshop Company. Slowly (I only work on it a couple of hours per week), I'm doing some progress... See the evidence. In June I have my guitar examination. Will it be ready by then?

Upgrade from Ubuntu 9.10 to Ubuntu 10.04

I recently upgraded Ubuntu in my laptop from version 9.10 to version 10.04. The upgrade was quite smooth, but I had to "fix" a number of things:

* I wanted to get rid of the login sounds, and I found how to do it at http://www.webupd8.org/2010/04/what-to-do-after-fresh-ubuntu-install.html

sudo -u gdm gconftool-2 --set /desktop/gnome/sound/event_sounds --type bool false
gconftool-2 --set /desktop/gnome/sound/event_sounds --type bool false


* My wife also uses this laptop. We both want a Spanish keyboard, but she wants the menus in Spanish while I prefer them in English. For some reason, after updating to 10.04 my menus were also in Spanish. This didn't look very promising (http://ubuntuforums.org/showthread.php?t=1472193) but in the end I managed to change it.

In the language support tool I had the following languages (in that order) English (United Kingdom), Spanish, English, but then I always got the menus in Spanish. Moved away Spanish below English and all is fine now. Perhaps the support for UK English is broken?

* Sound issue solved?
In 9.10 there was apparently a bug with the sound which made many games misbehave, and the trick was to create a file with name ".alsoftrc" in your home directory (and contents "drivers = oss"). It seems that this problem is gone in 10.04, so I get rid of my .alsoftrc file and the problem does not show.

* X problems after upgrade.
The upgrade generated a new and very basic /etc/X11/xorg.conf file, so I had to regenerate my old configuration.

So far I have not found any other issues...

Monday, 3 May 2010

Settings for "FlightGear in a testing 2x3 display wall"

Let's explain here what I did in order to get my testing 2x3 display wall working (as seen in FlightGear in a testing 2x3 display wall).

I've got 3 PC's in typical cluster configuration (one of them acting as a head node with two ethernet cards: one to the outside world and the other one to the internal network, via a Gigabit switch; the other two PC's are just connected to the internal network), although this should not matter for the FlightGear configuration. All 3 PC's are running Ubuntu Karmic (9.10). For some reason, the sound in FlightGear was not behaving properly, so in my home directory I had to create the file ".alsoftrc" as follows (http://www.flightgear.org/forums/viewtopic.php?f=2&t=6291):


angelv@vaiven:~$ cat .alsoftrc
drivers = oss
angelv@vaiven:~$


Each PC controls two monitors (a column in the picture in FlightGear in a testing 2x3 display wall). So first I had to deal with using both monitors. I use Nvidia drivers, and I'm using Twinview, but this has the problem that in some window managers, when you maximize a window, it will only expand as to occupy one of the monitors, so I changed to TWM, a very basic window manager, but when you run FlightGear in fullscreen mode, it will occupy all the available space (both monitors). With this, it is now just a matter of creating an appropriate XML file which will describe the views that I want in each of the monitors. For the central column I want the cockpit view and the helicopter view. For this I got my configuration file as:


angelv@vaiven:~$ cat fgfs-config
<PropertyList>
  <sim>
    <rendering>
      <camera-group>
        <window>
          <name>wide</name>
          <host-name type="string"></host-name>
          <display>0</display>
          <screen>0</screen>
          <width>1280</width>
          <height>2048</height>
          <decoration type = "bool">false</decoration>
        </window>
        <camera>
          <window>
            <name>wide</name>
          </window>
          <viewport>
            <x>0</x>
            <y>0</y>
            <width>1280</width>
            <height>1024</height>
          </viewport>
          <view>
            <heading-deg type = "double">0</heading-deg>
          </view>
          <frustum>
            <top>0.133</top>
            <bottom>-0.133</bottom>
            <left>-.1668</left>
            <right>.1668</right>
            <near>0.25</near>
            <far>120000.0</far>
          </frustum>
        </camera>
        <camera>
          <window>
            <name type="string">wide</name>
          </window>
          <viewport>
            <x>0</x>
            <y>1024</y>
            <width>1280</width>
            <height>1024</height>
          </viewport>
          <view>
            <heading-deg type = "double">0</heading-deg>
        <z>20</z>
          </view>
          <frustum>
            <top>0.133</top>
            <bottom>-0.133</bottom>
            <left>-.1668</left>
            <right>.1668</right>
            <near>0.4</near>
            <far>120000.0</far>
          </frustum>
        </camera>
        <gui>
          <window>
            <name type="string">wide</name>
          </window>
        </gui>
      </camera-group>
    </rendering>
  </sim>
</PropertyList>
angelv@vaiven:~$



For the right and the left columns I want basically the same view (though viewed from an angle as we will see later), but I also wanted to point the camera in the upper row a little bit lower (which can be useful to appreciate landings), so I created another XML file, basically the same as above, but displacing the camera a little bit:


angelv@vaiven:~$ diff -C 5 fgfs-config fgfs-config.sides
*** fgfs-config    2010-04-29 14:48:43.112948642 +0100
--- fgfs-config.sides    2010-04-29 15:16:40.880449639 +0100
***************
*** 44,53 ****
--- 44,54 ----
              <height>1024</height>
            </viewport>
            <view>
              <heading-deg type = "double">0</heading-deg>
          <z>20</z>
+         <y>-3</y>
            </view>
            <frustum>
              <top>0.133</top>
              <bottom>-0.133</bottom>
              <left>-.1668</left>
angelv@vaiven:~$


Once this is in place, I checked the FlightGear documentation and this document to make a multiple computer setting. At the end, it all came to creating this script:


angelv@vaiven:~$ cat fgfs-wall.sh
#!/bin/sh

killall -9 fgfs
ssh dwall-0 killall -9 fgfs
ssh dwall-1 killall -9 fgfs

ssh dwall-0 'fgfs --config=/home/angelv/fgfs-config --prop:/sim/menubar/visibility=false --enable-hud --enable-fullscreen --timeofday=noon --native-fdm=socket,out,60,vaiven,5500,udp --native-fdm=socket,out,60,dwall-1,5501,udp --native-ctrls=socket,out,60,vaiven,5600,udp --native-ctrls=socket,out,60,dwall-1,5601,udp --prop:/sim/view[0]/config/heading-offset-deg=-10&'  &

ssh dwall-1 fgfs --config=/home/angelv/fgfs-config.sides --prop:/sim/menubar/visibility=false --enable-hud --enable-fullscreen --timeofday=noon --fdm=null --native-fdm=socket,in,60,,5501,udp --native-ctrls=socket,in,60,,5601,udp --prop:/sim/view[0]/config/heading-offset-deg=70&

fgfs --config=/home/angelv/fgfs-config.sides --prop:/sim/menubar/visibility=false --enable-hud --enable-fullscreen --timeofday=noon --fdm=null --native-fdm=socket,in,60,,5500,udp --native-ctrls=socket,in,60,,5600,udp --prop:/sim/view[0]/config/heading-offset-deg=-80 &

angelv@vaiven:~$


I run this in "vaiven" (which is my cluster head node, and controlling the right column of monitors). dwall-0 is the centre column, and where I run the "controller" FlightGear. I'm sure this can be done much better, but this was just a quick hack to get it working in my 2x3 display wall. Any comments on how to improve this configuration are wellcome.

By the way, my keyboard and mouse are connected (for "historical" reasons) to vaiven, the computer in the right column of monitors, but I want to control FlightGear from the monitor in the centre column of the display wall. This is very easily done by using Synergy