Jan 21, 2007 - The Piper Will Lead Us To Reason

It was brought to my attention that the XHTML on my site no longer validated. Not liking this one bit, I was forced to make a couple of minor corrections to my site (one typo, and one careless mistake. A pre element cannot be the child of a p element). In the process, I figured I may as well make an update here.

For the past few months, I have been working on a publisher's demo for a hopefully upcoming DS title. I've written the majority of the engine code for it, and I've been having a whole lot of fun. I have a real devkit sitting right next to me as I type this, I have access to all sorts of confidential Nintendo documentation, and of course all the software that goes with it. I can't really say a whole lot about it, other than the simple fact that it rules. libnds is some fine software. But in many ways, it pales to what is present in the real thing.

Dissonance is without doubt dead for the time being, and is probably permanently dead as a homebrew project. But you know, if by some miracle I ever get some free time for myself, I might be interested in resurrecting it as a commercial project. I don't think it's really marketable as a standalone application. But I might be able to stick it in a game for DS or Wii at some point, if I could sell the idea to my superiors. (Wii Ware?). She needs a lot of work first though. But as it so happens, I am actually getting not too bad at my job. And I can find my way around the official devkit even better than libnds at this point.

Anyways, that's about it for today. I might seriously consider updating this site a little more often in the future though. Talk a little about what I'm doing and how its going, without violating my NDA.

Oct 10, 2006 - Source Release

Here it is. Source release of Dissonance 0.3 (Alpha). It's not everything that I had hoped, and it's a source only release, as it does not yet compile for NDS. It DOES compile for Linux however (albeit with huge glaring bugs). What needs to be fixed in the DS release is a fairly reasonably short list. Starting with the big stuff...

sound.c needs to be rewritten for the DS on both the ARM7 and the ARM9. the ARM7 version needs simple playback and stop functions, as well as a utility to determine if a specified channel is playing or not. The ARM9 version just needs to query these functions on the ARM7. Some of the code that I threw out after 0.2 could be used to hack this functionality in.

A few functions are missing that dswifi depends on (the ancient version I am using at least). These functions need to be added to the source somewhere. (I tried, but for some reason the compiler couldn't find them. Odd, but I don't have time to fix it).

Anyway, I guess that's that. I did a lot of work on this application for the last couple of days, but time just ran short, and the deadline is here. Yesterday was a day of rest for me... as I have been a little anxious about starting my career. So I played Guitar Hero rather than fix this. I'm sorry, but I need to get on with things. If it's AT ALL POSSIBLE, I will try to release a working version at some point. But I wouldn't keep your hopes up. If anyone wants to fork this application, and fix the last few bugs, please email me at matter.grey@gmail.com, and I will see to it that it gets hosted.

Oct 7, 2006 - Remember That Metal is in Your Heart

So here we are, another month has gone by. I'm really terribly sorry for all the time that's gone by. I really intended to do things right this time. But somehow real life intruded almost as much as it always has. A lot has happened over the last month. I have some good news and some bad news for everyone.

First, the bad news. Dissonance is being discontinued. I have been hired as an Assistant Programmer on a pretty awesome DS game. Which means that I am doing this for real now. I am going to be getting an official devkit soon (perhaps as soon as Monday). I have not signed an NDA for the devkit yet, so I am currently working my butt off to get a last release ready. But I am thinking that after I sign an NDA and become an official developer, I won't be able to release homebrew anymore. Regardless, my job is going to be occupying all of my time anyway. This is a job that I want to do right.

I alluded to the good news... but to spell it out for you, I will be making a final release in the next day or two. I have been working long days for the last couple of days. The main reason it's been taking so long is that I have been being very hard headed about coding my own mixer functions for the Linux version. It's been going nowhere, and I've rewritten and messed up the sound api so much that it's beyond repair. Today, I am officially giving up, due to lack of time and experience in that matter. Next time I try, I am going to buy a book on DSP programming. So I am ditching libao, and using SDL Mixer, which should work a lot better. For the Windows users out there, it might be easier to port to Windows anyway. I've ran a couple of tests, and I should be able to get a draft of the sound api out by the end of the day. Which would leave me with tomorrow to polish up my code, add documentation, and remove the last few global variables in my code.

I should be able to release Dissonance 0.3 and libdiscus 0.1 on Sunday night/Monday Morning. libdiscus is the low level hardware access stuff, such as networking, sound, graphics, input, and ipc in a nice, easy to use library. A Linux port of the low level stuff exists to test your code on, before you bother compiling for DS. Unfortunately, at the present time, networking is the only thing that actually works. But I should have sound and hopefully some sort of input working soon.

