2008-03-06

Sorting package version strings

Interesting less trivial than expected problem (solved): sorting package version numbers:

import re
import rpm

def get_package_version(name):
    """Return version string of installed package."""

    # note: ts can take an argument that is the root of the installation
    #       typically with a var/lib/rpm directory underneath it.
    transaction_set = rpm.ts()

    versions = [header['provideversion'][0]
                for header in transaction_set.dbMatch('name', name)]
    versions.sort(cmp_versions)
    return versions

def version2sortable(version):

    parts = re.split(r'(d+)', version)
    fields = []
    for part in parts:
        try:
            part = int(part)
        except ValueError:
            pass
        fields.append(part)
    return tuple(fields)

def cmp_versions(a, b):

    return cmp(version2sortable(a), version2sortable(b))

if __name__ == '__main__':
    print get_package_version('kernel')

Output:

['2.6.23.8-63.fc8', '2.6.23.9-85.fc8', '2.6.23.14-107.fc8', '2.6.23.14-115.fc8', '2.6.23.15-137.fc8']

Note: Wordpress is screwing up the markup on the code blocks above. If you have any tips on how to fix this please drop me a line.
Update: Using pre/blockquote hack for now and will try out a code highlighter plug-in when I get the chance. Thanks Tim and Lindsay! :-)

Filed under: fedora, Python — twegener @ 22:04

2008-02-09

Exaile volume problem in OS2008 fixed

I finally got around to looking at the problem tonight. The fix was very simple. My apologies for not addressing this sooner!

Get the updated .deb.

The problem was due to the volume range on the original Exaile going from 0-1. For some reason on maemo (OS2008) the volume range is 0-10. According to the gstreamer volume control docs the range should be 0-10, so I’m not sure why the original Exaile works properly on my desktop machine.

Anyway, I mainly use Kagu and Vagalume for music on my N800 these days. As a result I haven’t done anything on maemo Exaile for ages. I hope to one of these days, though.

Filed under: exaile, N800, maemo — twegener @ 23:34

2007-12-11

Nokia vs Ogg

It’s lovely to see Nokia embracing “Web 2.0″…

You can participate too, with a related issue. Help convince Nokia to provide out-of-the-box support for Ogg Vorbis:

  • Vote for bug 176
  • PledgeBank (* I haven’t pledged - sticking with my N800)
  • The organization responsible for the Ogg formats have provided a template for writing a letter to Nokia

According to Nokia’s Ari Jaaksi, some time ago, “There’s nothing technical that prevents it. However, the 770 is a consumer device. The challenge is that there is not much [Ogg Vorbis and Ogg Theora] content right now.“.
I hope Wikipedia qualifies as “content”, not to mention personal music collections.

Meanwhile, the intrepid Tuomas Kulve has released a new version of ogg-support for maemo that enables the built-in media player to play Ogg Vorbis files. He notes, “It’s untrivial to get everything working properly as the FileManager, the Metalayer Crawler, and the Media Player are all close source applications and their behaviour is not really documented anywhere.” Hopefully this situation will change.

See also:

Filed under: maemo, Freedom — twegener @ 23:26

2007-12-08

Updating the N800 to OS2008

Here are my notes from updating to OS2008 for getting root access via ssh and taking an early snapshot of the image filesystem with rsync:

  1. Download the OS2008 firmware image.
  2. Follow the instructions for flashing with new firmware image
  3. Go to Settings->Application Manager and go to Tools->Application Catalog and enable the Maemo Extras repo
  4. Click ‘Browse installable applications’ and inst the OpenSSH package
  5. Repeat the flasher steps but replace the flash command line with flasher/flasher-3.0 --enable-rd-mode to enable R&D mode
  6. Go to Utilities->X terminal and do sshroot@localhost
  7. Change the default password: passwd
  8. Repeat the flasher steps but replace the flash command line with flasher/flasher-3.0 --disable-rd-mode to put the tablet back into production mode
  9. Install rsync from the .deb package
  10. Take a snapshot of the root file system by using rsync to copy from the device to another machine: rsync -avzx root@:/ snapshot_dir
  11. Follow the instructions for entering Red Pill Mode
  12. Install apps such as less, screen, wget
  13. Return to Blue Pill Mode

The tips needed to get ssh root access working again mainly came from here.

Most of my previously installed packages in OS2007 are already available for OS2008. The main ones that I am still missing are gtick (metronome) and a UPnP client. IIRC, I grabbed everything form the official maemo downloads page and this list of Working 2008 OS Software.

