Archive for the ‘Open Source Software’ Category

Using ATI Catalyst drivers on Ubuntu 12.10 with old hardware

February 14th, 2013 No comments

As of version 12.10, Ubuntu has upgraded the version of they include to the latest and unfortunately it is no longer compatible with the official ATI Catalyst drivers for some cards, specifically the HD2xxx, 3xxx and 4xxx models. The open source driver is the only officially supported alternative and, while it is fine for most uses, it doesn’t support the advanced power settings that the ATI driver does. This means that on my laptop in particular the fan runs constantly as it tries to cool down the overheating card.

So… no Ubuntu 12.10+ then?

Thankfully someone has created a PPA that successfully downgrades the version of to the maximum supported version for the official ATI driver. This step is obviously quite drastic and should not be used on production systems. However from the limited time that I have been running it things seem pretty stable. The PPA (and instructions) can be found at this link: AMD Catalyst Legacy

Categories: Tyler B, Ubuntu, Xorg/X11 Tags: , , ,

Batch Converting FLAC to MP3

April 2nd, 2012 1 comment

I came across this neat script somewhere on the internet while trying to batch convert a folder full of FLAC files to mp3 files. Hopefully it will help somebody else:

for file in *.flac; do flac -cd “$file” | lame -b 320 -h – “${file%.flac}.mp3”; done

Categories: Jon F, Open Source Software Tags:

Fixing build issues with phonon-backend-gstreamer-4.5.1

November 9th, 2011 No comments

I’ve decided to try and upgrade my LFS system to the latest version of KDE (4.7.3 as of the time of this writing) and correspondingly needed to upgrade phonon-backend-gstreamer. Unfortunately, following the previous version’s compilation instructions provided this nasty message:

[ 4%] Building CXX object gstreamer/CMakeFiles/phonon_gstreamer.dir/audiooutput.cpp.o
In file included from /sources/phonon-backend-gstreamer-4.5.1/gstreamer/audiooutput.cpp:22:0:
/sources/phonon-backend-gstreamer-4.5.1/gstreamer/mediaobject.h:200:38: error: ‘NavigationMenu’ is not a member of ‘Phonon::MediaController’
/sources/phonon-backend-gstreamer-4.5.1/gstreamer/mediaobject.h:200:38: error: ‘NavigationMenu’ is not a member of ‘Phonon::MediaController’
/sources/phonon-backend-gstreamer-4.5.1/gstreamer/mediaobject.h:200:69: error: template argument 1 is invalid/sources/phonon-backend-gstreamer-4.5.1/gstreamer/mediaobject.h:262:11: error: ‘NavigationMenu’ is not a member of ‘Phonon::MediaController’
/sources/phonon-backend-gstreamer-4.5.1/gstreamer/mediaobject.h:262:11: error: ‘NavigationMenu’ is not a member of ‘Phonon::MediaController’/sources/phonon-backend-gstreamer-4.5.1/gstreamer/mediaobject.h:262:42: error: template argument 1 is invalid
/sources/phonon-backend-gstreamer-4.5.1/gstreamer/mediaobject.h:263:45: error: ‘Phonon::MediaController::NavigationMenu’ has not been declared
/sources/phonon-backend-gstreamer-4.5.1/gstreamer/mediaobject.h:317:11: error: ‘NavigationMenu’ is not a member of ‘Phonon::MediaController’
/sources/phonon-backend-gstreamer-4.5.1/gstreamer/mediaobject.h:317:11: error: ‘NavigationMenu’ is not a member of ‘Phonon::MediaController’/sources/phonon-backend-gstreamer-4.5.1/gstreamer/mediaobject.h:317:42: error: template argument 1 is invalid
make[2]: *** [gstreamer/CMakeFiles/phonon_gstreamer.dir/audiooutput.cpp.o] Error 1make[1]: *** [gstreamer/CMakeFiles/phonon_gstreamer.dir/all] Error 2make: *** [all] Error 2

To fix this issue, make sure you have the latest GStreamer and phonon-backend-xine installed. Then I followed some of the advice from this KDE forum topic.

If, like me, you installed Qt into /opt/qt, create a symbolic link into the qt directory pointing to your system’s latest version of phonon. For later success with kde-runtime, create links to the libphonon libraries in /opt/qt-4.7.1/lib to your recently compiled /usr/lib64 versions (adjust paths to /usr/lib on 32-bit systems):

# mv /opt/qt-4.7.1/include/phonon /tmp
# ln -snf /usr/include/phonon /opt/qt-4.7.1/include/phonon
# cd /opt/qt-4.7.1/lib
# rm -rf libphonon*
# ln -snf /usr/lib64/
# ln -snf /usr/lib64/
# ln -snf /usr/lib64/
# ln -snf /usr/lib64/
# ln -snf /usr/lib64/
# ln -snf /usr/lib64/

Then rerun the compilation process for phonon-backend-gstreamer and voila, no more errors. (You’ll probably still have more issues to work out, but this gets past the phonon-backend-gstreamer blockade.)

Why do so many open source programs throw C/C++ warnings?

November 8th, 2011 4 comments

Seriously, I’d like to know, because this is a bit ridiculous.

For all the heavily encouraged coding styles out there, nearly all the open source software packages I’ve had to compile for Linux from Scratch have either

  1. Insanely chatty defaults for compilation; that is, GCC provides ‘notices’ about seemingly minor points, or
  2. A large number of warnings when compiling – unused variables, overloaded virtual functions, and deprecated features soon to disappear.

In the worst case, some of these warnings appear to be potential problems with the source. Leaving potentially uninitialized variables around seems to be a great way to run into runtime crashes if someone decides to use them. Overloading virtual functions with a different method signature has the same possible impact. And comparing signed and unsigned numbers is just a recipe for a crash or unpredictable behaviour down the line.

