Microsoft Lifecam on WIndows Embedded Standard 2009

12
Getting your Microsoft Lifecam Cinema working on Microsoft Windows Embedded Standard 2009 – Step-by-step Tutorial – [email protected] Page 1 of 12 This document describes all the steps required to have a working Windows Embedded Standard 2009 (WES) + Microsoft Lifecam Cinema. Readers are not required to have a working knowledge of WES as this document explains the process of configuring, building, and deploying a custom WES image from ground up. Step 1: Create the WinPE iso, complete with additional tools. Windows Preinstallation Environment (aka Windows PE, WinPE) is a lightweight version of Windows XP, Windows Server 2003, Windows Vista, Windows 7, or Windows Server 2008 R2 that is used for the deployment of workstations and servers. It is intended as a 32-bit or 64-bit replacement for MS- DOS during the installation phase of Windows, and can be booted via PXE, CD-ROM, USB flash drive or hard disk 1 . You need to boot the target machine using WinPE in order to be able to obtain the profile of the hardwares, which you will need later when you configure our custom WES image. In order to generate WinPE, you need to have Windows Automated Installation Kit (AIK) installed on your development machine. Download AIK from http://www.microsoft.com/downloads/details.aspx? FamilyID=C7D4BC6D-15F3-4284-9123-679830D629F2&displaylang=en . Once you have AIK installed, proceed with the following actions 2 : 1. Go to Start, All Programs, Microsoft Windows AIK, and then click on Windows PE Tools Command Prompt. (In Vista, Right Click and Run as Administrator.) 2. In the Command Prompt window that opens type in the following: copype.cmd x86 c:\winpe_x86 1 Ref.: http://en.wikipedia.org/wiki/Windows_Preinstallation_Environment 2 Ref.: http://blogs.msdn.com/b/embedded/archive/2008/04/02/creating-a-bootable-winpe-image-and-use-it-to-run-tap- exe.aspx (for item 1 through 6).

Transcript of Microsoft Lifecam on WIndows Embedded Standard 2009

Page 1: Microsoft Lifecam on WIndows Embedded Standard 2009

Getting your Microsoft Lifecam Cinema working on Microsoft Windows Embedded Standard 2009 – Step-by-step Tutorial – [email protected]

Page 1 of 12

This document describes all the steps required to have a working Windows Embedded Standard 2009 (WES) + Microsoft Lifecam Cinema. Readers are not required to have a working knowledge of WES as this document explains the process of configuring, building, and deploying a custom WES image from ground up.

Step 1: Create the WinPE iso, complete with additional tools.

Windows Preinstallation Environment (aka Windows PE, WinPE) is a lightweight version of Windows XP, Windows Server 2003, Windows Vista, Windows 7, or Windows Server 2008 R2 that is used for the deployment of workstations and servers. It is intended as a 32-bit or 64-bit replacement for MS-DOS during the installation phase of Windows, and can be booted via PXE, CD-ROM, USB flash drive or hard disk1.

You need to boot the target machine using WinPE in order to be able to obtain the profile of the hardwares, which you will need later when you configure our custom WES image. In order to generate WinPE, you need to have Windows Automated Installation Kit (AIK) installed on your development machine. Download AIK from http://www.microsoft.com/downloads/details.aspx?FamilyID=C7D4BC6D-15F3-4284-9123-679830D629F2&displaylang=en.

Once you have AIK installed, proceed with the following actions2:

1. Go to Start, All Programs, Microsoft Windows AIK, and then click on Windows PE Tools Command Prompt. (In Vista, Right Click and Run as Administrator.)

2. In the Command Prompt window that opens type in the following: copype.cmd x86 c:\winpe_x86

1 Ref.: http://en.wikipedia.org/wiki/Windows_Preinstallation_Environment2 Ref.: http://blogs.msdn.com/b/embedded/archive/2008/04/02/creating-a-bootable-winpe-image-and-use-it-to-run-tap-

exe.aspx (for item 1 through 6).

Page 2: Microsoft Lifecam on WIndows Embedded Standard 2009

Getting your Microsoft Lifecam Cinema working on Microsoft Windows Embedded Standard 2009 – Step-by-step Tutorial – [email protected]

Page 2 of 12

3. Drop several utility programs into the winpe_x86 we just generated. The ones we definitely need are: tap.exe and bootsect.exe.1. tap.exe is needed for obtaining the hardware profiles. 2. bootsect.exe is needed for updating the master boot record of the hard disk of the target

machine such that it can boot to WES. You can download those programs from http://www.box.net/shared/m3644kxill3. Unzip the downloaded file under c:\winpe_x86\ISO (you should have a folder named c:\winpe_x86\ISO\UTILITIES afterward, with tap.exe and bootsect.exe inside.

4. At this point you have at least two choices: (a) burn it to CD, or (b) burn it to USB flash drive. It depends on the target machine; if it doesn't have any CD reader, go with USB flash drive. In this tutorial we will be using virtual machine (VirtualBox) as the target machine. Currently VirtualBox – and VMWare for that matter – can not boot from USB flash drive. Therefore we can only go with option (a). Type the following command to build the ISO: oscdimg -n –bc:\winpe_x86\etfsboot.com c:\winpe_x86\ISO c:\winpe_x86\winpe_x86.iso. If you need to go with option (b), please refer to the link in footnote #3.

