CLIC Video Lab Automation Project
Sajid H. Sadi
Columbia University
New York, NY 10027
USA
shs54@columbia.edu
Abstract
The goal of the project was to exert a level of control over the
equipment of the CLIC lab video subsystem over HTTP. This has been
accomplished with the creation of a program that operates through the
Common Gateway Interface (CGI) protocol to control the linked video
switches and the VCR/DVD players in the lab. While the actual interconnects
are not yet implemented, the software produced can succcessfully issue
the commands necessary for the proper handling of the aforementioned
hardware.
Introduction
While there has been some research in remote/automatic control of
public lecture spaces, this project differs in that it does not have
as ambitious a goal, focusing instead on simply allowing remote control
of the lab equipment over an easily accisible medium. The core problem
lies in implementing control over the necessary hardware and in the
transfer of this control to CGI, which is essentially a stateless
environment. This is complicated by the fact that the control codes for
each peice of equipment is unique in content and format, requiring
essentially a separate set of functions for each device controlled.
Though present, the problem of stateless programming is comparatively
less of a hurdle, and is circumvented by using files and passed data
to maintain state information to the extent necessary.
Who else has been doing something similar and how your effort is
different.
Background
Before discussing the structure of the program, it is necessary to
discuss the equipment in question. Though there are many other components
in the lab's audio/video system, the parts of concert are:
- one Knox Matrix Video Switcha
- one Extron Matrix Video Switch
- one Panasonic VCR
- one Sony DVD player
- one Slink-e serial-to-infrared interface device
All except for the VCR and the DVD player accept serial input/output
using standard RS-232 connections, and simple ASCII commands that
can control most functions of the devices. The command codes are available
in the manuals provided with the devices as well as at the respective
websites of the manufacturers. The essential connection is as follows:
The two video sources are controlled by controlling the Slink-e device,
which is capable of emulating the infrared signals of the remotes of those
devices in order to control their functions. Only the common basic
functionality is supported in this manner, since the interface is intended
for normal usage and not as a complete replacement for equipment setups.
The control of the two matrix switches is by individual. However, it is clear
that in many cases the two should be controlled directly, and this is
reflected in the program design.
Architecture
In writing the code for his project there was an option of either
writing one module per device or a module for each general function.
While the module division based on devices seems more logical at first
glance, it is programmatically less feasible since related code is spread
through many files. Currently there is one specialized module for
controlling both of the video switches, the module to control
communication with the devices, a module to manage template matching, an
utility module, and the main program module. This organization allows
related functions to be grouped together and greatly simplifies debugging,
since it is much easier to make changes to related code. Furthermore,
this obviates the need for separate modules to tie together devices.
- Communication Module: The communication module controls all
serial communication with the devices. This includes reading data
from the switches, writing data to the switches, controlling port
settings, and controlling the Slink-e. The Slink-e is actually
controlled by calls to a python class that actually carries out the
communications, thus simplifying the code greatly. This method had to
be adopted since very limited information was available on the
programming of the Slink-e.
- Template-Mathc Module: The template matching module, as the
name suggests, provides template matching facilities. This module was
created in order to minimize the number of verbatrim output statements
within the C code, since C is not a language conducive to direct
output of large volumes of text. Tokens can be registered with the
matcher along with functions that are called whenever the token is
encountered to output data to the CGI output stream.
- Video Switch Module: The video switch module is dedicated to
control of the video switches. This module provides the functionality
to read settings from map files, read in input/output labels, and to
parse form data to determine configuration of the switches. This module
DOES NOT do any communications tasks.
- Utility Module: The utility module contains a few miscellaneous
functions to ease certain programming tasks.
- Main module: The main module has two main fucntions. Firstly, it
contains code to prevent two users from simultaneously accessing the
program without being warned. This prevents multiple concurrent uses and
ensures that all parties are aware of the current situation, given that it
is generally undesireable for multiple parties to control the system
simultaneously. Beyond this, the main module also carries out parameter
parsing and execution of the appropriate actions based on unser actions
and input.
All the project code is written in plain ANSI C. However, the Slink-e
control class is written in Python (available online from the
manufacturer's website), and is not directly part of the project. The
templates are all written in normal HTML, though some portions use
Javascript (tested in Netscape 4.7 and Mozilla 0.95).
Program Documentation
System Requirements
- Linux or Solaris Operating system. Others on request.
- Multiport Serial Card
- HTTP server capable of CGI interface (ie, Apache)
- ANSI-complient C compiler (ie, gcc)
Please note: some Sun machines ship without an complete compiler.
These machines may not be able to compile the code. Similarly, the
newest versions of gcc (3.x versions) have several issues, and
is not guarenteed to compile the code correctly.
Installation
- Edxpand the distribution archive:
tar -xzvf clic_control.tar.gz
- Enter the code directory:
cd clic_control/code
- Compile the program:
make
- Change to the file root:
cd ..
- Copy files to web root:
cp -R install/* <web_root_physical>/
The program will now be available under
<http://<web_root_logical>/cgi-bin/clic_control.cgi>.
Configuration
- Please investigate config.h in the code directory for
information on compile-time options.
- cgi-bin\settings\extron_io.txt: Extron (front) switch
input and output labels. See contents for format.
- cgi-bin\settings\knox_io.txt: Knox (back) switch
input and output labels. See contents for format.
- cgi-bin\settings\*.map: Switch settings presets. See
test.map for example.
- cgi-bin\settings\ports.txt: Port assignments for the
communications module. See contents for format.
Program Operation Map
Caveats
- All outside communications are write only, since there were
issues getting the serial connections working
- A connection needs to be established to the front switch using
a shielded cable in order to enable Extron's physical control.
- This program is taylored to the CLIC lab as it is now (Jan 2002),
and is not directly extensible to new equipment (though the
internal capability is there.
- The 8-port serial card is still missing, thus making direct tests
on it impossible. Serial I/O has been tested with FIFO devices.
- Authentication is meant to be implemented using http passwords. It
is the user's responcibility to implement the necessary changes to
protect the exposed systems.
Future Enhancements
- Automated camera control
- Touch panel on podium for controlling system
- Built-in authentication, and SSL/certificate-based security
- Ability to brodcast streaming video from cameras directly
Acknowledgements
- Many thanks to Prof. Henning Schulzrinne and Mr. Xiaotao Wu for their
patience with me.
- This program uses the free CGIC library (www.boutel.com)
- This program uses a user-domain python class for control of
the Slink-e. The copyright belongs to the original author.
Original can be obtained at www.nirvis.com
Last updated: 2002-01-17 by Sajid H. Sadi