View | Details | Raw Unified | Return to bug 98058
Collapse All | Expand All

(-)chapter.sgml (-72 / +65 lines)
Lines 1549-1561 Link Here
1549
    <sect2>
1549
    <sect2>
1550
      <title>Introduction</title>
1550
      <title>Introduction</title>
1551
1551
1552
      <para>&os;, like any modern operating system, allows the use of
1552
      <para>In &os;,
1553
	image scanners.  Standardized access to scanners is provided
1553
	access to image scanners is provided
1554
	by the <application>SANE</application> (Scanner Access Now
1554
	by the <application>SANE</application> (Scanner Access Now
1555
	Easy) <acronym role="Application Programming
1555
	Easy) <acronym role="Application Programming
1556
	Interface">API</acronym> available through the &os; Ports
1556
	Interface">API</acronym> available through the &os; Ports
1557
	Collection.  <application>SANE</application> will also use
1557
	Collection.  <application>SANE</application> will also use
1558
	some &os; devices drivers to access to the scanner
1558
	some &os; device drivers to access the scanner
1559
	hardware.</para>
1559
	hardware.</para>
1560
1560
1561
      <para>&os; supports both SCSI and USB scanners.  Be sure your
1561
      <para>&os; supports both SCSI and USB scanners.  Be sure your
Lines 1581-1588 Link Here
1581
1581
1582
	<para>The <filename>GENERIC</filename> kernel by default
1582
	<para>The <filename>GENERIC</filename> kernel by default
1583
	  includes the device drivers needed to support USB scanners.
1583
	  includes the device drivers needed to support USB scanners.
1584
	  Should you decide to use a custom kernel, be sure that the
1584
	  If you use a custom kernel, these
1585
	  following lines are present in your kernel configuration
1585
	  lines should be present in your kernel configuration
1586
	  file:</para>
1586
	  file:</para>
1587
1587
1588
	<programlisting>device usb
1588
	<programlisting>device usb
Lines 1592-1604 Link Here
1592
1592
1593
	<para>Depending upon the USB chipset on your motherboard, you
1593
	<para>Depending upon the USB chipset on your motherboard, you
1594
	  will only need either <literal>device uhci</literal> or
1594
	  will only need either <literal>device uhci</literal> or
1595
	  <literal>device ohci</literal>, however having both in the
1595
	  <literal>device ohci</literal>, but having both in the
1596
	  kernel configuration file is harmless.</para>
1596
	  kernel configuration file is harmless.</para>
1597
1597
1598
	<para>If you do not want to rebuild your kernel and your
1598
	<para>If you do not want to rebuild your custom kernel, you can
1599
	  kernel is not the <filename>GENERIC</filename> one, you can
1600
	  directly load the &man.uscanner.4; device driver module with
1599
	  directly load the &man.uscanner.4; device driver module with
1601
	  the &man.kldload.8; command:</para>
1600
	  &man.kldload.8;:</para>
1602
1601
1603
	<screen>&prompt.root; <userinput>kldload uscanner</userinput></screen>
1602
	<screen>&prompt.root; <userinput>kldload uscanner</userinput></screen>
1604
1603
Lines 1609-1617 Link Here
1609
	<programlisting>uscanner_load="YES"</programlisting>
1608
	<programlisting>uscanner_load="YES"</programlisting>
1610
1609
1611
	<para>After rebooting with the correct kernel, or after
1610
	<para>After rebooting with the correct kernel, or after
1612
	  loading the required module, plug in your USB scanner.  The
1611
	  loading the required module, plug in your USB scanner.  A
1613
	  scanner should appear in your system message buffer
1612
	  line showing the detection of your scanner should appear
1614
	  (&man.dmesg.8;) as something like:</para>
1613
	  in the system message buffer
1614
	  (&man.dmesg.8;):</para>
1615
1615
1616
	<screen>uscanner0: EPSON EPSON Scanner, rev 1.10/3.02, addr 2</screen>
1616
	<screen>uscanner0: EPSON EPSON Scanner, rev 1.10/3.02, addr 2</screen>
1617
1617
Lines 1645-1652 Link Here
1645
	<programlisting>device scbus
1645
	<programlisting>device scbus
1646
device pass</programlisting>
1646
device pass</programlisting>
1647
1647
1648
	<para>Once your kernel has been properly compiled, you should
1648
	<para>After building and installing the custom kernel,
1649
	  be able to see the devices in your system message buffer,
1649
	  the devices should be shown in the system message buffer
1650
	  when booting:</para>
1650
	  when booting:</para>
1651
1651
1652
	<screen>pass2 at aic0 bus 0 target 2 lun 0
1652
	<screen>pass2 at aic0 bus 0 target 2 lun 0