Impressions:

  • This update increases the maximum CPU clock speed from 330MHz to 400MHz. The graphical interface feels snappier.
  • The browser is now the mozilla-based microb browser which seems to use more memory and slightly slower than the previous Opera browser. However, it’s free software and supports newer web standards, so I’m happy with the change.
  • The graphical interface is nicer. The designers appear to have responded to user feedback well in this area.
  • There are more codecs , but still no Ogg Vorbis support, which is very disappointing. The third-party package works fine with third-party media players, but doesn’t work with the default media player.
  • Media streaming on the ABC now works. Among other things, this means I can listen to the local radio station from anywhere, and not have to suffer crappy AM quality. Annoyingly, when playing Internet radio from the widget it keeps a message box open (”buffering”) for as long as I have it playing.
  • I haven’t done any careful measurements of the battery life, but it seems to be about the same. This is a bonus given the increase in CPU speed.
  • Newer kernel (2.6.21), Gtk (2.10) and DBUS (1.0) and gstreamer now supports the generic playbin,
  • The built-in media player has been substantially improved, but without Vorbis support it’s of limited use to me. I prefer to use Kagu or Exaile.
  • Why is there still no support for recording videos in the camera app?
  • The problem where, if Bluetooth is disabled from the system tray, the Bluetooth icon disappears, so must be re-enabled from Control Panel, still persists. Annoying.
  • Text prediction and automatic capitalization are off by default.
  • The on-screen keyboard seems to be a bit over-sensitive and often registers a key twice when it was only tapped once.

With this update, it feels like the Internet tablet OS platform is maturing nicely.

Filed under: N800, maemo — twegener @ 23:35

2007-12-05

Exaile for maemo 4.0 (OS2008)

I’ve made a new release of Exaile for maemo 4.0 (i.e. OS2008, chinook). This drops a bunch of backward compatibility patches needed for OS2007, and takes advantage of some gtk 2.10 features. Also, there was a bug in the gtk shipped with OS2007 that prevented activating items in the sidebar. This has gone away, so now there are more playlist actions available.

Exaile on N800 (OS2008) screenshot

Note that the previous release won’t work on OS2008 because the id3lib gstreamer element is called id3demux in OS2008.

If you are in need of a player that handles Ogg Vorbis, m4a and mp3 (among others) on OS2008 and has decent playlist management features and you are willing to put up with a slightly slow and fat app then Exaile for maemo may be for you. :-)

Filed under: exaile, N800, maemo — twegener @ 22:38

2007-12-03

Exaile 0.2.11 for maemo

I’ve updated the maemo port of Exaile to version 0.2.11. There are not many visible changes, apart from alphabetic separators in the collection list. I now include the bytecode-compiled pyc files, so startup time should be reduced slightly. It still takes a bit long to start up though. I’ve been using this for about a month now and it seems to be stable enough.

This will probably be the last release for OS2007. I’ll make a release for OS2008 once I have that installed and working on my N800.

Filed under: exaile, N800, maemo — twegener @ 22:09

2007-11-30

Updating to Fedora 8

A few weekends ago I updated my system from Fedora 6 to Fedora 8. I did a fresh install, as opposed to doing an upgrade. Here are a few of the problems I encountered, along with solutions:

Wireless networking wasn’t working

Fedora 8 detected my Atheros-based wifi card, since it now includes the new freedomware ath5k driver. However I couldn’t get it to associate with my access point. The workaround was to install the proprietary madwifi package from livna: On a machine with Internet access, go to livna.org and download madwifi and the kmod-madwifi package corresponding to the installed kernel (do uname -r to find out). Then do:
su -
rpm -ihv madwiki kmod-wifi
modprobe -r ath5k
modprobe ath_pci

Go to Administration->Services and start/turn on NetworkManager and NetworkManagerDispatcher services. The NetworkManager applet should appear in the system tray. Click on this to configure a wireless connection.

1280×1024 resolution was not available

This resolution was working on my Fedora 6 setup, with an nVidia gforce2 MX 440 and Viewsonic E771 monitor.
To fix, add the following line to /etc/X11/xorg.conf in the “Display”/”Screen” section:
Modes "1280x1024" "1280x1024" "1280x960" "1280x960" "1280x800" "1280x800" "1152x864" "1152x864" "1152x768" "1152x768" "1024x768" "1024x768" "800x600" "800x600" "640x480" "640x480"

Setting up the livna repository

The livna.org repository is a separate repo containing packages that aren’t included in the main Fedora repo for various legal, technical and ethical reasons. I need it for the madwifi driver and the gspca webcam driver among other things. Set it up like so:
su -
rpm -ihv http://rpm.livna.org/livna-release-8.rpm

Installing the webcam driver

