Tuesday, June 26, 2007

Remapping the keyboard and ScummVM

I found a way to bypass the menu problem with ScummVM. The menu is originally bind to the F5 key - which does not exists on the zaurus. But I can map Fn-5 to simulate F5, just edit /etc/keymap-2.6.map, and add under,

keycode 6 = five
The following line,
altgr keycode 6 = F5
Now when I run ScummVM and press Fn-5 the menu pops up - hurrah.
So now I can update the old 0.6.1 version to the new 0.9.0 version,
removed the old version,
# ipkg-link remove scummvm-qpe
# ipkg remove scummvm-qpe
and installed the new one,
# ipkg install -d loop0 scummvm
# ipkg-link add libflac4; ipkg-link add libvorbis ; ipkg-link add scummvm
The new version supports skins, so I'll install the modern-dark theme from www.tyrannozaurus.com ScummVM section. After installing a theme the theme.ini and theme.zip filenames should be changed to modern.ini and modern.zip (in /usr/share/scummvm/themes/).
It is also suggested in tyrannozaurus to use the AdvMAME 2x filter.

Saturday, June 23, 2007

gpsp & VisualBoyAdvanced

I found a list of emulators in a post on OESF. I started with gpsp the same way as I did with snes9x, put the bios in the rom's directory, started gpsp - I got the menu, I could use the arrow keys, but couldn't use return (or ok or whatever starts a rom). Cancel did not exit the program, the only way to stop it is killall gpsp via ssh. I also tried to start a rom from command line, but then I got a nonreponsive black screen. Now I had to kill opie inorder to stop gpsp.

Then I tried VisualBoyAdvanced (VBA). Installed it (with -force-depends), I used a similar script to the one I used with snes9x...
and voilla, vba runs, a bit slow, no sound (If I enabled sound it came out statering) - but playable.
I needed to tweak a little bit with ~/VisualBoyAdvance.conf. I switched the arrow keys directions, return did not work so I changed select to Q. I tried playing with the various switches to improve performance but I had no luck there.

Friday, June 22, 2007

snes9x

I found this old ipk on my zaurus, snes9x-sdl-qpe_1.39-r1_arm tried to install it, and it complained for missing libsdl, which was already installed by libsdl-1.2, so I forced demands, and installed:

# ipkg install -d loop0 snes9x-sdl-qpe_1.39-r1_arm.ipk -force-depends
# ipkg-link add snes9x-sdl-qpe
when I tried to run it, I got a black window with sound (which was encouraging). I found this website and used the following switches, no snes9x started but it was rather slow (because of the resize):
# snes9x -hi -x2 -xs 640 -ys 480
The -x2 switch causes snes9x to double the picture so it fits the screen nicely, removing it greatly improves performance (but results in a small window). Another possibility is to use qcop commands to change resolution to 320x200 (like I did for mplayer). Now horizontal lines appeard and the picture was upside down. To solve this I added "SDL_QT_INVERT_ROTATION=0" before running snes9x. Now picture is nice, performance seems reasonable, but, the arrow keys are messed up. I couldn't fix the arrow-keys, but I found a way to redefine the controls, so I used g, l, i & m instead. To set the keys a S9XKEYS variable need to be defined (before starting snes9x):
# export S9XKEYS=27,100,99,115,120,97,122,113,32,103,108,105,109,121,98,112,13
Which translate to:
  • Quit = Cancel
  • D = Button A
  • X = Button B
  • S = Button X
  • X = Button Y
  • A = Button L
  • Z = Button R
  • Q = Start
  • Space = Select
  • The directions are:
Y
IP
G
L
B
MCR

The definition of S9XKEYS is explained here:
S9XKEYS=Quit, A, B, X, Y, L, R, START, SELECT, LEFT, RIGHT, UP, DOWN, LEFTUP, LEFTDOWN, RIGHTUP, RIGHTDOWN
The key codes maybe found in this post or here. Maybe I'll manage to fool SDL with redefining the arrow-keys with opie-keyz.

I use this script to run snes9x and set everything to my taste (almost). I also found these additional switches:
-nso = no sound
-dfr = show frame rate.

Monday, June 18, 2007

Backgammon

Installed opie-backgammon - for those boring moments...

# ipkg install -d loop0 opie-backgammon
# ipkg-link add opie-backgammon
opie-backgamon, like knights suffers from the small window problem, I wonder if there is a way to fix it...

Tuesday, June 5, 2007

FLITE (Text-To-Speech)

I am writing an application for my new GPS (see previous post). In order to have voice output from the Zaurus I have installed FLITE,

