30 June 2009

Sorry, moderation switched on

Sorry everybody, but I've been attacked by spammers of late, and have had to switch moderation on, at least for now, but I'm terribly liberal and will approve every single message that talks badly of my, uh, bum. When things calm down again I'll turn it off I'm sure, but I seriously wish Blogger.com had a better comments system (or even a better way to kill spam from an infected site; the current way is just absolute rubbish and painful!). Or maybe this is another sign from below to switch to WordPress which I've got a half-finished Topic Maps plugin for and integrates against my shiny new xSiteable Framework 3.0. Hmm.

24 June 2009

Linux sound-system sucks!

Yeah, so I've been running Linux / Ubuntu now for about 4 months, and it has been a pleasure almost the whole way. I've had to dabble in Windows from time to time, especially "supporting" our two other Windows machines in the house, but every time I meddle with them, I'm extremely happy to return to my Ubuntu Jaunty 9.04. For the most parts.

There is this one area which sucks, though, and I mentioned it in one of my previous reports that I couldn't get the microphone to work. Here's the low-down on this whole thing ;

Ubuntu comes out of the box with ALSA (Advanced Linux Sound Architecture) and PulseAudio (a client/server system for sound over networks, amongst other things), and the two connected together in GNOME (the default Window manager it uses) should in theory work. But the forums and intertubes are abundant with problems relating to sound setup, anything from sound not working at all, some aspects not working, cracking or garbled sounds, and so on. Because Linux is open-source and has the advantage of "so many options", then the disadvantage of "so many options" also becomes quite clear.

