Craptastic Experiences

Programming, Games No Comments »

Once more, I’m just a slight bit annoyed at the level of incompetence the pile of crap I’m sitting in front of has been engineered. Not that I’m buying cheap hardware — I’ve learned that lesson long ago — it’s just that even the best, to put it simply, is just mediocre most of the time.

Whenever I boot my top-of-the-range Asus motherboard, I’m greeted by a colorful picture intended to hide the actual boot messages, lest they scare the user. On this screen is written “Performance, Stability, Reliabilty“. Yes, that immediately convinces me that this message reflects the actual work that went into these things.

When I turn off my PC at the boot screen, it will warn me that the previous boot failed and asks me whether I want to continue or enter the BIOS setup. If I select continue, this message will come up again at the next boot, and the next, and the next. But if I turn off my PC at the boot screen again, the message disappears. Yes - if the user says it’s alright, keep nagging him. But if the same error occurs again, then it’s probably alright.

Recently, my brand new Western Digital 1 TB HDD (Raid Edition 2) developed bad sectors. 1365 of them, even though it was never moved an inch.

To locate and mark all current defects on the drive, each sector needs to be written to. Windows Vista’s checkdisk of course restarts at sector 0 each time it is run. It takes more than 6 hours to reach sector 100 (!), making it… mildly… inpracticable to scan the entire disk in one session. So checkdisk is out of the equation.

Trying to force the HDD’s controller to mark the bad sectors by formatting the entire drive has the same issue. Windows Vista’s partition manager doesn’t resume formatting after a reboot. The partition will just be marked as successfully formatted when you reboot during formatting.

If you try to cancel the formatting process, nothing happens. Even Minutes later, there’s no reaction from Vista. So that tells me the reboot is probably not even waiting for the partition manager to finish, leaving the partition in who knows what state.

While I’m formatting, whenever the drive encounters a bad sector, Windows Vista will deep-freeze for a fraction of a second. So it becomes quite hard to click on anything with the mouse and preventing you from working or playing on the machine while the drive is being formatted. Of course, audio playback stops too, so should you decide to watch a movie instead, that experience is utterly destroyed as well.

I’d like to close with a list of the files I found in my Mercenaries 2 folder:

d3dx9d_27.dll
d3dx9d_32.dll
d3dx9d_34.dll
D3DX9d_36.dll
d3dx9_32.dll
d3dx9_34.dll
d3dx9_35.dll
d3dx9_36.dll
dbghelp.dll
msvcp71.dll
msvcp71d.dll
msvcr71.dll
msvcr71d.dll
msvcr80.dll
msvcr80d.dll
xinput1_3.dll

For the non-programmers reading this, that’s the Visual C++ 2003 Runtime for C and for C++, the Visual C++ 2003 Debug Runtime for C and for C++, the Visual C++ 2005 Runtime for C, the Visual C++ 2005 Debug Runtime for C, D3DX from DirectX 9.0c December 2006, D3DX from DirectX 9.0c June 2007, D3DX from DirectX 9.0c August 2007 and D3DX from DirectX 9.0c November 2007.

Wow, just wow. Did anyone even have the slightest idea what they were doing? You’re not allowed to distribute even half of those DLLs in that form as per Microsoft’s license. I hope someone (hopefully a junior programmer or worse) just panicked and put everything he could think of in there to make it run because… the other possibility… scares me.

Windows Server 2008 Rant

Programming, General No Comments »

[Warning: rant follows!]

Now that the behemoth is released, I have a Windows Server 2008 trial version going again on my home NAT + File server. I had quite the trouble with Beta3 of Windows Server 2008, but expected the final product to be free of any such problems as I was encountering. Boy was I wrong.

The server is an AMD Athlon 3500+ with 2 GB of RAM (Corsair TwinX), four SATA drives (all WD - 1x 200 GB boot plus 3x 500 GB in a soft RAID 5) and a low-power passively cooled Asus GeForce 8300 card on an Asus NForce 4 mainboard.

I have to let off this rant because I’m so incredibly frustrated with this toy operating system. I’m not a linux guy and wouldn’t even remotely consider using it on my workstation for everyday work, but I’m seriously considering to go through the effort of configuring a complete linux environment just to get my home server running for good.