If I don't get as much done as I hope, then I will release what I do have to the community. libdiscus will be released under a BSD license, and I really hope that someone picks it up and finishes it. I can act as a maintainer for it, so if you have patches to make to it, I will post the patches on this site. Dissonance will be released under the GPL, along with some photoshoppery of what I had hoped it would look and act like when it hit 1.0. I would like my version to remain under my control for possible relicensing at a later time, but forks are of course, very welcome. (Perhaps someday I could resume my work on Dissonance with an official devkit, pay a fee to Underbit, and actually get it published. But that's in the DISTANT future. And providing that a fork does not do that first *hint hint*).

Aug 21, 2006 - An Apology

Alright, I once again haven't updated anything in a month. As the title says... sorry. However, I have been working a little bit. I have been working on the sound API... Basically, as I mentioned earlier, I am creating an API that should compile for NDS or Linux by setting a compiler define. I've been working on the linux version of this for the past month in 20 - 30 minute intervals. This is my first real experience with writing a multithreaded application, and the 20 - 30 minute interval thing just isn't working. One of these days, I am going to sit down for a good 8 - 16 hour period, and get some real work done. I just need to find some time.

In other news, I have been living in Sacramento for the past 2 months. I have to go visit a dentist, so I am heading to Vancouver very early tomorrow morning, and staying for a couple of days. Afterward, I am going to go to the Penny-Arcade Expo (PAX) once again this year. If any of my readers are heading to PAX next weekend and wish to talk with me, or just sit down and have a beer, then keep an eye out for me. I'll likely be on Pictochat quite frequently under the name PAX_Dave (as last year). If anyone was there last year, you might remember me as the guy who hosted NDS E3 demos from his laptop. I probably won't be doing that this year, except by request, as there's not a whole lot of new content. Still... there is the submarine game, air hockey, and some of the Japanese games. I might. At any rate, if you are going to be around, give me a shout on Pictochat. I'll likely be hanging out by the escalator or Speakeasy booth, same as last year. And I'll for sure be at the music concerts on Pictochat if nothing else.

When I get back from PAX next Monday, I'll be going to Los Angeles for a bit to meet with someone, and I may have a bit of free time after that. I'll try to get some honest work done soon. Anyway, sorry for the bad news, but hope to see some of you at PAX. I can't guarantee that I'll get any email in the near future, but send me an email if you plan on attending.

Jul 20, 2006 - Busy, Busy, Busy

I figure I haven't updated this site in over a month, so I have some explaining to do. I haven't actually done much work since my last post unfortunately... I've moved from Lethbridge, AB to Sacramento, CA, and have been taking care of things such as acquiring a Social Security number, and spending time with a good friend. I've also been building a mythtv box, and doing other odd tasks. But I think that this weekend is a good time to start working again. But just to show all my loyal fan something, here's a copy of my current README, straight off my SVN server. Now, if you will excuse me, I think I am going to get to work on actually implementing sound.c. =) If anyone has any suggestions or comments on how to make this better, or any obvious problems with my layout, please let me know, as I would love to hear it.

Alright, just a quick file to show the layout of this program.

You might notice while reading this, that many of these files exist to provide
high level functions that are portable and easy to use.  Dissonance might be
thought of to provide a simple cross-platform engine for usage...  But that's
something to discuss elsewhere.

Linux version requires SDL/ao development libraries.  I use ao instead of SDL
for audio, as it is ever so much simpler than SDL for simply playing audio. Of
course, all other standard development things, such as the standard C libaries
and GCC are still required.  Ubuntu users can install these by entering this
command: "sudo apt-get install build-essential libsdl1.2-dev libao-dev".

DS version requires devkitARM, dswifi, and libnds.  I like these over any of
the high level libraries, as I really like to write my own stuff.  However,
after the 0.3 release, I'll probably have my own high level library anyway.
Ubuntu users can email me for my deb packages of all required dev tools (x86
only).  Not hosted here for bandwidth concerns.

/*****************************************************************************
dissonance.h

This file contains global macros and defines that are relevant throughout the
program.  It might also contain misc function prototypes that don't fit in
elsewhere.

*****************************************************************************/

