sysadmin

Ubuntu Studio Tweaks

As I’ve been using Ubuntu Studio, I’ve discovered a number of must-have (for me, anyhow)  packages which were not installed by default.

As with any Ubuntu-based distro, there are a number of steps required to enable non-free and/or non-supported software.  I won’t bother to go into them, because Ubuntu has reached the point where it mostly prompts you to add codecs and things when you need them.  Of course, you should enable all repositories in the application manager (better yet, use Synaptic or, my favourite, Aptitude from the command line).

One exception I had to add was the “unstripped” versions of all the ffmpeg libraries.  I don’t think this is actually broken, just disabled in the default version of Ubuntu.  I just went into Synaptic, searched for ffmpeg, and added all the packages with “unstripped” in the name. (for details see Bug #254201 in ffmpeg-debian (Debian): “feature regression: ffmpeg lacks some video encoders (like h263+, MPEG4, maybe more…)”).  I use ffmpeg at the command line to encode video files and it is used in the background by many other video manipulation tools.

Some other packages I wanted to add to UbuStu:

  • openoffice (I used it to log my clips in a spreadsheet)
  • emacs (indispensable for tweaking config files and taking notes)
  • ntp (to make sure I’ve got the right time)
  • fslint (very useful for finding and removing duplicate files)
  • most (better than more or less for paging)
  • flashplugin-nonfree (to play flash in Firefox)
  • gstreamer (and plugins)
  • rhythmbox (my favourite jukebox for large music collections)
  • mplayer (commandline video player)
  • wv (commandline msoffice document dump)
  • elinks (commandline browser — comes in handy more often than you’d think)

I’m sure I’ll add plenty of more packages as I go along, but these are a few of the ones I’ve wanted so far.  I’ve also added a number of other applications, such as PiTiVi, Kdenlive, Avidemux, VideoCut, which I’m hoping to play with and get to know better.

Auditioning Multimedia Distros (part 3 – Ubuntu Studio)

After trying dyne:bolic and pure:dyne, I reverted to my last resort:  Ubuntu Studio (Intrepid Ibex version).

It isn’t that I dislike Ubuntu.  I’ve had it installed on my laptop and on our family computer for years.  I’ve also recommended it to friends several times with great success.  There were, however, two reasons why I wanted to avoid it for my multimedia workstations:

  1. Ubuntu uses the Gnome desktop, which, although it is great, needs more system resources than, for instance, Xfce.  I wanted to leave as much CPU and memory as possible for Cinelerra.
  2. Ubuntu Studio comes pre-configured with loads of good multimedia applications, but Cinelerra itself isn’t one of them.

It turns out that I needn’t have worried on either score.  Installing Cinelerra turned out to be painless.  I used the community version (see Cinelerra :: a video editor and compositor for Linux for information on adding the repository to apt and installing the package).  Further tips for installing Cinelerra on UbuStu can be found here.

Once I had Cinelerra installed, it seemed to be working, but I still needed to do some tweaking of Cinelerra’s own settings to make it usable.  I’ll cover that in another post.

Beyond that, UbuStu worked like a charm without any performance issues on my aging hardware.  I’m also really enjoying the artwork and styling of the default UbuStu desktop.  Very snazzy.

Sorting Out My Music Library

I have about 140GB of music which I have ripped from my CD collection or downloaded.  Since I was moving files around anyhow and eliminating my server, I decided I should reorganize my music library a little.  It contains files in several formats, with many duplicates.  I’m not finished, but I did make significant progress using the following techniques (some of which would work for any large collection of files of any type).

First, I decided that I would try to store everything in directories according to <Artist>, then <Album>.  I used to think that it didn’t matter how the files were organized because jukebox programs (like Rhythmbox, my usual choice) use tags to sort things out anyhow.  My son puts the <Artist> directories in <Genre> directories to help manage them.  I find that too arbitrary (plus it is a daunting task requiring even more hand-sorting).  I would’ve kept the <Artist> directories all together, but there are simply too many to be manageable, so I decided to put them in alphabetical ranges (<A-F>, <G-M>, etc.).

Secondly, I decided that I would try to name the files according to “<Artist> – <Title>.<extension>” format.  That doesn’t matter for the files which are already sorted into directories, but it was necessary for all the unsorted files named things like “Track 05.mp3″.

Tools which I found useful:

EasyTAG – Tag editor for MP3, Ogg Vorbis, FLAC, MusePack and Monkey’s Audio files, …

This program is not extremely friendly, but it bridges the gap between filenames and tags.  The tags can be used to create new filenames.  Beware that this can be a fairly slow process.  Some notes about Easytag:

  • you must navigate to the folder where your files are, but every time you move from one folder to the next in the program, it prompts you to save changes even if you haven’t made any;
  • be careful to select all of the files you want to modify in the middle window before proceeding;
  • select “Rename Files and Directory” from the “Scanner” menu.  Select the naming pattern you want from the drop down and click the greenish scan button.
  • note that the changes don’t actually happen until you navigate away from the current directory and confirm that you want to make the changes;
  • the file renaming works quite reliably, but takes a long time if you have many files.

Easytag has lots of other features, but I haven’t tried them yet.

Bulk Rename Utility

This is a great utility for renaming many files at once and previewing the results before you commit the changes.  Unfortunately, it doesn’t seem to work on directory names (though it does work on filenames across directories).

The rename command

This is a bash utility for renaming files according to a regular expression pattern.  It does work on directories as well as files.  I love sed and this tool is a quick and easy way to use it’s power for renaming.  For example, to replace underscores in file or directory names with spaces:

$rename ‘s/_/ /g’ *

USB Hard Drive Problem

I have a Western Digital 1TB external USB hard drive.  Under Debian, it worked some of the time, but would power itself off in the middle of major copy jobs.  The drive would unmount very ungracefully and my copy would end with “input/output error” for every file after the first few.

The drive works fine with my Ubuntu Hardy laptop, so I started digging to figure out why it wasn’t working in Debian.

After lots of research, I figured out the problem.  Some versions of the Linux kernel have a USB 2.0 module which doesn’t work.  I tried loading other kernels, but couldn’t come up with one that solves the problem for that drive.

To fix the problem, I had to just remove that module (as root):

#modprobe -r ehci_hcd

For a more permanent solution, you must rename the module so it doesn’t get reloaded on reboot.  There’s probably a more elegant way to do this, but here is what I did in my new Ubuntu Intrepid setup:

#cd /lib/modules/2.6.27-11-generic/kernel/drivers/usb/host/

#mv ehci-hcd.ko kk_ehci-hcd.ko

Without this module, the drive works fine, though very slowly.  I’ve moved all my video clips to the internal hard drive for editing.

Details here: Bug #88746 in linux-source-2.6.20 (Ubuntu): “ehci_hcd module causes I/O errors in USB 2.0 devices”

Choosing a Multimedia Linux Distro

For reasons I won’t go into yet, I decided to take my tried and true Debian server and turn it into a multimedia workstation.

The machine is a Shuttle barebones case with an Athlon XP 1700+ CPU, 2GB of RAM, and a ATI Radeon video card.  It contains two WD 200GB drives, plus I’ve added a WD 1TB (I love writing that!) external USB drive.

The system isn’t exactly ideal for it, but my ultimate goal is to use it for video editing with Cinelerra in particular.  My old Debian install had too many idiosyncracies to continue with, but I really wanted to stay with a distro in the Debian family, which I’m very familiar and happy with.

I narrowed the choice down to three options.  There are other similar distros out there which might do (64Studio, Musix, for example), but these seemed like the best options for me:

  1. d y n e : b o l i c



    Advantages
    • plenty of great software, including Cinelerra
    • uses low-resource window manager
    • seems to have a good user base and a bit of history behind it
    • made by Rastafarians!
    Disadvantages
    • doesn’t use Debian’s apt for package management, so you must wait for the next dyne:bolic release for upgrades
  2. pure:dyne



    Advantages
    • entirely Debian, with traditional package management
    • uses low-resource window manager
    • supported by Arts Council England
    Disadvantages
    • although it used to be based on dyne:bolic, the latest versions have been recreated from scratch from Debian, so there’s probably still work to do
  3. Ubuntu Studio



    Advantages
    • Ubuntu-based, so it will have plenty of support
    Disadvantages
    • uses Gnome
    • doesn’t include Cinelerra

I tested all three, but I ended up using Ubuntu Studio. Why? Because of hardware problems of one sort or another. I’ll explain more later.

First Post!

After a week of sysadmin Hell remaking my server into a multimedia workstation, I’ve decided I should document my experiences on this and future projects in case they may later be of use to me or somebody else.