What the hell am I doing wrong? If what I’m experiencing is the state of things with Windows Server 2008, I can’t imaging anyone seriously using such a system professionally.

Here’s a list of the first 20 days of my Windows Server 2008 trial:

Suicide by Disk Cache

If someone downloads larger amounts of data from this server (> 2 GB), the server seems to start paging out vital parts of the operating system. It gets so bad that I cannot connect via Remote Desktop anymore.

Maybe it’s supposed to be okay paging out everything that’s not actively in use to make space for the disk cache. After all, Windows just has to store useless copies of huge, sequentially read files that aren’t going to be accessed again. That’s worth any sacrifice.

Suicide by Memory Fragmentation

Most BitTorrent clients experience strange freezes and are unresponsive about 90% of their time (literally!). Azureus works and so does Halite (the only x64 BitTorrent client I know of). Having some quite large downloads going (I’m currently downloading all of the MythBusters episodes :p), I leave my BitTorrent client running for days at a time.

Last Monday, I noticed the server wasn’t issuing my workstation a DHCP IP anymore. Attempting to log in to the server was impossible, it took several minutes to go from the password prompt to the welcome screen. I finally hard-resetted the thing (which I don’t like to do since it means a full RAID array resync)

Tuesday, the server was unresponsive again. I had to hard-reset.

Wednesday, the server had the same problem yet again. I had to hard-reset.

Thursday, unsurprisingly, was no change. Another hard-reset.

Friday and over the weekend, I resorted to rebooting the server every morning, noon and evening. That kept it working, but it’s not enough time for the RAID array to fully resync (which means after rebooting, it starts the resync all over again).

What happens is that windows’ memory usage slowly climbs all the time while my BitTorrent client is running. The process itself doesn’t eat up any more memory (assuming the windows task manager would at least show if Halite and Azureus leaked memory).

RAID Array Mess-Up

Today while I was tagging some FLACs I had just encoded (I’m in the process of re-ripping my entire audio collection using EAC), suddenly, the server’s X: partition disappeared (that’s the RAID-5 parition I store my music collection, DVD backups, virtual machines and stuff on).

The whole RAID array was just gone. Windows showed “missing” on 2 out of the 3 drives. I checked their cables tried to reactivate, but only got errors that the device was unavailable.

After rebooting, the BIOS screen showed all drives. Back in windows, a “foreign” RAID array was shown (that’s Windows slang for “inactive RAID array”). I imported it. Whenever I tried to assign a drive letter to the RAID parition, Windows reported that the “function is not supported”.

Another reboot later, my RAID array was running and had its old drive letter assigned again. But it’s resyncing. I don’t know if it’s still resyncing from last week’s happenings or resyncing due to the import. After leaving the disk management console open for 6 hours, there was still no progress indication (normally, after a few minutes, I remember a percentage being shown behind the ‘resyncing’ status).

DNS Failures

I don’t know if my NAT, routing table and DNS server have some configuration error or what else it might be, but sometimes, specific domains don’t resolve anymore through DNS.

The funny part is that, sometimes, they can be resolved on the server, but not on NAT clients. And sometimes, even stranger, they cannot be resolved on the server, but by NAT clients using the very same server.

Flushing the DNS cache on both client and server doesn’t change a thing in this situation.

Virtual Server Outage

On Beta3, I had installed Microsoft Virtual Server to run some build agents for my continuous integration server (TeamCity, now free, I can wholeheartedly recommend!).

After several hours of work getting Virtual Server installed and setting up the build agents, the whole thing was finally running.

For about 3 days. Then the network adapter of Virtual Server broke out of the blue and even reinstalling didn’t change a thing. I discovered several others with this problem and the only solution was to reinstall the whole server.

I’m not going to even try Hyper-V or Virtual Server on Windows Server 2008. I’m so sick of putting hours into this nonsense just to know that all my work will be destroyed again sooner or later.

FreeImage 3.1.0 x64

Programming 1 Comment »

Yet another one! FreeImage is a popular library among game programmers that can load a wealth of image file formats (.bmp, .dds, .exr, .gif, .ico, .jpg, .mng, .pcx, .png, .tga, .tif). It’s also free and Open Source, so there’s nothing stopping me from attempting an x64 build of it ;)