/*****************************************************************************
dissonance.c

This is the main entry point for the program.  It has the ARM9 main loop
when compiled for the DS, and it is the entry point for the Linux client.

The aim is to have very little actually in this file, as with dissonance.h,
as it basically calls functions from the other files to do the actual work.
But it's here where the main logic of the program is working.  This includes
things such as setting up the playlist, controlling the state machine, and
playing the music.

It might also include misc functions that don't fit in elsewhere.

*****************************************************************************/

/*****************************************************************************
mp3.c/mp3.h

This is where MP3s are decoded.  A stream is passed into the MP3_run function,
and it is eventually outputted in PCM WAV format in the prcs_func.

Still up in the air, as I am not quite sure how I WANT it to work.  Edit 
before 0.3 release.

*****************************************************************************/

/*****************************************************************************
network.c/network.h

This is a wrapper for sockets, to make it a little easier to read and write 
from a network stream.  First, you init the network, then you connect to
the station you want to connect to, then you can send or recieve as you would
like.  After you are done with the connection, you can close it down, in order
to prevent memory leaks.

*****************************************************************************/

/*****************************************************************************
playlist.c/playlist.h

This is where playlists are parsed.  Standard pls format playlists are used,
and must be fed into PLS_read() in a null terminated string.  From there, you
can get the number of playlist items, or retrieve the titles or urls of the
different stations.

I am considering adding an extension to the PLS format to include sample rate,
but I may just bite the bullet, and figure it out with code.

*****************************************************************************/

/*****************************************************************************
sound.c/sound.h

This is a wrapper for sound functions.  There are functions for initializing 
sound, playing a buffer, or stopping playback, as well as finding the current
position of the read pointer (this may not be exact on the DS).  Sound 
channels should be closed when you are finished with them.  SND_shutdown 
should be called when the program is done with processing sound.  This will 
free all the memory on both linux and DS, shutdown the sound service on the 
DS, and close the connection to the sound server on a linux system.  SND_init
should be called if sound is needed again.

*****************************************************************************/

/*****************************************************************************
input.c/input.h

This is a wrapper for input functionality.  A callback function is registered
for each type of event, (SDL keys, or NDS keys, mouse or touchpad), and the
callback function is called more or less immediately (immediate on the DS, 
nearly immediate for Linux) in response.

*****************************************************************************/

/*****************************************************************************
graphics.c/graphics.h

This is a wrapper for low level drawing functions.  When initializing, 3D or
2D is selected, giving low level functions appropriate for each.  You must
also select which window you are initializing.  3D functionality will result
in an OpenGL window being created, and 2D will result in an SDL/Tile based
window.  

This will probably not be finished in any way, shape, or form before 0.3, as
it's the biggest of the low level wrappers to actually accomplish in terms of
coding, testing, and learning.  (I am still not overly proficient with the NDS
2D interface... and have not done much 3D work on the DS yet... and I have not
done anything in SDL that's 2D before either).

*****************************************************************************/

/*****************************************************************************
gui.c/gui.h

This is where all graphical output should be done.  This includes things such
as equilizers, visualizations, controls, or any other such things.

Please edit and fix before 0.3 after specs are finalized.

*****************************************************************************/

Jun 13, 2006 - Damage Report