# ipkg install flite -d loop0
# ipkg-link add flite; ipkg-link add libflite-cmu-us-kal1; ipkg-link add libflite1
Install a higher quality voice,
# ipkg install libflite-cmu-us-kal16-1 -d loop0
# ipkg-link add libflite-cmu-us-kal16-1
To replace the new voice with the old one replace the following symlink (in the /usr/lib directory),
# mv libflite_cmu_us_kal.so.1 libflite_cmu_us_kal.so.1.lowfreq
# ln libflite_cmu_us_kal16.so.1 libflite_cmu_us_kal.so.1 -s
To test flite simply run,
# flite -t "Hello world"
While we are at it, opie-reader can be setup to read text using flite. First install the opie-reader flite plugin,
# ipkg install opie-reader-output-flitecmd -d loop0
# ipkg-link add opie-reader-output-flitecmd
Now, in opie-reader under "Settings", select the "Scroll" tab. Under "Scroll type" select "Send to output" and under "Output" select "flitecmd". To start reading just start scrolling (Navagation->Scroll).
A word of warning; a. It takes couple of seconds before output starts, and b. The speech cannot be interrupted (as far as I found), opie-reader sends a full paragraph to flite, if you want to stop it - stop the scroll ONCE and wait... (I highly recommend putting a button in the toolbar)

Thursday, May 10, 2007

Global Positioning System (GPS)

I bought a Royaltek RBT-1000 GPS. This is a little (60gr) bluetooth GPS reciever. Connecting it to the Zaurus was really easy (mainly following this ipaq bluetooth gps howto),

  1. Turn the GPS and Zaurus on.
  2. Insert bluetooth CF. I found out that if the Zaurus was suspended with the bluetooth card inserted I had to restart the CF card with,
    #cardctl eject; cardctl insert
  3. Edit /etc/bluetooth/rfcomm.conf,
  4. Bind the dev (If the bind option is disabled).,
    # rfcomm bind /dev/rfcomm0
  5. To see the raw feed,
    # cat /dev/rfcomm0
  6. Start gpsd, this daemon gives a simpler interface to the gps feed, qpegps and (I think) roadmap use it to recieve data from the gps.
    #gpsd -f /dev/rfcomm0
    adding the -n switch turns on the bluetooth immidiatly and leaves it on (even if there is no active connection) otherwise gpsd closes the bluetooth after the connection was closed. This is good if I want to recive data using a command line script like (thanx ckuethe),
    #echo "0" | nc localhost 2947
    This will spit out the position and velocity information.
  7. Connecting to gpsd using telnet,
    # telnet localhost 2947
    there several commands that are documented in the gpsd manpage.
  8. roadmap gps terminal seems to work out of the box,
    # roadgps
    but gives very limited information (only satellite constellation and signal strength).
That was the easy part. roadmap started ok only if I start it from the map folder (where usdir.rdm exists) managed to connect to the gps, but it doesn't show the map (which I got from freemap.co.il). qpegps started ok, but couldn't connect to gpsd which makes it useless.

Thursday, May 3, 2007

bluetooth...

I'm trying to connect my Motorola RAZR V3 using a bluetooth connection. This is what I found to be semi-successful:
On cellphone side:

  1. Enable bluetooth connection.
  2. Enable detection.
On the zaurus side:
  1. Set the pin number:
  2. # echo "0000" > /etc/bluetooth/pin
  3. create the script /usr/bin/bluepincat.sh
    #!/bin/sh
    echo -n "PIN:"
    cat /etc/bluetooth/pin


    Alternatively In Bluetooth Manager (under the Settings tab), uncheck "enable authentification" and "enable encryption", and set the Default Passkey to "0000", this seems to work aswell.

  4. In /etc/bluetooth/hcid.conf, change security from user to auto.
    also change the PIN helper to pin_helper /usr/bin/bluepincat.sh;

  5. Restart the bluetooth service:
    # /etc/init.d/bluetooth stop; /etc/init.d/bluetooth start
Now I can do:
# hcitool inq
and I see the information about the cellphone.
# sdptool browse MAC_ADDRESS
and I see a list of services - with gibberish titles... but list of them nonetheless...

This concludes it, I cannot send files to the cellphone. When I try sending files from the cellphone to the Zaurus I receive a "Service Not Supported" error.

Wednesday, May 2, 2007

zRoadMap again

I've found Wendell Turner's Sharp Zaurus ipk, and installed it:

# ipkg install -d loop0 /media/card/zroadmap_1.0.12-r2_arm5te.ipk
# ipkg-link add kernel-module-usbcore-2.6
# ipkg-link add kernel-module-usbkbd-2.6
# ipkg-link add kernel-module-usbmouse-2.6
# ipkg-link add usbutils
# ipkg-link add zroadmap
after copying the files from /opt/QtPalmtop/share/roadmap to ~/.roadmap/
# cp /opt/QtPalmtop/share/roadmap/* ~/.roadmap/
and starting roadmap from ~/.roadmap:
# cd ~/.roadmap
# roadmap
But there is still the issue of getting maps....

Tuesday, May 1, 2007

qpeGPS & zRoadMap

Install qpegps:
first, install gpsd:

# ipkg install gpsd -d loop0
# ipkg-link add gpsd
Then libgps14:
# ipkg install libgps14 -d loop0
# ipkg-link add libgps14
Then qpe:
# ipkg install qpegps -d loop0
# ipkg-link add qpegps
In order for the map download to work, downmap and gif2png needed to be extracted into /opt/QtPalmtop/bin
wget is needed to be installed (apparently the busybox version is not compatible with downmap)
# ipkg install wget -d loop0
# ipkg-link add wget
Now I'll try to download Haifa area maps... this takes some time (24 maps are downloaded)

Apperantly the popup menu doesn't work... :-(

zroadmap
I'll try my luck with zroadmap:
# ipkg install -d loop0 zroadmap
# ipkg-link add zroadmap

It seems that the directories are not configured well, roadmap searches for the file usdir.rdm which I found in /opt/QtPalmtop/share/roadmap/, once I started roadmap from this directory it started ok (but no maps...).
No luck finding maps, So I removed it
# ipkg-link remove zroadmap
# ipkg remove zroadmap

Friday, March 30, 2007

QPDF2 - pdf reader for OPIE

Install QPDF2:

# ipkg install qpdf2 -d loop0
# ipkg-link add qpdf2; ipkg-link add t1lib

Works out of the box

Saturday, March 10, 2007

Links

I've added some links to the files I've used in the last post

Friday, March 9, 2007

Reflash OZ3.5.4.1

GPE fail to load, so I decided to reflash the whole thing.

Before reflashing, I moved the root folder to root.old.

# mv /home/root /home/root.old
Downloaded the OpenZaurus 3.5.4.1 OPIE Image from ewi546.ewi.utwente.nl mirror and followed the OpenZaurus C7x0/Install Howto.


Loop0 Image:

I have an image on the SD. To create one (512MB):
# dd if=/dev/zero of=ext2.img bs=1024 count=512000
Format the image as ext2: # mkfs.ext2 /media/card/images/loop0.imgCreate a directory to accommodate the mount:
# mkdir /media/loop0
to manually mount the image:
# mount -t ext2 -o loop /media/card/images/loop0.img /media/loop0
add it to fstab so it will be auto-mounted upon reboot, add the following line at the end of /etc/fstab:
/media/card/images/loop0.img /media/loop0 ext2 loop,rw 0
This can be verified by:
# mount /media/loop0
Exit OPIE:
# /etc/init.d/opie stop
Move /home/ and /opt/ directories to loop0:
# mkdir /media/loop0/home
# mv /home/root /media/loop0/home

# ln /media/loop0/home/root /home/root -s

# mv /opt /media/loop0/
# ln /media/loop0/opt /opt -s
Restart OPIE
# /etc/init.d/opie start

Configure USB networking:
I use this Windows XP driver for USB networking (I tried this only with OpenZaurus on Windows XP). Some times the driver crashes, I then reenable USB from the Zaurus side (see below)... sometimes I have to reboot windows...
Zaurus Side (usb0):
ip: 192.168.0.100
Subnet Mask: 255.255.255.0
Gateway: 192.168.0.1
DNS: 192.168.1.1
PC Side:
Make sure the IP 192.168.0.1 is free.
In network settings, advanced tab, enable internet sharing with the Zaurus interface.
settings:
ip: 192.168.0.1
Subnet Mask: 255.255.255.0
Gateway: 192.168.0.100
DNS: 192.168.1.1

EnableUSB:
Create the script enableUSB.sh:
#! /bin/sh
# Check if usb storage module is loaded, if it does remove it.
if ["`lsmod | grep g_file_storage`" != "" ]; then
echo g_file_storage is loaded
echo Unloading g_file_storage
rmmod g_file_storage
fi

# Check if usb networking module is loaded, if it does remove it.
if ["`lsmod | grep g_ether`" != "" ]; then
echo Stopping USB networking module...
echo Unloading g_file_storage
rmmod g_ether
fi