When you write your software you write for either OSS (Open Sound System; try Googling for OSS and they'll translate it into Open Source Software ... AAARGH!) or ALSA, and both packages have wrappers for eachother, but it means that there's a multitude of ways to reach that haven of good supported sound. We can throw ESound and Gstreamer and JACK into the mix for further confusion as well.

So, one perticular part of these options was that the Linux kernel guys decided to throw out OSS and put in ALSA instead, at around Kernel version 2.5.x or so. The reason was mostly that OSS v.2 was in wide use as the developers entered into a lengthy v.3 rewrite, the company that sponsored them changed the license (dual license, one branch for GPL [often lagging], another for a sellable version). Then they scrapped v.3 to start on the new and improved v.4, which was to be fully GPL'ed and all things sorted out. In theory, but in the mean-time the world moved on, and ALSA became the standard.

So, back to my story. My sound system was finally working, except for the fact that my microphones (plug and internal) didn't work. I tried it all, including downloading and manually compiling and modding the Kernel with the latest version of ALSA drivers and libs, without any luck. (Well, I upgraded ALSA nicely, but alas no microphones). I tweaked manually the modprobe configuration files, upgraded and updated any Esound, Gstreamer or ALSA thing I could find, tweaked their links configs, reset them, autodetection and manual stuff, on and off, on and off. It drove me nuts!

So in the end I got the whiff of the OSS story. First it was simply dismissed because it was "the old system", but as more and more reported success with the latest OSS v.4 where ALSA failed, I thought I'd give it a try. I removed anything ALSA and PulseAudio (and frankly, not that many people have a need for PulseAudio, even less be able to correctly set it up, so why make it default?), installed some dependencies for OSS, downloaded a .deb package (trickier than it sounds), restarted, installed, configured (setup GNOME with the OSS sinks), and ...

Microphones work! They friggin' actually work, and after only 4 months I can make Skype calls which I need for work. But, as sound in general works fine - and here's the punchline! - now the left channel has crackling when the sound reaches a certain low / mid threshold (no, the mixer is set correctly; this is weirder in that it's only in the left channel. It's not overdrive, but some clicking-ish noise), and I can't friggin' get rid of it!

And yeah, you try searching the intertubes for Ubuntu 9.04, sound and OSS v.4 where "OSS" is treated as "Open Source Software" by Google. Bloody smart-arses.

Sure I love Linux, but I friggin' hate the Linux sound system. And I hate Google a little bit, too, this time.

5 June 2009

My creative past

Moving to a different country away from old friends and family can make you somewhat nostalgic, so add to that when playing my music collection at random I bump into either something that has memories attached, or, as in this case, blows the memories meter. I can't not want to share and talk about it.

Many years ago now I had a music studio down-town Oslo (near Børsen, top-floor where that great Indian restaurant is) which I shared with an old musical buddy of mine and a movie production company (more on that later, I suspect). There I laid down the foundations of much which was to become my music and musical style for years to follow. It was sitting in this loft office in the murky hours of the night I first met my wife online in one of the few chat sessions I ever did back in those days, chatting with Julie who was in the Australian bush near Bowral in the Southern Highlands. Instead of continuing my musical and movie carreer, I chose to go to Australia to meet the woman I fell in love with instead. And 10 years later I'm married to her, got three kids, a house and a Volvo S70 station-wagon and live in Australia. Things certainly took a different path.

But before my married life happened, there was a few years of back and forth and the pain of separation from both Julie and my first daughter, Grace. Two years in which a lot of my frustrations and lonely nights after long working days were filled with the remnants of my old music, and in this brew I concocted a whole slew of stuff. And some of that old music I stumbled upon by random last night, and I've got three tunes I'd like to share.

I popped them into my MySpace, and they are ;

Flying Through - an alien observing life on earth. Well, probably an alien. Could be anything or anyone observing us. This tune is somewhat in the style of Klaus Schulze, and features some well-planned syntheziser counterpoints, and probably most importantly my old friend Bjørn Rummelhoff-Hansen (my old band-mate from Sundrunk) on guitar. It's dedicated to another friend of mine, Øystein Aarseth, who turned me on to old-school synth music. Oh, and if you followed that WikiPedia link, don't take the bad stuff written there as absolute truth; there was more to Øystein that could fit into his act (our shared passions were classical and old-school synth music, protagonist philosophy and port-wine, stuff rather far from the public image he put on).

Sexy DJ - Back in the days when MP3.com was a place of good music and a fantastic community, singer/songwriter Nadine Renee started a cool competition where she release the vocal tracks from her song "Sexy DJ" to the hoards of the interwebs, saying "let's see what you can make of it", and my contribution won the Rythm'n'blues category (although I think this is rather far from rythm'n'blues). She has sadly passed away during complications of child-labour a few years back, so I note her for posterity that the whole competition was as fantastic as she was good-natured and kind. This tune happens to also feature my own dad on saxophone, Milos Ocasek.

Dunish - I'm a Dune-fanatic. If Frank Herbert was a woman, I'd have a crush on her for sure. This music is like a collage of musical themes and styles, and was for me an excercise in music production as I was working on film music at the time. If you loved the movie by David Lynch, you'd hopefully enjoy this one as well.

Update: added a song ;

Bekk - What e-business consultancy company with respect for itself doesn't have a theme song? My old company in Norway, Bekk Consulting, is truly the most rockin' gig in town. This is a tune I made in the wee hours of the night for no apparent reason, featuring my dad on sax, my good friend Hanne Svenningsen on "vocals", and Bjørn Rummelhoff-Hansen again on guitar (what would I have done without you?).

Let me know what you think of my MySpace adventures of the past.

3 June 2009

03.06.09

Wow, what cool sequence of numbers is that?

03.06.09

And that's today's date, a very special day indeed. Expect me to meddle and go slow and enjoy family and friends, and I'll see you all on the other side tomorrow. (And given my wife's fantastic treatment I'd better start planning something seriously cool for 09.09.09. Suggestions welcome!)

2 June 2009

Successful crap

It never ceases to amaze me peeking into various successful open-source projects, seeing the innards, and wonder how they even got this crap code past their own pride. Yes, I need to vent.

This weekend I was head-down in various content-management systems and their ilk, digging into anything from WordPress to Habari to Joomla to Simple CMS (which you would expect be simple) eZ publishing. All of them had rather abysmal code scattered throughout (with eZ publishing being the better of the lot), oddities, and all the worts you'd expect of systems hobbled together, where their success is more an afterthought.

But hang on, I can't criticise systems for their organic growth. But I can criticise them for not doing much about the trouble that comes from it. Sure, I understand that rewriting core parts of a system requires a huge ego and nerves of steel, and I understand how "if it ain't brok, don't touch it" rules the end of the day, but surely the end means is good software, right?

But.

It's crap. It's rubbish. And more importantly, as I can put up with crap if it gives me opportunities and love, it hinders innovation, flexibility and, well, love.

Let's pick on a random contender that I worked heaps with last week, WordPress. If we cut away comments, this is its index.php ;
define('WP_USE_THEMES', true);
require('./wp-blog-header.php');
If we look into wp-blog-header.php, here's what we get ;
if ( !isset($wp_did_header) ) {
$wp_did_header = true;
require_once( dirname(__FILE__) . '/wp-load.php' );
wp();
require_once( ABSPATH . WPINC . '/template-loader.php' );
}
Ok, so let's peak into wp-load.php, and we find about 20 lines of code and more includes. Don't you just love playing hide and seek with files to find out where it's going and why? These things maybe have come around from shuffling the organic growth of the system into other files, and left them with these sad little snippets that's hard to get an overview of and takes a slight performance toll, too, as well as eat away your sanity and good programming ethics. And they all contain that newbie error of putting this at the end of every business logic file ;
?>
It's not needed, and if you like your whitespace under reasonable control, you're stuffed. Not a big crime, mind you, but just one of those niggling little things. Then you've got functions and objects, some with the wp_ prefix, some without, business logic in files called wp_settings.php, repetition of code everywhere, hundreds of DEFINE's scattered about in different files, and so on and so on. (And yeah, I should contribute as it is open-source and all that, and I'm actually writing a embedded Topic Maps engine as a plugin, so we'll see)

But I'm not here to pick on WordPress per se. It's more about how this organic growth hinders innovation and opportunities. So let's talk about frameworks. All little pieces of code together form a framework, so we're not necessarily talking about a framework of disjoint classes or functions that aid developers making stuff like the Zend Framework, or Cake, or Symfony, or CodeIgniter, or 1000 others out there. Well, kinda; all those little things the app is made from also constitutes a framework, but it isn't disjoint nor refactored or synergetic or stable or well thought-out as you get in a more established framework, but never the less that's what it is.

PHP itself is a framework, of course, and most PHP frameworks are wrappers and added code to make PHP act more like a coherent system, fixing inaccuracies and bugs and niggles, stabilizing behaviour and increasing the need for spending hours and hours learning some new paradigm you can't use elsewhere.

Hmm. Where was I? Oh, right; every app is a framework. But when the framework isn't a perticulary good one, where the pieces are either too fragmented or too disjoined to make any sense, making stuff in that framework is going to be a pain. Like WordPress is a pain. And before you know it we get to the next rewrite, and this time we'll get it right, although we need to keep our legacy intact, and hence we write hacks on top of fresh code to drag it back to the hole it came from. The data model needs to rewritten, but it won't because "well, it works, doesn't it?" and the framework needs to be rewritten, but it won't because "well, it's not broken!"

When I can't replace MySQL with something else, that's a hindrance. If I can't change the way tagging works, I can't move forward. If I can't change the URI handling, I'm stuffed. If I can't use portions of it to write something else, nothing new will come. Sure, there might be a plugin architecture somewhere, perhaps a simple event model that one can tap into, but if I can't replace the model in which it operates I can't make it more beautiful. I am forced to accept the model and framework in which WordPress sits.

And it sits quite squarely on top of everything I want to do. I want to create better and typed links, I want to reuse a model for sequences and storage, I want to replace tags with guided controlled vocabularies (maybe even typed and binary linked to external WordNet sites), I want to use it as a CMS and skip the URI handling alltogether, and so on. But I can't, because WordPress wasn't designed with change and innovation in mind.

But a day will come when even the most successful project will face its own innards. And some people will branch it, some will stay on, some will create something new, and some will stop using it alltogether. And it's all a really good thing; this is organic growth, it's a framework that spawns other frameworks. And more crap will be successful. Things will be broken and ugly and hackish, just like some things hopefully won't.

And in a few iterations, something beautiful - with a probably different name - will emerge.

Update: It would be great to get your suggestions for open-source projects which are designed for change and has quality and / or elegant code to boot. Let's make a list!