Wow, another 10 days have gone by? How time flies. Anyways, I've been hacking away at the code again today. I don't think I ever mentioned this, but I'm a C++ programmer, and C is kind of new to me. I've used it before in school (I wrote a UNIX shell), but I never fully learned it, as I am not the best learned in a classroom environment (I'm more hands on, but I learn quickly). I decided to write this in C from the beginning in order to hone my skills. As a result, I've made a lot of stupid mistakes. As time went on, I learned more and more about the language, and I have begun wholesale rewriting large chunks of code, with my newfound knowledge.

Today, I wrote the playlist parsing "class". I plan to do the same for ui, decoding, networking, and stations (again). The goal is to rework Dissonance in a way that allows me to develop it for Linux, with a DS port. This will significantly improve testing time, and clean up the code base. All I have to do is hide the inner workings of the DS specific stuff such as graphics, sound, and networking, and use branching defines to select between them at compile time. This is of course how it should have been done from square one, but I just wanted to get it working before I started perfecting it, as I was (somewhat) new to C, and I had never done any low level networking before.

Like sgstair, I hesitate to give any sort of timeframe on the next release. But it should support playlists, have boosted volume, and a nicer interface. However, I am leaving the country for an extended period in 14 days, and I haven't even begun packing all my stuff to move it into storage yet. And finals are next week. So my time is going to be more valuable than ever. But good things come to those who are patient, right? Mind you, if I wanted to throw together another cludgey release like 0.2, I could probably release it today with boosted volume and playlists. But I don't even want to sync it to my SVN repository it's so broken at present. ;-)

Jun 3, 2006 - Update

Alright, Half-Life 2: Episode One is done and over with. It's a little short, but an awesome game, and I can't wait for Episode Two. So now it's time to start thinking about Dissonance again. I have been working on it off and on lately, but I had a problem in that my code base got so badly out of whack that I had to resync back to my last working subversion revision. So I lost about maybe 100 - 200 lines of code that didn't work right. I also started playing with the CVS dswifi library again, and unfortunately it doesn't fix the #1 bug, so I'm going to try to get a simple test app to sgstair to demonstrate the problem that I have. Depending on how much I get done, I might release a 0.2.2 release if dswifi is fixed before I get playlist support finished. If I were to release such a thing right at this very minute, it would probably feature an easy way of changing stations, and not much more. I am hoping to have playlist support, a code cleanup, and increased volume before the next release, but we'll see how that goes. I am intending to release the next version within a day or two of the first working release of dswifi. So anyway, that's my status report for the time being.

May 22, 2006 - Laziness

After my release the other day, I was extremely tired. I had been working on Dissonance for about a week with 16 hour days, and I really felt in need of a break. So I've been spending all my time since then playing all the Half-Life that I could. I played through Half-Life, Half-Life: Opposing Force, and Half-Life: Blue Shift in preparation for Half-Life 2: Episode One. But I've quenched that need for the time being, so I can concentrate on Dissonance again. I've built a new binary of Dissonance against sgstair's cvs release... so it might fix some obscure bug. However, I don't notice much difference myself, and so my source has not been updated.

Anyways, due to the discussion going on on the dswifi forum, I can say that the next release will likely have two key features. Higher volume, (or adjustable pre-amp), and support for some sort of playlist. Right now, I am thinking about just appending an M3U or something to the end of the ROM, and calling it a day for now. But the grand plan is to support the shoutcast directory. It's just a lot of work getting there.

May 18, 2006 - Thanks Dovoto!

Wow... second server move in as many days. And I guess now I'm just another drunken coder. =) Thanks to the infinite generosity of Dovoto, I now have hosting on what's probably the best domain name in existence. For those just tuning in now, I've largely been flying under the radar for a long time. But I intend to actually make good with Dissonance, and produce something that I can be proud of.

And in case you are wondering, this site has been ported over from old domains at grey.homelinux.org (my personal server that my ISP wouldn't be too happy about), and people.uleth.ca/~dave.brady, which is why there are old news items here. My University hosting is about to cease, given that I am graduating very soon, and Dovoto was nice enough to offer me some space. So, here I am.

In Dissonance news, I might put it on the back plate for a bit, and relax while I wait on sgstair to fix some bugs in the library. So for the next bit, I might be working on Holocaust. But probably the next things to be implemented in Dissonance will be items such as play/pause, playlist support, or some better visualization.

But thanks again Dovoto for being so generous.

May 18, 2006 - Bugfix

I gave my release yesterday a very limited actual official release to a small group of testers, and told them to keep quiet. Today, I will try to get a little more publicity... so if you are seeing my site for the first time, then welcome. Dissonance can be downloaded in the Projects section of the web site. The new feature I added over the last day is simply to reconnect to the server if the connection is dropped. So it might be a little more useful to you now.

May 17, 2006 - Release!

It was a little easier than I had anticipated. When I woke up this morning, I had the answer to my problems in my head, and I knew how to fix it. I remembered the mysterious input function that libmad takes as an argument... I never really figured out what it did, so I just ignored it. This morning, I realized that it was there for precisely what I needed it for. It's there for refilling the buffer when streaming media. It took me all of about 30 minutes to write the code that refilled the buffer from the socket, and I was good to go. I compiled it, left it to upload to my DS via WMB, and went to the kitchen to check the spaghetti, thinking that it wouldn't work. When I got back, I heard some music playing. I checked my DS, and I was absolutely amazed to find it playing back Virgin Radio absolutely flawlessly. Thus, all I had left to do was do a bit more code cleanup, add some more comments, and publish it. So, here it is, in all its glory. Dissonance, version 0.2.

I think I am going to move my code to my University's web server, and then see if Slashdot or Digg wants to link to this. It's not finished yet by any means, but hey, it was about 2 weeks of good solid work. And it's working in a fashion that at least I find it useful.

May 16, 2006 - Almost here!

I finally found the bug in my code, and a release is almost upon us. I ditched the idea of integrating xmms code, as I made the discovery that my own code was *almost* there, I just made one mistake. Only two problems remain...

I am simply calling recv over and over again, and feeding that into libmad. As a result, the frame sizes for the MP3 stream is incorrect. I have to make sure that my buffer size is always a multiple of the MP3 frame size.

The second problem is a little more tricky... I am having some performance issues. But it's not the kind I'm sure that I can fix. The DS keeps up with the stream for a little bit, and then falls behind. This seems due to network issues. I think I'm going to have to release it without that bug fixed, as there doesn't seem to be a lot that I can do about it. However, it may just be my router, as it's not quite compatible with my DS I find (trouble locking the router to 2 Mb/s).

Anyways, keep watching this spot. Release is almost upon us. One more day's hard work might be all that's needed.

May 16, 2006 - Another Update? WTF?

Wow, two updates in one week. Obviously I'm still in holiday mode, and can devote a lot of time to personal work. I've been staying up to the wee hours, and watch the sun come up every morning. And I'm honestly never happier than when I'm working out some software bug in some ridiculously complicated project. Anyways, I am just updating today to mention that the 0.2 release of Dissonance (my internet radio client for NDS) might be forthcoming in another day or two. I spent the last few days cleaning up the existing code so that it's not so painful to look at, and trying to integrate the network code into the project. Last night, I had the program reading from the socket, and feeding the data to libmad. Unfortunately, all that came out of the speakers was a bunch of static, blips, and bloops. So it still isn't ready for prime time.

The problem lies somehow in how I am reading from the socket. Maybe I am being a bit overeager in my reads, and it's corrupting the data. I'm not really sure on that. But it doesn't work properly in my linux test app either, so it's not the DS. At any rate, my network code and my mp3 code is co-existing, which was my whole goal of last night's work. I've also downgraded to C, simply to ease my peace of mind, and not have to work with two languages. Hell, it might be faster now anyway.

So tonight, I have taken a look at some of the xmms source code, and I think I can integrate a good portion of it into my project as-is. I like that. As I mentioned before, my network programming ability is somewhat lacking, so it's nice to find a source that I can both use and learn from. But it definitely wasn't a bad idea to try it on my own to begin with. All the code that would have looked very cryptic to me before is now looking quite familiar. Anyways, it's back to work for me.

May 13, 2006 - Project Updates

It's come to my notice that I have a large amount of empty space on my front page that would be awesome for posting news items. So I've decided to make this into my blog of sorts. Maybe sometime when I have time, I'll even stop being lazy, and create an actual form and submission for news items. That way I won't have to modify the actual PHP. ;) But there's time for that later. I've got bigger fish to fry...

Now that the summer is here, I thought I would give a little bit of attention to my projects, and update the status of the projects on the project page. Big Joy Farm has met up with a rather colossal failure. In short, I got my work on the project done, but the level was never finished enough to actually include my work. I don't think I can post the source code for IP reasons.

I am currently working on two projects. One is an as-of-yet unreleased game. I don't really want to talk a lot about it though, as the potential is actually quite huge, compared to my other projects. However, I am currently taking a small break from it in order to finish up work on my DS MP3 player, as the wifi library has met with an official release supporting DNS, TCP, and DHCP, which I really needed in order to get things working the way I wanted them to. I've been working on the network code, and it's been coming along nicely. (Aside from a very stupid error on my part, where my debug code was improperly written, but the actual code worked fine).

I've also applied for Google's Summer of Code 2006. I submitted an application to the Ubuntu Linux project, where I asked to write system restore functionality for the OS. I figure that it should be a fairly easy project to accomplish. Just copy each bit from a partition, check for errors, and then compress. Then do the reverse when restoring. The real beauty of Linux is that my app would largely be building on the small building blocks that other people have already done. Since it's so easy to do that much, I also said that I would try to do incremental restores, and user selected directories to back up, and wrap it all up in a nice GTK interface. I think it would be a really interesting project, and I hope I get hired.

Mar 20, 2006 - Welcome (Site Launch)

This is my web site. It's not much to look at, but it's a place to drop my code, a place to talk about what I do, and a place for people to download software that I write, for whatever they might like to use it for. Anything you find here is free of charge, and in some cases, has source code included, depending on the quality, and my future intentions for said project.

Anyway, take a look around, and see if there's anything you like. My name is Dave Brady, a programmer from Canada. Currently freelance, but available for work if you got some.