FreeImage internally uses OpenEXR, the IJG reference JPEG implementation, libmng, libpng, OpenJPEG (supported JPEG 2000) and LibTIFF. All of these libraries are available as source packages as well. I’ve updated all these libraries to their latest available version.

Source Patches

Here are some patches containing the changes I had to apply to FreeImage in order to make it compile to x64 cleanly:

Download: Patch fixing all x64 issues for OpenJPEG 1.3
Download: FreeImage 3.1.0 patch fixing all x64 issues

Visual C++ 2008 Binaries

You can find precompiled, optimized binaries for Visual C++ 2008 in my Subversion repository:

https://devel.nuclex.org/external/svn/freeimage/tags/3.1.0-r1

The binaries have been compiled with Visual C++ 2008, all contained libraries targeting the Multithreaded DLL runtime, so you’ll need the Visual C++ 2008 Runtime (x86, x64) to use them. If you have Visual C++ 2008 installed, you already have the runtime.

Demo Application

If you just want to see whether this truly works, here’s a quick command-line image loader (loads .bmp, .dds, .exr, .gif, .ico, .jpg, .mng, .pcx, .png, .tga, .tif) in both x86 and x64 incarnations. The x64 version only works if you’re running Windows XP x64 or Windows Vista x64, of course:

Download: FreeImage x64 demo application
Requires the Visual C++ 2008 Runtime [x86, x64] to work!

Audiere 1.9.4 x64

Programming, Music No Comments »

If you haven’t heard of it before, Audiere is a well designed multi-platform audio library. It incorporates Dumb (for mod playback), FLAC (lossless audio playback), libogg/libvorbis (ogg vorbis playback), Speex (special speech compression) and supports some formats on its own (including .mp3 and .wav of course). And the best part yet: it’s free and open source.

Recently, I’ve been playing around with native x64 applications. My experiences have been very positive so far: Basically any library that provides its source code could be compiled to x64 binaries with very few changes.

Source Patches

Audiere was no different. There was some assembly in FLAC 1.2.1 and libvorbis 1.2.0 that I had to patch, a small WinAPI pointer issue in Audiere and some more minor things. Here are the patches containing my changes:

Download: Patch for libvorbis 1.2.0 fixing all x64 issues
Download: Patch for FLAC 1.2.1 fixing all x64 issues
Download: Audiere 1.9.4 fixes and x64 patch

Visual C++ 2008 Binaries

You can find precompiled, optimized binaries for Visual C++ 2008 in my Subversion repository:

https://devel.nuclex.org/external/svn/audiere/tags/1.9.4-r1

The binaries have been compiled with Visual C++ 2008, all contained libraries targeting the Multithreaded DLL runtime, so you’ll need the Visual C++ 2008 Runtime (x86, x64) to use them. If you have Visual C++ 2008 installed, you already have the runtime.

Demo Application

If you just want to see whether this truly works, here’s a quick command-line audio player (plays .wav, .mp3, .ogg, .flac and .mod) in both x86 and x64 incarnations. The x64 version only works if you’re running Windows XP x64 or Windows Vista x64, of course:

Download: Audiere x64 demo application
Requires the Visual C++ 2008 Runtime [x86, x64] to work!

Enjoy!

Visual Studio 2008 Professional - No x64

Programming 8 Comments »

I’ve got Visual C++ 2008 Express installed on my Windows Vista x64 system and it’s running just fine. Double clicking a project doesn’t work due to UAC and it doesn’t do x64 projects, but at least I’ve got a decent IDE with strong C++ support.

This weekend, however, I had started thinking about doing an x64 build of Ogre3D, a free 3d graphics engine that is continuing to gather highly interesting features such as Blender integration (a 3d modeling toolkit) and a large scale paging terrain addon.

You can do x64 development for free if you install Microsoft’s Windows SDK, but you will have to do without the IDE - and without the project configurations and even without vcbuild.exe, meaning you have to run the compiler, librarian and linker yourself from the command line. Thus, I wrote some NAnt scripts which called these utilities with the arguments Visual C++ 2008 Express was using - with the necessary changes to do an x64 build of course.

