I recently bought a new notebook and installed the 64-bit edition of Vista Business on it. I'm running Vista on 6 machines at home and one at work, and overall I like the OS... but I'm not in like with it. Anyway, I've had nothing but headaches with 64-bit Vista, partly because the 64-bit version won't load 32-bit and/or unsigned drivers, and partly because Vista takes about a fortnight to boot or resume from hibernation on this notebook, despite very respectable CPU/memory specs and even the Intel Turbo Memory upgrade (so far, my official opinion is 'don't waste your money').
So, I'm "upgrading" (take that!) to Windows XP Professional. I'm not washing my hands and saying I'm done with Vista yet, because it still runs acceptably on my other machines, and I haven't proven to myself (yet) that XP will be that much better on this notebook... but I suspect it will be.
XP doesn't come with SATA hard disk drivers for this notebook, so I had to download them and copy them to a floppy disk for this installation. That's not a big deal. The notebook doesn't have a floppy drive, but I have a USB floppy drive for such occasions.
Press enter to boot from CD, press F6 to load a third-party driver, S to select the driver from the floppy, F8 to sign away my firstborn to the devil accept the Microsoft EULA, prepare the HD partition, and finally start copying files.
"Please insert the disk with the SATA driver into drive A: and press Enter."
But... the disk is already in drive A:. Fine, I'll press Enter. *Enter.* Nothing.
Great. So XP setup can see the disk during the first part of the install process, but not when copying files to the hard disk. Turns out that XP only supports some USB floppy drives, and mine isn't one of them. I tried a USB flash drive with no luck, so it looks like my remaining options are slipstreaming the drivers onto the XP install CD, or using Remote Installation Services. RIS is cool and I've had some success with it, but I don't have that kind of time tonight. I've slipstreamed drivers and service packs into Windows setup CDs before, but it's always been kind of a hassle to do that manually.
While looking for other options, I came across the nLite application. Slipstreaming the drivers with nLite was a breeze, and it looks like it handles service packs as well (I assume it's just as easy).
I went ahead and slipstreamed the appropriate SATA and Ethernet/wireless drivers onto the setup CD, and the rest of the Windows installation process went very smoothly. And best of all, nLite is free (donations appreciated)!
Wednesday, March 12, 2008
nLite Saves the Day
Posted by
jwyse
at
9:34 PM
0
comments
Monday, January 14, 2008
Vista Hibernates Again After Resuming from Hibernation
I've noticed that my new notebook (running Vista) has been hibernating very soon after I resume it from hibernation. I'll often start/resume the notebook and then turn my attention away to do something else while it's resuming, only to find that it's hibernating again when I turn back. After searching Google for much longer than should have been necessary, I found a Microsoft knowledge base article that addresses the issue.
The KB article deals primarily with XP, which re-hibernates after 5 minutes of inactivity after resuming from hibernation. I read that much of the article and then closed the tab and resumed searching since I'm not running XP, and I'm seeing this occur after much less than 5 minutes. If I had read the whole article the first time, I would have found out (sooner) that Vista behaves similarly, after only two minutes of hibernation. Aha.
I'm looking for a way to adjust this timeout via a registry key or similar setting, if it's possible at all. It may be that the only "solution" is to pay more attention when I'm resuming from hibernation. So much for multi-tasking.
Posted by
jwyse
at
3:15 PM
2
comments
Thursday, August 09, 2007
Getting a Batch File's Directory
Tonight I ran into a problem trying to uninstall a Windows Service via a batch file. The batch file is simple:
C:\Program Files\MyProduct\uninstsvc.cmd@echo off
:: get the Framework directory
set NETFX=%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727
:: stop the service
net stop MyService
:: uninstall the service
%NETFX%\installutil /u MyService.exe
Since MyService.exe is in the same directory as the batch file, this works as long as my working directory is C:\Program Files\MyProduct. However, if I call the batch file from any other working directory, I get this output:Uninstalling MyService service...
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.312
Copyright (c) Microsoft Corporation. All rights reserved.
Exception occurred while initializing the installation:
System.IO.FileNotFoundException: Could not load file or assembly 'file:///D:\Some\Other\Working\Directory\MyService.exe' or one of its dependencies. The system cannot find the file specified..
This could be easily solved by using the full path to MyService.exe in the batch file:installutil /u C:\Program Files\MyProduct\MyService.exe
But what if my end user doesn't install my product in the default directory? I want the batch file to just look for MyService.exe in the same directory where the batch file itself is stored.
I knew that you can use variables like %1, %2, etc. to get the parameters passed into a batch file, and %0 to get the full name of the batch file itself -- but I didn't know that you could use modifiers on those variables to extract different pieces of the path.
In my service uninstaller, I need to get the path to the batch file, but exclude the batch file name. I can do that using %~dp0, which represents the drive and path portion of the file %0.%0 = C:\Program Files\MyProduct\uninstsvc.cmd
%~d0 = C:
%~p0 = \Program Files\MyProduct\
%~dp0 = C:\Program Files\MyProduct\
There are several other useful modifiers too: Using Batch Parameters. This ended up saving me a lot of time because I didn't have to make the application installer modify the batch file dynamically to include the full installation path. Sometimes you just can't beat a decent batch file. :)
Posted by
jwyse
at
1:11 AM
2
comments
Labels: Tips
Friday, July 06, 2007
Retrieving SQL Table Row Counts
I recently needed to get a quick row count from each table in a large SQL database, and I came across this post that shows two ways to do it. I'm pasting the SQL queries below; read the original post for more information.sp_msforeachtable "Print '?' select count(*) from ?"select convert(varchar(30),object_name(id)) [Table Name], rows from sysindexes
where object_name(id) not like 'sys%' and indid = 1
order by object_name(id)
Posted by
jwyse
at
1:47 PM
1 comments
Labels: Development, SQL, Tips
Monday, May 07, 2007
ForFiles Command
I just discovered a very useful command in Windows: ForFiles. It's used to iterate over files from the command prompt (and much easier to use than the for command, when it comes to manipulating files), and even processes some criteria.
I just used this command to cleanup old (/d -30; older than 30 days) gzipped (/m *.gz) files in the path (/p) e:\tempfiles and all subdirectories (/s). For each file, it issued the command (/c) to echo the filename to the command window (so I could see which files were being deleted) and then delete the file.forfiles /p e:\tempfiles /s /m *.gz /d -30 /c "cmd /c echo @file & del @file"
Check the Microsoft TechNet documentation for complete usage information and some more examples. If you don't already have the ForFiles command in your version of Windows (I know that it's included in Vista and Server 2003 SP1, but not XP SP2), you can get it from Microsoft's FTP site under the NT 4.0 "y2kfix" Resource Kit files.
[EDIT 2007.05.14: Apparently I posted the wrong MS FTP link. Thanks to Daniell for pointing this out and sending me the corrected link.]
Posted by
jwyse
at
10:13 AM
3
comments
Friday, May 04, 2007
HD Video Performance in Vista Media Center (Followup)
In my previous post, I said that I had updated drivers and tweaked some settings to get pretty good 720p video playback on my HTPC. My HTPC is a couple of years old, so I'm still running an Athlon XP 3200+, 1 GB RAM, and a GeForce FX 5500 GPU.
I wrote about my "success" after watching the first 5 minutes or so of the last episode of Heroes with perfect audio/video sync. I got too excited (and posted declaring victory) after too little testing. When I tried watching other 720p videos later, they still experienced A/V sync problems (although not nearly as bad as they were before I started).
Tonight I did some more research and testing, and found another codec that seems to have fixed this issue (for real this time!). I had been using CCCP, which includes ffdshow, which uses the libavcodec for H.264 video. CoreAVC is another codec that several sources claim is the fastest H.264 codec available, and is at lest 30% faster than the libavcodec that I had been using. The CCCP folks have a pretty good wiki entry about why CoreAVC isn't included in CCCP, and how to use CoreAVC instead of ffdshow.
I tried it out, benchmarking my FPS before and after registering the new codec. I used this post as a general guideline to do the benchmarks using Media Player Classic (included in CCCP) and Fraps. I used the same 720p and 1080p sample videos links in the post. The videos have a framerate of 23.976 fps. My results (average framerates) for the 720p sample video are below.
libavcodec: 17.402 fps
CoreAVC: 23.983 fps
My 720p videos play like any others now, and I can skip forward/back without losing A/V sync. The audio plays immediately after the skip, and the video catches up and re-syncs within a second or two. My CPU utilization is quite a bit lower now too (it was 100% using libavcodec).
Unfortunately, the CoreAVC codec isn't free like ffdshow, but it's still cheaper than upgrading hardware.
Posted by
jwyse
at
7:46 PM
0
comments
Labels: Media Center, Vista
Thursday, May 03, 2007
HD Video Performance in Vista Media Center
[Edited 2007.05.04: While I still recommend updating Windows/drivers/codecs anyway, it turns out that this didn't completely resolve my problem. Read my followup post for another codec option that performs much better and seems to have really resolved this issue.]
I was talking to James earlier this week about HD video in Media Center, and he warned me that 720p video performance is not that great (video is choppy and audio is out of sync) on his machine. He was giving me the heads-up because we have very similar HTPCs: I'm running Vista Ultimate on an Athlon XP 3200+; he's running XP MCE 2005 on an Athlon XP 2800+. Both have 1GB of dual-channel memory and similar (and quite modest) video cards.
I tried playing a 720p HD video on my machine tonight and saw exactly what he described, despite my slightly faster processor. My HTPC is a couple of years old, but it still runs great otherwise, so I'm not crazy about the idea of upgrading the hardware right now.
I was determined to squeeze acceptable performance out of my current hardware, so I started tweaking. I've now got the video running MUCH better, without any overclocking or outrageous settings (I even have Aero enabled). The video is smooth, and the audio and video are in sync, at least until I skip forward/back during playback -- and I suspect that a little bit more tweaking will fix that.
I took sort of a shotgun approach and changed quite a few things the first time around. All of these are changes that I wanted to make anyway, so I wasn't concerned with pinpointing which ONE change was the silver bullet.
- Added a 2GB USB flash drive and enabled ReadyBoost: Very noticeable improvement in the OS and Media Center interface, but no apparent changes to HD video playback.
- Ran Windows Update: There were no significant driver or Media Center-related updates available, but I needed to get the last batch of critical updates anyway. I don't think this had any effect on HD video playback.
- Updated my power settings from Power Saver (this must be the default, because I never would have chosen this option for an HTPC) to High Performance. In some configurations, the power settings throttle the CPU to conserve power, but since I don't have the AMD Cool 'n Quiet driver installed, I think it defaulted to maximum CPU power anyway.
- Verified that my memory was running in Dual Channel mode (it already was; no change here).
- Verified that I had the latest BIOS version installed (I already did; no change here).
- Updated CCCP (a pack of the most common audio/video codecs like DivX and Xvid) to the latest version.
- Stopped/disabled unused services like Indexing and Windows Firewall (the firewall was already "disabled," but the service was still running).
- Updated my video drivers to the latest version (Forceware 96.85, for my NVIDIA GeForce FX 5500).
I did a few quick tests along the way, and none of these changes noticeably improved playback until the last one: updating the video card drivers. The performance logs show that I still have very high CPU utilization during playback after these tweaks, but the audio/video is great now. I'd say perfect, but I need to do a little bit more tweaking so that I can fast-forward/rewind without getting the audio and video out of sync. Most of these changes should apply to both Vista and XP, and I'm curious to see if this fixes James' HD playback performance in XP MCE.
There are a couple more changes I can think of that might improve performance a bit more:
- Overclock the CPU/FSB/GPU in BIOS.
- Disable Windows themes (Aero/Luna): I'd expect a big improvement in most desktop applications, but I would hope that Windows isn't spending any CPU cycles rendering the theme while I have the Media Center application running full-screen anyway.
I've read some blog/forum posts that recommend setting the Enable Advanced Performance option in your disk write caching settings. This seems irrelevant (as far as video playback is concerned) because write caching shouldn't affect the disk read rate.* Disk access doesn't seem to be a factor in my case anyway, since I playback most of my TV shows from a mapped drive (a SATA disk in my server, mapped over my gigabit network). My tests tonight didn't show any difference between the network-mapped and local copies of the same video file.
A lot of this will depend on your hardware, but I read quite a few reports of people having this same problem with MUCH better hardware than what I'm running. Let me know if you have any other tips/recommendations to further improve HD video playback.
* At least not in my case, because this hard disk is dedicated to media, and no other processes are reading/writing to the disk while I'm playing video. If you have your media on disk shared with the OS or other applications, write caching might make a bit of difference for you.
Posted by
jwyse
at
12:12 AM
2
comments
Labels: Media Center, Vista