KDE 3.5.10: White noise when ripping audio CDs to MP3
Tagged:  •    •  

One of the Arch Linux systems I maintain is still running KDE 3 from the KDEmod repositories. We're talking about KDE 3.5.10 here. Unfortunately, there's a bug in the audio CD ripping process. When you drag a (virtual) MP3 file/folder from the audiocd:// KIO-slave, it produces only MP3 files with white noise. Unless your audio CD contains white noise only, there's no problem of course, in other cases you might like to fix this.

After some searching I found this article. The workaround boils down to write a wrapper for the lame encoder to enforce spitting out files in little-endian order.

First, move the distribution's lame executable:

mv /usr/bin/lame /usr/bin/lame-actual

Then, create this script and store it as /usr/bin/lame:

#!usr/bin/sh
lame-actual --big-endian -x "$@"

Now make sure this new script is executable:

chmod 755 /usr/bin/lame

The KIO audiocd:// slave should now produce valid MP3 files.

Of course this is a dirty workaround. Be careful when you update lame, the problem might come back or your distribution might complain that you've been messing with system files. Whenever you upgrade, make sure to repeat the steps above again.
The long term solution would be to upgrade to a newer KDE. In KDE 4, this bug does not appear.