Lines 1672-1678 Link Here
1672
&lt;AGFA SNAPSCAN 600 1.10&gt;           at scbus1 target 2 lun 0 (pass3)
1672
&lt;AGFA SNAPSCAN 600 1.10&gt;           at scbus1 target 2 lun 0 (pass3)
1673
&lt;PHILIPS CDD3610 CD-R/RW 1.00&gt;     at scbus2 target 0 lun 0 (pass2,cd0)</screen>
1673
&lt;PHILIPS CDD3610 CD-R/RW 1.00&gt;     at scbus2 target 0 lun 0 (pass2,cd0)</screen>
1674
1674
1675
	<para>More details about SCSI devices, are available in the
1675
	<para>More details about SCSI devices are available in the
1676
	  &man.scsi.4; and &man.camcontrol.8; manual pages.</para>
1676
	  &man.scsi.4; and &man.camcontrol.8; manual pages.</para>
1677
      </sect3>
1677
      </sect3>
1678
    </sect2>
1678
    </sect2>
Lines 1680-1727 Link Here
1680
    <sect2>
1680
    <sect2>
1681
      <title>SANE Configuration</title>
1681
      <title>SANE Configuration</title>
1682
1682
1683
      <para>The <application>SANE</application> system has been
1683
      <para>The <application>SANE</application> system is
1684
	splitted in two parts: the backends (<filename
1684
	split into two parts: the backends (<filename
1685
	role="package">graphics/sane-backends</filename>) and the
1685
	role="package">graphics/sane-backends</filename>) and the
1686
	frontends (<filename
1686
	frontends (<filename
1687
	role="package">graphics/sane-frontends</filename>).  The
1687
	role="package">graphics/sane-frontends</filename>).  Backends
1688
	backends part provides access to the scanner itself.  The
1688
	control the scanner, while frontends provide a user interface.
1689
	The
1689
	<application>SANE</application>'s <ulink
1690
	<application>SANE</application>'s <ulink
1690
	url="http://sane-project.org/sane-supported-devices.html">supported
1691
	url="http://sane-project.org/sane-supported-devices.html">supported
1691
	devices</ulink> list specifies which backend will support your
1692
	devices</ulink> list specifies which backend will support your
1692
	image scanner.  It is mandatory to determine the correct
1693
	image scanner.</para>
1693
	backend for your scanner if you want to be able to use your
1694
	device.  The frontends part provides the graphical scanning
1695
	interface (<application>xscanimage</application>).</para>
1696
1694
1697
      <para>The first thing to do is install the <filename
1695
      <para>The first step is to install the <filename
1698
	role="package">graphics/sane-backends</filename> port or
1696
	role="package">graphics/sane-backends</filename> port or
1699
	package.  Then, use the <command>sane-find-scanner</command>
1697
	package.  Then use <command>sane-find-scanner</command>
1700
	command to check the scanner detection by the
1698
	to check the scanner detection by the
1701
	<application>SANE</application> system:</para>
1699
	<application>SANE</application> system:</para>
1702
1700
1703
      <screen>&prompt.root; <userinput>sane-find-scanner -q</userinput>
1701
      <screen>&prompt.root; <userinput>sane-find-scanner -q</userinput>
1704
found SCSI scanner "AGFA SNAPSCAN 600 1.10" at /dev/pass3</screen>
1702
found SCSI scanner "AGFA SNAPSCAN 600 1.10" at /dev/pass3</screen>
1705
1703
1706
      <para>The output will show the interface type of the scanner and
1704
      <para>The type of interface and
1707
	the device node used to attach the scanner to the system.  The
1705
	device node where the scanner is attached to the system are shown.  The
1708
	vendor and the product model may not appear, it is not
1706
	scanner vendor and model may not appear.</para>
1709
	important.</para>
1710
1707
1711
      <note>
1708
      <note>
1712
	<para>Some USB scanners require you to load a firmware, this
1709
	<para>Some USB scanners require an upload of firmware, which
1713
	  is explained in the backend manual page.  You should also read
1710
	  is explained in the backend manual page.  You should also read
1714
	  &man.sane-find-scanner.1; and &man.sane.7; manual
1711
	  &man.sane-find-scanner.1; and &man.sane.7; manual
1715
	  pages.</para>
1712
	  pages.</para>
1716
      </note>
1713
      </note>
1717
1714
1718
      <para>Now we have to check if the scanner will be identified by
1715
      <para>Now we have to check if the scanner will be identified by
1719
	a scanning frontend.  By default, the
1716
	a scanning frontend.  Included with the
1720
	<application>SANE</application> backends comes with a command
1717
	<application>SANE</application> backends is
1721
	line tool called &man.scanimage.1;.  This command allows you
1718
	&man.scanimage.1;.  This program allows you
1722
	to list the devices and to perform an image acquisition from
