Installing Ubuntu 10.10 (Maverick Meerkat) on Fujitsu U820, U2010, U2020

Here are a few notes on how to get the most important hardware of the Fujitsu U820 / U2010 / U2020 working on Ubuntu 10.10 Maverick Meerkat.
Some of the hints might also apply to the Fujistu U810 / U1010 – make sure to ignore step 1 as these devices use the GMA 950 graphics chip which is working perfectly out of the box.

1. Installing the Intel GMA 500 graphics driver

The Ubuntu Wiki has all the necessary information here.

Basically one just needs to do as follows:

sudo add-apt-repository ppa:gma500/ppa 
sudo apt-get update
sudo apt-get install poulsbo-driver-2d poulsbo-driver-3d poulsbo-config

UPDATE: The following step is no longer required.

Unfortunately the version as of this writing does not support Compiz and thus you won’t get any of the funky special effects. However, there is a workaround available as described in the Ubuntu Wiki:

wget http://dl.dropbox.com/u/1338581/poulsbo/poulsbo-config_0.1.2%7E1004um3_all.deb
sudo dpkg --install poulsbo-config_0.1.2~E1004um3_all.deb
sudo apt-get install compiz

2. Installing the Fujitsu Buttons driver (fjbtndrv)

In order to get the buttons and auto-rotation functionality working we will need to compile and install the latest version of fjbtndrv.
The most current version as of this writing is 2.2.1. Please make sure you download the latest version here.

sudo apt-get install libxrandr-dev libxtst-dev libxi-dev libhal-dev
wget http://sourceforge.net/projects/fjbtndrv/files/fjbtndrv/2.2.1/fjbtndrv-2.2.1.tar.gz/download
tar xvzf fjbtndrv-2.2.1.tar.gz
cd fjbtndrv-2.2.1
./configure
make
sudo make install

3. Installing the Fujitsu Touchscreen driver

The touchscreen is working somewhat with the included evdev driver. I could not find a way to calibrate the touch screen via xinput etc. So I went back to using zmiq2‘s touch screen driver available here.
Version 0.3.7 won’t compile because some important USB functions were renamed in kernel 2.6.35.
Straight from the kernel 2.6.35 changelog:

USB: rename usb_buffer_alloc() and usb_buffer_free() users

For more clearance what the functions actually do,

usb_buffer_alloc() is renamed to usb_alloc_coherent()
usb_buffer_free() is renamed to usb_free_coherent()

So, one either needs to patch the fujitsu_usb_touchscreen.c manually and replace every occurrence of the aforementioned function names or we just move on and use the already patched version provided by nerd65536. I mirrored the file he posted to the hosting service linked to in the comments section of zmiq’s blog post.

wget http://katastrophos.net/downloads/fujitsu-usb-touchscreen-0.3.8.tar.gz
tar xvzf fujitsu-usb-touchscreen-0.3.8.tar.gz
cd fujitsu-usb-touchscreen-0.3.8
make
sudo make install

In order to have the auto-rotation functionality of fjbtndrv working with the fujitsu-usb-touchscreen driver we need to add a new startup item: Click on System -> Preferences -> Startup Applications and click Add. Enter following

    Name: Fujitsu Touchscreen Auto-Rotation
    Command: /usr/bin/fujitsu-touchscreen-rotate.py
    Comment: 

Click Add and Close the preferences dialog.

Finally, reboot the system.
Enter the BIOS and make sure that the setting Advanced -> Miscellaneous Configurations -> Touch Panel Setting is set to Tablet, ie. the same setting that is required to use the Tablet functionality in Win XP Tablet, Vista or Seven.

3.1. Calibrating the touchscreen

Once the system has booted and you are back on the Gnome desktop, start a Terminal session and run

fujitsu_touchscreen_calibration.py

to calibrate the touchscreen. Click on any corner of the visible screen (repeat a few times) and press the S key to save the settings.

3.2. Configuring the Right-Click feature

In order to get the feature “right-click by press and hold” go to System -> Preferences -> Mouse, click the tab “Accessibility” and check the option “Trigger secondary click by holding down the primary button“.

4. Fixing the repeating sound issue

If you are experiencing the Ubuntu startup jingle repeating over and over again, the snd_hda_intel module might have problems coping with the ALC269 chip in your device. In this case run the following command:

sudo gedit /etc/modprobe.d/alsa-base.conf

and add the following line to the end of the file:

options snd-hda-intel enable_msi=0

Save and finally reboot the system.

Nightly Builds of Quasar Media Player available

Quasar Media Player

It’s been some time since the last update. In my previous post I mentioned I was in the process of setting up a nightly build system. This system has been running silently since May.
I guess it is finally time for me to officially announce the nightly builds of Quasar Media Player:

http://www.katastrophos.net/downloads/quasar/nightly/

