Saturday, February 17, 2007

My Wii Little Friend


Say hello to my Wii little friend! Happy Valentine's day to me...

It's safe to say my productivity is back down to zero. In fact, my indy development may well just be done now. I'm not sure. You may have noticed my attention has hovered more around video editing, DVR's and gaming itself rather than development. I'm not sure if I'm calling it quits or just taking a break.

We'll see. I've got a few rounds of golf to play now.

Monday, February 12, 2007

The Retelling of a Myth: Fin

My MythBox has been in service for nearly two weeks now - and I haven't had a single problem in nearly as long. It's quite remarkable that I was able to construct such an appliance for under $400 USD, and I owe most of those remarks to VIA and their lovely Mini-ITX EPIA C7 platform. They've crammed ten pounts of digital goodness into a five pound bag, and made it all passively cooled to boot. While it may not benchmark the fastest, it benchmarks as the most useful and power-efficient general purpose plaform I've ever used. The EPIA doesn't work faster - it works smarter by building in acceleration for what you actually need. Cryptography, MPEG2, audio and TV-out are all done intelligently by chipsets design for that specific purpose. That means you, yes you, get to reap the benefits of an extremely fast and jitter-free MythTV box without the cost, power consumption, size or complexity of a regular mobo/CPU combo. And VIA understands how Linux is crucial to their enterprise, and has worked towards providing support likewise. Open-sourcing their driver base is a smart step.. let's just hope they continue to document their chipsets and offer open-source implementation, as well as Linux driver support around every corner. If they do, I promise to keep buying. Deal? Deal.

Also, one should be greatly impressed by the Myth team's gusto. They've brought Linux together and have shown the world that this nimble little behemoth of an OS can really make a tremendous splash. Indeed, one almost gets a feeling as if this was Linux's endgame, and all the pieces of the puzzle are now being assembled; all that remains are the easy pieces inside the corners.

One also should give mad props to the community at large, which has taken it upon their anti-anti-social selves to document every living, breathing attempt to get a myriad of hardware configurations to run Myth. Indeed, these past five blog posts are my contribution back to the lukewarm saline pool that holds our collective brains. Without the dozens of blog, newsgroup and forum posts out in the wild I never would have been able to build this box. Thanks to this modern era of communications, n00bs everywhere are being schooled at the speed of light.

Now if you'll excuse me, I have 20 back episodes of The Daily Show to watch.

Sunday, February 11, 2007

The Retelling of a Myth: The Myth Part

Installing MythTV is fairly easy once the OS & appropriate drivers are installed. Thanks to the all-knowing Packman repository for SuSE, I was able to easily use YaST2 and get the mythfrontend, mythbackend, myth-plugins and myth-themes with a minimum of fuss. Dependencies automagically installed and I was ready to go in a few minutes.

The SuSE packages show a good deal of polish. I installed the Gnome login manager (GDM), since it seemed to be the most lightweight login manager that allowed the mythtv user to auto-login. While I installed FvWM and expected I would need to use .xinitrc to launch mythfrontend upon startup, it turns out SuSE setup GDM to have MythTV as a session choice unto it's own. So instead of needing to specify Gnome, KDE or FvWM as the session to login to I could specify MythTV as a session of its own without a window manager. Very nice!

First, one needs to set a root password for MySQL and create an account for the zap2it Web service. After those accounts were created I followed the universal MythTV installation instructions for openSUSE, started the backend server and began populating the database.

Once the backend was ready to go, the frontend was ready to roll. First thing I did was ensure live TV was rendering correctly; since XvMC wasn't enabled, I had to find alternate ways of doing motion compensation. I ended up using the "standard" MPEG2 decoder library with kernel deinterlacing, which was the only deinterlacer that a) worked and b) reduced blur. Bear in mind the rational option should have been using the VIA XvMC decoder w/ bob 2x deinterlacing, but it just wasn't an option using VIA's X11 drivers. However, MPEG2 playback still only consumes 40% of the CPU. Go figure.

Sound, recording and playback all pretty much worked out of the box. Transcoding and archiving to DVD are still a work in progress for me... I haven't been able to get everything working correctly yet. I was able to transcode using default settings to RJPEG... but that turned a 1.1GB MPEG2 file into a 1.4GB RV file. Umm... wrong way.

I attempted to stream DVD-quality MPEG2 files from my home file server via 802.11b, but of course the latency just didn't agree with that kind of streaming. I replaced the Linksys 802.11b bridge I was using with an old (and I mean old) 10Mb Ethernet hub and the DVD-quality MPEG2 files were rendered via my MythTV box just fine.

While tweaks are still to be had the keyboard has been disconnected, cables tucked away and recordings are now being scheduled. Playback is smooth thanks to the via X11 driver and recording is transferring to ye olde Western Digital nicely thanks to the ATA patch. Lirc is reading remote commands nicely, and the 10M Ethernet line is feeding remote streams just fine.

Saturday, February 10, 2007

The Retelling of a Myth: Happy Hauppauge, Very VIA

The Hauppauge PVR-150 kit is fairly nice, assuming you actually get one in the box. It comes with a remote that works with lirc, and the on-board MPEG2 encoding means you can barf CATV streams directly into memory without tying up the CPU. It also has S-Video and composite inputs, although I haven't tried them.

After I put in the PCI card I expected to just run through the YaST2 TV card module and be done with it - it marches you through configuring TV cards fairly effectively. Much to my chagrin it didn't work however - the hotplug manager needed firmware downloaded and installed before it could load the device. There were two separate files that needed to be installed - one for the MPEG2 video stream, one for audio.