#Load USB networking module:
echo Starting USB networking module...
modprobe g_ether

#Enable the network interface.
echo Bringing up network interface:
ifup usb0
Enable networking
# /media/card/myScripts/enableUSB.sh
To automatically enable networking on reboot:
# ln -s /media/card/myScripts/enableUSB.sh /etc/rcS.d/S49local
For ssh to work a password must be set:
# passwd
Now ssh can connect to the Zaurus from the host computer.

Install to loop0:
In order for ipkg to be able to install packages to loop0 (using the -d loop0 switch) it must be mounted using the ipkg-link, at the end of /etc/ipkg.conf add:
dest loop0 /media/loop0/packages/


Timezone
First, update ipkg:
# ipkg update
Install timezones-asia:
# ipkg install -d loop0 timezones-asia
# ipkg-link add timezones-asia
For some reason /etc/profile does not search for ~/.profile to fix it I added before the export line:
if [ -e "$HOME/.profile" ]; then
. $HOME/.profile
fi
Set the local timezone in ~/.profile
export TZ="Asia/Jerusalem"
Update the clock:
# ntpdate nist1.datum.com

Install
mplayer
# ipkg install -d loop0 mplayer
# ipkg-link add liblzo1; ipkg-link add libmad0; ipkg-link add libmp3lame0; ipkg-link add libsdl-1.2-0; ipkg-link add mplayer; ipkg-link add mplayer-common
The mplayer from the feed is missing the font files (maybe the local fonts can be used...) to have OSD mplayer fonts should be copied to ~/.mplayer/fonts.
Key binding can be configured in input.conf. To see a list of available commands run:
# mplayer -input cmdlist
to see a list of keys:
# mplayer -input keylist
I'm using mpfsr.sh script to run mplayer:
#! /bin/sh

if [ "$1" = "" ]; then
echo "Please supply filename"
else
#disable screen saver and autosleep:
qcop QPE/System 'setScreenSaverMode(int)' 2
qcop QPE/System 'setScreenSaverIntervals(int,int,int)' 0 0 0

#change resolution to 240x320:
fbset -n -xres 240 -yres 320 -match;

#Invert rotation, for some reason with default rotation SDL runs upside down. and then start mplayer:
SDL_QT_INVERT_ROTATION=1 mplayer $@

#change resolution back to normal:
fbset -n -xres 640 -yres 480 -match;

#enable screensaver and autosleep:
qcop QPE/System 'setScreenSaverIntervals(int,int,int)' -1 -1 -1
qcop QPE/System 'setScreenSaverMode(int)' 100

#Update the screen otherwise the screen remains black.
qcop "QPE/System" "applyStyle()";
fi

Add MyScripts and MyApps tabs:
tabs are directories under /opt/QtPalmtop/apps, so to create new tabs:
# mkdir /opt/QtPalmtop/apps/myApps
# mkdir /opt/QtPalmtop/apps/myScripts

A .directory file is also needed to be created for both directories:
[Desktop Entry]
File=/opt/opie/apps/myApps/.directory
Icon=myAppsIcon
Type=application/octet-stream
Name=MyApps
Restart OPIE for the changes to take effect:
# /etc/init.d/opie stop
# /etc/init.d/opie start
Install BASH:
# ipkg install -d loop0 bash
# ipkg-link add bash
The default shell cannot be changed in /etc/passwd, but I can add to ~/.profile:
exec /bin/bash
which will do the trick this is a very bad solution.

To disable the history file, add to .bashrc:
unset HISTFILE

Install less:
less is much better than more...
# ipkg install -d loop0 less
# ipkg-link add less

Install opie-autorotateapplet
I don't like the autorotation feature, and I think it causes problems when closing the hinge, this applet can disable/enable the autorotation "feature"
# ipkg install -d loop0 opie-autorotateapplet
# ipkg-link add opie-autorotateapplet
Install opie-reader
# ipkg install -d loop0 opie-reader
# ipkg-link add opie-reader; ipkg-link add opie-reader-codec-aportis; ipkg-link add opie-reader-codec-arrierego; ipkg-link add opie-reader-codec-chm; ipkg-link add opie-reader-codec-isilo; ipkg-link add opie-reader-codec-plucker; ipkg-link add opie-reader-codec-ppms; ipkg-link add opie-reader-codec-reb; ipkg-link add opie-reader-codec-weasel; ipkg-link add opie-reader-filter-htmlfilter
Hebrew fonts
Install unicode which includes also hebrew fonts:
# ipkg install -d loop0 qte-font-unifont-160
# ipkg-link add qte-font-unifont-160;
ipkg-link add qpf-font-common

