Introduction to Mirametrix EyeTracker Hao Wu 1 Preface This is an introduction of how to set up Mirametrix eye tracker to Linux system. This eye tracker only has Windows version driver. We usually use Linux system to run our experiment program, so we need find a way to use eye tracker with a Linux system PC. The solution is to install virtual machine software on the Linux system. Virtual machine software can simulate another PC, whose system is Windows, connecting to the Linux PC. The software can also simulate the Windows PC connecting with eye tracker. There is official software designed by Mirametrix, which can be installed in virtual Windows PC to make it become an Internet server. In this way, the Linux PC can control the eye tracker by visiting virtual server. The virtual machine software used here is QEMU, which is very powerful and designed for Linux system. QEMU is designed based on the virtualization function of CPU; i.e. QEMU only can work on the PC whose CPU has virtualization function. In addition, there are many other kinds of virtual machine software, such as VirtualBox. Through my past test, VirtualBox does not work, because it cannot get image from eye tracker on the virtual Windows environment. The reason is unknown and becomes a long lasting unsolved bug. 2 Hardware Preparation 1. CRT Monitor with VGA Cable 1
Figure 1: CRT Monitor 2. External Keyboard and Mouse with USB cables Figure 2: Keyboard and Mouse 2
3. Mirametrix Eye Tracker Device with USB cable Figure 3: Eye Tracker 4. PC whose CPU has Virtualization Function Figure 4: Laptop 3
(a) How to check whether the CPU has Virtualization Function i. Find the model name of CPU Figure 5: For this laptop, the CPU is AMD Athlon II X2 M300 ii. Google the name and find the specification of the CPU Figure 6: Specification of AMD Athlon II X2 M300 iii. Check the item Hardware Virtualization or Virtualization Technology in the specification. If it says Virtualization or Yes, the CPU has Virtualization Function. If it says No or this item is not on the specification, the CPU does not have this function and it cannot be used for eye tracker. 4
(b) How to enable Hardware Virtualization Function i. Find a way to enter BIOS of the PC. The way is different for different PC. Usually, you need press the button F2 or F8 on the keyboard when the PC starts. When the PC starts, there is a short sentence on the bottom of screen that says which button you need to press. Another solution is to google the brand name of your PC and to find the instruction. ii. Find an item contains Virtualization and enable it. If you cannot find this item, do not worry. Usually, the Intel CPU has the item and you need to enable it manually. However, the AMD CPU does not have the item in the BIOS and the Virtualization function has already been activated automatically. 3 Hardware Set-up 1. Connect the CRT monitor to PC through VGA cable. Figure 7: VGA cable is connected to laptop 5
2. Connect the external keyboard and mouse to PC through USB cables. 3. Connect the Eye tracker to PC through USB cable. Figure 8: Set-up of all Hardware 4 Software Preparation 1. Linux System Installation Flash Drive Any Linux systems such as Ubuntu, Arch-Linux can be downloaded on their official websites and created to bootable installation USB flash drives. I highly recommend Ubuntu, which has a workable QEMU graphical user interface (GUI) virt-manager. QEMU is virtual machine software, which can be installed and operated by commend line in any Linux system. However, operating QEMU need type a lot of complex code. A good GUI like virt-manager can make this thing easy. Through my past test, virt-manager is not working on Arch-Linux but working on Ubuntu. The method to create Ubuntu installation flash drive is https://help.ubuntu.com/community/installation/ FromUSBStick 6
2. Certified Windows Installation Disc Contact the staff managing software in your department. Ask him or her to borrow a certified Windows installation disc. The staff now is Bill Eickmeier whose email is bee@uwaterloo.ca. Its very important to borrow a certified disc. Do not download it from unofficial websites. 3. Mirametrix Eye Tracker Official Software Installation Program The official software installation program is located in the same folder of this instruction, which will be installed on virtual Windows PC. 5 Software Set-up (Ubuntu and Windows 7 were used in the following steps) 1. Install Linux System (Ubuntu) on PC (a) Insert Ubuntu installation flash drive to PC. (b) Start PC and enter BIOS. Find the menu BOOT. In this menu, there is a top-down list of different device names, which determines the boot priority of device. Find the name of your flash driver and put it on the top of the list. Finally, exit BIOS. The PC will boot from your flash driver and enter Ubuntu installation program. (c) Follow steps of Ubuntu installation and choose options carefully. Completely formatting hard drive of PC is not recommended, which will cause unrecoverable results. 2. Install QEMU and Virt-manager on Ubuntu PC (a) Open terminal and type sudo apt-get install qemu. QEMU will be installed automatically. The (b) Type sudo apt-get install virt-manager. The GUI of QEMU virtmanager will be installed automatically. 3. Create a Windows (Windows 7) virtual PC by virt-manager (a) Launch virt-manager through Applications System Tools Virtual Machine Manager. 7
(b) Insert the certified Windows 7 installation disc in your CD-ROM. (c) Click the button (Create a new virtual machine) on the top left corner of the Window (d) This will start a wizard to guide you through the rest of your VM creation i. Enter your virtual machine details A. Name: Windows7 B. Choose Local install media (CDROM) C. Forward Figure 9: Enter your virtual machine details ii. Locate your install media A. Use CDROM or DVD B. OS type: Windows C. Version: Microsoft Windows 7 D. Forward 8
Figure 10: Locate your install media iii. Choose Memory and CPU settings A. Memory (RAM): 2048MB B. CPUs: 1 C. Forward 9
Figure 11: Choose Memory and CPU settings iv. Select Enable storage for this virtual machine A. Select Create a disk image on the computer s hard drive: 20 GB B. Select Allocate entire disk now C. Forward 10
Figure 12: Enable storage for this virtual machine v. Ready to begin installation A. Confirm the details B. Finish vi. You should now see the OS installation proceed within a virtmanager window. Complete the installation and reboot. 4. Modify Virtual Windows PC to recognize input from Eye Tracker (a) Launch virt-manager, and click Open 11
Figure 13: Launch virt-manager (b) Click Exclamation Symbol Show virtual hardware details 12
Figure 14: Click Exclamation Symbol (c) Click Controller USB on the left list and Model: USB 2 Figure 15: Click Controller USB 13
(d) Click Add Hardware in the left bottom corner of the window. Another window Add New Virtual Hardware will pop out. (e) Click USB Host Device on the left list of the window Figure 16: Click Add Hardware (f) Click Point Grey Research USB 2.0 Digital Imaging Camera (g) Finish 14
Figure 17: Click Point Grey Research USB 2.0 Digital Imaging Camera 5. Unify screen resolution for Ubuntu PC and Virtual Windows PC (a) Click System Settings on the left side launcher menu Figure 18: Click System Settings 15
(b) Click Screen Display (c) Drag Unknown Display to left side of Build-in Display (d) Unselect Mirror display (e) Resolution: 1024 768; Rotation: Normal; Laucher placement: Build-in Display; Sticky edges: OFF (f) Apply Figure 19: System Settings (g) Click the green arrow on the window of virt-manager to start virtual Windows PC 16
Figure 20: Start virtual Windows PC (h) Right click on the desktop of Windows PC and choose Personalize Figure 21: Personalize 17
(i) Click Display in the left bottom corner of the window Figure 22: Display (j) Adjust resolution on the left side list (k) Resolution: 1024 768 (l) OK 18
Figure 23: Adjust resolution (m) Drag the window to the left side CRT screen and click Switch to fullscreen view Figure 24: Fullscreen 6. Install Mirametrix Eye Tracker Official Software on virtual Windows PC (a) Move Mirametrix Eye Tracker Official Software installation file to Windows PC. The Windows PC should be connected to internet automatically, so installation file can be transferred by gmail or dropbox. 19
(b) Double click Mirametrix Eye Tracker Official Software installation file; follow the wizard to complete installation (c) Double click the shortcut of Tracker to launch the eye tracker program. Figure 25: Eye Tracker Program 6 Communication Code Set-up The communication between Ubuntu PC and virtual Windows PC is set up by a python code eyetracking.py, which will be run on Ubuntu system. The python code file is saved in the same folder of this instruction. To make the code working, you should follow steps below. 1. On Windows PC desktop, open start menu and type cmd in the Search programs and files to open Windows terminal. 2. Type ipconfig in the terminal. 20
Figure 26: Windows Terminal 3. The terminal will show the Internet connection information. Find the term IPv4 Address and the number following. Here is 192.168.122.164. 21
Figure 27: IP Information 4. On Ubuntu PC, find the file eyetracking.py and open it. 5. Find a line showing SERVER = and type 192.168.122.164 after the equal sign. (Quotation signs before and after numbers also need to type) 22
Figure 28: IP Editting 7 Eye Tracker Testing Example I design a experiment testing code ETtest.py to give a example of how to use eye tracker for your experiment. This testing experiment will show a dot in the centre of CRT screen for 5 seconds and the show another dot in the other place of CRT screen for 5 seconds. The participant have to alway focus two eyes on the dot. 1. Create a experiment python file experiment.py on the Ubuntu desktop 2. Open communication file eyetracking.py and copy all codes to the file experiment.py. 3. Open file ETtest.py and copy all codes to the file experiment.py following the codes which are from eyetracking.py. 4. Following the codes from ETtest.py in experiment.py, Type start eyetracking(output filename=false) 23
runhsneg( ) stop eyetracking() (runhsneg( ) is the main function of my experiment testing code ETtest.py, is the file name.) Figure 29: Code Editting 5. Before running experiment.py, you should change the output directory according your situation. 24
Figure 30: Output Directory 6. Run the code experiment.py and Complete the experiment. 7. There are two outputs files you need to analyze. One output(.dat) indicates the precise position where the dot showed. Another output( record.csv) are the locations of your eyes recorded by eye tracker. The meaning of terms in record.csv can be found in official instruction Mirametrix API.pdf. 25
Figure 31: Output of.dat Figure 32: Output of record.csv 8. Use statistic software, like R, to analyze data in the record.csv 26
and compare the data in.dat to check if eye tracker is working fine. 27