Once the firmware was installed I moved on to the infrared remote control. For some odd reason, the YaST2 screen that configures TV cards wouldn't let me select the correct driver for the PVR-150... instead it gave me two (what appeared to be) infrared keyboard drivers. Ummm.... no.

In fact, it appears that the correct version of the lirc driver for the new "gray / black" Happauge remotes isn't included with openSUSE 10.2. Instead, I had to jump on lirc's download page and obtain the source distro myself. I have to give a hand to the lirc maintainers however - they came up with a fantastic means of building from source. When building from source you first enter a menu screen that allows you to select the appropriate card & ir type. This pipes out a script that runs ./configure with the appropriate arguments, which you can then modify if you need (i.e. if you need to change the --prefix). The Makefile correctly builds & installs the kernel modules and userspace tools, and does so with minimal fuss or manual intervention. It even placed the kernel modules in a different location than SuSE's lirc modules, so it didn't run a chance of clobbering existing drivers. Of course, I needed to remove SuSE's lirc and lirc kernel packages to ensure the correct version(s) were invoked... but that was small potatoes. Lirc was probably one of the easiest from-source builds I've done in a long time.

After the modules were installed I had to change SuSE's sysconfig for lirc. I modified /etc/sysconfig/lirc to include LIRCD_DEVICE="/dev/lirc" and LIRC_MODULE="lirc_i2c". Another nicety of the source distribution was a universal Hauppauge configuration file - remotes/hauppauge/lircd.conf.hauppauge appears to support all the different Hauppauge remotes currently in the wild, and all in one file. I just dropped it over into /etc/lircd.conf and restarted the lirc daemon. The /dev/lirc device spawned, and all was good.

To map the actual keys I just used irw to tell me what the individual keys I pressed corresponded to. As I did that, I created a spreadsheet of remote buttons, the lirc code and the MythTV keyboard command. After I had exhausted all the MythTV/button permutations, I went through and created a .lircrc file. Each button press was defined as:

# Mute
begin
prog = mythtv
button = MUTE
repeat = 3
config = |
end

It took a while to define each key - to save time one can search for other people's posted configs as reference and adapt as necessary. After the file was set, I created a symbolic link from .lircrc to .mythtv/lircrc so MythTV's frontend could appropriately parse it.

Finally we have the hardware built, case constructed, OS installed, capture card configured and IR remote sending events. It may seem like a lot of effort, but think about it this way: we, lowly consumers, are creating a digital appliance out of naught but thin air. The very fact that we have such a flexible yet coherent construct in the first place is pretty remarkable. We've been able to pull parts off the shelf and build the foundations of a DVR without writing a single line of code!

Now on to actually orchestrating our products and convincing them to cooperatively put our favorite TV shows in its little robot brain...

Friday, February 09, 2007

The Retelling of a Myth: The OS

Now that I have built my Mini-ITX box, it was time to install the OS.

The platform I had chosen would be a bit more difficult than installing on a vanilla x86 machine. Since I was using a VIA EPIA board, this was choc-full of coprocessors, crazy chipsets and the like. The C7 1GHz processor would be ample to do most things, but I needed to ensure that everything ran comfortably in 512MB and didn't otherwise sap the juice from my CPU.

The biggest issue would be the S3 Unichrome graphics chipset. It absolutely had to work, since I needed MPEG2 acceleration and XvMC, not to mention TV-out. VIA has recently decided to open up the source to its Linux drivers, and since then the OpenChrome project has released the open-source versions that most distributions use. It appeared several had success with previous iterations, so I felt confident the C7 could be done as well.

Ubuntu is an extremely nice and light-weight distro. Since it can run on a minimum of packages, I decided to try it out first. MythTV packages abounded, and I was able to install everything quite easily. Ubuntu had decent support for Unichrome, and evidently installing the X11 drivers was just an apt-get away. However, actually building the X11 xorg.conf configuration file proved to be way too much of a headache. I love Ubuntu, don't get me wrong. But they need some decent administrative tools. I can hack an xorg.conf if I need to, but dammit I just don't have the time anymore. I was still able to glean some good information from those who did.

I eventually settled with OpenSUSE 10.2, which also has ready-made repositories for MythTV and OpenChrome (including a new repository by openSUSE itself). Of course at this point I have no DVD or CD to boot off of - I didn't purchase a drive to go with the box. Luckily with SuSE you can easily install without a CD... instead I took my bargain-bin 32M USB stick and built a USB boot disk. I was able to connect to a repository over the Internet, perform an install (albeit with GRUB errors) and come back the next morning with SuSE nearly ready to go.

One problem during USB installation is that the installer believes your USB stick is installable media - so GRUB becomes confused and assumes your hard drive is a secondary device. It's not of course... so when the SuSE installer attempts to install GRUB to your system several errors come spewing back to you. At this point you have no choice but to ignore them and press on. After the installer boots your system, you need to boot off your USB drive once again then, via the boot disk's installer menu, tell the disk to "Boot [the] Installed System." Afterwards your previous installer can resume & complete, at which point you can manually fix GRUB. For me, this meant opening up /boot/grub/device.map and removing /dev/sda as a mounted device. My primary IDE HD - /dev/hda - became the primary device for GRUB. After that was tweaked, I jumped into /boot/grub/menu.lst and made the appropriate changes whenever I saw hd0 or hd1. I re-ran grub-install and things booted swimmingly afterwards.