1719
	to list the devices and scan images from
1723
	the command line.  The <option>-L</option> option is used to
1720
	the command line.  The <option>-L</option> option is used to
1724
	list the scanner device:</para>
1721
	list the scanner devices:</para>
1725
1722
1726
      <screen>&prompt.root; <userinput>scanimage -L</userinput>
1723
      <screen>&prompt.root; <userinput>scanimage -L</userinput>
1727
device `snapscan:/dev/pass3' is a AGFA SNAPSCAN 600 flatbed scanner</screen>
1724
device `snapscan:/dev/pass3' is a AGFA SNAPSCAN 600 flatbed scanner</screen>
Lines 1733-1739 Link Here
1733
	used.  The <filename
1730
	used.  The <filename
1734
	class="directory">/usr/local/etc/sane.d/</filename> directory
1731
	class="directory">/usr/local/etc/sane.d/</filename> directory
1735
	contains all backends configuration files.  This
1732
	contains all backends configuration files.  This
1736
	identification problem does appear with certain USB
1733
	identification problem appears with certain USB
1737
	scanners.</para>
1734
	scanners.</para>
1738
1735
1739
      <para>For example, with the USB scanner used in the <xref
1736
      <para>For example, with the USB scanner used in the <xref
Lines 1743-1751 Link Here
1743
1740
1744
      <screen>&prompt.root; <userinput>sane-find-scanner -q</userinput>
1741
      <screen>&prompt.root; <userinput>sane-find-scanner -q</userinput>
1745
found USB scanner (UNKNOWN vendor and product) at device /dev/uscanner0</screen>
1742
found USB scanner (UNKNOWN vendor and product) at device /dev/uscanner0</screen>
1746
      <para>The scanner is correctly detected, it uses the USB
1743
      <para>The scanner is detected, it uses the USB
1747
	interface and is attached to the
1744
	interface and is attached to
1748
	<filename>/dev/uscanner0</filename> device node.  We can now
1745
	<filename>/dev/uscanner0</filename>.  We can now
1749
	check if the scanner is correctly identified:</para>
1746
	check if the scanner is correctly identified:</para>
1750
1747
1751
      <screen>&prompt.root; <userinput>scanimage -L</userinput>
1748
      <screen>&prompt.root; <userinput>scanimage -L</userinput>
Lines 1756-1796 Link Here
1756
which came with this software (README, FAQ, manpages).</screen>
1753
which came with this software (README, FAQ, manpages).</screen>
1757
1754
1758
      <para>Since the scanner is not identified, we will need to edit
1755
      <para>Since the scanner is not identified, we will need to edit
1759
	the <filename>/usr/local/etc/sane.d/epson.conf</filename>
1756
	<filename>/usr/local/etc/sane.d/epson.conf</filename>.
1760
	file.  The scanner model used was the &epson.perfection; 1650,
1757
	The scanner used in this example was an &epson.perfection; 1650,
1761
	so we know the scanner will use the <literal>epson</literal>
1758
	so we know it will use the <literal>epson</literal>
1762
	backend.  Be sure to read the help comments in the backends
1759
	backend.  Before making changes, read the comments in the backends
1763
	configuration files.  Line changes are quite simple: comment
1760
	configuration files and manual pages.  Comment
1764
	out all lines that have the wrong interface for your scanner
1761
	out all lines that have the wrong interface for your scanner
1765
	(in our case, we will comment out all lines starting with the
1762
	(for this USB scanner, we will comment out all lines starting with the
1766
	word <literal>scsi</literal> as our scanner uses the USB
1763
	word <literal>scsi</literal>),
1767
	interface), then add at the end of the file a line specifying
1764
	Then, at the end of the file, add a line specifying
1768
	the interface and the device node used.  In this case, we add
1765
	the interface and the device node used.  In this case, we add:</para>
1769
	the following line:</para>
1770
1766
1771
      <programlisting>usb /dev/uscanner0</programlisting>
1767
      <programlisting>usb /dev/uscanner0</programlisting>
1772
1768
1773
      <para>Please be sure to read the comments provided in the
1769
      <para>We can now verify if the scanner is identified:</para>
1774
	backend configuration file as well as the backend manual page
1775
	for more details and correct syntax to use.  We can now verify
1776
	if the scanner is identified:</para>
1777
1770
1778
      <screen>&prompt.root; <userinput>scanimage -L</userinput>
1771
      <screen>&prompt.root; <userinput>scanimage -L</userinput>
1779
device `epson:/dev/uscanner0' is a Epson GT-8200 flatbed scanner</screen>
1772
device `epson:/dev/uscanner0' is a Epson GT-8200 flatbed scanner</screen>
1780
1773
1781
      <para>Our USB scanner has been identified.  It is not important
1774
      <para>Our USB scanner has been identified.  It is not important