I just don’t get it. In my former development experiences, any compiler notifications were something to pay attention to. Usually when first developing an application, they were indicative of a typo, a forgotten variable or just general stupidity with the language. If a warning was absolutely unavoidable, it was specifically ignored in the build scripts with a clear explanation as to why.

So what’s the case with your programs? Have you noticed any stupid or insightful compiler messages scrolling past?

LFS so far – why you should build i686 and x86_64 binaries

November 7th, 2011 No comments

I’ve now been actively using my (Beyond) Linux from Scratch installation for about a week now, and it’s actually pretty neat to have something working that I built with just a general outline. Granted, the LFS guide is very well put together, but going beyond the basic console of a system requires a bit of time and effort.

In really any other distro, the package manager should really be your best friend (except when it breaks.) Even in a source-based Linux like Gentoo, Portage gives you a pretty decent idea of what’s installed and is able to keep track of dependencies. With LFS, there are really some times where I don’t want to have to locate and download seventeen .tar.bz2 files, and ./configure –prefix=/usr; make; make install to each one in sequence. What’s worse is when you run into three dependencies for a particular piece of software, and the first two install properly, but the third one depends on ten additional packages.

This is what building software in LFS looks like.

There are also some libraries that despite being built on an x86_64 system will come out as 32-bit, and require special compiler or configure flags in order to build a pure 64-bit version. LFS x86_64 does not really have patience for anything 32-bit. This is generally fine because you’re building most of the applications yourself, but you can’t “just run” any typical application unless it’s taken the architecture into account.

In summary, while it’s awesome to go to SourceForge and have the very latest version of a package, sometimes I just don’t feel like going through all those hoops and satisfying twenty conditions for a compile to take place. Perhaps I’m OK if your application uses a built-in library rather than relying on whatever happens to be installed in /usr/lib.

The takeaway from this is that besides providing the source, considerate developers should try and build an i686 and x86_64 binary from that same source. If your build system has issues or you find it painful to produce binary releases, remember that anyone attempting to follow the INSTALL file will run into the same pain points. Firefox, for example, has both i686 and x86_64 release tarchives. The 64-bit version works quite well on my LFS installation and it’s how I’m writing this post.

LFS: Installing VLC

November 6th, 2011 1 comment

Since the install of Linux From Scratch, one of the main issues I’ve been having is the playback of audio and video files. VLC does both quite well, so I decided to install it.

Like most of my installs in Linux From Scratch, there are millions of dependencies, and you have to install each one manually. I found that the CBLFS VLC page was a great help in determining which packages were required.

One thing I noticed, is that even though it lists some packages as “Optional,” VLC will not compile without a few of them. The easiest way to deal with this is to just install the optional packages as required.

I only ran into one issue while compiling:

D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace

The quick fix for this is to just run:

dbus-uuidgen > /var/lib/dbus/machine-id

Now that VLC is compiled, you can run it anytime by using vlc from the command-line. Make sure you don’t pull a Jake and run it as root. It will yell at you.

Linux From Scratch: We Have Lift-off…

November 4th, 2011 No comments

Hi Everyone,

Now that I have a relatively stable environment, I just wanted to write an update of how things went, and some issues that I ran into while installing my desktop environment.

No Sound

Not that I was expecting anything different from LFS, but I had no sound upon booting into KDE. I found this quite strange, as alsamixer was showing my sound card fine. One thing I can tell you, is that alsaconf is a filthy liar. My sound is now working, and it still says it can’t find my card. I’m not sure how I got it working, but here are a few tips.

  • Make sure your sound is un-muted in alsamixer.
  • Check your kernel to make sure that either support is compiled in for your card, or module support is selected.
  • If you selected module supprt, make sure the modules are loaded. For me, this was snd-hda-intel.

Firefox and Adobe Flash

I’m not going to go into too many details about Firefox, as Jake covered this in his post here, but I’d like to note that installing Flash into Firefox was quite easy. All I had to do was download the .tar.gz from Adobe, and do the following:

tar -xvf flash.tar.gz (or whatever the .tar.gz is called)
cd flash
cp ~/.mozilla/plugins (make sure plugins is created if it does not exist.)

KDE Crash On Logout

The first time I tried to logout of KDE, I noticed that it crashed. After doing some investigations, I found a solution here. You want to edit your $KDE4_PREFIX/share/config/kdm/kdmrc to reflect the following:



What’s Next?

I’m actually not sure what I’m going to do next. I suppose I should get VLC running on the system, but that shouldn’t be too difficult. I now have a working web browser, flash, and sound, which should be fine until I can get other things working.

Getting Firefox 3.6.23 to compile under LFS

November 4th, 2011 No comments

