HTPC - Chapter 3

Back to Chapter 1       Back to Chapter 2

Some HTPC Topics in Depth

by Conrad McDonnell

Topics

The Directshow system
HTPC and DVD Region Control
Interlaced and progressive scan material
Forced subtitles, forced trailers and copyright warnings, and other UOPs
Playing DVDs off the hard-drive
Using a media server
Advanced DVD playback filters
Itty bitty settings
Remote control
HTPC as Personal Video Recorder
Setting up SPDIF audio
Acknowledgements

 

The Directshow system
DVD software on a Windows PC is based around the Windows "DirectShow" subsystem, which is also what is used to play video clips in WMV, MPEG, DivX, AVI etc formats. It is worth gaining a basic understanding of how Directshow works in order to set up your machine optimally and to understand the errors that may arise in practice.

Directshow is modular, so that whenever multimedia is being displayed under Windows, several different modules (which may be made by different vendors) are in use. When playing a simple MPEG2 video clip, the following modules are used:
 Source file reader
 MPEG2 splitter (separates out the audio and video streams, which were combined into a single MPEG2 file)
 Video decoding filter
 Audio decoding filter
 Video renderer
 Audio renderer

The different Directshow modules used to play a trailer ripped from DVD

The workings of all these different modules have to be synchronised, so that video will be fed to the display device at the proper frame rate (24 frames per second for film) and so that the audio will remain smooth and in sync with the video. Since audio cannot be speeded up (which would change the pitch) and any tiny skips or pauses inserted in audio would be audible as pops or glitches, Directshow's priority is to playback the audio at precisely the correct speed. Therefore the whole Directshow system takes its timing from your soundcard. While this should result in correct audio playback, it can sometimes lead to non-smooth video playback. Almost always, the cure to video smoothness problems is to make changes to the audio system.

When playing a DVD, the source file reader is a special 'DVD Navigator' made by Microsoft (the filename is quartz.dll). The DVD Navigator understands the complex set of codes which operate DVD Menus, Chapters, alternative languages and subtitles, multiple angles etc. There is also an additional video decoding filter for the 'subpicture', which is the part of the DVD which displays subtitles and the clickable icons on a DVD menu.

One of Zoom Player's many option screens: Directshow filter setup

Because a Directshow system uses modules made by several different vendors, it may be unstable in some situations; in particular it is not advisable to 'Alt-Tab' away from your DVD player when it is in the middle of operations such as spinning up or ejecting a DVD.

HTPC and DVD Region Control
HTPCs when received from the factory are normally region controlled devices; Windows itself includes DVD Region Control functions allowing up to a maximum of 5 DVD region changes before the region becomes permanent. Most HTPC owners by-pass region control using one of several DVD region-free software packages, of which the best known is DVD Region Free although others may be less expensive. Old-timers still use the freeware DVD Region Killer, having first 'flashed' their DVD-ROM drive to make it a region-free (RPC-1) drive; DVD Genie is also propular with some users as it allows the PC's DVD region to be changed temporarily on a per-disk basis.