The driver for my Logitech Quickcam IM webcam is freedomware, however apparently it does yucky things like JPEG decoding inside the kernel, so is not included in the mainline kernel. It can be installed from livna like so:
su -
yum install gspca
modprobe gspca

Alternatively, you can install it from the GUI by going to System->Add/Remove Software and searching for gspca.
You can test that the webcam is working by running Ekiga (strangely filed under Internet->IP Telephony blah blah) and setting up video.

Using a home directory on a separate partition

I have my home directory stored on a separate ‘data’ partition. I was not able to log in when I configured my account to use this as my home directory. To fix this, I had to change the SELinux context on the root directory of the file-system on the data partition like so:
chcon system_u:object_r:home_root_t:s0 /data

Fixing broken icons in Evolution

It appears that the necessary dependency isn’t installed by default for a KDE install. Fix the icons like so:
su -c 'yum install nodoka-theme-gnome'

Installing Adobe Flash Player

To install the proprietary Adobe Flash player do:
su -
rpm -ihv http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
yum install flash-plugin

Note that a freedomware flash player, gnash, is in the works, but it only supports a subset of Flash v7 functionality.

Other issues

I’ve had problems with sound not being available upon booting from time to time. This seems to be due to the coexistence of the webcam’s internal microphone sound device, and my main soundcard sound device. I also get ‘artsd’ crash messages upon logging into KDE from time to time.

I hope to cover my impressions of the various Fedora 8 components in subquent posts, but we’ll see how we go.

Filed under: fedora — twegener @ 22:27

2007-08-12

How to create a .deb package for maemo without Scratchbox

The officially recommended way to create .deb packages for the maemo platform is to use dpkg-buildpackage within Scratchbox. For me, Scratchbox is a pain to install for two main reasons. First, there is no RPM package of the scratchbox environment, so apparently I need to run some scripts as root, let my system get a little messier, which I am not willing to do. Second, the docs advise to turn off SELinux in order to get the Scratchbox environment to work, which again I am not keen to do.

If you are using Debian or Ubuntu, there is probably a cleaner approach, but I am currently using Fedora, so I just rolled my own method using the command line. Copy the following files to your project directory:

Then rename deb_hand_example.mak to Makefile, and adjust the variables in this file to match your project.

Setup the required files (referenced in these makefiles) for packaging. There some pointers on this in the Python Maemo howto in the packaging section.

Note the ${PACKAGE_DIR}/data: ${SOURCE_DIR} target in the makefile. This must be modified to layout all files as you wish them to be installed on the target system. The example makefile rule should be a reasonable guide.

Then once you are ready, do ‘make PACKAGE_DIR= deb’ and if all goes well a shiny new deb package should be sitting in release_dir. If not, fix your settings in the Makefile, run ‘make clobber’ and then try again.

Filed under: N800, maemo — twegener @ 14:40

2007-08-01

Exaile N800 port webpage

I’ve whipped up a webpage for the Exaile N800 port. This has the latest packages, screenshots, todo list, etc.

I’ve also made a new release with the following changes:

  • Basic Hildon-ization: window, menus, full-screen support, file dialogs
  • Icon now appears in taskbar
  • Fixed default OSD background colour
  • Made track info in title bar briefer

Double-clicking the playlist items in the sidebar doesn’t work. This is due to this bug in maemo gtk. Vote for it if you want this fixed.

There is plenty still to be done. I don’t have stacks of time to work on it at the moment. Send me some encouragement and I may work a bit faster. :-)

Filed under: exaile, N800, maemo — twegener @ 22:02

2007-07-22

Exaile N800 port updated to 0.2.10

I’ve rebased the N800 port of Exaile to the latest upstream release. In the process, I tidied up my existing patches and it is marginally more stable now. Here are some of the more noticeable changes:

  • the track position is now a progress bar and looks much nicer (upstream)
  • the plugin loader works now (upstream)
  • the volume slider works better (upstream)
  • turned off a lot of my debug output from the previous release
  • fixed a bug where a playing track would occasionally stop out of the blue

.debs are here:

Next, I’ll probably work on making the interface a bit prettier, starting with hildon-izing the menus. I’d also like to add Replay Gain support to Exaile at some stage. And of course there are still a few bugs to iron out. There is a TODO file tucked away somewhere in the package with more details on things that need to be done.

BTW, make sure you change the foreground color in the preferences for the OSD notifications. There is some problem setting the background color at the moment which results in the notifications appearing blank. I’ll fix this (at least the default setting) soon.

Filed under: exaile, N800, maemo — twegener @ 22:56
Next Page »
Powered by WordPress

-->