Install ZKBApplet
# ipkg install -d loop0 opie-zkbapplet
# ipkg-link add opie-zkbapplet
ZKBApplet requires a XML file with the key definitions. this file should be placed in /opt/QtPalmtop/share/zkb/.

Install opie-clipboardapplet:
# ipkg install -d loop0 opie-clipboardapplet
# ipkg-link add opie-clipboardapplet

Disable LCD Softkeys:
Mark out the entries for the LCD Softkeys in /etc/keymap-2.6.map (lines 121-131).
reboot for the changes to affect.


Install opie-networkapplet

# ipkg install -d loop0 opie-networkapplet
# ipkg-link add opie-networkapplet
Couldn't make this to work...

Install opie-memoryapplet
# ipkg install -d loop0 opie-memoryapplet
# ipkg-link add opie-memoryapplet

Install ScummVM-qpe:

Using the version from the old (OZ3.5.4) feed, all other versions seem to have a problem with the menu key (not working):
# ipkg install -d loop0 /media/card/scummvm-qpe_0.6.1b-r0_arm.ipk
# ipkg-link add libmpeg2; ipkg-link add libogg0; ipkg-link add libvorbisidec1; ipkg-link add scummvm-qpe
At the beginning the cursor is a bit off, to fix that, choose "Fix aspect ratio" under options (in the main screen).
A newer version is installed later


Install Knights
Knights is a front end for the Phalanx chess engine.
# ipkg install -d loop0 knights
# ipkg-link add knights; ipkg-link add phalanx

Tuesday, March 6, 2007

Continue with freeciv...

I stopped compiling last night, today when I tried to continue I got the following error:

install: cannot stat `/stuff/tmp/work/all-linux/ttf-dejavu-2.13-r0/dejavu-ttf-2.13/*.ttf': No such file or directory
when trying to install ttf-deavu-2.13-r0. The problem is probably a defective /stuff/sources/dejavu-ttf-2.13.tar.bz2. Removed that file (and also its md5 counterpart). And then:
# bitbake -crebuild ttf-dejavu
This caused bitbake to download the file again and to build it ok. Continue with freeciv:
# bitbake freeciv

Now it failed with gtk+:
***Can't link to Pango. Pango is required to compile
*** GTK+...
According to /stuff/tmp/work/armv5te-linux/gtk+-2.8.9-r7/gtk+-2.8.9/config.log cairopango-1.0 library is missing...


Monday, March 5, 2007

Statistics

I subscribed to Google Analytics to get some statistics about the blog.

Bug #1940

bitbake failed compiling libX11 with the following error, with makekeys causing floating point exception. Somebody just posted a fix in the OE Bugtracker.

So I'll try to continue...
To fix the bug I edit: /stuff/tmp/work/armv5te-linux/diet-x11-X11R7.1-1.0.1-r4/libX11-X11R7.1-1.0.1/src/util/makekeys.c
and change

KeySym val;
} info[KTNUM];

#define MIN_REHASH 10
#define MATCHES 10

char tab[KTNUM];
to

KeySym val;
} info[KTNUM];

#define MIN_REHASH 15
#define MATCHES 10

char tab[KTNUM];
I created a /stuff/setVars to setup the enviroment, with the two export command in it:
export PATH=/stuff/bitbake/bin:$PATH
export BBPATH=/stuff/build:/stuff/org.openembedded.dev

Now bitbake:
# cd /stuff/
# . setVars
# bitbake freeciv
This fixed the problem.

Saturday, March 3, 2007

Trying to compile freeciv for OZ

I want to compile FreeCiv for the Zaurus:

  • Set local configuration (/stuff/build/conf/local.conf), change/insert the following lines:
    • DL_DIR = "/stuff/sources"
    • BBFILES := "/stuff/org.openembedded.dev/packages/*/*.bb"
    • MACHINE = "c7x0"
    • DISTRO = "openzaurus-unstable"
    • ASSUME_PROVIDED += "qemu-native"
    • Remove the last line in the file.
  • Setup the enviroment:
# export PATH=/stuff/bitbake/bin:$PATH
# export BBPATH=/stuff/build:/stuff/org.openembedded.dev
  • Try to compile:
# bitbake freeciv
  • No luck today - bitbake failed.

Friday, March 2, 2007

Created YoGZLog

Wandered around google and stumbled upon this place...
Maybe I'll use it for my Zaurus log...