I followed the advice of ExtremeTech and created two partitions: one smaller 8 GB partition formatted with ext3, and a second XFS partition that occupied the remainder of the drive. The ext3 partition would be used for the OS and all system files, while the XFS /video partition would be used to store the large MPEG2 files that Myth would be generating. XFS works best with large files, and reportedly has faster write speeds than JFS. While it may not be as failsafe as ext3's journaling capabilites, I wasn't as worried about losing a recorded CATV stream as much as I worried about read/write performance.

There were a few minor hacks that appeared to be needed with earlier versions of openSUSE, but I'm not sure if they're needed anymore. I applied 'em anyway.

We move on to the Unichrome drivers next. Installing the OpenChrome drivers will do just fine... as long as you're using DVI or VGA outputs on the board. TV-out is a different animal altogether. The EPIA CN10000EG uses a VT1625 TV-out chipset, which currently isn't supported by the OpenChrome drivers. I spent nearly 20 hours trying an unbounded number of modelines and configuration tweaks in my xorg.conf, all to no avail. I ended up downloading and attempting to install VIA's own Linux drivers, but their installer never installed things correctly. It appeared to be looking for old XFree86 directories and files... ones that had since gone the way of the XOrg. I eventually had to tell VIA's installer to extract the files, build what it needed but then not to clean up its temporary installation directory with --keep. Once I had all the files to peruse, I was able to take XServer/via_drv.so from the installation script and manually copy it over to /usr/lib/xorg/modules/drivers/. Once I moved VIA's own drivers over and followed the expert advice of those before me, TV-out finally worked. I used the modeline's that VIA's installer automagically inserted in my xorg.conf file - the standard list of built-in modelines didn't seem to fill the entire screen. Finally, three days of tearing my hair out came to an end.

Unfortunately, I was never able to get XvMC successfully installed. I specified the driver library (in this case libviaXvMCPro.so in the config file /usr/etc/X11/XvMCConfig. For the life of me I don't know why Myth looks in the /usr/etc directory instead of /etc - so I just made a symbolic link between the two. Nevertheless, the VIA drivers didn't seem to provide the necessary XvMC libraries... even though the OpenChrome packages did. Maybe once OpenChrome catches up I'll be ablet o use their X11 driver and enable XvMC support for better MPEG2 acceleration and motion compensation... until then my workaround is disabling glx in xorg.conf (so that I didn't get lags from weird cache timeouts) and enabling kernel deinterlacing in MythTV (more on that later). Even without XvMC, however, I'm only using 40-45% of the CPU decoding MPEG2 files. No complaints there.

The VIA installer script also had extracted libddmpeg.so along with the X11 drivers. Not sure if it helped... but I replaced the existing /usr/X11R6/lib/libddmpeg.so with this version. We'll see if it breaks anything.

Next I needed to improve hard drive performance. UltraDMA/100 was enabled for my old WD 40GB drive, but performance from hdparm -Tt was still slow. The ATA drivers that shipped with SuSE's default kernel worked passably, but they weren't fast enough to read/write large MPEG2 streams. It turns out that there is a known issue with openSUSE 10.2 and VIA's VT8237 southbridge doesn't perform appropriately with it. Again I had to return to VIA's driver site and download a kernel patch to fix SuSE 10.2's ATA support. Once I installed the kernel sources, patched the appropriate files, rebuilt the kernel modules and reinstalled kernel/drivers/ata/libata.ko and kernel/drivers/ata/sata_via.ko. Once the modules were reloaded my IDE speed problems cleared up.

Sound would sometimes work, sometimes not. Occasionally sound would skip, crackle and pop with horrible results due to interrupt conflicts. I modified my GRUB boot parameters to include pci=noapic so that ACPI wouldn't allocate the IRQ's for the sound card. After that, sound worked consistently fine.

Now to give Myth a little extra juice, let's tweak the Myth frontend to run with higher priority. Just modify /etc/security/limits.conf and add the entries
mythtv     -      rtprio       50
and
mythtv     -      nice         0
, if mythtv is the user logging in and launching the front-end. This should give Myth higher priority over other system processes, just in case resource contention should become a problem.

Aight... VIA's chipsets were now covered... graphics, TV-out, MPEG2 and ATA works. Now time to turn our attention to the PVR-150.

Wednesday, February 07, 2007

The Retelling of a Myth: Part One

Recently some benevolent sponsors gave me a grant to purchase a DVR for myself. The notion was that I would "lease" a PVR from our local cable provider at their going rate of $10/mo, plus $30 for their digital cable service.

In all honesty, I'm not that big of a TV watcher. However, there are two shows that I go absolutely giddy for... but I constantly and consistently forget that they're on. I actually have... prepare yourselves now... a monaural VHS video cassette recorder that I usually commission to record my show once a week. Yes... I actually have used magnetic tape up 'til now. Magnetic tape that has started to wear very, very thin.

The DVR gift was a great idea. But where my benefactors might expect me to zig, I zagged.

Every Linux zealot wants to build a Myth box. It's become nearly a rite of passage. Nowadays every IT department is brimming with architects who design and provision their own home theater PC to record an entire lifetime of "The Simpsons." Some use Windows Media Center Edition, some use SageTV, but those who have that extra oompah down their pants build a MythTV box.

A lot of people don't realize this, but Linux distributions (and often BSD distributions for that matter) are filled to the brim with building blocks. The basic components for everything you could ever need are all right there. LDAP? Check. An HTTP server? Check. A framework for playback of any number of video codecs? Check. A way to quickly transcode video? Check. The problem with Linux software isn't that things don't exist... it's that there is no glial matter binding it all together.