Along with the most current sourcecode tarball, binaries are available for 4 platforms:
Windows (win32), OS X (universal binary), Sharp Qtopia and pdaXrom Linux (both for Zaurus PDA)
The Windows version comes in two styles: a generic setup (EXE) and a self-contained portable version (7z archive)

Enjoy and please leave a comment.

Setting up the Inno Setup compiler on Debian

I’m currently setting up a nightly build system for Quasar on my Linux box which is running Debian. This system also cross-compiles Quasar for Windows.
The Windows version of Quasar is going to be available in two fashions: one self-contained, portable version and one version that can be installed.
I’m not a huge fan of installers. But when it comes to creating a setup program for a given Windows application I’m quite accustomed to Inno Setup having used it for years. Unfortunately there is no native Linux version of the Inno Setup compiler available for Linux. NSIS exists as package for Debian but I am not fond of using it, largely because I am a Delphi guy. :)
So, here is a small guide on how to get the Inno Setup compiler up and running on Debian:

First step is to install Wine either as super user or by using sudo:

sudo apt-get install wine

As normal user fire up your X server and your favourite terminal application and get the latest Inno Setup QuickStart pack:

mkdir /tmp/innosetup
cd /tmp/innosetup
wget http://files.jrsoftware.org/ispack/ispack-5.2.3.exe
wine ./ispack-5.2.3.exe

This will start the installer in Wine. Note, for the installation you will need a running X11 server since the installer obviously is graphical. If you have not set up Wine before, the default location C:\Program Files\Inno Setup 5 will install to ~/.wine/drive_c/Programme/Inno Setup 5.

Luckily the Inno Setup compiler offers a command line interface, ISCC.exe, which will run in Wine without the necessity of having a X server running. So it is ideally suited for automated runs.

Here is a simple wrapper shell script called iscc:

#!/bin/sh
unset DISPLAY
scriptname=$1
[ -f "$scriptname" ] && scriptname=$(winepath -w "$scriptname")
wine "C:\Program Files\Inno Setup 5\ISCC.exe" "$scriptname" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"

I installed this script in my local bin directory (~/bin) and added it to the PATH environment variable.
This will allow running the Inno Setup compiler from anywhere and it also makes it very easy to integrate into a build script. You can even feed a script via stdin, e.g. something like:

iscc - < ./myscript.iss

rdesktop: Connect to Windows 7 and Vista with ClearType font smoothing enabled

So Windows Vista finally allows to enable ClearType font smoothing for Remote Desktop / Terminal Services sessions. Update: Windows XP SP3 does too!
If you try to connect to a machine running Windows XP SP 3 or later using rdesktop, you won’t get smoothed font typing since at the time of this writing rdesktop does not officially offer an option to control this feature. However, here is a workaround:
Continue reading “rdesktop: Connect to Windows 7 and Vista with ClearType font smoothing enabled”

Enhanced audio driver for Zaurus SL-C1000/C3x00 available

Today I’m officially releasing my extended driver and mixer for the Wolfson WM8750 CODEC / sound chip that comes included in the latest Zaurus models.
The driver exposes the following new features:

  • ability to set and control Treble, Bass and 3D stereo sound enhancement;
  • ability to set and control various cut-off frequencies supported by the sound chip;
  • output source selection (Autodetect, Internal Speaker, Headphone).

These features can be easily accessed via a Qt based mixer control app or directly via a /proc/driver/wm8750 kernel interface.

{wm8750mixer} WM8750 mixer control app running on pdaXii13 and X11.{wm8750mixer} WM8750 mixer control app running on Cacko ROM and Qtopia.

Both, the driver and the control app are available for Sharp ROM / Cacko ROM and pdaXrom beta 3 / pdaXii13.

Kernel patches are available for Sharp’s Linux kernel 2.4.20 and can be downloaded here:
http://www.katastrophos.net/zaurus/sources/wm8750mixer/
(No kernel 2.6.x support yet. Sorry folks.)

By default the audio driver is compiled into the kernel. Sharp didn’t compile it as module, so it can’t be easily replaced. Same goes for most third party ROMs. You’ll have to reflash your kernel to install the new driver.
In case you don’t want to roll your own kernel, I’ve made pre-compiled kernels available for all supported ROMs and models here:

http://www.katastrophos.net/zaurus/kernels/v55/

The control app and start up scripts are available as IPK here:

wm8750mixer_0.9_arm.ipk – WM8750 mixer for Sharp ROM / Cacko ROM
wm8750mixer_0.92_armv5tel.ipk – WM8750 mixer for pdaXrom beta 3 / pdaXii13

On a side note, we’ve been discussing the extended features of the WM8750 audio chip for quite some while in this thread over at the OESF forums. I have the feeling the driver and the Qt application have received a fair bit of testing. So, that’s why I am officially releasing it today.

“Yet Another Zaurus Media Player”… not dead yet: “Quasar Media Player”