Using the instructions from the BLFS book with the latest available 3.6 build of Firefox, I was able to achieve success. I figured I’d try out 3.6 before going onto something with a terribly inflated version number, and as per usual, ran into some problems:

  • Rebuild libpng-1.5.5 with APNG support. This is actually optional as I ended up commenting out the –with-system-png option in mozconfig.
  • In the suggested mozconfig, comment out the last two lines:

    #ac_add_options --with-system-libxul
    #ac_add_options --with-libxul-sdk=/usr/lib/xulrunner-devel-

    to create a standalone build.

  • Apply the GCC patch from this Bugzilla report (direct download).
  • Apply a partial patch from the Chromium project of all places. I’ve customized it here:

    # TLE Patch for Firefox/LFS

    diff -u a/gfx/ots/src/ b/gfs/ots/src/
    — a/gfx/ots/src/ 2011-11-02 07:10:17.000000000 -0400
    +++ b/gfx/ots/src/ 2011-11-02 07:10:30.000000000 -0400
    @@ -5,6 +5,7 @@
    #include “os2.h”

    #include “head.h”
    +#include <cstddef>

    // OS/2 – OS/2 and Windows Metrics

  • Apply a GCC4.6-specific patch to fix various .cpp files. Some parts of the patch will fail; that’s expected.
  • Manually edit layout/style/nsCSSRuleProcessor.cpp and go to line 1199. Change the source code as follows:

    const nsCaseInsensitiveStringComparator ciComparator;
    should become

    const nsCaseInsensitiveStringComparator ciComparator = nsCaseInsensitiveStringComparator();
  • For the toolkit/components/places/src/SQLFunctions.cpp file, change line 126 to:
    const nsCaseInsensitiveStringComparator caseInsensitiveCompare = nsCaseInsensitiveStringComparator();
  • In toolkit/crashreporter/google-breakpad/src/common/linux/, make sure line 51 is changed to:
    const CPPLanguage CPPLanguageSingleton = CPPLanguage();
  • In toolkit/xre/nsAppRunner.cpp, line 990:

    static const nsXULAppInfo kAppInfo = nsXULAppInfo();
  • While this is resolved in newer Firefox versions, copy security/coreconf/ to security/coreconf/ to add support for the 3.1 kernel.

Your reward will be a working Firefox installation:


November 3rd, 2011 No comments

Tonight, I finally got X11 working on my Gentoo machine. For those who are following along, on Tuesday night I managed to get my machine up to a command line. The next logical step is a graphical window manager.

I’ve chosen to give Gnome3 a spin, but before I can dive into all of it’s shiny UI-goodness, I need an X11 server installed on my machine. Because I have an nVidia graphics card in my machine, and I’ve had great luck with Ubuntu’s proprietary nVidia drivers in the past, I decided to skip over the open-source Nouveau drivers this time around. I started out the installation by following Gentoo’s nVidia guide, supplementing with info pulled from the nVidia entry on the Gentoo Wiki.

Although X is supposed to configure your system automagically, it couldn’t find my screens or devices on my first run of startx. I looked about the internet for a bit, and found out that you can force X to automatically configure itself. Simply run Xorg -configure and copy the file that it creates into your Xorg config directory (you can find it in the log file, mine is at /usr/share/X11/xorg.conf.d/).

In my case, these automagical settings still needed a bit of tweaking. I noticed in the log file (again, mine is at /var/log/Xorg.0.log, your mileage may vary) that X was failing to load GLX, which is essentially for 3D acceleration. In my case, GLX was installed, but it NVIDIA’s version wasn’t being loaded. Once again, the Gentoo Wiki came through for me, instructing me to run eselect opengl set nvidia. This worked like a charm.

Finally, I had to install twm and xterm so that I could see X working. That was a quick and painless process. Now on to Gnome!

Categories: Gentoo, Jon F, Xorg/X11 Tags:

Closed source AMD/ATI drivers, wireless networking and Flash in Gentoo

November 3rd, 2011 No comments

Graphics Drivers

Continuing where I left off in my previous posts I now had a somewhat working desktop but a few things still had to be done. For one I am running this on my laptop and while the open source radeon drivers are actually pretty decent they’re just not quite good enough when it comes to power management. Thankfully the Linux closed source drivers are up to the job.

After reading through these two sites I was able to install the closed source drivers and get full control over my graphics card. To be perfectly honest I’m not exactly sure what steps got me to this point but I do know it was a mixture of the two sites.

Wireless Networking

After careful consideration I had come to the conclusion thought I had bricked my wireless. Worse yet after following the guide here (even the parts specific to KDE) I just couldn’t seem to get it to work. Thankfully I stumbled upon this guide which instructed me to install networking components for KDE. Apparently once I had installed this package all was good.


Flash was actually incredibly easy to install. All I had to do was enter the following command in a root terminal and then restart Firefox.

emerge adobe-flash


Another big install was the official Oracle Java JRE and JDK. To install just the JRE run the command dev-java/sun-jre-bin. If you want the JDK as well then run the command dev-java/sun-jdk. The only weird part about this was that this package is now considered restricted. To work around it simply download the bin file from Oracle and place it in /usr/portage/distfiles before running the command.

More to Come

There is still plenty more to do, like install LibreOffice and figure out why my computer currently can’t play audio CDs. I am however thankful that at this point I am at least a bit better off than some other fellow Linux Experiment participants.

My Desktop So Far

The high CPU load was because I had just finished compiling a bunch of stuff ūüėõ

KDE4, LFS: Make GTK Applications Look Like QT4 Applications

November 3rd, 2011 2 comments

Do your GTK applications (i.e. Firefox) look like something designed in the 90’s in KDE? I think I can help you.

I installed the latest Firefox, (not the one in the screenshot, I stole this.) and was very disappointed to see something like the following:

Tyler pointed me to the Gentoo guide here, which helped me find out which packages I needed.

If you install Chakra-Gtk-Config, and either oxygen-gtk or qtcurve (make sure to download the gtk2 theme), you will have better looking GTK applications in no time. Note that there are probably tons of other GTK themes for KDE4, these are just some suggestions to get you started.

That is much better.

Installing glib-1.2.10 in LFS to get XMMS working

November 3rd, 2011 1 comment

So I wanted to install XMMS in Linux From Scratch, as it’s one of the more reliable MP3 players and one of the first multimedia Linux apps I’ve used. It’s very reminiscent of Winamp 2:

If you would also like to get it installed, you’ll need the source and glib-1.2.10. Then, check out a common problem when installing glib, and a patch to fix the ./configure step.

LFS, pre-KDE: kdebindings and kdebase-runtime

November 2nd, 2011 No comments


Are you running into the following problem when compiling kdebindings? Well, you’re probably not, because you picked a saner distribution than LFS, but here goes anyway!

ASSERT failure in QList::at: “index out of range”, file /qt/trunk/include/QtCore/qlist.h, line 456
/bin/sh: line 1: 7841 Aborted (core dumped)

From, you can fix this with a patch to indexedstring.cpp:

--- generator/parser/indexedstring.cpp.orig 2011-02-23 22:12:38.695255708 +0100
+++ generator/parser/indexedstring.cpp 2011-02-24 02:36:09.035361151 +0100
@@ -195,12 +195,15 @@

QByteArray IndexedString::byteArray() const {
+  qDebug() << "strings()->size():" << strings()->size() << ", m_index:" << m_index;
return QByteArray();
else if((m_index & 0xffff0000) == 0xffff0000)
return QString(QChar((char)m_index & 0xff)).toUtf8();
-  else
+  else if (m_index < strings()->size())
return strings()->at(m_index).toUtf8(); /*arrayFromItem(globalIndexedStringRepository->itemFromIndex(m_index));*/
+  else
+    return QByteArray();

unsigned int IndexedString::hashString(const char* str, unsigned short length) {

I ended up removing the first qDebug() line before the if statement as I don’t need my compiler to be that chatty – I just need this package to compile properly. Reconfigure and attempt to make with:

    -DKDE_DEFAULT_HOME=.kde4 \
    -DSYSCONF_INSTALL_DIR=/etc/kde4 \
    .. &&


You can patch away your problems if you run into the following message:

[ 39%] Building CXX object kioslave/nfs/CMakeFiles/kio_nfs.dir/kio_nfs.o
In file included from /sources/kdebase-runtime-4.6.0/kioslave/nfs/kio_nfs.cpp:21:0:
/sources/kdebase-runtime-4.6.0/kioslave/nfs/kio_nfs.h:33:21: fatal error: rpc/rpc.h: No such file or directory
compilation terminated.

First, get libtirpc installed to make this work, but then again, you could have just guessed that you needed it, right? ūüėČ

Used under Creative Commons NC license from zhenech

There are some LFS-specific instructions to follow before libtirpc will compile:

  • Unpack glibc-2.14.1
  • In its directory, execute:
    mkdir -p /usr/include/rpc{,svc}
    cp sunrpc/rpc/*.h /usr/include/rpc
    cp nis/rpcsvc/*.h /usr/include/rpcsvc
  • Compile libtirpc with ./configure --prefix=/usr && make && make install

Then from Sourcemage, linking to an old Bugzilla installation:

diff --git a/kioslave/nfs/CMakeLists.txt b/kioslave/nfs/CMakeLists.txt
index b973a73..6556769 100644
--- a/kioslave/nfs/CMakeLists.txt
+++ b/kioslave/nfs/CMakeLists.txt
@@ -3,8 +3,8 @@ set(kio_nfs_PART_SRCS kio_nfs.cpp mount_xdr.c nfs_prot_xdr.c )

 kde4_add_plugin(kio_nfs ${kio_nfs_PART_SRCS})

-target_link_libraries(kio_nfs   ${KDE4_KIO_LIBS})
+target_link_libraries(kio_nfs   ${KDE4_KIO_LIBS} tirpc)


Once this is complete you should be able to get kdebase-runtime compiled.

Categories: God Damnit Linux, Jake B, KDE Tags:

LFS, pre-KDE: Errors Compiling qca-2.0.3

November 2nd, 2011 No comments

If you’re going through the Beyond Linux From Scratch guide, and run into this error while compiling qca-2.0.3 (and I assume many other versions of qca), I think I can help.

You don’t seem to have ‘make’ or ‘gmake’ in your PATH.
Cannot proceed.

The fix is relatively easy. Just make sure to have which installed on the machine. Jake found this out the hard way by looking through the configure script. Doing this experiment on Linux From Scratch has really given me an appreciation for distributions that come with basic utilities such as which.

Since which is very difficult to find on Google, here is a link:

How to enable reboot/shutdown in KDE on Gentoo

October 30th, 2011 No comments

Yeah… apparently the ability to restart or shutdown your system using a normal user account from within KDE SC is not something that is installed by default. In order to accomplish this you need to compile and install the kde-misc/kshutdown package using the following command from a root terminal:

emerge kde-misc/kshutdown

I also had to create a new file called /etc/portage/package.accept_keywords in order for this to work. Inside that file just put the following text


Categories: Gentoo, KDE, Tyler B Tags: , ,

Gentoo (A.K.A. “Compiling!”)

October 30th, 2011 No comments

For this version of the experiment I have chosen to try my hand at installing Gentoo. Gentoo, for those who don’t know, or who weren’t following Jake’s posts during the original experiment, is a fully customizable distribution where you have to compile and install all of your applications from source code downloads. Thankfully they do offer some excellent package management tools, Portage in particular, that help automate this process.


I suppose a bit of background is the best place to start. During the original experiment I ran Fedora which, while having a whole host of issues of its own, was more or less a straight forward experience. Since that time I’ve dabbled here and there with other distributions, Ubuntu, openSUSE, Linux Mint, among others. For this experiment I wanted a bit of a challenge. I now know the basics, and then some, about running a day-to-day desktop Linux system but I still don’t fully understand all of the inner workings that are going on under the hood. That’s where my choice of Gentoo comes in.

Getting Started

I began by following the rather excellent Gentoo Handbook which thankfully got me to the point where I was able to boot my machine, without the installation media, into a kernel that I had personally configured and compiled. To say that this was smooth sailing probably isn’t accurate, but considering what was actually involved in getting to this point, and how quickly I managed to do it, is a testament to how easy the guide actually is to follow along with.

One thing I would stress to Linux users who may want to try Gentoo and are coming from a more user friendly distribution like Ubuntu is to make sure to get a list of hardware before you start. Run lshw in your Ubuntu (or whatever) install and save the output somewhere. This will show you the list of hardware devices and more importantly the drivers required to run them correctly. I ran into a snag early on where my network card wasn’t working even though Gentoo claimed to be loading the drivers correctly. A quick modprobe later of the driver that was shown to be in use from my earlier install, tg3, and I was back and Internet enabled. Sadly even the lshw output didn’t provide a whole lot of direction when it came to picking and choosing some of the more obscure configuration options for my kernel.

The Challenge

So what do you do when you can finally turn your computer on and boot into your kernel? Well install X I suppose. Unfortunately it was this step that caused me more grief than any of the others. You see apparently you’re supposed to remember what graphics card is in your machine before you try and build a kernel that supports it…

Following along with the X Server Configuration Guide I made it all the way up until the point when I had to specify which “in-kernel firmware blobs” I wanted to compile into my kernel. After, literally, hours of compiling X and then a series of trial and error attempts I finally found a combination that seemed to work. For my own reference the only firmware blob I seem to require is


The Wait

I finally had a system that could start X and present me with multiple(!) graphical terminals. By this point I had sunk about ~5 hours into this project. Now it was time to try setting up a desktop environment. My two main choices were GNOME 3.x or KDE SC. I opted for KDE for two reasons:

  1. I hadn’t used KDE 4.x in a couple of releases and didn’t mind it last time I had tried it
  2. I have yet to try GNOME 3.x but since it is quite the departure from the 2.x series I figured I would go with what I know for now and maybe try GNOME 3.x later

Pulling up the Gentoo KDE guide I began my compilation of KDE SC.

emerge -av kde-meta

More than 400 packages needed to be compiled and installed. My system, a Core2Duo at 2.4Ghz and 4GB of RAM, took approximately 24 hours to finish this single process. Gentoo is certainly not a system that you can expect to have up and running in an afternoon if you’re expecting to have a fully working desktop environment.


USE Flags are ridiculous. I understand the concept for them but the fact that you have to continuously add to this list in order to compile programs you explicitly told it to install is a bit much. If you don’t know what a USE Flag is consider yourself lucky. For those thinking about installing Gentoo, don’t worry you’ll know soon enough.

Be sure to change the root password and add any user accounts after you chroot into your new installation. Otherwise you’ll end up like me and boot into a system that you can’t log into!

Next Steps

Well I’d like to finish setting up my desktop. I now have KDE installed but there seems to be some missing components that I hope won’t require a re-compilation… I’ll let you know how that turns out. I also need to sort out my wireless card and get that working. But hey at least for now I can browse the web in my new installation!

Categories: Gentoo, KDE, Tyler B Tags: , , ,

Linux Multimedia Studio on Ubuntu 10.04

July 31st, 2011 1 comment

Recently, Tyler linked me to Linux Multimedia Studio, a Fruityloops-type application for Linux. Since I’m big into music recording and production, he figured that I’d be interested in trying it out, and he was right. Unfortunately, the developers of same were not as interested.

To start off, I installed the application from a PPA with the following terminal commands:

sudo apt-add-repository ppa:dns/sound
sudo aptitude update
sudo aptitude install lmms

After the install process finished, I tried to launch the application from the command line, only to see a bunch of nasty error messages:

jonf@THE-LINUX-EXPERIMENT:~$ sudo lmms
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
Segmentation fault

I dumped the errors into Google, and found a helpful thread on the Ubuntu forums that suggested that I uninstall Bluetooth Audio Services from my machine. Since I don’t use bluetooth audio in any capacity, I happily obliged. When finished, my list of installed items with Bluetooth in the name looked like this:

A list of installed software matching the search term "bluetooth" in Ubuntu Software Centre

Unfortunately, I didn't think ahead enough to note down the names of the packages that I uninstalled.

After ridding myself of Bluetooth audio support, I tried to launch the application again. Unfortunately, I got another Segmentation fault error:

jonf@THE-LINUX-EXPERIMENT:~$ sudo lmms
Segmentation fault

Reading on in the thread, I saw somebody suggest that I check the dmesg tail for messages pertaining to the crash:

jonf@THE-LINUX-EXPERIMENT:~$ dmesg | tail
[  233.302221] JFS: nTxBlock = 8192, nTxLock = 65536
[  233.314247] NTFS driver 2.1.29 [Flags: R/O MODULE].
[  233.343361] QNX4 filesystem 0.2.3 registered.
[  233.367738] Btrfs loaded
[ 2233.118020] __ratelimit: 33 callbacks suppressed
[ 2233.118026] lmms[10706]: segfault at 7f241c7fdd80 ip 00007f241c7fdd80 sp 00007f24187f8a38 error 14 in[7f241ca01000+1000]
[ 2523.015245] lmms[10808]: segfault at 7fd80e9bcd80 ip 00007fd80e9bcd80 sp 00007fd80a9b7a38 error 14 in[7fd80ebc0000+1000]
[ 2671.323363] lmms[10845]: segfault at 7fbe39a77d80 ip 00007fbe39a77d80 sp 00007fbe35a72a38 error 14 in[7fbe39c7b000+1000]
[ 2836.885480] lmms[11246]: segfault at 7f885b71ed80 ip 00007f885b71ed80 sp 00007f8857719a38 error 14 in[7f885b922000+1000]
[ 3039.773287] lmms[11413]: segfault at 7ff83056ed80 ip 00007ff83056ed80 sp 00007ff82c569a38 error 14 in[7ff830772000+1000]

On the last few lines, you can see that the error was thrown in a module called A bit of Googling turned up the fact that this module is a part of the LADSPA (Linux Audio Developers Simple Plugin API) stack, which provides developers with a standard, cross-platform API for dealing with audio filters and effects.

Scrolling down in the aforementioned thread, I found a post that suggested that I kill all PulseAudio activities on my system before attempting to run the application. PulseAudio is another part of the Linux audio layer that allows user-land applications to talk to your sound hardware via a simple API. It also provides some effects plugins and mixdown capabilities. I went ahead and killed the PulseAudio server on my machine with the following command:

jonf@THE-LINUX-EXPERIMENT:~$ killall pulseaudio

After executing this command, I still got a Segmentation fault when starting LMMS under my user account, but did actually get to a Settings panel when running it with Sudo:

jonf@THE-LINUX-EXPERIMENT:~$ sudo lmms
Home directory /home/jfritz not ours.
ALSA lib pcm_dmix.c:1010:(snd_pcm_dmix_open) unable to open slave
Playback open error: Device or resource busy
Expression 'snd_pcm_hw_params_set_buffer_size_near( self->pcm, hwParams, &bufSz )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1331
Expression 'PaAlsaStreamComponent_FinishConfigure( &self->playback, hwParamsPlayback, outParams, self->primeBuffers, realSr, outputLatency )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1889
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1994
Couldn't open PortAudio: Unanticipated host error
Home directory /home/jfritz not ours.
Home directory /home/jfritz not ours.

Although the output appeared to be riddled with audio layer errors, and the Audio Settings tab of the Setup panel gave me a clue as to why:

Notice how the Audio Interface setting in that image says “Pulse Audio (bad latency!)”. I would hazard a guess that the latency issues with PulseAudio have something to do with the fact that I killed it just prior to getting this damned thing to launch. When I hit the OK button, I was able to see the application, but there was no sound.

Figuring that sound was a necessary component of an audio production application, I booted back to the Setup menu, and told the app to funnel its audio through JACK instead of PulseAudio. The JACK Audio Connection Kit is another sound subsystem, kind of like PulseAudio, that provides an API that developers can use to interface with a machine’s audio hardware. Because of its low latency performance, JACK is often considered to be the standard API for high-quality audio recording and production apps. Unfortunately, it doesn’t work worth a damn in LMMS:

jonf@THE-LINUX-EXPERIMENT:~$ sudo lmms
jackd 0.118.0
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details

no message buffer overruns
JACK compiled with System V SHM support.
loading driver ..
SSE2 detected
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
control device hw:0
SSE2 detected
all 32 bit float mono audio port buffers in use!
cannot assign buffer for port
cannot deliver port registration request
no more JACK-ports available!
No audio-driver working - falling back to dummy-audio-driver
You can render your songs and listen to the output files...
Home directory /home/jfritz not ours.
Home directory /home/jfritz not ours.
the playback device "hw:0" is already in use. Please stop the application using it and run JACK again
cannot load driver module alsa
Home directory /home/jfritz not ours.

Having dealt with JACK on a previous install, I had one more trick up my sleeve in my effort to get this bastard application to make a sound. I installed the JACK Control Panel from the Ubuntu Software Centre. It’s a QT app that interfaces with the JACK server and allows you to modify settings and stuff.

With it installed, I pressed the big green (or is it red – I’m colour blind, and hate when developers use these two colours for important status messages) Start button, only to encounter some nasty errors:

That might be a problem. I hit the messages button and found a message advising me to make a change to the /etc/security/limits.conf file so that JACK would be allowed to use realtime scheduling:

JACK is running in realtime mode, but you are not allowed to use realtime scheduling.
Please check your /etc/security/limits.conf for the following lines
and correct/add them:
@audio - rtprio 100
@audio - nice -10
After applying these changes, please re-login in order for them to take effect.
You don't appear to have a sane system configuration. It is very likely that you
encounter xruns. Please apply all the above mentioned changes and start jack again!

I figured that it was worth a shot, considering how far I’ve already gone just to try out a piece of software that I don’t really even need. I made the requested changes in the config file, restarted my machine and tried again… only to be greeted by the same damned error message.

At this point, I decided to give up on LMMS. It’s too damned complicated, and ultimately not worth my time. Perhaps when they release a version that I can install and start using without an hour of troubleshooting, I’ll come back and give it another shot. In the mean time, if you’re looking for a decent drum machine with more than a few tricks up its sleeve, check out Hydrogen Drum Machine. It works very well, and I’ve created some neat stuff in it.

Create a GStreamer powered Java media player

March 14th, 2011 1 comment

For something to do I decided to see if I could create a very simple Java media player. After doing some research, and finding out that the Java Media Framework was no longer in development, I decided to settle on GStreamer to power my media player.

GStreamer for the uninitiated is a very powerful multimedia framework that offers both low-level pipeline building as well as high-level playback abstraction. What’s nice about GStreamer, besides being completely open source, is that it presents a unified API no matter what type of file it is playing. For instance if the user only has the free, high quality GStreamer codecs installed, referred to as the good plugins, then the API will only play those files. If however the user installs the other plugins as well, be it the bad or ugly sets, the API remains the same and thus you don’t need to update your code. Unfortunately being a C library this approach does have some drawbacks, notably the need to include the JNA jar as well as the system specific libraries. This approach can be considered similar to how SWT works.


Assuming that you already have a Java development environment, the first thing you’ll need is to install GStreamer. On Linux odds are you already have it, unless you are running a rather stripped down distro or don’t have many media players installed (both Rhythmbox and Banshee use GStreamer). If you don’t it should be pretty straight forward to install along with your choice of plugins. On Windows you’ll need to head over to ossbuild where they have downloadable installers.

The second thing you’ll need is gstreamer-java which you can grab over at their website here. You’ll need to download both gstreamer-java-1.4.jar and jna-3.2.4.jar. Both might contain some extra files that you probably don’t need and can prune out later if you’d like. Setup your development environment so that both of these jar files are in your build path.

Simple playback

GStreamer offers highly abstracted playback engines called PlayBins. This is what we will use to actually play our files. Here is a very simple code example that demonstrates how to actually make use of a PlayBin:

public static void main(String[] args) {
     args = Gst.init("MyMediaPlayer", args);

     Playbin playbin = new PlayBin("AudioPlayer");
     playbin.setVideoSink(ElementFactory.make("fakesink", "videosink"));


So what does it all mean?

public static void main(String[] args) {
     args = Gst.init("MyMediaPlayer", args);

The above line takes the incoming command line arguments and passes them to the Gst.init function and returns a new set of arguments. If you have every done any GTK+ programming before this should be instantly recognizable to you. Essentially what GStreamer is doing is grabbing, and removing, any GStreamer specific arguments before your program will actually process them.

     Playbin playbin = new PlayBin("AudioPlayer");
     playbin.setVideoSink(ElementFactory.make("fakesink", "videosink"));

The first line of code requests a standard “AudioPlayer” PlayBin. This PlayBin is built right into GStreamer and automatically sets up a default pipeline for you. Essentially this lets us avoid all of the low-level craziness that we would have to normally deal with if we were starting from scratch.

The next line sets the PlayBin’s VideoSink, think of sinks as output locations, to a “fakesink” or null sink. The reason we do this is because PlayBin’s can play both audio and video. For the purposes of this player we only want audio playback so we automatically redirect all video output to the “fakesink”.

The last line is pretty straight forward and just tells GStreamer what file to play.


Finally with the above lines of code we tell the PlayBin to actually start playing and then enter the GStreamer main loop. This loop continues for the duration. The last line is used to reset the PlayBin state and do some cleanup.

Bundle it with a quick GUI

To make it a little more friendly I wrote a very quick GUI to wrap all of the functionality with. The download links for that (binary only package), as well as the source (all package) is below. And there you have it: a very simple cross-platform media player that will playback pretty much anything you throw at it.

Please note that I have provided this software purely as a quick example. If you are really interested in developing a GStreamer powered Java application you would do yourself a favor by reading the official documentation.

Binary Only Package All Package
File name:
Version: March 13, 2011
File size: 1.5MB 1.51MB
File download: Download Here Download Here

Originally posted on my personal website here.

Recovering a Corrupted Banshee Database

February 27th, 2011 11 comments

A couple of nights ago, I left Banshee running overnight, filling my phone with music to listen to the next day at work. Sometime during that process, the media player crashed in a big way, and my entire system ground to a halt. When I woke up the next morning, my computer was frozen solid, with no keyboard or mouse input accepted, and the system clock hadn’t advanced since 11:16pm the previous night. I did a hard reboot, hoping that all would be well when it came back up.

Boy was I wrong.

The Problem

It seems that when Banshee went down, it took my library database file with it. Now, whenever I launch the application, I get a lovely dialog box that looks something like this:

Launching the application from the command line provides more details:

jonf@THE-LINUX-EXPERIMENT: ~/.config/banshee-1$ banshee-1
[Info  11:20:32.175] Running Banshee 1.9.0: [source-tarball (linux-gnu, x86_64) @ 2010-12-09 13:07:07 EST]
[Warn¬† 11:20:32.451] Service `Banshee.Database.BansheeDbConnection’ not started: The database disk image is malformed
database disk image is malformed
[Warn  11:20:32.453] Caught an exception РMono.Data.Sqlite.SqliteException: The database disk image is malformed

Apparently, the SQLite database that forms the backend of Banshee is severely corrupted, and the application can’t open it for reading. Based on the command line output, I figured that Banshee uses SQLite3 for its database, and after a little bit of research, I found out that it stores the database file at ~/.config/banshee-1/banshee.db. After installing the SQLite3 package from my repositories with the command sudo apt-get install sqlite3, I was able to connect to the database without issue. A little bit of reading over at showed me how to do an integrity check on the database, which came back with some nasty results:

jonf@THE-LINUX-EXPERIMENT:~/.config/banshee-1$ sqlite3 -interactive banshee.db
SQLite version 3.6.22
Enter “.help” for instructions
Enter SQL statements terminated with a “;”
sqlite> PRAGMA integrity_check;
*** in database main ***
Main freelist: 2291 of 2292 pages missing from overflow list starting at 18928
On tree page 28 cell 4: Child page depth differs
On tree page 28 cell 6: 2nd reference to page 15475
On tree page 28 cell 6: Child page depth differs

On tree page 16807 cell 25: Child page depth differs
On tree page 16807 cell 26: 2nd reference to page 18171
On tree page 16807 cell 26: Child page depth differs

Each line of this output refers to a broken or corrupted index, with a total of 99 errors reported. Yikes.

The Solution

Before attempting to fix the problem, I made a backup of the broken database, just in case some data could be resurrected from it. To do this, I made sure that Banshee wasn’t running, and then made a copy of the database file with the command cp ~/.config/banshee-1/banshee.db ~/.config/banshee-1/banshee.db.old.

Since the integrity check showed a number of broken or corrupted indices, I thought perhaps I would be able to recover the database by rebuilding all of its indices. A quick scan of the SQLite documentation turned up the REINDEX function. Again, I connected to the database through the command-line interpreter, and gave it a shot:

jonf@THE-LINUX-EXPERIMENT:~/.config/banshee-1$ sqlite3 -interactive banshee.db
SQLite version 3.6.22
Enter “.help” for instructions
Enter SQL statements terminated with a “;”
sqlite> REINDEX;
Error: database disk image is malformed

That clearly didn’t work.

My next thought was to drop and re-create all of the indices in the database, in hopes that I could rebuild them. I used the graphical tool sqliteman (available from your repositories with the command sudo apt-get install sqliteman) to dump the database schema out to a text file and then scrolled through the file looking for each index. I managed to drop all but four of them, but got the image malformed error whenever I tried to drop the remaining four or recreate any of the ones that were successfully dropped.

Out of ideas, I resorted to attempting to recover what data I could from the mangled file. Using sqliteman, I created a dump of my library data to go along with the schema dump that I had created earlier. The good thing about this dump is that it contains all of the data with none of the indices. Next, I opened up a terminal and navigated to the temporary directory where I had saved the database dump. Using the sqlite3 command line interpreter, I built an image of the old database from the dump:

jonf@THE-LINUX-EXPERIMENT:~/Desktop/banshee$ sqlite3 -interactive banshee.db
SQLite version 3.6.22
Enter “.help” for instructions
Enter SQL statements terminated with a “;”
sqlite> .read dump.sql

Finally, I copied the newly created database into the banshee data directory with the command cp ~/Desktop/banshee/banshee.db  ~/.config/banshee-1/banshee.db.

The next time I started the application, all of my data was restored.


I’ve put a lot of work into collecting and maintaining all of the music in my Banshee library. In order to avoid losing all of that work, I’ve decided to write a short script that takes a backup image of the library database every so often, and puts it in a safe place on my hard drive. Once I get that put together, I’ll throw it up on here for so that everybody can use it.

How to Compile Banshee 1.9.0 on Ubuntu 10.04

December 9th, 2010 1 comment

Regular readers of this site will know that I’m no fan of Rhythmbox. When I recently installed Ubuntu 10.04 on my desktop PC, I decided to give Gnome’s default media player a few days to win back my affection. Unfortunately, while Novell’s Banshee project appears to be moving ahead with lots of great new features, Rythmbox still suffers from the issues that I outlined in my now infamous lambasting of it, nearly 8 months ago. To be fair, the pre-installed version of Rythmbox is only 0.12.8 on Ubuntu 10.04 (the same one that I reviewed previously), while the project has forged ahead to version 0.13.2.

Regardless, I prefer to listen to my music with Banshee, and I’m itching to try the latest version. On November 10th, the project released Banshee 1.9.0, and it looks positively excellent. I decided to give it a go, and downloaded the source tarball from the project’s website. Following are the steps that were necessary to install it:

  1. Head over to a terminal and install intltool, libgtk2.0-dev, libgtk2.0-cil-dev, libmono-dev, mono-gmcs, libmono-addins-cil-dev, monodoc-base, boo, libboo-cil-dev, libmono-addins-gui-cil-dev, libndesk-dbus-glib1.0-cil-dev, libgdata-dev, libgdata-cil-dev, libtag1-dev, libtaglib-cil-dev, sqlite3, libsqlite3-dev, libgconf2.0-cil-dev, libmtp-dev, libmono-zeroconf1.0-cil, libmono-zeroconf1.0-cil-dev, libwebkit-dev, libwebkit-cil-dev, and libsoup-gnome2.4-dev with the following command:

    sudo apt-get install intltool libgtk2.0-dev libgtk2.0-cil-dev libmono-dev mono-gmcs libmono-addins-cil-dev libmono-addins-gui-cil-dev monodoc-base boo libboo-cil-dev libndesk-dbus-glib1.0-cil-dev libgdata-dev libgdata-cil-dev libtag1-dev libtaglib-cil-dev sqlite3 libsqlite3-dev libgconf2.0-cil-dev libmtp-dev libmono-zeroconf1.0-cil libmono-zeroconf1.0-cil-dev libwebkit-dev libwebkit-cil-dev libsoup-gnome2.4-dev

  2. Next, you’ll need GStreamer and a few of its base plugins package: libgstreamer0.10-dev and libgstreamer-plugins-base0.10-dev

    sudo apt-get install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev

  3. If you want to play music encoded in non-free formats like mp3, you’ll also need a few restricted GStreamer libraries like gstreamer-plugins-good, gstreamer-plugins-bad, gstreamer-plugins-bad-multiverse, gstreamer-plugins-ugly, and gstreamer-plugins-ugly-multiverse.

    sudo apt-get install gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-bad-multiverse gstreamer-plugins-ugly gstreamer-plugins-ugly-multiverse

  4. Since I don’t have an iPod or similar Apple device, I’ve configured my installation to disable Apple device support. If you have an iPod, you can lose the –disable-apple-device and –disable-ipod flags after the configure command, but you’ll also need to add a couple of extra libraries to your system. To compile and install Banshee, navigate to the folder where you unzipped the tarball, and type the following in your terminal:

    ./configure –disable-appledevice –disable-ipod
    sudo make
    sudo make install

Banshee should now be installed. From your terminal, type


as a sanity check. Once the application launches, select Help > About and ensure that the version number is 1.9.0. If so, you should be good to go.

I’ll try to post a full review of this latest version of Banshee within a couple of days. In the mean time, happy listening!