That's why projects such as QDVDAuthor, Kino and MythTV are so lovingly accepted and absolutely brilliant. They build on existing infrastructure such as MySQL, Xine, ffmpeg, mjpeg tools, lirc and the kernel itself to give the user a single, consistent and logical interface to it all. The Kino authors have written much of their infrastructure itself, but MythTV does a great job of leveraging the given strength of a platform and concentrating on an extremely usable and imminently extensible interface for the user.

I was decided I'd build a MythTV box. The total cost needed to be cheap, the heat & noise needed to be minimal and the form factor had to fit in a narrow cabinent where my VCR resided. High-definition content wasn't (currently) the target... this was simply going to be a replacement for the aging tech that took five minutes to program each time and had to be manually rewound.

I spec'd out two possible hardware platforms: a Mini-ITX setup that was largely integrated and had a very small footprint & power consumption, and a Micro-ATX setup that had some definite beef and a litany of possibile upgrades in the future. In the end, the Micro-ATX setup was nearly twice the cost, five to ten times the power consumption and required a larger footprint. While the Micro-ATX setup would have eventually granted me HD DVR capability in the very near term, all I wanted was lo-res basic cable. The VIA's EPIA CN is a nice all-in-one solution with MPEG2 acceleration, hardware crypto, TV-out, insanely low power requirements and passive cooling for everything - including the CPU. All I needed to add was a case (with included power supply), a Hauppauge PVR-150 for on-board MPEG2 encoding, and some RAM. I found an old 40 GB Western Digital hard drive lurking in my closet, so I blew the dust off and prepped it for service. No CD or DVD drive needed... again, this is just a surrogate VCR.

Whenever I try to build a system, it seems at least on thing needs to be returned or RMA'd. Everything arrived quickly enough... so I began cracking open boxes. When I opened the Happauge box I was surprised to discover they had swapped out the PVR-150 with an HVR-1600. Evidentally Hauppauge has taken it upon themselves to replenish their PVR-150 stock with the more impressive, albeit completely incompatible, HVR-1600. It's a nice tuner, don't get me wrong. It has two on-board tuners: one for standard TV and one for terrestrial HDTV; however the HVR-1600 is completely unsupported in Linux, and doesn't look like it will be obtaining support any time soon. While I'm sure Hauppauge thought they were doing everyone a favor, they forgot that they had a huge following of Linux users. I contacted Hauppauge directly, and they swapped parts with me fairly quickly.

Once the PVR-150 came back, I prototyped the Myth system with my current workhorse workstation. I tossed the PCI card in to my AMD64 system, ensured I was able to receive a terrestrial television signal and confirmed the IR remote worked properly. Once I was satisified that the hardware was sound and Linux was up to the task I began constructing the box.

Of course, whenever you work in a Mini-ITX case you leave yourself zero room or expansion. You'd better hope that any oblong hardware fits like a jigsaw puzzle, otherwise you're hosed. Wire management is key - the first few builds of the box evidently had some wire or component that was unsatisfactorily grounded. One snap of static electricity to the case would cause the entire machine to sieze up. Not good.

A hole was drilled through the plastic cover that would conceal the slot where a small CD/DVD drive would otherwise fit. This would later allow me to route the IR receiver from the PVR-150's PCI slot, through the back of the case, past the innards of the box and out to the front bezel.

The hard drive and PCI card, once mounted, were a tight fit against each other. The hard drive actually ended up pressing against the metal shield surrounding Hauppauge's TV tuner. Not sure if this will cause problems... either due to the heat generated by the drive or the RF leakage that the tuner's shield is supposed to reduce. Luckily the case fan is not far away, so the exhausted air may at least provide some relief for the heat buildup.

Wiring the front bezel to the motherboard's header pins is always fun. It took me nearly 20 minutes to distinguish the orientation and location of the power, reset, HD activity and power LED... but I eventually figured it out. The case emitted a blue light that completely pierced the retina - I yanked that cord fairly quickly. I also discovered by my own error-and-trial that connecting the front bezel's audio ports disabled the rear audio ports. One or the other - not both. I had to take the case back apart and re-jumper the header pins to allow audio to be piped out the back of the box.

Finally after all the lacerations to my hand were mended and all stripped screws were replaced, I was ready to hook 'er up and see if I could get it to POST. Long at last, it did.

I was fairly happy with the form factor. I had routed the IR cable through the case to the front, which helped astetics somewhat. The IR blaster cable was twist-tied in the back, and the IR receiver was adhered to the front with some 3M dual-sided sticky pull stuff they use for posters or coat hangers or whatever. With all said and done. I ended up with a case that was about 1/3rd the size of my original VCR. Not to shabby.

Now on to installing the OS itself... the most heinous of all acts...

Thursday, January 25, 2007

Double Wires

Had to talk about this one. The same physics fun guy who brought us World of Sand has now given us something just as addictive - Double wires. Ever think you'd be badass as Spiderman? This lil' physics game shows that you, as a webslinger, would just result in an extended hospital stay.

Tuesday, January 23, 2007

Running at 100%

I'm knee-deep in the depths of development. I have so much to tell you, good and faithful reader, but time is a fickle mistress. I already feel extreme pangs of guilt having fallen behind on ConsultComm bugfixes and feature releases.

A huge cheer and huzzah to CrystalSpace for releasing 1.0. This is an amazingly huge accomplishment. If you've ever needed a 3D game engine, look no further now. It's now feature-complete and stable.

