Words from the inside


Scrolling with TrackPoint

Posted in Igalia, Tunning by jasuarez on the October 15th, 2008

If you’re using a TrackPoint as your favourite mouse, probably you configured it to allow scrolling with the help of middle button. If not, I suggest to take a look at ThinkWiki.

But those steps explain how to configure vertical scrolling, but what about horizontal scrolling? If you want to have scrolling in both directions, add the following section in your xorg.conf file.

Section “InputDevice”
Identifier  “Trackpoint”
Driver      “mouse”
Option      “CorePointer”
Option      “Device”              “/dev/input/mice”
Option      “Protocol”            “ImPS/2″
Option      “Buttons”             “7″
Option      “YAxisMapping”        “4 5″
Option      “XAxisMapping”        “6 7″
Option      “EmulateWheel”        “true”
Option      “EmulateWheelButton”  “2″
EndSection

QEmu-Arm in text mode

Posted in Igalia, Tunning by jasuarez on the September 1st, 2008

Are you using Debian for Arm through QEmu? If so, and you want to use it in text mode (useful, for example, to use it outside a graphical window), the key is the special terminal ttyAMA0.

You must configure your debian to put a getty on ttyAMA0, so you can log in it, and to send boot messages  to that terminal too.

First, enter in the virtual machine, and edit /etc/inittab and add the following line

T0:23:respawn:/sbin/getty -L ttyAMA0 9600 vt100

Next time you boot on machine, a ttyAMA0 terminal will be spawn.

Finally, add to -append options the option “console=ttyAMA0″, so all boot messages will be sent to ttyAMA0.

Now, you can start qemu-system-arm with -nographic option work in text mode.
If you want to login as root, add the ttyAMA0 to the /etc/securetty list.

And the final tip! You can exit from qemu with “Ctrl+A X” (don’t forget to power-off first your virtual machine).

Ubuntu and Scratchbox: singing duets

Posted in Igalia, Tunning by jasuarez on the May 2nd, 2008

Recently Igalia gave me a new laptop, a Lenovo “The Beast & The Best” Thinkpad, for everyday work. I decided to install Ubuntu Hardy Heron 64bits, as I had never worked with such operating system, and I am eager to learn benefits and drawbacks of working on a 64bits OS.

Among other features, Hardy comes with PulseAudio, the new sound system which has a lot of features.

As I am playing with Maemo I have installed a scratchbox too. A workmate, Calvaris, wrote about how to install scratchbox in a Linux Amd64.

Now the problem: scratchbox comes with esound to manage the sounds. When I am working within the scratchbox, esound daemon blocks the /dev/dsp device, preventing other applications outside the scratchbox to be able to play. This disturbs me a lot, as I like listening music while working. Of course, we can kill esd daemon to free the dsp device, but in this case I can not play songs inside the scratchbox, which I need to do too.

So, what is the solution? The idea is to use the soundcard to play songs for our Ubuntu applications, while the scratchbox will use a virtual soundcard that will sent the music to another host using networking capabilities of esound. The trick is that the ‘another host’ will be our own host, which will receive the music stream and will play it. Cool, uh?

Lets do it!.

Configuring PulseAudio

The first step is configuring Pulseaudio to be able to receive streams through the network. Therefore, edit /etc/pulse/default.pa and add the following line:

load-module module-esound-protocol-tcp

It is likely that line already exists in the file but commented. In this case, uncomment it.

Now you must restart pulseaudio in order to load the new configuration.

Configuring a Dummy Soundcard

Scratchbox esound daemon requires to have a dsp device even when sending the music through network. So we are going to add a dummy sound card that will be used by the daemon.

Linux kernel provides a driver for a dummy soundcard. To load it, execute as root:

modprobe snd-dummy

A new dsp device, /dev/dsp1, will be created.

Configuring Scratchbox eSound

We must configure esound daemon in scratchbox to use the new dummy soundcard. To do this, enter in the scratchbox and edit /etc/esd.conf file. Search the options line and add at the end:

-d /dev/dsp1

In my case, the esd.conf file contains:

auto_spawn=1
#spawn_options=-promiscuous -nobeeps
spawn_options=-promiscuous -nobeeps -d /dev/dsp1
spawn_wait_ms=500
# default options are used in spawned and non-spawned mode
#default_options=-promiscuous -nobeeps
default_options=-promiscuous -nobeeps -d /dev/dsp1

Thus, scratchbox will use the dummy soundcard, while the real soundcard will remain free for Ubunutu. Of course, being a dummy sound card, don not expect to hear music playing in the scratchbox. To resolve this problem, the last step is send what is playing with esound daemon through the network to our own host to be played through pulseaudio.

Configuring eSound’s Network Transparent Sound

This is the last step. Network sound uses a authentication mechanism. So in order to use network transparency both sides must be authenticated between them. When pulseaudio is launched, an .esd_auth file is created in the home directory. Copying this file to the scratchbox home will allow esd to send music to pulseaudio daemon. After copying the file, restart esound daemon.

Now we can send the sound to the pulseudio daemon. From the scratchbox, execute this:

esdmon | esdcat -s 127.0.0.1 &

esdmon listens all data sent to esound daemon, sending it also to the standard output. On the other hand, esdcat reads all data from the standard input and sends it (in this case) to the localhost. As you can notice, working together means that all sound sent to the dummy sound card is also sent through localhost to the pulseaudio daemon, which in turn sends it to the real soundcard.

Now, you can play songs inside the scratchbox and you will hear them! Moreover, you can be playing at the same time music in the scratchbox and in the host, due to multiplexing capabilities of pulseaudio. So both systems, Ubuntu and scratchbox, will sing duet.