Step 2: Download and install Windows Embedded Standard 2009

The download center of Windows Embedded technologies is http://www.microsoft.com/windowsembedded/en-us/downloads/default.mspx. On that page you should find the download link to Windows Embedded Standard 2009 (the toolkit). An evaluation key will be emailed to you, and with that you can use WES2009 Toolkit for indefinite time. The catch: the custom Windows image you build will expire in around 120 days after the build date.

3 Actually tap.exe is shipped with Windows Embedded Standard 2009, and bootsect.exe can be copied from Windows Vista installation disk. The download link to the box.net is provided here to ease your life.

Page 3: Microsoft Lifecam on WIndows Embedded Standard 2009

Getting your Microsoft Lifecam Cinema working on Microsoft Windows Embedded Standard 2009 – Step-by-step Tutorial – [email protected]

Page 3 of 12

WES toolkit requires an MS SQL server (as repository of components). The easiest way to get an SQL server installed is by installing Visual Studio. You can download the free Visual Studio 2008 Express from http://www.microsoft.com/express/downloads/#Visual_Studio_2008_Express_Downloads. Install VS2008 Express first before installing WES. During the VS2008 Express installation wizard, opt to use the SQL Server Express installed locally.

Step 3: Prepare the hard disk of the target machine & get the hardware profile

It has been mentioned previously that we will use a VirtualBox virtual machine (vm). Create a virtual disk of 10 gigabytes in size, create a vm, and attach that newly-created virtual drive to the vm. It is assumed (recommended) that the vm has the following profile:

• OS type: Windows XP.• VT-x / AMD-V enabled4.• Base memory: 1024 megabytes.• Video memory: 24 megabytes.

◦ 2D video acceleration enabled.• Network adapter enabled (NAT).• Serial port disabled.• USB and USB 2.0 enabled.• Audio enabled (Null Audio Driver).• Boot order (CD/DVD-ROM followed by Hard Disk).

◦ Un-check the Floppy5.◦ Attach the winpe_x86.iso created in Step 1 to the CD/DVD-ROM.

Run the vm, it will boot to the winpe_x86. Wait until the command prompt is ready, as shown in the following figure:

4 Requires that the hardware virtualization checked in the BIOS setting of your development PC.5 This, I suppose, removes the floppy drive.

Page 4: Microsoft Lifecam on WIndows Embedded Standard 2009

Getting your Microsoft Lifecam Cinema working on Microsoft Windows Embedded Standard 2009 – Step-by-step Tutorial – [email protected]

Page 4 of 12

At this point you are ready to format the harddisk of the target machine, and writes the master boot record code. This is an activity that you will perform only once. To format the harddisk, type diskpart in the command prompt. Followed by typing the following series of commands within diskpart's console (Select Disk 0, Clean, Create Partition Primary, Active, Format FS=NTFS). See the following picture.

Back in the command prompt, to write the master boot record code, type d:\utilities\bootsect.exe /nt52 c:

Page 5: Microsoft Lifecam on WIndows Embedded Standard 2009

Getting your Microsoft Lifecam Cinema working on Microsoft Windows Embedded Standard 2009 – Step-by-step Tutorial – [email protected]

Page 5 of 12

Finally, type d:\utilities\tap.exe -o devices.pmq. The application writes out the hardware profile into a file named devices.pmq stored under x:\windows\system32\.

To copy that PMQ file, connect your USB flash drive to the virtual machine, and type copy x:\windows\system32\devices.pmq e:\

Page 6: Microsoft Lifecam on WIndows Embedded Standard 2009

Getting your Microsoft Lifecam Cinema working on Microsoft Windows Embedded Standard 2009 – Step-by-step Tutorial – [email protected]

Page 6 of 12

Step 4: Create the component for Microsoft Lifecam Cinema

In this step, you will learn how to package Microsoft Lifecam Cinema's driver into a component that can be integrated to your custom image. Open the Component Designer.

Normally you would have to install Microsoft Lifecam Cinema's driver on a “normal” Windows XP machine (your development PC, for instance). That's a way to obtain all the DLL, SYS, and INF files that makes up the driver. The installer of the driver can be downloaded from http://www.microsoft.com/hardware/download/download.aspx?category=ICE&type=LifeCam&sku=H5D-00001

Page 7: Microsoft Lifecam on WIndows Embedded Standard 2009

Getting your Microsoft Lifecam Cinema working on Microsoft Windows Embedded Standard 2009 – Step-by-step Tutorial – [email protected]

Page 7 of 12

The installation process takes several minutes to complete, as it downloads even more files during the installation from Microsoft's site. In order to save you some efforts, I collected all those files into a single ZIP file that can downloaded on the following URL: http://www.box.net/shared/764mbiv4qk .

