Category: Networking
:: Next Page >>
Vista audio glitch on Sony Vaio V505CP
My personal laptop is a Sony Vaio V505CP. It's almost five years old, but after upgrading it to 1.5 GB RAM and a 160 GB hard drive, it does a good job of running Windows Vista SP1. I use it mainly when I'm out on consulting jobs or travelling, so I don't need anything more powerful.
A month or two back, I noticed that whenever I played music, the audio would glitch every 20-30 seconds. The mouse pointer also froze briefly during the glitches. This was something new -- it was working fine after the original upgrade to Vista SP1. Today, I finally got around to investigating the cause.
For those in a hurry: the culprit was NDIS.SYS, the network driver. Simply turning off the built-in wireless adapter (easily done with a switch on the front of the Sony's case) made the glitch go away. I can live with this for now, since I rarely use wireless and stream music at the same time; normally, I leave the wireless enabled all the time, just in case I might need it, but it's not a big deal to turn it off.
So how did I figure this out? Here are the steps I followed, including dead ends (the journey is often as interesting as the destination).
My first port of call was Windows Task Manager. I usually start here, simply because Task Manager is standard on every Windows PC. In this case, it showed a big CPU spike whenever the glitch occurred, but unfortunately, Task Manager itself froze during the glitch so I couldn't identify what process was responsible.
The next tool to try was Process Explorer from SysInternals, a wonderful tool for all kinds of system probing. It includes a dummy task entry for DPC (Deferred Procedure Calls) and so I could see that during glitches, DPC was particularly active, responsible for almost all the additional CPU usage.
Deferred Procedure Calls are used whenever a process needs to make a system call, but the system is busy doing something important like handling an interrupt. The system call is queued until the interrupt completes, and all outstanding calls are then executed in sequence -- hence the brief jump in CPU activity.
Some Googling brought me to a handy tool called DPC Latency Checker, which graphs DPC usage over time. Using this confirmed the theory:

The red peaks indicate unusually long DPC latencies, which will cause system problems. Unfortunately, the checker didn't tell me the cause of these, but I knew it was probably a badly written device driver. The checker's website suggested using Microsoft's RATTv3 developer tool to identify the culprit.
I hadn't come across RATTv3 before, but it's very useful -- if you're running Windows XP, that is. It records the latency of each and every device driver's interrupt calls, correlated over time, and identifies the bad ones for you. Unfortunately, it doesn't work too well under Vista.
Back to Google, where I found a thread suggesting Microsoft's new Performance Toolkit as a good Vista alternative. This does everything RATTv3 can do, and a lot more besides.
One thing to watch out for: after installing the toolkit, all the files end up in "C:\Program Files\Microsoft Windows Performance Toolkit". I suggest copying them to C:\XPerf for convenience, since the installation folder is not added to the system path automatically.
After installing, you can begin a new capture by opening a command prompt in the toolkit folder and typing:
xperf -on DiagEasy
to begin tracing. Then let the system run for a minute or two, until the glitch has occurred. Next, turn off tracing and convert the results to a file suitable for viewing:
xperf -d trace.etl
Finally, view the accumulated results:
xperf trace.etl
Pretty easy! Doing this produced a summary page with a ton of detail, most of which I didn't need (CPU usage, disk i/o, etc.) The thing I was interested in was DPC activity, which it showed as a graph like this:

The peaks in the graph show unexpectedly high DPC levels. By selecting one of those peaks and right-clicking, I was able to display a summary of all the driver activity that had contributed to the peak:

From this, it was clear that NDIS.SYS was the culprit, with a worst-case latency of more than 200 ms. (I repeated the test several times to confirm this, and it was consistently in top place.)
So mystery solved. From here, it was an easy step to try disabling the network adapters to see if that fixed things -- and turning off the wirless adapter did the trick.
So when I have a chance, I'll upgrade my wireless driver and hopefully that will sort it out permanently. For now, though, I'm just glad to have properly working audio again.
OpenSocial: now facebook is for everyone
Marc Andreessen's always-interesting blog today talks about OpenSocial, a new standard spear-headed by Google which aims to provide a common API for embedding new web content and apps across all the main social network sites.
This is very similar to the Facebook Platform API launched a few months ago to critical acclaim, but with the significant difference that OpenSocial is an open standard which pretty much everyone else except Facebook is jumping on the bandwagon to support.
Marc's blog does a much better job of describing the benefits than I can. In a nutshell, though, it means that if you run a website that offers a useful service, you can now easily allow it to be embedded in any of the main social networking sites (LinkedIn, Friendster, Ning, etc.) by just adding some basic HTML & Javascript support.
This should be fun...
(The official Google launch is tomorrow, at which point http://code.google.com/apis/opensocial should become operational.)
Seam Carving & Tiny First Person Shooters
My friend James was impressed by the Tilt-shift photography I mentioned in the previous post, and sent me some related material.
Seam carving is an image resizing technique which works by identifying horizontal and vertical seams with low information content and then removing them, rather than simply removing pixels according to a fixed scaling algorithm.
This means that the proportions of important items within the picture are maintained. The same technique can be adapted to increase the size of an image (especially in a single dimension) without making it look skewed. And more intriguingly, by first marking parts of the image as "low value", you can seamlessly erase elements of a picture automatically -- no Photoshop expertise required.
This YouTube video does a good job of describing it:
Not content with this, James also pointed me towards .kkrieger, a simple 3D shoot-em-up with an impressive twist: the executable size is less than 100 KB. (Yes, that's Kilobytes). The program would have easily fitted onto a standard 170 KB floppy disk from the Commdore 64 era 25 years ago!
Despite this, the game has pretty decent graphics and sound, not dissimilar to Doom, as this screenshot shows:
The amazingly small file size is achieved by generating all textures algorithmically at runtime. This leads to long, though not excessive load times.
To download the game or read more about it, visit the main .kkrieger website.
Server room on a chip
Jon Stokes from ArsTechnica has a good article on Intel's recently announced Terascale 80-core processor.
When you have so much processing power available, how do you make best use of it? One way is to treat it as a virtual server room, and run virtual machines on each core. For example, a heavily trafficed website, which is traditionally spread across multiple web & database servers, could be hosted completely on a single piece of silicon, with corresponding cost and power savings (especially power).
Then there's the problem of how to keep such a fast chip adequately supplied with data, to ensure it doesn't spend too much idle time waiting for new packets to arrive. There are some hints that Intel may be about to announce on-chip optical support.
I doubt we'll see this technology on the desktop any time soon (though you never know), but in an era where datacentres are routinely sucking up megawatts of power, it's useful to have a potential glimpse of a future where the entire room may be reduced to a single server cabinet.
(Let's ignore storage, for now...)
Flatrate 3G access from Vodafone
ENN reports that Vodafone Ireland have announced a flatrate 3G access package from 1 July.
For around €50 per month, users can enjoy up to 1 Mbps downstream Internet access while on the move, subject to a monthly cap of 5 GB of data.
This sounds like a pretty good deal, though I'm dubious as to how close to 1 Mbps your average mobile user can expect; I'd expect speeds closer to 128 Kbps. You only need to have a conversation with someone on a car phone to realise how hard the mobile network works just to keep a connection up at all.
However, I'm more interested in its potential for fixed base users, such as those in areas too remote to have traditional broadband available. Until now, the only solution for such users has been satellite, which is both expensive and awkward.
Vodafone have > 99% coverage around the country, so there is an excellent chance that almost every household will be within range of a mobile signal. It's not clear whether Vodafone need to upgrade the transmitters on each mast to support 3G access, or whether this can be accomplished by a software upgrade. If the latter, then this may finally be a cost-effective way for small businesses in remote regions to get decent Internet access.
(Keep in mind also that a fixed antenna should be capable of much better datarates than a purely mobile solution. And if the introductory price is €50 per month, prices can only get cheaper over time.)
:: Next Page >>