Alright, this blog has been very quiet for the last few months. That’s partially due to me being very busy with other stuff.
I’m slowly picking up pace and getting things done again.

So, here is a short update on the media player that I’m currently developing for my Zaurus. Well, actually it’s been in long-term testing mode for ages now… :)
I finally have a name for it. It will be called “Quasar Media Player” – or shorter “Quasar”. Below are some screenshots of the current development version running on Qtopia. I hope to have a release ready soon.

{Quasar} Shown is the new toolbar and play list selector.{Quasar} The new play info screen. Cover art is supported and rendered in this funky view. Any Satch fans out there? ;){Quasar} More eyecandy.{Quasar} Normal list view filtered.

“Yet Another Zaurus Media Player”… done differently . (Phase 2.1: Development progress 2)

Yet another short update on the development of my still untitled media player for the Zaurus. In the meantime it’s called YAZMP.

Again, I’ve been working on improving performance – this time on the performance when loading playlists.
Before I continue, let me give a brief overview of the structure:

Library -> Playlists < -> Media Cache

YAZMP doesn’t manage a library similar to i*Tunes. Instead it solely relies on playlists. Metadata (title, artist, album, etc.) is kept in the database and will be associated to once the playlist is loaded. The reason for this is pretty simple: Scanning audio files (and media files in general) each and every time a playlist is loaded will definitely take a lot of time. So, for every file the gathered metadata will be saved in the DB. Think of it as a cache.
Continue reading ““Yet Another Zaurus Media Player”… done differently . (Phase 2.1: Development progress 2)”

“Yet Another Zaurus Media Player”… done differently . (Phase 2: Development progress, no release yet.)

So, like I’ve already mentioned in my previous comment, I’ve got some free time to work on my pet project here.

Development progress

I’ve been optimizing a lot under the hood. Tons of blood, sweat and tears have already run into optimizing the core parts.
Coming from a different background in programming, namely a desktop background, doing embedded development is a whole new experience for me. And let me say this: it’s definitely a refreshing one.
Development for embedded devices can be quite challenging if you have hard memory limitations and performance restrictions CPU-wise. These limitations go even further than the ones I’m used to when doing component or graphics development. And I’m doing quite a lot of that…

Just so you get the idea:
My essential requirement for this project is that the player is able to cope with thousands of files in a playlist.

With that being said, I’ve already rewritten the playlist management four times. :)
The first approach was fast but ate RAM for breakfast. Incremental searching on a playlist was fast but also required additional memory. The second approach was more memory-friendly, but searching was slow. Besides, some Qt widgets make development a real pain – at least in Qt/E 2.3.x. For instance, QListView can pose an incredible hog on performance. I’m currently using several hacks to speed things up. However, I’m still thinking about replacing the whole component or doing some custom coding to improve it…

Anyway, since I couldn’t really get rid of the memory problems, I finally decided to give SQLite a try. SQLite offers very sophisticated caching, which helps getting rid of the RAM problem. I really could use the enhanced features of a SQL database. And let me say this: SQLite is awesome. And it’s as fast as it could be on such a small device – that is, if you know how to use it…

With that being said, different rules in database design apply for embedded systems:
In the third approach I already created a pretty decent database schema. Something I naturally would have done on a desktop system. Keeping the layout clean, using relations where applicable, minimizing data storage requirements.
On a desktop system dereferencing and joining tables is fast. However, not so on my Zaurus: Simple left-joins over three tables would take up to a few hundred milliseconds. In contrast, these queries are almost unmeasurable on my desktop system, meaning they were faster than 10 ms.
Now add a few other equally expensive queries to that and imagine, you’re doing a search on your playlist with 2000 items. Do you want to wait 3 seconds or longer for the result? That’s not what I call interactive.
So, I had a nice profiling, optimizing and testing marathon last weekend. To make a long story short, after analyzing the bottlenecks and also having a lengthy discussion with a DB-guru friend, I ended up simplifying the database schema in a direction I wouldn’t normally take on a desktop system. It’s not totally ugly now, but it’s just not as relational as you might expect a SQL database to be. Also, some data is redundantly held in temporary tables, which isn’t nice either, but helps performance A LOT.
In order to do the profiling I made some changes to the SQLite codebase, which I will post shortly along with some optimization hints. Update: Hints here, patch here.

Screenshots

No release yet, sorry! I have to finalize some features first.
However, here are some new screenshots that show the new overview feature in action. The design of the application is temporary, stay tuned! :)

{YAZMPDD} YAZMPDD - Work In Progress Screenshot 4: Overview feature with multi-selection in action.{YAZMPDD} YAZMPDD - Work In Progress Screenshot 5: Search filter + Overview filter{YAZMPDD} YAZMPDD - Work In Progress Screenshot 6: Portrait window mode. Note: This is the contrast skin, which will change in the future.