You might notice the size of the ZIP file is smaller then the size of the installer. It is because the ZIP only contains the files for the driver, while the installer contains even more applications (e.g.: video capturing application), which we wouldn't include in our image. You must extract the ZIP file in your development PC. In my case I extracted it under: My Documents\fortutorial\NX6000\6.

You can jump-start the creation of this component by importing the driver information file. Click File → Import, and select nx6000.inf under My Documents\fortutorial\NX6000\.

As the result, you will see several components have been created automatically. Delete all of them – right click on the component's name, and click Delete – except the one named Microsoft Lifecam Cinema.

6 You might notice NX6000 is actually another webcam product from Microsoft. Apparently this Microsoft Lifecam Cinema is using a driver a “generic” driver for NX6000-compatible cameras. I wonder if or when will they provide a driver specifically written for Lifecam Cinema. Link: http://www.microsoft.com/hardware/digitalcommunication/productdetails.aspx?pid=005

Page 8: Microsoft Lifecam on WIndows Embedded Standard 2009

Getting your Microsoft Lifecam Cinema working on Microsoft Windows Embedded Standard 2009 – Step-by-step Tutorial – [email protected]

Page 8 of 12

Now we have to modify the configuration of Microsoft Lifecam Cinema component a little bit. Select the Files node under the component's node. You will several files listed in the pane to the right. Delete dshowext.inf, USBVideo.inf, and USBVideo.sys. They are provided by other WES 2009 components that we'll add into this component later on.

Save your work as mslifecamcinema.sld before moving on to the next task: defining a new repository in the database.

Page 9: Microsoft Lifecam on WIndows Embedded Standard 2009

Getting your Microsoft Lifecam Cinema working on Microsoft Windows Embedded Standard 2009 – Step-by-step Tutorial – [email protected]

Page 9 of 12

The idea is to have that repository contains all the files (copied) from the location where you extracted the ZIP file. Therefore, specify the source path of that repository; click the Browse button next to the Source Path label in the repository configuration page, and navigate to My_Documents\fortutorial\NX6000\ in the folder selection dialog presented afterward. Don't forget to give this repository a name: NX6000.

Then you assign the Microsoft Lifecam Cinema component to the newly-created repository, such that it knows where to fetch the pertaining files from. You do this by clicking the Repositories button in the component's property page, and select NX6000 from the dialog presented.

Page 10: Microsoft Lifecam on WIndows Embedded Standard 2009

Getting your Microsoft Lifecam Cinema working on Microsoft Windows Embedded Standard 2009 – Step-by-step Tutorial – [email protected]

Page 10 of 12

Next, you have to add the components which this NX6000 depends on. Two components are already included when you imported the INF file, namely Analog TV and Primitive: Ks.inf.

Below is the list of the components that must be added:

• Audio / Video Core• BDA IPSink• BDA Slip De-Framer• Class Installer - Stream• Closed Caption Decoder• Digital TV• DirectShow Capture• DirectShow Video For Windows / WDM• Kernel Streaming User Mode Support• Microsoft Kernel Acoustic Echo Canceller• Microsoft Kernel Audio Splitter• Microsoft Kernel DLS Synthesizer• Microsoft Kernel DRM Audio

Descrambler• Microsoft Kernel GS Wavetable

Synthesizer• Microsoft Kernel System Audio Device• Microsoft Kernel Wave Audio Mixer• Microsoft Streaming Clock Proxy• Microsoft Streaming Quality Manager

Proxy• Microsoft Streaming Service Proxy• Microsoft Streaming Tee/Sink-to-Sink

Converter• Microsoft TV/Video Connection

• Microsoft WINMM WDM Audio Compatibility Driver

• NABTS/FEC VBI Codec• Performance Data Helper• PnP (User-mode)• Primitive: Drmk.sys• Primitive: Portcls.sys• Primitive: Wdmaud.drv• Teletext Decoding• TV Common• USB Audio Device• USB Composite Device• USB Video Device• World Standard Teletex Codec

Page 11: Microsoft Lifecam on WIndows Embedded Standard 2009

Getting your Microsoft Lifecam Cinema working on Microsoft Windows Embedded Standard 2009 – Step-by-step Tutorial – [email protected]

Page 11 of 12

I built the list above by actually installing the driver on a “normal” clean Windows XP. I took the snapshot of the system (registry entries, files, etc) before the installation, and compare it with the snapshot right after the installation. In addition to that I also checked the dependencies of the DLLs, SYS, and AX files of the NX6000 driver, and of course by analyzing the nx6000.inf itself. The technique is well explained in MSDN: http://msdn.microsoft.com/en-us/library/ms838332.aspx

Finally, mark the component as released, and save it. This would be the last thing to do inside the Component Designer.

Finally, you have to make this component available in the component database. You do this importing the component design file (SLD) you just created through Component Database Manager.

Inside the Component Database Manager, click the Import button, and select your SLD file in the import dialog presented.

Page 12: Microsoft Lifecam on WIndows Embedded Standard 2009

Getting your Microsoft Lifecam Cinema working on Microsoft Windows Embedded Standard 2009 – Step-by-step Tutorial – [email protected]

Page 12 of 12

Step 5: Configuring and Building Custom WES Image

Lorem ipsum dolor sit amet....