Item! Linspire's (formerly Lindows) Click 'N Run software is now being distributed for Linux distributions at large. Now every Linux user can take advantage of it's clickishness and runocity. Some may think that this is just a overly verbose apt-get, but it's not. Since it also can provision commercial software, this may turn out to be the Steam of desktop applications. That, my friend, would be a killer app.

Microsoft's new intellectual property blitz is hilarious. Their understanding of how creators "feel" about copyright law is laughable.

SecondLife's client software is now available under the GPL. Icculus had already been working on a Linux port, but now the whole community gets to jump in and help. Better yet, Linden Labs has just added a staff of several thousand developers that offer bugfixes, ports and ideas free of charge. I'm hoping this works out well for them - all eyes are on the project now.

If you hadn't guessed already, I'll buy anything Carmack makes.

Sunday, January 14, 2007

Blogroom Blitz

If you haven't noticed, I've taken upon myself to use this blog as a conduit for taking old articles and posts, espousing their ideas with my own, then regurgitating them for myself and all those regular readers, numbering too many to count. Mainly because I never learned how. Today, dear Rockford, is no different.

The Bad Game Designer, No Twinkie! database is online. I took a moment to read the article about how bad bottom-up game design is... something every new game developer should read. 99% of indy developers take an engine "concept" - physics, fluid dynamics, spatial sound, bump mapping, geometry shaders, whatevea... then they make that one property the "game". I do that. Repeatedly. Still am. Right now. At this moment.

