Monday, December 31, 2007

Vista usage

I read this post on Mike Taulty's blog, which seemed to show widespread adoption of Vista

which led me to this post from Craig Murphy, again showing widespread adoption of Vista

which led me to this slightly more cynical view from Thomas Lee

which led to the original post from Alex Eckelberry

which again shows a less than rosy picture for Vista adoption. My guess is the first two are getting much higher numbers because they are MS-based development blogs, which are read by MS geeks, who are the people most likely to be using Vista. From my small sample space (from the Random Pub Finder) in December, of the 89% visitors who are using Windows, 7.6% are using Vista, meaning it's just overtaken Windows 2000. Personally I think this is a much more realistic figure. Most non-techy people I know don't know nor care what Vista is and continue to use XP quite happily. And I think they may be quite sensible, what are the compelling reasons to upgrade? I'm yet to find them. Under the hood there may be lots of changes, but on the surface there's not a lot to see.


Thursday, December 20, 2007

Calling a COM object on a remote machine with no type library

I'd always assumed to connect to a remote COM object required the client code to reference the type library for the COM object and for the type library to be registered on the client machine as well, but somebody showed me a way of doing this today that appears to avoid the need for either of these.

      Type type = Type.GetTypeFromCLSID(new Guid("{12345678-1234-1234-1234-123456789012}"), server, true);
      Object obj = Activator.CreateInstance(type);
      return (string)obj.GetType().InvokeMember("Method", 
        BindingFlags.InvokeMethod, null, objTest, new object[1]{param});

Admittedly it uses reflection, which will probably be slower than a direct call to the interface, but given it's a call over the wire, this probably won't be the slowest part of the call anyway. And it sure makes deployment easier.

Wednesday, December 12, 2007

Solving the Vista "Failed to play test tone" sound problem

It's almost a year since I installed Vista on my work machine. I sorted out most of the glitches a long time ago but I've not had any sound the whole time, which I kind of learned to live with. I'd pretty much given up trying to fix it, thinking I'd wait for SP1, which I was sure would sort out the problem.

So I saw SP1 RC1 was available and installed it and excitedly tried my sound. Still nothing... OK I thought, now is the time to figure out what the problem is. I tried out some of the SysInternals tools to see if they could provide some kind of useful info, basically to see if the audio subsystem was trying to access a registry key or file that didn't exist or it didn't have access to (I'd already decided it probably wasn't a driver problem since a completely different sound card had exactly the same problem).

I got nowhere with that so I moved onto my next idea, trying to figure out what was going on in the audio log files. If you change the registry key HKLM\System\CurrentControlSet\Control\WMI\AutoLogger\Audio\Start value from 0 to 1, log files get generated in %WINDIR%\system32\LogFiles\Audio (called something like AudioSrv.Evm.001). But I have no idea how to view these log files, they are in some kind of proprietary binary format. So I'd thought I'd harass Larry Osterman. I don't know the guy, but he's the only member of the Windows Audio team who I'm aware of that blogs. But before I had a chance to make a fool of myself I saw a link on one of his comments by someone who'd solved their own Vista sound problem for themselves.

There were two nuggets in there. First up was the suggestion to debug the issue using the WinAudio sample from the Vista SDK. That way, you find out exactly what error message the audio APIs are returning. The second nugget was the solution to his particular problem, which was to delete the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole\DefaultAccessPermission. I didn't think it would fix my machine, since I'd followed quite a few other suggestions without success, but I tried it anyway. It didn't work. Or so I thought, until I rebooted and my speakers miraculously started making noise.

So I'm a happy camper, but there's a few things I don't understand. Why is the logging file format not documented? Perhaps it is, but it should be more widely publicised if it is. For that matter, why's it not just a text file? And why doesn't the audio stack just write to the event log like most other Windows components when something goes wrong? If I'd seen something in there saying access was denied to some COM component I'd have a clue what the problem was. 

And see this below? That's what I'm listening to. Yes, music!

Currently listening to Something , Blue Jay Way (Tran by The Beatles from the album Love

Addendum for non-technical readers

  • From the Windows Start menu, choose 'Run...'.
  • Type regedit in the 'Open' text box.
  • Navigate to 'Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole
  • Delete the registry key 'DefaultAccessPermission'. If it isn't there, chances are this isn't the problem causing your lack of sound.
  • Beware that fiddling with your registry can cause system problems if you modify important settings.

Sunday, December 02, 2007

The last CRT

Some time ago our TV died, trying to switch it on led to a light coming on for a few seconds, then it turned itself off. My guess was the power supply had died or the screen itself had died (for a few days the picture displayed hadn't been the right size).I did think for a second about getting it fixed but then thought it would be as cheap to buy a new TV. After all, the price of TVs has been dropping for a while. And my brother would no doubt be able to fix it, so the TV wouldn't go to waste. But then I actually had a look for a TV and was unable to find any CRT TVs anywhere. I did find some LCD TVs that were pretty cheap but there were a few problems.

  • Most of them were too big to fit into our living room without removing shelving. Not everybody wants a 32"+ screen.
  • Call me a Luddite but the picture quality of LCD screens doesn't seem that good. OK, when high definition TV becomes ubiquitous, the picture quality may be pretty good, but for a 28" screen I don't really need high definition TV.
  • Most LCD screens seem very fragile. They look like they can get knocked over very easily. Having a five year old wandering around with an LCD screen in the room is asking for trouble.

I know I'm not really getting into the new technology here but I think CRT TVs are great. The picture quality, even on very cheap models, is pretty damn good. The technology is proven. The prices are now great, if you can actually find one. Finally I discovered probably the last CRT TV available, from Argos.

Some of you may be thinking "it's analogue, you won't be able to receive anything on it in a couple of years", which is a fair point*. But we have a DVR with FreeView so that's not an issue for us. Also, there is a digital version available for a few quid more. Funnily enough, delivery on this TV took a very long time. Apparently the demand for it is pretty high, so perhaps I'm not the only person who thinks CRT TVs are actually pretty good.

* Digital TV itself seems something of a con. OK, there are more (mostly crap) channels available, although chances are you'll need a better aerial to receive them but why turn off the analogue signal?  Obvious really, it forces everybody to upgrade their kit so equipment manufacturers get some additional income and the government can sell of the old analogue bandwidth to get some extra revenue. Everybody's a winner, except the public. Expect a switch to HD only channels in a few years time.