This worked fine, but writing a complete build system from scratch isn’t exactly a pleasing experience and while I did get the job done, enough at least to build x64 binaries of the FreeImage library (which already is no small feat if you, like me, want to integrate the latest versions of the libpng, libmng, libtiff, jpeg, openjpeg and openexr libraries).

Then I remembered that there was an trial version of Visual Studio 2008 Professional available for download. I downloaded it, installed and… no x64 project configurations were available. In fact, I couldn’t even add another project configuration.

I know how to set up an x64 project because at work, I’ve got Visual Studio 2008 Professional on my workstation and among all the Smart Device platforms, I can select x64 as the target platform. No so in this case.

Another 30 minutes later I had uninstalled everything (Uninstalling Visual Studio 2008 leaves most of the Visual Studio packages on your system as it turns out) and went on to reinstall Visual Studio 2008 a second time, again making sure that I had ticked the x64 compiler and libraries.

Visual Studio 2008 installed, I could create a new project, but again, no way to create an x64 project, let alone select any configuration between an Win32, standard x86 build.

Well, if Microsoft intended the trial to get me interested in buying Visual Studio 2008 Standard (or even Visual Studio 2008 Professional): you failed, miserably.

I suspect the problem is that if you already have installed Visual C++ 2008 Express, installing Visual Studio 2008 Professional will leave you without the x64 targets. To validate this theory however, I’d have to reinstall Windows Vista which I… erm… don’t feel like doing right now.

MSVC 2008 Quality

Programming, General 1 Comment »

When I was working on an absolutely clean install of my Windows Vista development system so that I could create an image for later use, one of the many things that caused me to start all over again was Visual C++ 2008:

The .NET Framework 3.5 installer in the VC folder of the Visual Studio 2008 Express DVD is broken. It will take forever and then proclaim that setup failed. I had to manually install the .NET Framework 3.5 using the installer in the VC# folder before I could successfully run the VC 2008 setup.

Today I’ve downloaded the Windows SDK 2008. Any installation attempt fails because vcredist_x64.msi is broken. Attempts to manually run vcredist_x64.msi will result in a message box telling me that the installation package is broken.

Taking a look at all the trouble I’ve been having recently, I am very worried about Microsoft’s quality control.

Not too long ago I had the issue of Windows Vista crashing with a BSOD that’s 100% reproducible if you have 4 GB of RAM and your mainboard is equipped with a device that causes storport.sys to be loaded.

Stuck Auto-Hide Windows in Visual Studio

Programming 2 Comments »

There’s a small problem in the Visual Studio IDE that isn’t really a blocker but can be really annoying: If you set your “Error List” or “Output” panels to auto-hide (that’s the mode in which they slide into the borders of the main window so you can only see their captions), sometimes, these windows will get stuck.

What typically happens in my case is that I double click on an error in the “Error List” panels, the source code editor opens the file in question, but the “Error List” panels stays open, with my cursor hidden behind the “Error List” window so I cannot see the code I’m supposed to fix. Even if I move the mouse to the other side of the screen and keep hammering the Escape key, the darn thing stays open :)

If I then just close the entire panel, the next time it pops up, it will have auto-hide disabled and waste precious space in your IDE window. As I said, nothing terrible, but it’s regularly nagging me.