Interlaced and progressive scan material
PCs are progressive-scan devices, in other words they process a whole video or film frame as one continuous block. Standard TVs (and video cameras) are interlaced devices, in other words each video field contains only half the video information - alternate lines are scanned, first the odd lines and then the even lines in the next field, but because the phosphor coating on a TV set has a slight persistence and the human eye responds slowly, the stripey effect that this produces is not detectable unless, for example, you take a still photograph of your TV screen. Film is a progressive-scan medium, in other words each film frame contains the whole of the video information. But video-source material, such as music videos, some TV programs (but not big-budget shows such as Buffy the Vampire Slayer or Star Trek which are shot on film), home videos and many 'featurettes' or documentaries found as DVD extras, are interlaced because they have been filmed using TV cameras. The consequence of this interlacing is that there is a 30 millisecond delay between filming the odd lines and the even lines of each full video frame, so that if the subject matter is moving, or if the camera is moving or panning or zooming, then the subject matter will have changed position between the odd lines and the even lines. To see what this actually looks like, play any video-source DVD (such as a music video) on your HTPC, and in the DVD software set the deinterlacing method to 'Weave'.
Interlaced source material is not a problem so long as it is played back on an interlaced display such as a TV set. However it is a perpetual problem for progressive-scan devices such as PCs and digital displays such as projectors, LCD and plasma. The playback device has the choice of either displaying exactly what is stored on the DVD, which is the 'Weave' deinterlacing method which produces the characteristic ugly fringed effect whenever there is motion in the image, or of applying some type of processing to deal with this. One standard 'cheat' is to display the material on the PC at half resolution, so effectively displaying only the odd lines of the video image and throwing away the troublesome even lines - this is what most software that comes with consumer video cameras does: a pointer to this is that video image displayed on the PC only has 240 lines of resolution at native resolution instead of 480 lines as it should.
There are several types of processing which may be used to de-interlace interlaced source material on a PC, and it is still a developing area. Many good consumer DVD players or display devices incorporate Faroudja DCDi processing which is very acceptable to most people although it produces a slightly soft video effect which serves to cover up any residual faults from the de-interlacing. Faroudja DCDi processing is not an option for HTPC users since the de-interlacing has to be done inside the HTPC (thus Faroudja DCDi is an unnecessary feature of a display for HTPC users unless they will also be connecting other video sources to it). Most PC DVD software features 'Bob' de-interlacing which usually produces better results than 'Weave', although it can sometimes result in a blurred effect which is identical to PAL/NTSC ghosting. WinDVD in all versions since WinDVD 4 Pro has featured advanced de-interlacing which is very much superior to either Bob or Weave, and in many cases better than Faroudja, so that when using WinDVD in this mode all interlacing artifacts disappear and perfect results are produced. For this reason WinDVD (or an alternative front-end using the WinDVD video filter) is the recommended DVD software for playing any interlaced source material. Some competing software now also offers adaptive de-interlacing or motion compensated de-interlacing. ffdshow features an excellent motion compensated de-interlacing filter named TomsMoComp after Tom Barry who wrote it.
Note that all material on DVDs is strictly speaking stored on the disk in an interlaced format since DVD uses the NTSC or PAL TV standards which are interlaced. However film-source material has no motion between the two video fields containing the odd and the even lines of the image - therefore this is referred to as a progressive-source DVD (the DVD format provides for a progressive-scan "flag" which the DVD author should set for such material to help DVD players identify it, although good quality PC DVD software does not require this flag to be correctly set).

Forced subtitles, forced trailers and copyright warnings, and other UOPs
Many commercial DVDs use the 'User Operatation Prohibited' function to provide such irritating 'features' as: non-removable subtitles, subtitles or languages which cannot be changed in mid-movie, trailers and copyright warnings which cannot be fast-forwarded or skipped. Although highly irritating for users, the authors of these DVDs continue with such practices because they can. An HTPC can sidestep these irritations in one of three ways: (1) once a disk has played through the forced trailers once, the PC can be set to commence playing the disk every time from a later point, such as the first frame of the actual movie; (2) software such as DVD Idle (which may be bundled with DVD Region Free) can eliminate UOPs entirely, so that nothing is forced; (3) most packages which copy DVDs to the hard drive also remove all region protection and UOPs automatically.

