### Clone Pupil Repository and Install Dependencies Source: https://github.com/pupil-labs/pupil/blob/master/README.md Clone the Pupil repository, checkout the develop branch, and install required Python packages using pip within a virtual environment. This is the initial setup for running Pupil from source. ```sh git clone https://github.com/pupil-labs/pupil.git cd pupil git checkout develop python -m pip install -r requirements.txt ``` -------------------------------- ### Install PortAudio Library on Linux Source: https://github.com/pupil-labs/pupil/blob/master/README.md Installs the 'libportaudio2' library required by the 'sounddevice' Python package on Debian-based Linux systems. This is necessary for audio playback functionality. ```sh sudo apt install libportaudio2 ``` -------------------------------- ### Run Pupil Service Application Source: https://github.com/pupil-labs/pupil/blob/master/README.md Executes the Pupil Service application by navigating to the 'pupil_src' directory and running the main Python script. This command starts the background service for Pupil. ```sh cd pupil_src python main.py service ``` -------------------------------- ### Run Pupil Capture Application Source: https://github.com/pupil-labs/pupil/blob/master/README.md Executes the Pupil Capture application by navigating to the 'pupil_src' directory and running the main Python script. This command starts the eye tracking data acquisition process. ```sh cd pupil_src python main.py capture ``` -------------------------------- ### Run Pupil Capture with Administrator Privileges on macOS Source: https://github.com/pupil-labs/pupil/blob/master/README.md Starts the Pupil Capture application with administrator privileges on macOS 12 Monterey and newer due to technical limitations with USB camera access. Prepend 'sudo' to the command to grant necessary permissions. ```sh sudo python main.py capture ``` -------------------------------- ### Clone Pupil Wiki Repository Source: https://github.com/pupil-labs/pupil/wiki/Home Use this command to clone the historical wiki repository for the Pupil project. This is useful for historical reference. ```bash git clone https://github.com/pupil-labs/pupil.wiki.git ``` -------------------------------- ### Configure USB Access for Pupil Core on Linux Source: https://github.com/pupil-labs/pupil/blob/master/README.md Grants Pupil Core applications access to cameras on Linux by setting up udev rules and adding the user to the 'plugdev' group. Ensure your user is part of the 'plugdev' group for proper camera access. ```sh echo 'SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="plugdev", MODE="0664"' | sudo tee /etc/udev/rules.d/10-libuvc.rules > /dev/null sudo udevadm trigger sudo usermod -a -G plugdev $USER ``` -------------------------------- ### Run Pupil Player Application Source: https://github.com/pupil-labs/pupil/blob/master/README.md Executes the Pupil Player application by navigating to the 'pupil_src' directory and running the main Python script. This command is used for replaying recorded eye tracking data. ```sh cd pupil_src python main.py player ``` -------------------------------- ### info.player.json Schema Source: https://github.com/pupil-labs/pupil/blob/master/pupil_src/shared_modules/pupil_recording/README.md Defines the structure and data types for the info.player.json file, which contains essential metadata for a Pupil Player recording. Includes required and optional fields. ```json { "meta_version": "2.0", "min_player_version": "1.16", "recording_uuid": string, // follows RFC 4122 "start_time_system_s": float, // double-precision, unit: seconds "start_time_synced_s": float, // double-precision, unit: seconds "duration_s": float, // double-precision, unit: seconds "recording_software_name": string, "recording_software_version": string, // optional "recording_name": string, "system_info": string, } ``` -------------------------------- ### Pupil Player Recording File Hierarchy Source: https://github.com/pupil-labs/pupil/blob/master/pupil_src/shared_modules/pupil_recording/README.md The basic file structure for a Pupil Player recording, highlighting the essential info.player.json file. ```text +- info.player.json (REQUIRED) +- ... ``` -------------------------------- ### Clock Service Announcement Format Source: https://github.com/pupil-labs/pupil/blob/master/pupil_src/shared_modules/time_sync_spec.md A clock service announcement is a two-frame ZRE message. The first frame is the string representation of the service's rank, and the second is the string representation of its network port. ```python rank = 1.234 port = 5678 # Example of how the announcement might be constructed (actual ZRE message format may vary) announcement = [str(rank).encode('utf-8'), str(port).encode('utf-8')] ``` -------------------------------- ### Clock Service TCP Server Source: https://github.com/pupil-labs/pupil/blob/master/pupil_src/shared_modules/time_sync_spec.md The clock service acts as a TCP server. It listens on a specified network port and responds to 'sync' messages by sending its current timestamp. ```python import socket import time port = 5678 # This port should be announced with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind(('0.0.0.0', port)) s.listen() conn, addr = s.accept() with conn: while True: data = conn.recv(1024) if not data or data.decode('utf-8') != 'sync': break timestamp = str(time.time()).encode('utf-8') conn.sendall(timestamp) ``` -------------------------------- ### Clock Service Rank Calculation Source: https://github.com/pupil-labs/pupil/blob/master/pupil_src/shared_modules/time_sync_spec.md The clock service rank is a positive float calculated as a linear combination of base bias, master status, sync status, and a tie-breaker. This formula is used for master selection. ```python base_bias = 1.0 has_been_master = 1.0 # or 0.0 has_been_synced = 1.0 # or 0.0 tie_breaker = 0.5 # random float between 0.0 and 1.0 rank = 4 * base_bias + 2 * has_been_master + has_been_synced + tie_breaker ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.