Now I’ve found the solution: Use the keyboard shortcut that opens the panel and it will, after the usual time it’s supposed to stay open, slide away again. For the “Error List” window, that shortcut happens to be Ctrl+W,E and for the “Output” window, it’s Ctrl+Alt+O (at least if you chose the Visual C# Developer profile for your IDE).

As far as I know, this little bug has persisted from Visual Studio 2005 (maybe even earlier, I don’t remember) up to Visual Studio 2008 and seemingly affects all editions, including the Express SKUs.

C# 3.0: Extension Methods

Programming No Comments »

C++ supported multiple inheritance. Generally a frowned upon feature, because
apparently some guy was able to repeatedly shoot himself into the foot with it,
multiple inheritance allowed for some conveniency when defining interfaces:

class IBitmap {
  public: void blit(IBitmap target) {
    blit(target, Region(0, 0, width, height));
  }

  public: virtual void blit(IBitmap target, Region region) = 0;
};

Any class implementing the IBitmap interface would now
automatically have a blit method that omits the Region
parameter.

Now C# comes along, says that interfaces are something different from classes,
that interfaces can only contain abstract methods, properties and events. Now
we have to make both blit methods abstract and reimplement the default logic
in all implementing classes - or remove it.

Then C# 3.0 tries to patch this and invents Extension Methods,
a nightmarish hack. Basically, you can now write some arbitrary method like…

public static class IBitmapMethods {
  public void blit(this IBitmap self, IBitmap target) {
    self.blit(target, Region(0, 0, self.width, self.height));
  }
}

…and it will allow you to act as if blit() was another member
of the IBitmap interface (notice the this
keyword on the method’s argument list):

// Allows:
IBitmap screen, sprite;
sprite.blit(screen); // calls IBitmapMethods.blit()

Fantastic, guys. Now I can basically write any method for any class in
any namespace and it will only be callable when the caller has the proper
namespace imported. Method definitions for my class can appear througout
the whole codebase, basically you could see code like:

using Magic;

public class Foo { /* look ma, no methods */ }

class Program {
  static void Main() {
    foo.Bar(); // WTF?
  }
}

That’s an exaggerated example and nobody should misuse this feature like that,
you say? Well, the argumentation that “someone could” was enough to
give multiple inheritance a bad reputation. Bad programmers do bad things,
whether their tool is multiple inheritance or extension methods.

5 Reasons to Go Indy

Programming No Comments »

Becoming an independent software developer is the dream of many people doing their daily 9-to-5 slavery. It is mine, too. However, you can’t just decide to do this step, quit your job and tomorrow you’re an independent developer.

If you decide to walk this path, you will first be forced to give up a lot of your precious free time by working on your own projects on the evenings and weekends in addition to your day job. You’ll have to do this for months or even years to come in order to build a portfolio of products that generate enough additional income so you can switch to only working your day job half-time.

That’s exactly the point I’m at now and I feel that just like in a marathon race, there will be a time when you reach the thirty kilometer mark where you’ll ask yourself: “Why am I doing this?”. Then you need a good answer to keeps you going, one that gives you drive. My 5 most important reasons for going indy are:

  • I want to set my own times. With a job, I cannot just decide to go out jogging on sunny days or when I feel like it. It’s depressing to get up while it’s dark, work the entire day and drive home in the dark again during the winter months.
  • I want to decide what I do, and when. In the corporate environment, you are assigned a task and then that’s what you’re going to do. Yes, I have quite some influence here in my current job, but I still have to help fulfil the company goal. It’s like driving in a bus: You are free to choose your seat, but you have to cope with other passengers and neither the route nor the time is under your control.
  • I want to be proud of what I produce. At least for me, things produced in the corporate environment never live up to my standards. There are other developers with other priorities that produce tons of uncommented, badly abstracted code all the time. I’m not free to choose whether I accept these people or not. I have to live with them.
  • I want to become rich. Right, call me a dreamer, a heretic even, for thinking I can become rich as an indy developer. But fact is, I do. One thing should be clear: You will not become rich as a corporate working slave. If you want to get the money, you need to be the one in control. Maybe I’ll have to turn my indy business into a startup game development company some day to achieve this goal. So be it.
  • I want to be in control. Have a bad feeling about some concept and would rather put it aside to see how it develops before doing the grunt work? Forced to do crunch time but know for sure that the deadline is but an artificial one? It’s not about choosing the easy way out in all these questions, it’s about who decides what to do.

XNA Game Studio Express Beta 2 on Windows Vista RC2

Programming 1 Comment »

Just two days ago, I installed XNA Game Studio Express Beta 1 on my evaluation copy of Windows Vista RC2. Apart from the project templates, everything worked smoothly. Now Beta 2 is out and makes everything harder ;)

To get XNA Game Studio Express Beta 2 installed in Windows Vista, follow these steps:

VC# Express 2005 SP1 should fix the issue about the setup assistant failing to register the project templates. If it still would fail, after you acknowledge the error message, a rollback would be performed, removing all installed files again.

The next problem will be that you XNA projects will not compile anymore. The workaround here is to create a normal Windows Application project and add references to the XNA assemblies and your code files from the XNA project there.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Login