Playing DVDs off the hard-drive
Most PC DVD software, in particular Zoom Player, operates equally well whether the DVD data that it is reading happens to be stored on the DVD-ROM drive (e.g. drive D:) or the hard-drive (drive C:). This opens the possibility of copying entire DVDs onto the hard-drive. Apart from the limited DVD piracy possibilities (this site does not support DVD piracy: if you don't want to buy a disk then at least rent it), reasons why a user might want to do this are:
(a) slightly quieter operation as the DVD drive is not spinning;
(b) no layer change;
(c) battery saving for laptops, e.g. for long journeys;
(d) complete elimination of region controls and 'forced subtitles';
(e) possibility of adding custom subtitles;
(f) possibility of merging two DVDs into one seamless file (e.g. both disks of Das Boot, Lawrence of Arabia or one of the Lord of the Rings extended editions, or any 'flipper' disk).
For example, the shareware program DVDShrink can back up a DVD to hard-drive exactly as it is found on disk, but automatically eliminating region controls and forced subtitles, forced FBI warnings and other UOPs (User Operation Prohibited commands).
Alternative subtitle tracks for many movies can be found
online, or you can make your own. More information on the software necessary to do this can be found at www.doom9.org.

Using a media server
In this context a media server is a machine with plenty of hard drive space (typically four 250Gb drives or more) located in a different room from your HTPC and linked by a network (100 MBit/s is recommended). It needs to be in a different room because a machine with four or more hard drives requires plenty of cooling fans and will be noisy. The hard drives are used to store copies of CDs and DVDs. Software is available for cataloguing these media and for displaying cover images. The HTPC reads the desired CD or DVD movie over the network. The user has access to his entire DVD collection, or at least the heart of it, without having to leave his armchair, and without the risk of physical damage to the disks.
Most media server users choose to use desktop alternative / DVD launcher software such as MainLobby.

Advanced DVD playback filters
Most experienced HTPC users use one or more of the following Directshow filters to achieve video nirvana: AC3 filter, ReClock audio renderer; and ffdshow post-processing filter. All of these must be used in conjunction with another DVD video playback system such as Zoom Player with appropriate DVD filters. The functionality of these add-ons is as follows: AC3 filter and ReClock usually lead to better handling of the audio side of things which, as explained, should result in smoother video playback; AC3 filter allows the audio track to be advanced or delayed by milliseconds for perfect sync with video (which may otherwise be a minor problem on some systems); these filters can also perform pitch correction for PAL movies if desired.

Reclock in operation: here SPDIF ('AC3 passthrough') is in use so the user has chosen to use the audio card's clock as the reference clock for Directshow - that does not make use of Reclock's full functionality

ffdshow provides many video post-processing functions equivalent to a multi-thousand dollar professional video processing unit, including noise reduction, video sharpening, de-interlacing and fine colour and gamma adjustments - it is also a versatile set of filters which can be used for playback of MPEG2, MPEG4, DivX and DV format video files. If your processor is fast enough, ffdshow should be set to perform its video post-processing functions after having resized your video to final display resolution. An excellent and comprehensive beginners guide to using ffdshow for DVD playback on a high resolution HTPC system can be found here.

Itty bitty settings
For smooth DVD playback, the following settings are recommended:
* Enable DMA for your DVD drive (usually enabled for DVD drives automatically) - in Windows XP this is done in Device Manager/Primary (Secondary) IDE Channel/Advanced Settings where 'Transfer Mode' should be set to "DMA if available".
* Disconnect any network card you have, alternatively use your HTPC on a small 'quiet' network with only one or two other machines so that HTPC processing is interrupted as little as possible by network activity
*
Disable as much startup and system tray software as possible, in particular all 'scheduled tasks' applications. Consider disabling your anti-virus software if you are sure your system is clean.
* If using Zoom Player, set Thread Priority to 'High' (Advanced Options/Values and Tools/Other/Player Thread Priority).
* If using Windows 98 or Me, increase your system cache memory for DVD reads by following the instructions
here under the heading Max Cache Speed - this setting is not necessary or advisable for Windows XP users.
* For Windows XP, try some of the other performance boosts suggested
here
* If using ffdshow with Sonic filters (or Theatertek), you need to edit the registry to find a key in HKEY_LOCAL_MACHINE\SOFTWARE\Sonic\CineMaster DS DVD\2.5\VideoDecoder called "AllowAllRenderers" and set it to 1. Try a Google search for "AllowAllRenderers" to find other discussions of suggested registry settings for the Sonic filters.
* If using PowerDVD 4 (or its filters under Zoom Player), you may need to edit two registry keys to activate SPDIF. For SPDIF to be active in PowerDVD, the following two keys should have the following values: [HKEY_CURRENT_USER\Software\CyberLink\PowerDVD] "DSAUIF"=dword:00000004 [HKEY_LOCAL_MACHINE\Software\CyberLink\PowerDVD] "DSAUIF"=dword:00000004

Remote control
Many remote control devices are available for HTPC. A typical configuration is an infra-red remote control with an infra-red sensor which plugs into a USB socket, and this arrangement is inexpensive, typically costing around $30-$40. Enterprising individuals have used an IRDA-compatible remote control with the infra-red reader built-in to most laptops. Mac owners can obtain software which allows them to use a Bluetooth mobile phone as a remote control for the Mac, although this author is not yet aware of any PC equivalent. Another option could be simply to use a small wireless keyboard.

The remote control is used with software which mimics keypresses when the buttons on the remote control are pressed. There are several PC Remote Control packages; many HTPC users use Girder.

HTPC as Personal Video Recorder
An HTPC with a large hard disk makes an excellent PVR. It requires hardware to receive the TV images - this may either be a simple PC TV card (in which case it might only be able to record live TV) or it may be a more expensive 'video capture' card which can digitise the image from any video source connected to it. Different PC TV cards offer varying degrees of quality, although cards manufactured by Hauppage are among the most popular.

Advanced users use a PC with an HDTV capture card such as that made by FusionHD. This results in a PVR for HDTV, which is not otherwise a readily available consumer device at present - this probably represents the apogee of HTPC functionality. A fast processor and a prodigious quantity of empty hard disk space are required; the results are said to be very rewarding.

Setting up SPDIF audio
SPDIF (or sometimes S/PDIF) is the name given to the digital audio connection between a PC and an external receiver, amplifier or 5.1 speaker system. SPDIF is essential for an HTPC unless either you have a 6 channel audiophile soundcard in your PC (in which case you can connect the soundcard's outputs directly to power amps/loudspeakers), or unless you are willing to accept 2 channel audio which is achieved simply by connecting your PC's headphones output to your stereo amplifier using a suitable lead (or preferably an inexpensive external PC stereo audio adapter which is recommended for increased sound quality).

A laptop port replicator: note the white DVI connector, and the SPDIF connector on the right - this is a standard RCA (coaxial) hi-fi style connector

The SPDIF connection is physically the same as the digital connection between a CD player and an amplifier, also known as Toslink if optical cabling is used. But apart from setting the correct display resolution, setting up your HTPC to use the SPDIF audio output is likely to be the most difficult task for a novice user. SPDIF features on PCs are not well documented because few people use them. In order for SPDIF output to work, the following elements must all be in place otherwise you will just hear silence:
* The DVD must be using a multi-channel soundtrack (including DD2.0, but not PCM stereo tracks or MPEG audio)
* The DVD software must be set to output SPDIF - before using Zoom Player, try simply making the standard WinDVD or PowerDVD software output audio in SPDIF mode
* If using ReClock or other audio-post processing, it must be set to a mode compatible with SPDIF passthrough
* Windows must be set to output 5.1 channel sound and to enable SPDIF - use Adjust Audio Properties (right click the loudspeaker icon in the taskbar)
* Your audio adapter's drivers must support SPDIF - early driver versions (in particular for laptop sound systems, where SPDIF is used very rarely) may not have activated SPDIF functionality
* The SPDIF output on your PC must be physically connected to a digital input on your amplifier or receiver - initially, try using a short run (no more than 5m/15 feet) of standard RCA audio extension lead
* Your amplifier or receiver must be able to recognise the input signal as DD5.1 (also known as AC3) or DTS as the case may be.
If you have a problem, try to isolate it by reference to components known to work - for example, check that your amplifier and audio system is correctly set up for SPDIF by connecting the digital audio output on a standard consumer DVD player; try a standard DD5.1 track before something like DTS; if using Zoom Player, use it with the ReClock audio renderer which has the useful function of displaying the format of the audio it is being fed: if ReClock is receiving SPDIF it describes it as "Audio stream: AC3 passthrough, 48000 Hz". Zoom Player is awkward switching to SPDIF (using the 'External' tab in Advanced Options) if using WinDVD or PowerDVD audio filters, especially when Zoom Player is used following the standalone WinDVD or PowerDVD players. It may be necessary to edit Registry entries to correctly enable SPDIF in WinDVD or PowerDVD under Zoom Player.

The author gratefully acknowledges the help of Matt and all at SeeingThings.co.uk.

Feedback on this article (errors, additional HTPC tips) can be sent to HTPCfeedback@yac.ndo.co.uk but please do not ask for advice about your own setup as such questions will not be answered - instead use the online forums for that.

All trademarks are acknowledged. Discussion of or linking to a product does not indicate a DVD Beaver endorsement of that product, nor that that product is necessarily the best in its class - links are intended only to provide examples of the types of product that may be available, in order to help the reader with his own further research.

 Back to Chapter 1       Back to Chapter 2