1782
	if the brand and the model do not match.  The key item to be
1775
	if the brand and the model do not match the scanner.  The key item
1783
	concerned with is the
1776
	is the
1784
	<literal>`epson:/dev/uscanner0'</literal> field, which give us
1777
	<literal>`epson:/dev/uscanner0'</literal> field, which shows
1785
	the right backend name and the right device node.</para>
1778
	the right backend name and the right device node.</para>
1786
1779
1787
      <para>Once the <command>scanimage -L</command> command is able
1780
      <para>Once the <command>scanimage -L</command> command is able
1788
	to see the scanner, the configuration is complete.  The device
1781
	to detect the scanner, configuration is complete.  The device
1789
	is now ready to scan.</para>
1782
	is now ready to scan.</para>
1790
1783
1791
      <para>While &man.scanimage.1; does allow us to perform an
1784
      <para>While &man.scanimage.1; does allow us to perform an
1792
	image acquisition from the command line, it is preferable to
1785
	image acquisition from the command line, 
1793
	use a graphical user interface to perform image scanning.
1786
	graphical user interfaces are usually preferable for image scanning.
1794
	<application>SANE</application> offers a simple but efficient
1787
	<application>SANE</application> offers a simple but efficient
1795
	graphical interface: <application>xscanimage</application>
1788
	graphical interface: <application>xscanimage</application>
1796
	(<filename
1789
	(<filename
Lines 1798-1816 Link Here
1798
1791
1799
      <para><application>Xsane</application> (<filename
1792
      <para><application>Xsane</application> (<filename
1800
	role="package">graphics/xsane</filename>) is another popular
1793
	role="package">graphics/xsane</filename>) is another popular
1801
	graphical scanning frontend.  This frontend offers advanced
1794
	graphical scanning frontend which offers 
1802
	features such as various scanning mode (photocopy, fax, etc.),
1795
	various scanning modes (photocopy, fax) and other advanced features.
1803
	color correction, batch scans, etc.  Both of these applications
1796
	Both of these applications
1804
	are useable as a <application>GIMP</application>
1797
	are useable as <application>GIMP</application>
1805
	plugin.</para>
1798
	plugins.</para>
1806
    </sect2>
1799
    </sect2>
1807
1800
1808
    <sect2>
1801
    <sect2>
1809
      <title>Allowing Scanner Access to Other Users</title>
1802
      <title>Giving Other Users Access To The Scanner</title>
1810
1803
1811
      <para>All previous operations have been done with
1804
      <para>All previous operations have been done with
1812
	<username>root</username> privileges.  You may however, need
1805
	<username>root</username> privileges.  However, you may wish to give
1813
	other users to have access
1806
	ordinary users access
1814
	to the scanner.  The user will need read and write
1807
	to the scanner.  The user will need read and write
1815
	permissions to the device node used by the scanner.  As an
1808
	permissions to the device node used by the scanner.  As an
1816
	example, our USB scanner uses the device node
1809
	example, our USB scanner uses the device node
Lines 1826-1838 Link Here
1826
	also have to set the correct write permissions (0660 or 0664)
1819
	also have to set the correct write permissions (0660 or 0664)
1827
	on the <filename>/dev/uscanner0</filename> device node, by
1820
	on the <filename>/dev/uscanner0</filename> device node, by
1828
	default the <groupname>operator</groupname> group can only
1821
	default the <groupname>operator</groupname> group can only
1829
	read the device node.  This is done by adding the following
1822
	read the device node.  This is done by adding these
1830
	lines to the <filename>/etc/devfs.rules</filename> file:</para>
1823
	lines to <filename>/etc/devfs.rules</filename>:</para>
1831
1824
1832
      <programlisting>[system=5]
1825
      <programlisting>[system=5]
1833
add path uscanner0 mode 660</programlisting>
1826
add path uscanner0 mode 660</programlisting>
1834
1827
1835
      <para>Then add the following to
1828
      <para>Then add this line to
1836
	<filename>/etc/rc.conf</filename> and reboot the
1829
	<filename>/etc/rc.conf</filename> and reboot the
1837
	machine:</para>
1830
	machine:</para>
1838
1831
Lines 1845-1851 Link Here
1845
	<filename>/dev/uscanner0</filename>.</para>
1838
	<filename>/dev/uscanner0</filename>.</para>
1846
1839
1847
      <note>
1840
      <note>
1848
	<para>Of course, for security reasons, you should think twice
1841
	<para>For security reasons, you should think twice
1849
	  before adding a user to any group, especially the
1842
	  before adding a user to any group, especially the
1850
	  <groupname>operator</groupname> group.</para>
1843
	  <groupname>operator</groupname> group.</para>
1851
      </note>
1844
      </note>

Return to bug 98058