<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
 Copyright (C) 2002-2003 Hubert Figuiere (hfiguiere@teaser.fr)
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
 02111-1307, USA.

 Revision: $Id: digicam-xslt.xml,v 1.22 2005/07/31 16:13:51 hub Exp $
-->

  <xsl:output method="html" encoding="iso-8859-1"
    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
    media-type="text/html"/>
  <xsl:template match="camera_support_list">
    <html>
      <head>
	<title>Digital Camera Support for UN*X</title>
	<META NAME="keywords" CONTENT="usb, digital camera, digicam,
	  linux, gphoto, bsd, unix" />
      </head>
      <body bgcolor="#FFFFFF">
	<h1>Digital Camera Support for UNIX, Linux and BSD</h1>
	<address>by Hubert Figuière 
	&lt;<a href="mailto:hfiguiere@teaser.fr">hfiguiere@teaser.fr</a>&gt;
	</address>
	<hr />
<script type="text/javascript">&lt;!--
google_ad_client = "pub-3132655432304224";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "B4D0DC";
google_color_bg = "ECF8FF";
google_color_link = "0000CC";
google_color_url = "008000";
google_color_text = "6F6F6F";
//--&gt;
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>	
	<hr />
	<p>
	Digital camera support on UNIX system is not a simple matter. 
	Most if not all of the manufacturers don't give any attention to 
	non-Windows (and MacOS) systems. Most of them don't even provide
	the needed documentation to write proper support for their camera. And
	with the increasing number of models, it begins to be a real tower
	of babel. Luckily, these days, there seems to be two trends 
	with major camera vendors when it comes to communication protocols:
	PTP and USB Mass Storage. However, many cheap (think less than 1MPix
	and less than 150 USD or 150 EUR) cameras still don't follow that
	trend and are likely to use another protocol. I'll try to explain 
	how to find out if your camera may work or not under a UNIX system.
	Don't worry, I won't forget serial cameras.
	</p>
	<h2>USB Cameras</h2>
	<p>
	Nowadays USB cameras are the most common. Since every USB device
	is identified by vendor and product ID combination, it can be detected
	easily on the bus. Usually one can safely assume that devices with 
	similar USB IDs are identical, from the USB protocol point of view,
	but we'll see later that there are notable exceptions.
	</p>
	<p>
	For the protocol, there are 2 USB standardized protocols that 
	digital camera uses: USB Mass Storage and PTP (aka Still Image Device).
	If a camera doesn't use one of these two protocols, it surely uses a
	proprietary protocol, and this is were things get uneasy: most 
	manufacturers don't disclose these protocols for various reasons. So
	reverse engineering has to be performed.
	</p>
	<h3>USB Mass Storage</h3>
	<p>
	USB Mass Storage is the protocol used by hard drives and removable disks
	devices over USB. This is basically SCSI over USB. Linux 2.4.x and the 
	*BSD systems handle it by default in their USB stack. All you need is
	to mount the correct device to the mount point of your choice. For 
	Linux, please read the 
	<a href="http://www.linux-usb.org/USB-guide/x498.html">fine manual</a>.
	</p>
	<p>
	If you wish to use this kind of camera with Digikam from KDE, read the
	<a href="http://digikam.sourceforge.net/docs.html#q3">Digikam Documentation</a>.
	</p>
	<p>
	In 2001, Olympus, Nikon, Minolta, Sony, Casio and many others started to 
	use that protocol for their cameras. This greatly simplified the 
	use of these
	cameras with various operating system. Free OS users
	got one of the biggest benefits: the camera works as is, out of the box.
	One of the drawbacks is that given that USB Mass Storage protocol is
	for disk device, you can't manipulate settings and camera options,
	nor remote control it. We'll see later that there are some 
	cameras that offer some alternative solutions.
	</p>
	<p>
	For Casio cameras, please read the note about 
	<a href="#casio-specifics">Casio specifics</a>.
	</p>
	<h3>PTP</h3>
	<p>
	PTP, Picture Transfer Protocol, is a standardized protocol mainly
	developed by Kodak whose goal is to provide a standard way to access
	digital camera. This protocol has been adopted by the USB consortium to
	handle Still Image Device class (6). A complete specification of the
	protocol has been published. See the sourceforge 
	<a href="http://ptp.sourceforge.net/">project</a>.
	</p>
	<p>
	By 2001, Sony appeared to be the second vendor after Kodak to implement
	PTP on its digital cameras, offering it in conjunction with USB Mass 
	Storage. By the end of 2002, Nikon seemed to have made the switch too,
	by offering several firmware upgrades to offer PTP support in addition
	to USB Mass Storage. Canon did the same, and that is great news as
	Canon was one of the last major vendors to not use USB Mass Storage, and
	the company had a heavy past of being really unfriendly with gphoto2 
	developers and the whole "non-Windows" developer community (yes, that
	also included Mac developers).
	</p>
	<p>
	By the end of 2003, Olympus seemed to provide PTP mode for their cameras
	labeling it "Print" unlike Mass Storage labeling it "PC". I suspect this
	is related to direct camera to printer connections. Sometime it is also 
	called "PictBridge".
	</p>
	<h4>Canon extensions</h4>
	<p>
	Canon has developed some extensions to support capture. This is crazy, 
	but there is nothing that can be done but supporting this. See <a 
	href="http://jalkapallo.org/superkolik/canon.html">http://jalkapallo.org/superkolik/canon.html</a>
	for software supporting them.
	</p>
	<h3>Other protocols</h3>
	<h4>Canon</h4>
	<p>
	Canon was probably the last major vendor who stuck to a proprietary
	protocol. This is also the company that gave most of the headaches to 
	developers of packages like 
	<a href="http://www.gphoto.org/">gphoto2</a>. They went recently to an 
	almost complete switch to PTP so that now Canon cameras are more standardized
	when it comes to USB connectivity, but older models still use that 
	protocol. Some models seems even to support both, 
	transparently.
	</p>
	<p>
	Stephen H Westin, the current maintainer of the gphoto2 Canon driver has published
	a <a href="http://www.graphics.cornell.edu/~westin/canon/">comprehensive protocol documentation</a>
	based on all the reverse engineering work done everyone.
	</p>
	<h4>STV0680</h4>
	<p>todo</p>

	<h4>Sierra</h4>
	<p>This is the protocol used by all the camera systems OEMed from
	Sierra Imaging. Various vendors did use it by the end of 2000. It is
	not being abandoned in favor of USB Mass Storage or PTP.</p>
	<p>Olympus cameras have some <a href="#olym-specifics">specifics</a>
	that still allow to use the Sierra protocol to perform operations not possible 
	with USB Mass Storage.</p>

	<h4>Others</h4>
	<p>todo</p>

	<h3>Camera specific by manufacturers</h3>
	<p>Some manufacturers have their own specifics that make their 
	product harder to use and harder to support. I'll describe these.</p>
	
	<h4><a name="casio-specifics">Casio</a></h4>
	<p>Old serial port based Casio cameras (QV-10, QV-100, etc.) use their
	own protocol. <a href="http://www.asahi-net.or.jp/~XG2K-HYS/index-e.html">QVplay</a> 
	does implement almost everything. As of today, <a href="http://www.gphoto.org/">gphoto2</a> 
	drivers are still broken because developers don't have a camera to test with.</p>
	<p>Casio recent cameras all use USB Mass Storage device. Unfortunately, their
	implementation is substandard. Thankfully, for Linux users, there is a 
	<a href="http://www.harald-schreiber.de/">document</a> (not endorsed by Casio)
	that describes problems and solutions.</p>

	<h4><a name="nikon-specifics">Nikon</a></h4>
	<p>Switching a Nikon camera to PTP mode if available (this
	depends on both the firmware version and the camera):
	Go into camera's setup interface and specify the interface 
	as "PTP". Default is "Mass Storage".</p>

	<h4><a name="olym-specifics">Olympus</a></h4>
	<p>Since 2001, all the USB cameras made by Olympus interface with PC using the
	USB Mass Storage standard protocol. However some might want to control them
	to perform remote capture. </p>
	<p>While some model have a "PC Control" mode in the menus
	that allow
	that, disabling Mass Storage in favor of the <i>Sierra</i> protocol, some don't
	have this feature. For example Olympus C-750 require some trick to switch to
	"PC Control" mode. This is achieved by opening the card slot while holding down
	OK and View buttons. You might want to give it a try.</p>
	<p>Some models are even able to support both protocols on the same USB interface
	without any switching required. This requires disabling USB Mass Storage for the
	device on the OS before trying to use control software (like gphoto2).</p>
	<p>
	Starting at the end of 2003, Olympus started providing a "Print" mode for USB 
	connectivity that switches the camera into PTP mode. This to supplement USB Mass
	Storage.
	</p>

	<h2>Proprietary image formats</h2>
	<p>
	Some camera allow storing pictures in a RAW file format that is proprietary. Some 
	don't even give the choice. If for any reason you need or want to read these files
	without using the proprietary software that runs only on Windows and eventually on 
	Mac OS, there is a solution: <a href="http://www.cybercom.net/~dcoffin/dcraw/">Dave 
	Coffin RAW Digital Photo Decoder</a>. It supports lot of models, including Canon,
	Nikon and Kodak. Of course, your mileage may vary.
	</p>

	<h2>Various links</h2>
	<ul>
	<li><a href="http://www.geocities.com/piccolbo/dplinux.html">Digital 
	Photography and Linux</a> list comprehensive resource for using Digital
	Cameras with Linux</li>
	</ul>
	<h2>Special Thanks to</h2>
	<ul>
	<li>all the people that reported info</li>
	<li>patrick for English spelling and grammar</li>
	</ul>
	<hr/>
	<p>This table summarize for digital cameras, how they are supported
	under UNIX operating systems:</p>
	<table border="1" cellspacing="1" cellpadding="3">
	  <tr><th bgcolor="#C0C0C0">Model</th><th
	      bgcolor="#C0C0C0">USB IDs</th><th
	      bgcolor="#C0C0C0">Media</th><th
	      bgcolor="#C0C0C0">Drivers</th><th bgcolor="#C0C0C0">Comments</th></tr>
	  <xsl:apply-templates select="camera">
	    <xsl:sort select="name" data-type="text" order="ascending"
	      case-order="upper-first" />
	  </xsl:apply-templates>
	</table>
	<hr/>
	<p>Version:<xsl:value-of select="version" /></p>
	<p>Template version: $Id: digicam-xslt.xml,v 1.22 2005/07/31 16:13:51 hub Exp $</p>
	<address>Generated from xml data with XSLT. DTD and XSLT
	  template by <a href="mailto:hfiguiere@teaser.fr">hfiguiere@teaser.fr</a></address>
	<p>
	  Fetching the source: [ <a href="digicam-xslt.xml">XSLT</a>
	  | <a href="digicam.dtd">DTD</a> | <a href="digicam.xml">XML
	    data</a> ]</p>
	<hr/>
	<p>
	  <a href="http://validator.w3.org/check/referer"><img border="0"
	      src="http://www.w3.org/Icons/valid-html401"
	      alt="Valid HTML 4.01!" height="31" width="88"/></a>
	</p>
      </body>
    </html>
  </xsl:template>

  <xsl:template match="camera">
    <tr>
      <td>
	<xsl:value-of select="name"/>
      </td>
      <td>
	<xsl:apply-templates select="usb_ids"/>
      </td>
      <td>
	<xsl:value-of select="media_type"/>
      </td>
      <td>
	<xsl:apply-templates select="support"/>
      </td>
      <td>
	<xsl:apply-templates select="comments"/>
      </td>
    </tr>
  </xsl:template>
  
  <xsl:template match="usb_ids">
    <xsl:choose>
      <xsl:when test=". = 'no'">
	N/A
      </xsl:when>
      <xsl:otherwise>
	<xsl:value-of select="usb_vend_id"/>/<xsl:value-of select="usb_prod_id"/> 
		<xsl:apply-templates select="protocol"/>
		<br />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
  <xsl:template match="protocol">
		(<xsl:value-of select="."/>)
  </xsl:template>

  <xsl:template match="support">
    <xsl:apply-templates select="@name"/><xsl:if test="@component != ''">/<xsl:value-of select="@component"/> 
    </xsl:if>
    <xsl:if test="@version != ''">
    	(<xsl:apply-templates select="@version"/>)
    </xsl:if>
    <xsl:if test="@port != ''">
      (<xsl:apply-templates select="@port"/>)
    </xsl:if>
    <xsl:if test="@status != ''">
    	<b>[<xsl:apply-templates select="@status"/>]</b>
    </xsl:if>
    <br />
  </xsl:template>
  
  <xsl:template match="comments">
    <xsl:apply-templates />
  </xsl:template>

  <xsl:template match="a">
  	<a href="{@href}"><xsl:value-of select="."/></a>
  </xsl:template>

</xsl:stylesheet>