Back in November, there was a round-the-world blogging event entitled "So You Want To Be An Indy Game Developer?" Crowd favorite Introversion was there, as well as our good friends at Gibbage. While the resonant theme was "don't hope to make enough money to eat whilst being an indy developer," there were some notable other nuggets to be had.

  • Cliffskis had some good, pragmatic advice such as maintaining a solid online presence. Content should be easily available, never move to a different URL and have stuff that is quick to download and install. Realize it will take years to be noticed, and you'll want to make sure that you leave an adequate trail to be found.

  • GameProducer.Net had some points that I've already discovered the hard way... if I had heard this advice earlier, it would have easily saved me nearly two years of work. Begin by making a game, not by learning how to make games. Knowing the technology is certainly part of the process, but if you stick with just the development process you won't progress much beyond writing demos and how-to's. Alongside that thought, don't re-engineer the wheel. So many fantastic engines, API's and SDK's are ready and waiting for developers... don't try to create a 3D engine on your own. Worst case, find an open source project (i.e. CrystalSpace) and help them out. Save time, grief, effort, bugs, etc. by using existing tools.

  • Reality From The Sidelines had an entry that could have well been ripped from the pages of this very blog. Not only is he extremely tardy in producing a title, but he moved from grandiose ideas of FPS' & believing casual games were too lowly to consider to finding casual games the best place to being experimenting with both design, production and gameplay. We both seem to realize like time is slipping away, and whatever we do, it needs to be now.

  • Zoombapup focused the entire post on making a single, but very striking point. I'm definitely not looking to make any cash with any titles I might release, but I won't turn down any accidental riches that land in my path. Zoomba illustrates how excruciatingly difficult any riches, incidental or not, are to glean from small-biz development. Although he uses the same concrete (as pudding) mathematics as my science teacher used to estimate the number of piano tuners in New York, the basic figures are sound. If you're wildly successful, you'd be lucky to have two years of effort translate into $100,000. More than likely, it would be -$100,000.

  • Never use Comic Sans.
  • Wednesday, December 27, 2006

    Christmas Software Shenannigans

    Is that how you spell "shenannigans?" Oh well.

    Received a nifty lil iPod nano this Christmas. An obvious conundrum hit right away... my entire music library is formatted & encoded using Ogg Vorbis. iPods use AAC or MP3's.

    Amarok - KDE's killer app - has great iPod support. Of course, the gold standard for iPod support on Linux remains gtkpod - an app that allows your little fingers to get into every facet of your iPod's filesystem layout. But Amarok makes me so tingly inside it's hard to express.

    For example, Amarok can transcode your files on-the-fly. Are all your files in Speex but need them in MP3 format for your digital player? Just queue your files in Amarok's media device browser and it will automagically convert your files. Everything in Vorbis but you need AAC? TransKode will take care of it for you.

    Not to mention Amarok now has an in-browser music store: Magnatune. I freakin' love Magnatune. The fact that it's now tightly integrated with Amarok makes me giddy.

    But there are a few problems. I was up until 1:30 AM this morning trying to get transKode and Amarok to play nicely... there were so many uninstalled dependencies it wasn't even funny. And were there error messages? Nooooooooooooooooo.... I had to go and track down faac, vorbis-tools, gdkpixbuf, blah blah blah. After I made sure every possible package was installed, I was finally able to get Amarok to convert files automagically. I can't blame SuSE for not installing those dependencies... transKode is a plug-in to Amarok after all, and installing every possible dependency for Amarok would suddenly make it heftier than GnuCash.

    Even with these limitations, Amarok is suiting my needs much, much better than iTunes. I don't think I'd be able to do jack nor squat with iTunes, considering it can't transcode my library. Next stop is trying to get contacts, calendar, to-do lists and notes to sync. But I've only filled up 10% of my 4GB so far. w00t!

    Speaking of software, I'll stop my openSUSE 10.2 after this post. Several may have noticed Hubert Mantel is coming back to SuSE, which I hope is a good omen of things to come. The distribution has slipped since he left, so I'm hoping he can bring things back on course. I must say however - the bug reports I've filed so far have been resolved promptly. They're triaging bugs well. There are some pretty stale ones, like Evolution not running correctly in KDE. But by comparison Ubuntu has had an outstanding bug for what seems like an eternity that's stopping me from switching over: not mounting encrypted partitions at boot time.

    openSUSE is going well now... dual-monitor support is working flawlessly now, SCPM is helping me effortlessly switch between home and office, and Amarok is allowing my expansive music collection to survive on my iPod. Hard to complain at this moment.

    Monday, December 18, 2006

    Sloppy SuSE

    Have you seen Novell's "improvement" on the KDE menu? Have you seen the quotes around the word "improvement"? I have no idea what they were thinking. Reading the openSUSE site they claim the menu was the brainchild of hundreds of hours of usability study and research, examining every minute detail of user interaction. And yet they came up with a menu that takes 50 clicks to launch an application. Riiiiiight.

    I just spent the past three days trying to get dual monitors working with the very insipid ATI card in my Latitude D600. Bear in mind, this isn't the first time I've tried to get a Xinerama-like "bigdesktop" setup working with this machine. Nope. I've had one since I've owned this machine, which is going on two and a half years. And yet, with every OS install on this machine, I've had to wrestle with getting the ATI drivers to obey. It's absolutely ridiculous.

    The crazy thing is that we're not even talking about different driver versions. From XFree86 to XOrg, things have behaved weird or wacky in different ways. The only version of the driver I can run is 8.28.8, and even that would be unavailable if it wasn't for K's cluttered loft. 8.29.6 causes the LCD on my laptop to slowly - and I'm not kidding here - burn and bleed pixels. 8.32.5 won't even detect a screen. It's a pretty sorry state of affairs, especially considering 8.28.8 won't even work with XOrg 7.2, which is what SuSE 10.2 ships with. I have to backport to XOrg 7.1, install the 8.28.8 driver, then hack the config file.

    Don't even get me started about the xorg.conf file. Even though my version of the driver stays the same, with each SuSE release the file has to change. Release before last I had to tell it my "DesktopSetup" was "0x00000000". Last release I had to ForceMonitors to be "auto,auto" for some unexplained reason (actually specifying the monitors wouldn't work). And in this release I had to specify ForceMonitors to be "lvds,tdms" and explicity specify the HSync2 and VRefresh2 of the monitor in the "Device" section. If I didn't, it would either never turn the monitor on, choose an incorrect frequency or choose a lower resolution.

    If the above sounds like absolute rubbish, you're absolutely correct. And SuSE isn't the cause of the problem... it's ATI. Ubuntu, Fedora... they'd have the same problem. It's just that ATI doesn't feel like they need to adhere to "standards" of configuration at all, and their driver is simply unstable and, at times, unusable. The lesson: never, in your life, buy ATI hardware.

    Friday, December 15, 2006

    Send SuSE Back...

    I upgraded my desktop and laptop to openSUSE 10.2 this week. Wow. Bad wow.

    First off, ATI's support of Linux drivers is still abysmal. Not only are their configuration files whack, but they can't be composited, don't support Xinerama (on my laptop at least) and are a pain to install. SuSE ships with a release candidate XOrg 7.2 (because they are really into Xgl and composite extensions), and ATI wasn't ready to support it yet... probably since it hasn't been released. And yet, ATI quickly updated their driver. Still, with my laptop, neither the newer driver nor XOrg 7.2 run. I had to down-port to 7.1, then find an elder driver and use that. Hacked, ugly and it wasted a day and a half of hacking.

    NVidia support still isn't much better. When the computer first starts post-install, you get nothing but a blank XWindow. Nice. You actually have to install the NVidia proprietary drivers first, then you can run your window manager. WTF?

    As for sound, that was also borked. My laptop did fine with the install, but with my AMD64 desktop sound didn't work at all unless I was root. For some crazy-go-nuts reason, my users weren't in the "sound" group and didn't have permission to access /dev/dsp. So that was fun chasing down.

    The Gnome people love messing with my head. Now they've created a keyring manager not unlike KWallet except, just like everything else for Gnome, it's far too convoluted. Evolution uses it to obtain passwords, however OpenSUSE doesn't open the keyring properly prior to launching Evolution. So I have to resort to an ugly, dirty hack for it to work.

    So let's sum up here before I rant too long. My desktop wouldn't work immediately after install. Evolution didn't work. My laptop could run on the open-source drivers, but no luck on dual-monitor configs with the proprietary driver. Sound took hacking to work on the desktop. I think we need to let the original SuSE have their distro back - they always polished things to a nice sheen.

    On the upside ODE 0.7 is automagically included it seems. So at least I have a standard ODE to develop on / release with. Also Novell has admitted to ZEN sucking - and they've offered alternatives. Although their really horrid ZEN update is still the default. Encrypted partitions work exactly as they should, and NetworkManager works as well.

    Hopefully even though openSUSE 10.2 was off to a really rocky start, it will be smooth sailing from here.

    Tuesday, December 12, 2006

    Trapped In The (Triganometry) Matrix

    When everyone in intermediate school asked the math teacher "why the hell should we spend four months on matrix math," he should have looked directly at me and said "because, chuck, you'll need to know how to rotate sprites in both 2D and 3D space, otherwise your code in the future will suck." I would have listened then.

    I was finally able to get Qt to properly apply a bitmask to my QWidget, so I can now have a window open that tilts at a 45 degree angle. I've got to start thinking Π/2... ODE works in radians, Qt in degrees.

    There's a number of differences between Qt and ODE that can be a real pain in the butt. ODE's screen coordinate origin is at the bottom-left of the screen (or world)... which I guess kinda makes sense for physics coordinates that want to model themselves after the real world. But Qt uses what everyone else in computer-land uses: an origin at the top-left of the screen. It's whack. That means counter-clockwise rotations in ODE land are clockwise rotations in Qt land. Increasing your values of y send you up in ODE, down in Qt. Normals face one way with ODE, the other way with Qt. Blech.

    A big tip o' the hat to Stefan Waner and Steven R. Costenoble for their Finite Mathematics page. Also big thanks to Columbia College of Missouri for reminding me how to reduce a matrix in my head. Without them I wouldn't have been able to remember how to invert the rotation matrix and easily convert ODE rotation matrixes to Qt rotation matrixes.

    Friday, December 08, 2006

    Computer Science Isn't Science

    ...it's math.

    The inside joke in universities is that if a subject has the word "science" concatenated onto it, it's not really a science. "Social Science" isn't a science. "Computer Science" isn't a science. Physics is. Chemistry is.

    I think it's true. What's now "Computer Science" (or in other completely nonsense realms, "Informatics") is really mathematics. I think a lot of modern colleges and universities are getting it completely wrong... don't put CS in with engineering, vocation or *gasp* business. Put it where it belongs.

    The knowledge and understanding of algorithms is what separates decent coders from great ones. Nowhere is this demonstrated better than on Beyond3D's Origin of Quake3's Fast InvSqrt(). Here we try to trace back a very elegant, fast and extremely effective five lines of code to its original author. The understanding and anthropology of this Newton-Raphson inverse square codification acts as a veritable who's-who in 3D real-time rendering, from Carmack to Gary Tarolli.

    Take a look at "Exceptional lC++", reviewed by the good ol' Register. This is not just a trove of complex but simple C++ snippits - it can be a litmus test for those rare C++ hackers that can change the physical properties of the world with a mere wave of their hand.

    For those of us who are still on the intermediate side of the scale, S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani have been releasing drafts of their textbook, "Algorithms," to the general laudations of the programming populous. It really is a fantastic resource, if for no other reason than to have such a nice reference on-hand on-line.

    Friday, December 01, 2006

    So You Want To Be An Indie (Console) Developer?

    I love Andre' LaMothe. How could you not? I remember how completely... dork-filled I felt when his copy Black Art of 3D Game Programming arrived at my office. Well, not really an office. At the time I was a consultant working for a local home builder, and they had shoved me into a 12x12 room with another consultant doing crapwork with MS Access. I was so incredibly psyched when the book came in, but received odd stares from my fellow outsourced monkey when he saw the uber-dorkcover that emblazoned the tome. It looked more like someone's AD&D ruleset guide than a programming book. I immediately put it back in the box and reserved it for reading in the bathroom and attics.

    But since then Andre' has not only cleaned up his book covers but released some interesting products. Not software, as some would expect. No... Andre has gone decidedly hardware, by selling do-it-yourself consoles that hackers and hobbyists alike love dearly. He started with the XGameStation, a kit made for the hardware-centric folk who wanted to know how their console ticked. They could build, from the ground up, their very own console with whatever hardware they liked. His latest release, the Hydra Game Development Kit, is more about how you create software that stays as close to the hardware as humanly possible. The Hydra looks like a fantastic lil' learning tool - it keeps would-be programmers close to the metal.

    In a world of fifth-generation languages and programming high-level meta-languages, having to be mindful of registers and opcodes is definitely needed. Java protects you from worrying about memory allocation, but you still need to remember memory allocation. But people forget. This is a nice return-to-your-roots tool that keeps your code-fu sharp. Gamasutra's Q&A with Andre' has a great quote:
    You can’t imagine the amount of ownership and excitement someone gets from building a small computer and writing every single line of code that controls EVERYTHING on the system including the raster and TV signal. There is nothing like it.

    True dat.

    Stop It With The Extra Cores Already!

    Game programming is a very monolithic and event driven. I should restate that... it has been very monolithic and event driven. And now with machines like the PS3, there are five bazillion (slower) cores on a CPU die instead of a single, long-pipeline overclocked processor. So if you're going to see any speed bumps in your code, you need to find a way to separate your engine logic out into multiple threads.

    This is hard, mainly due to resource contention and scheduling synchronization. Gamasutra has a very down-to-earth and easy to read article of the different multithreading architectures developers are evaluating, along with the pros and cons of each.

    To see how someone has actually implemented these architectures, or hybrid versions of them at least, one can look at how Valve has threaded their system. Not only did they have to make their events more atomic, they had to re-order and redesign their entire render pipeline. I still don't quite get how one can do animation in a separate thread (you'd think it would need to be synchronized with shading/rendering/drawing/blah), but the results do seem impressive.

    The crazy thing was that they said threads spent 95% of the time reading memory, 5% writing. That's insane. But again, the results speak for themselves.

    Saturday, November 18, 2006

    AMD's Multi-Core Not Just Multiple Cores

    Hopefully this will put an end to my incessant postings on this topic. It appears AMD is indeed developing a processor with vector units, and using them in their actual processor pipeline instead of using it just for graphics processing. This means their CPU will be able to crunch straight-line algorithms much easier (like Folding@Home) by virtue of a unit on-die that caters to that type of processing.

    Monday, November 06, 2006

    Evil Creeping At Your Door

    It's odd how concommitant my Free Software / Open Source Software experiences have been this week.

    I heard Richard Stallman speak at the local law school recently and it was... interesting. I recorded it so I could quote more exactly, but my MP3 player took this opportunity to corrupt the filesystem and junk my recorded files. Nice.

    Basically he thinks proprietary software is criminal. He also picks lots of things out of his hair. He also likes to play the recorder to parrots. He also thinks taxing CD media is a good way to subsidize music. I'm not kidding on any of these.

    He spoke of the "tivotization" of software - basically digitially signing one's binaries to ensure they're completely tied to a given hardware platform. Linus doesn't care if his kernel is "tivolized" - he's just happy to have people contributing to the kernel however they see necessary. Stallman has vested a lifelong fight against it. He loves to say "GNU + Leeenux" as opposed to just "Linux" as most are accustomed to. Some people believe this is a minor distinction... that Linus' "Open Source Software" is pretty much the same as "Free Software." Wrong - Stallman believes all software should be tinkerable and modifiable, imminently hackable like your car's carburetor. Making something unmodifiable, like not being able to recompile your Tivo's kernel, is like welding your car's hood shut.

    Meanwhile, I'm trying to help push Linux adoption at home by having our office adopt SLES 10. No sooner had I received approval than Novell announced their partnership to Microsoft. The divide between Free Software and Open Source Software was cleaved apart even further - now they're on opposite sides of a huge digital divide.

    Some see this as an incarnation of Ghandi's famous quote:
    First they ignore you, then they laugh at you, then they fight you, then you win.


    But it's not. It's more like "they ignore you, then they laugh at you, then they fight you, then they build up an ominous intellectual property portfolio, then offer indemnity only if you recognize we're right and you're wrong."

    As The Register recently pointed out, Novell has effectively become a licensee of Microsoft intellectual property. Now Microsoft can point to SuSE as their "competition in the market," sue the other Linux distros and steer Novell in whatever direction they wish. Now Microsoft has enormous leverage over SuSE, because now Novell can no longer afford to exit the Microsoft deal. The moment they do, Microsoft can litigate the pants off of Novell. Novell has now acknowledged Linux uses Microsoft intellectual property, because they've effectively been given free reign to use said IP by Microsoft. The moment they exit the covenant with Microsoft, they're screwed. Microsoft can always argue that since SuSE had access to their IP, it has to be embedded in their product offering.

    Novell will no doubt say they've just entered into a covenant not to sue with Microsoft, and this just allows open source developers to innovate without worry of litigation. But this just doesn't make any sense; Microsoft is paying Novell. Is Novell giving anything in return? No. What this gives Microsoft is their own "blessed" version of Linux, expansion of its intellectual property dominion, and the ability to insert their own "viral licensing."

    Microsoft did this once in 1999, by promoting Linux during their antitrust trials. Their trial started the .com bubble bursting, but greatly increased adoption of Linux. Now they're trying to do the same thing for Europe, pointing to their interoperability with SuSE.

    And now I need to go find a new Linux distro.

    EDIT: I just had to add this quote from a Computer Business Review Online article, taken from Microsoft's chief executive, Steve Ballmer:
    "Novell is actually just a proxy for its customers, and it's only for its customers," [Steve Ballmer] added. "This does not apply to any forms of Linux other than Novell's SUSE Linux. And if people want to have peace and interoperability, they'll look at Novell's SUSE Linux. If they make other choices, they have all of the compliance and intellectual property issues that are associated with that."


    If that's not a threat, I don't know what is.

    Monday, October 23, 2006

    Waxing Rhapsodic

    This was a week to remember the good ol' days. The early archives of Computer Gaming World was released to the public, harking its imminent rebranding. Be sure and check out the ads... Apple II, DOS 3.2 required. John Romero released the source for all the Quake maps, allowing us to see the actual art and design of each level before it was BSP-fragged. And my vote for the longest running easter egg goes to Nintendo's Totaka Kazumi.

    Sunday, October 22, 2006

    Nvidia's CPU

    Now that ATI and AMD are one, Nvidia is working on a CPU as well. There are a lot of people saying they're working on a "GPU on a chip," but I seriously doubt it. It seems a lot of people are wagering this will go toward the embedded or low-power market, just like when VIA acquired Cyrix. But to do so would be extremely narrow-minded of ATI and Nvidia, even considering the boom of embedded devices and the increasing horsepower needed by set-top boxes.

    I'm much more inclined to think that Nvidia is working with Intel (which would be a huge surprise, considering how they've been fighting with SLI on nForce vs. Intel chipsets) to compete with AMD & ATI working on bringing vector processing units to CPU's.

    I incessantly bring this topic up, but I had to mention this since it seems that my predictions are actually going to happen. I don't necessarily think this will cause GPU's-on-CPU's to happen, although it might be a by-product. Instead I think this is going to allow for increased parallelization, faster MMX instructions (or 3DNow! if that's your taste) and a movement of putting the work of those physics accelerator cards back on the CPU die.

    We may see a CPU with four cores, each with integer and floating point units then a handful of separate vector processors (a la IBM's cell) along side them. Given how the Cell reportedly absolutely sucks for many types of algorithms, this may give developers the best of both worlds. Rapidly branching and conditional logic can be done on the integer units with branch prediction and short instruction pipes while long, grinding algorithms can go to the vector processor. This has already worked for projects like Folding@Home, and could work for many similar algorithms.

    Or AMD/ATI and Nvidia could just go for a stupid, embedded GPU's sitting on die with the CPU. But they'd be passing up something much cooler.