aboutsummaryrefslogtreecommitdiff
path: root/en_US.ISO8859-1/books/handbook/multimedia/chapter.xml
diff options
context:
space:
mode:
authorSergio Carlavilla Delgado <carlavilla@FreeBSD.org>2021-01-25 23:31:29 +0000
committerSergio Carlavilla Delgado <carlavilla@FreeBSD.org>2021-01-25 23:31:29 +0000
commit989d921f5d4ac8d8b7c831c13b8954ad1901be24 (patch)
treea5d768f9af4b55422fdf5b17064879ae1c7ce032 /en_US.ISO8859-1/books/handbook/multimedia/chapter.xml
parent0cff342f42461c5081b98bce7581f43df319e4f4 (diff)
downloaddoc-989d921f5d4ac8d8b7c831c13b8954ad1901be24.tar.gz
doc-989d921f5d4ac8d8b7c831c13b8954ad1901be24.zip
Migrate doc to Hugo/AsciiDoctor
I'm very pleased to announce the release of our new website and documentation using the new toolchain with Hugo and AsciiDoctor. To get more information about the new toolchain please read the FreeBSD Documentation Project Primer[1], Hugo docs[2] and AsciiDoctor docs[3]. Acknowledgment: Benedict Reuschling <bcr@> Glen Barber <gjb@> Hiroki Sato <hrs@> Li-Wen Hsu <lwhsu@> Sean Chittenden <seanc@> The FreeBSD Foundation [1] https://docs.FreeBSD.org/en/books/fdp-primer/ [2] https://gohugo.io/documentation/ [3] https://docs.asciidoctor.org/home/ Approved by: doceng, core
Diffstat (limited to 'en_US.ISO8859-1/books/handbook/multimedia/chapter.xml')
-rw-r--r--en_US.ISO8859-1/books/handbook/multimedia/chapter.xml1696
1 files changed, 0 insertions, 1696 deletions
diff --git a/en_US.ISO8859-1/books/handbook/multimedia/chapter.xml b/en_US.ISO8859-1/books/handbook/multimedia/chapter.xml
deleted file mode 100644
index e1ae696ce9..0000000000
--- a/en_US.ISO8859-1/books/handbook/multimedia/chapter.xml
+++ /dev/null
@@ -1,1696 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
- The FreeBSD Documentation Project
-
- $FreeBSD$
--->
-<chapter xmlns="http://docbook.org/ns/docbook"
- xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
- xml:id="multimedia">
-
- <info>
- <title>Multimedia</title>
-
- <authorgroup>
- <author>
- <personname>
- <firstname>Ross</firstname>
- <surname>Lippert</surname>
- </personname>
- <contrib>Edited by </contrib>
- </author>
- </authorgroup>
- </info>
-
- <sect1 xml:id="multimedia-synopsis">
- <title>Synopsis</title>
-
- <para>&os; supports a wide variety of sound cards, allowing users
- to enjoy high fidelity output from a &os; system. This includes
- the ability to record and play back audio in the MPEG Audio Layer
- 3 (<acronym>MP3</acronym>), Waveform Audio File
- (<acronym>WAV</acronym>), Ogg Vorbis, and other formats. The
- &os; Ports Collection contains many applications for editing
- recorded audio, adding sound effects, and controlling attached
- MIDI devices.</para>
-
- <para>&os; also supports the playback of video files and
- <acronym>DVD</acronym>s. The &os; Ports Collection contains
- applications to encode, convert, and playback various video
- media.</para>
-
- <para>This chapter describes how to configure sound cards, video
- playback, TV tuner cards, and scanners on &os;. It also
- describes some of the applications which are available for
- using these devices.</para>
-
- <para>After reading this chapter, you will know how to:</para>
-
- <itemizedlist>
- <listitem>
- <para>Configure a sound card on &os;.</para>
- </listitem>
-
- <listitem>
- <para>Troubleshoot the sound setup.</para>
- </listitem>
-
- <listitem>
- <para>Playback and encode MP3s and other audio.</para>
- </listitem>
-
- <listitem>
- <para>Prepare a &os; system for video playback.</para>
- </listitem>
-
- <listitem>
- <para>Play <acronym>DVD</acronym>s, <filename>.mpg</filename>,
- and <filename>.avi</filename> files.</para>
- </listitem>
-
- <listitem>
- <para>Rip <acronym>CD</acronym> and <acronym>DVD</acronym>
- content into files.</para>
- </listitem>
-
- <listitem>
- <para>Configure a TV card.</para>
- </listitem>
-
- <listitem>
- <para>Install and setup MythTV on &os;</para>
- </listitem>
-
- <listitem>
- <para>Configure an image scanner.</para>
- </listitem>
-
- <listitem>
- <para>Configure a Bluetooth headset.</para>
- </listitem>
- </itemizedlist>
-
- <para>Before reading this chapter, you should:</para>
-
- <itemizedlist>
- <listitem><para>Know how to install applications as described in
- <xref linkend="ports"/>.</para></listitem>
- </itemizedlist>
- </sect1>
-
- <sect1 xml:id="sound-setup">
- <info>
- <title>Setting Up the Sound Card</title>
-
- <authorgroup>
- <author>
- <personname>
- <firstname>Moses</firstname>
- <surname>Moore</surname>
- </personname>
- <contrib>Contributed by </contrib> <!-- in November 2000-->
- </author>
- </authorgroup>
-
- <authorgroup>
- <author>
- <personname>
- <firstname>Marc</firstname>
- <surname>Fonvieille</surname>
- </personname>
- <contrib>Enhanced by </contrib> <!--in September 2004-->
- </author>
- </authorgroup>
- </info>
-
- <indexterm><primary>PCI</primary></indexterm>
- <indexterm><primary>sound cards</primary></indexterm>
- <para>Before beginning the configuration, determine the model of
- the sound card and the chip it uses. &os; supports a wide
- variety of sound cards. Check the supported audio devices
- list of the <link xlink:href="&rel.current.hardware;">Hardware
- Notes</link> to see if the card is supported and which &os;
- driver it uses.</para>
-
- <indexterm>
- <primary>kernel</primary>
- <secondary>configuration</secondary>
- </indexterm>
-
- <para>In order to use the sound device, its device driver must be
- loaded. The easiest way is to load a kernel module for the
- sound card with &man.kldload.8;. This example loads the driver
- for a built-in audio chipset based on the Intel
- specification:</para>
-
- <screen>&prompt.root; <userinput>kldload snd_hda</userinput></screen>
-
- <para>To automate the loading of this driver at boot time, add the
- driver to <filename>/boot/loader.conf</filename>. The line for
- this driver is:</para>
-
- <programlisting>snd_hda_load="YES"</programlisting>
-
- <para>Other available sound modules are listed in
- <filename>/boot/defaults/loader.conf</filename>. When unsure
- which driver to use, load the <filename>snd_driver</filename>
- module:</para>
-
- <screen>&prompt.root; <userinput>kldload snd_driver</userinput></screen>
-
- <para>This is a metadriver which loads all of the most common
- sound drivers and can be used to speed up the search for the
- correct driver. It is also possible to load all sound drivers
- by adding the metadriver to
- <filename>/boot/loader.conf</filename>.</para>
-
- <para>To determine which driver was selected for the sound card
- after loading the <filename>snd_driver</filename> metadriver,
- type <command>cat /dev/sndstat</command>.</para>
-
- <sect2>
- <title>Configuring a Custom Kernel with Sound Support</title>
-
- <para>This section is for users who prefer to statically compile
- in support for the sound card in a custom kernel. For more
- information about recompiling a kernel, refer to <xref
- linkend="kernelconfig"/>.</para>
-
- <para>When using a custom kernel to provide sound support, make
- sure that the audio framework driver exists in the custom
- kernel configuration file:</para>
-
- <programlisting>device sound</programlisting>
-
- <para>Next, add support for the sound card. To continue the
- example of the built-in audio chipset based on the Intel
- specification from the previous section, use the following
- line in the custom kernel configuration file:</para>
-
- <programlisting>device snd_hda</programlisting>
-
- <para>Be sure to read the manual page of the driver for the
- device name to use for the driver.</para>
-
- <para>Non-PnP ISA sound cards may require the IRQ and I/O port
- settings of the card to be added to
- <filename>/boot/device.hints</filename>. During the boot
- process, &man.loader.8; reads this file and passes the
- settings to the kernel. For example, an old Creative
- &soundblaster; 16 ISA non-PnP card will use the
- &man.snd.sbc.4; driver in conjunction with
- <literal>snd_sb16</literal>. For this card, the following
- lines must be added to the kernel configuration file:</para>
-
- <programlisting>device snd_sbc
-device snd_sb16</programlisting>
-
- <para>If the card uses the <literal>0x220</literal> I/O port and
- IRQ <literal>5</literal>, these lines must also be added to
- <filename>/boot/device.hints</filename>:</para>
-
- <programlisting>hint.sbc.0.at="isa"
-hint.sbc.0.port="0x220"
-hint.sbc.0.irq="5"
-hint.sbc.0.drq="1"
-hint.sbc.0.flags="0x15"</programlisting>
-
- <para>The syntax used in <filename>/boot/device.hints</filename>
- is described in &man.sound.4; and the manual page for the
- driver of the sound card.</para>
-
- <para>The settings shown above are the defaults. In some
- cases, the IRQ or other settings may need to be changed to
- match the card. Refer to &man.snd.sbc.4; for more information
- about this card.</para>
- </sect2>
-
- <sect2 xml:id="sound-testing">
- <title>Testing Sound</title>
-
- <para>After loading the required module or rebooting into the
- custom kernel, the sound card should be detected. To confirm,
- run <command>dmesg | grep pcm</command>. This example is
- from a system with a built-in Conexant CX20590 chipset:</para>
-
- <screen>pcm0: &lt;NVIDIA (0x001c) (HDMI/DP 8ch)&gt; at nid 5 on hdaa0
-pcm1: &lt;NVIDIA (0x001c) (HDMI/DP 8ch)&gt; at nid 6 on hdaa0
-pcm2: &lt;Conexant CX20590 (Analog 2.0+HP/2.0)&gt; at nid 31,25 and 35,27 on hdaa1</screen>
-
- <para>The status of the sound card may also be checked using
- this command:</para>
-
- <screen>&prompt.root; <userinput>cat /dev/sndstat</userinput>
-FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
-Installed devices:
-pcm0: &lt;NVIDIA (0x001c) (HDMI/DP 8ch)&gt; (play)
-pcm1: &lt;NVIDIA (0x001c) (HDMI/DP 8ch)&gt; (play)
-pcm2: &lt;Conexant CX20590 (Analog 2.0+HP/2.0)&gt; (play/rec) default</screen>
-
- <para>The output will vary depending upon the sound card. If no
- <filename>pcm</filename> devices are listed, double-check
- that the correct device driver was loaded or compiled into the
- kernel. The next section lists some common problems and their
- solutions.</para>
-
- <para>If all goes well, the sound card should now work in &os;.
- If the <acronym>CD</acronym> or <acronym>DVD</acronym> drive
- is properly connected to the sound card, one can insert an
- audio <acronym>CD</acronym> in the drive and play it with
- &man.cdcontrol.1;:</para>
-
- <screen>&prompt.user; <userinput>cdcontrol -f /dev/acd0 play 1</userinput></screen>
-
- <warning>
- <para>Audio <acronym>CD</acronym>s have specialized encodings
- which means that they should not be mounted using
- &man.mount.8;.</para>
- </warning>
-
- <para>Various applications, such as
- <package>audio/workman</package>, provide a friendlier
- interface. The <package>audio/mpg123</package> port can be
- installed to listen to MP3 audio files.</para>
-
- <para>Another quick way to test the card is to send data to
- <filename>/dev/dsp</filename>:</para>
-
- <screen>&prompt.user; <userinput>cat <replaceable>filename</replaceable> &gt; /dev/dsp</userinput></screen>
-
- <para>where
- <filename><replaceable>filename</replaceable></filename> can
- be any type of file. This command should produce some noise,
- confirming that the sound card is working.</para>
-
- <note>
- <para>The <filename>/dev/dsp*</filename> device nodes will
- be created automatically as needed. When not in use, they
- do not exist and will not appear in the output of
- &man.ls.1;.</para>
- </note>
- </sect2>
-
- <sect2 xml:id="bluetooth-headset">
- <title>Setting up Bluetooth Sound Devices</title>
-
- <indexterm>
- <primary>Bluetooth audio</primary>
- </indexterm>
-
- <para>Connecting to a Bluetooth device is out of scope for this
- chapter. Refer to <xref
- linkend="network-bluetooth"/> for more information.</para>
-
- <para>To get Bluetooth sound sink working with FreeBSD's sound
- system, users have to install
- <package>audio/virtual_oss</package> first:</para>
-
- <screen>&prompt.root; <userinput>pkg install virtual_oss</userinput></screen>
-
- <para><package>audio/virtual_oss</package> requires
- <literal>cuse</literal> to be loaded into the kernel:</para>
-
- <screen>&prompt.root; <userinput>kldload cuse</userinput></screen>
-
- <para>To load <literal>cuse</literal> during system startup, run
- this command:</para>
-
- <screen>&prompt.root; <userinput>sysrc -f /boot/loader.conf cuse_load=yes</userinput></screen>
-
- <para>To use headphones as a sound sink with
- <package>audio/virtual_oss</package>, users need to create a
- virtual device after connecting to a Bluetooth audio
- device:</para>
-
- <screen>&prompt.root; <userinput>virtual_oss -C 2 -c 2 -r 48000 -b 16 -s 768 -R /dev/null -P /dev/bluetooth/<replaceable>headphones</replaceable> -d dsp</userinput></screen>
-
- <note>
- <para><replaceable>headphones</replaceable> in this example is
- a hostname from <filename>/etc/bluetooth/hosts</filename>.
- <literal>BT_ADDR</literal> could be used instead.</para>
- </note>
-
- <para>Refer to &man.virtual_oss.8; for more information.</para>
- </sect2>
-
- <sect2 xml:id="troubleshooting">
- <title>Troubleshooting Sound</title>
-
- <indexterm><primary>device nodes</primary></indexterm>
- <indexterm><primary>I/O port</primary></indexterm>
- <indexterm><primary>IRQ</primary></indexterm>
- <indexterm><primary>DSP</primary></indexterm>
-
- <para><xref linkend="multimedia-sound-common-error-messages"/>
- lists some common error messages and their solutions:</para>
-
- <table xml:id="multimedia-sound-common-error-messages"
- frame="none" pgwide="1">
- <title>Common Error Messages</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Error</entry>
- <entry>Solution</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry><errorname>sb_dspwr(XX) timed
- out</errorname></entry>
- <entry><para>The I/O port is not set
- correctly.</para></entry>
- </row>
-
- <row>
- <entry><errorname>bad irq XX</errorname></entry>
- <entry><para>The IRQ is set incorrectly. Make sure
- that the set IRQ and the sound IRQ are the
- same.</para></entry>
- </row>
-
- <row>
- <entry><errorname>xxx: gus pcm not attached, out of
- memory</errorname></entry>
- <entry><para>There is not enough available memory to
- use the device.</para></entry>
- </row>
-
- <row>
- <entry><errorname>xxx: can't open
- /dev/dsp!</errorname></entry>
- <entry><para>Type <command>fstat | grep
- dsp</command> to check if another application is
- holding the device open. Noteworthy troublemakers are
- <application>esound</application> and
- <application>KDE</application>'s sound
- support.</para></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <para>Modern graphics cards often come with their own sound
- driver for use with <acronym>HDMI</acronym>. This sound
- device is sometimes enumerated before the sound card meaning
- that the sound card will not be used as the default playback
- device. To check if this is the case, run
- <application>dmesg</application> and look for
- <literal>pcm</literal>. The output looks something like
- this:</para>
-
- <programlisting>...
-hdac0: HDA Driver Revision: 20100226_0142
-hdac1: HDA Driver Revision: 20100226_0142
-hdac0: HDA Codec #0: NVidia (Unknown)
-hdac0: HDA Codec #1: NVidia (Unknown)
-hdac0: HDA Codec #2: NVidia (Unknown)
-hdac0: HDA Codec #3: NVidia (Unknown)
-pcm0: &lt;HDA NVidia (Unknown) PCM #0 DisplayPort&gt; at cad 0 nid 1 on hdac0
-pcm1: &lt;HDA NVidia (Unknown) PCM #0 DisplayPort&gt; at cad 1 nid 1 on hdac0
-pcm2: &lt;HDA NVidia (Unknown) PCM #0 DisplayPort&gt; at cad 2 nid 1 on hdac0
-pcm3: &lt;HDA NVidia (Unknown) PCM #0 DisplayPort&gt; at cad 3 nid 1 on hdac0
-hdac1: HDA Codec #2: Realtek ALC889
-pcm4: &lt;HDA Realtek ALC889 PCM #0 Analog&gt; at cad 2 nid 1 on hdac1
-pcm5: &lt;HDA Realtek ALC889 PCM #1 Analog&gt; at cad 2 nid 1 on hdac1
-pcm6: &lt;HDA Realtek ALC889 PCM #2 Digital&gt; at cad 2 nid 1 on hdac1
-pcm7: &lt;HDA Realtek ALC889 PCM #3 Digital&gt; at cad 2 nid 1 on hdac1
-...</programlisting>
-
- <para>In this example, the graphics card
- (<literal>NVidia</literal>) has been enumerated before the
- sound card (<literal>Realtek ALC889</literal>). To use the
- sound card as the default playback device, change
- <varname>hw.snd.default_unit</varname> to the unit that should
- be used for playback:</para>
-
- <screen>&prompt.root; <userinput>sysctl hw.snd.default_unit=<replaceable>n</replaceable></userinput></screen>
-
- <para>where <literal>n</literal> is the number of the sound
- device to use. In this example, it should be
- <literal>4</literal>. Make this change permanent by adding
- the following line to
- <filename>/etc/sysctl.conf</filename>:</para>
-
- <programlisting>hw.snd.default_unit=<replaceable>4</replaceable></programlisting>
- </sect2>
-
- <sect2 xml:id="sound-multiple-sources">
- <info>
- <title>Utilizing Multiple Sound Sources</title>
-
- <authorgroup>
- <author>
- <personname>
- <firstname>Munish</firstname>
- <surname>Chopra</surname>
- </personname>
- <contrib>Contributed by </contrib>
- </author>
- </authorgroup>
- </info>
-
- <para>It is often desirable to have multiple sources of sound
- that are able to play simultaneously. &os; uses
- <quote>Virtual Sound Channels</quote> to multiplex the sound
- card's playback by mixing sound in the kernel.</para>
-
- <para>Three &man.sysctl.8; knobs are available for configuring
- virtual channels:</para>
-
- <screen>&prompt.root; <userinput>sysctl dev.pcm.0.play.vchans=4</userinput>
-&prompt.root; <userinput>sysctl dev.pcm.0.rec.vchans=4</userinput>
-&prompt.root; <userinput>sysctl hw.snd.maxautovchans=4</userinput></screen>
-
- <para>This example allocates four virtual channels, which is a
- practical number for everyday use. Both
- <varname>dev.pcm.0.play.vchans=4</varname> and
- <varname>dev.pcm.0.rec.vchans=4</varname> are configurable
- after a device has been attached and represent the number of
- virtual channels <filename>pcm0</filename> has for playback
- and recording. Since the <filename>pcm</filename> module can
- be loaded independently of the hardware drivers,
- <varname>hw.snd.maxautovchans</varname> indicates how many
- virtual channels will be given to an audio device when it is
- attached. Refer to &man.pcm.4; for more information.</para>
-
- <note>
- <para>The number of virtual channels for a device cannot be
- changed while it is in use. First, close any programs using
- the device, such as music players or sound daemons.</para>
- </note>
-
- <para>The correct <filename>pcm</filename> device will
- automatically be allocated transparently to a program that
- requests <filename>/dev/dsp0</filename>.</para>
- </sect2>
-
- <sect2>
- <info>
- <title>Setting Default Values for Mixer Channels</title>
-
- <authorgroup>
- <author>
- <personname>
- <firstname>Josef</firstname>
- <surname>El-Rayes</surname>
- </personname>
- <contrib>Contributed by </contrib>
- </author>
- </authorgroup>
- </info>
-
- <para>The default values for the different mixer channels are
- hardcoded in the source code of the &man.pcm.4; driver. While
- sound card mixer levels can be changed using &man.mixer.8; or
- third-party applications and daemons, this is not a permanent
- solution. To instead set default mixer values at the driver
- level, define the appropriate values in
- <filename>/boot/device.hints</filename>, as seen in this
- example:</para>
-
- <programlisting>hint.pcm.0.vol="50"</programlisting>
-
- <para>This will set the volume channel to a default value of
- <literal>50</literal> when the &man.pcm.4; module is
- loaded.</para>
- </sect2>
- </sect1>
-
- <sect1 xml:id="sound-mp3">
- <info>
- <title>MP3 Audio</title>
-
- <authorgroup>
- <author>
- <personname>
- <firstname>Chern</firstname>
- <surname>Lee</surname>
- </personname>
- <contrib>Contributed by </contrib> <!--in Sept 2001-->
- </author>
- </authorgroup>
- </info>
-
- <para>This section describes some <acronym>MP3</acronym>
- players available for &os;, how to rip audio
- <acronym>CD</acronym> tracks, and how to encode and decode
- <acronym>MP3</acronym>s.</para>
-
- <sect2 xml:id="mp3-players">
- <title>MP3 Players</title>
-
- <para>A popular graphical <acronym>MP3</acronym> player is
- <application>Audacious</application>. It supports
- <application>Winamp</application> skins and additional
- plugins. The interface is intuitive, with a playlist, graphic
- equalizer, and more. Those familiar with
- <application>Winamp</application> will find
- <application>Audacious</application> simple to use. On &os;,
- <application>Audacious</application> can be installed from the
- <package>multimedia/audacious</package> port or package.
- Audacious is a descendant of XMMS.</para>
-
- <para>The <package>audio/mpg123</package> package or port
- provides an alternative, command-line <acronym>MP3</acronym>
- player. Once installed, specify the <acronym>MP3</acronym>
- file to play on the command line. If the system has multiple
- audio devices, the sound device can also be specified:</para>
-
- <screen>&prompt.root; <userinput>mpg123 <replaceable>-a /dev/dsp1.0 Foobar-GreatestHits.mp3</replaceable></userinput>
-High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
- version 1.18.1; written and copyright by Michael Hipp and others
- free software (LGPL) without any warranty but with best wishes
-
-Playing MPEG stream from Foobar-GreatestHits.mp3 ...
-MPEG 1.0 layer III, 128 kbit/s, 44100 Hz joint-stereo</screen>
-
- <para>Additional <acronym>MP3</acronym> players are available in
- the &os; Ports Collection.</para>
- </sect2>
-
- <sect2 xml:id="rip-cd">
- <title>Ripping <acronym>CD</acronym> Audio Tracks</title>
-
- <para>Before encoding a <acronym>CD</acronym> or
- <acronym>CD</acronym> track to <acronym>MP3</acronym>, the
- audio data on the <acronym>CD</acronym> must be ripped to the
- hard drive. This is done by copying the raw
- <acronym>CD</acronym> Digital Audio (<acronym>CDDA</acronym>)
- data to <acronym>WAV</acronym> files.</para>
-
- <para>The <command>cdda2wav</command> tool, which is installed
- with the <package>sysutils/cdrtools</package> suite, can be
- used to rip audio information from
- <acronym>CD</acronym>s.</para>
-
- <para>With the audio <acronym>CD</acronym> in the drive, the
- following command can be issued as
- <systemitem class="username">root</systemitem> to rip an
- entire <acronym>CD</acronym> into individual, per track,
- <acronym>WAV</acronym> files:</para>
-
- <screen>&prompt.root; <userinput>cdda2wav -D <replaceable>0,1,0</replaceable> -B</userinput></screen>
-
- <para>In this example, the
- <option>-D <replaceable>0,1,0</replaceable></option> indicates
- the <acronym>SCSI</acronym> device <filename>0,1,0</filename>
- containing the <acronym>CD</acronym> to rip. Use
- <command>cdrecord -scanbus</command> to determine the correct
- device parameters for the system.</para>
-
- <para>To rip individual tracks, use <option>-t</option> to
- specify the track:</para>
-
- <screen>&prompt.root; <userinput>cdda2wav -D <replaceable>0,1,0</replaceable> -t 7</userinput></screen>
-
- <para>To rip a range of tracks, such as track one to seven,
- specify a range:</para>
-
- <screen>&prompt.root; <userinput>cdda2wav -D <replaceable>0,1,0</replaceable> -t 1+7</userinput></screen>
-
- <para>To rip from an <acronym>ATAPI</acronym>
- (<acronym>IDE</acronym>) <acronym>CDROM</acronym> drive,
- specify the device name in place of the
- <acronym>SCSI</acronym> unit numbers. For example, to rip
- track 7 from an IDE drive:</para>
-
- <screen>&prompt.root; <userinput>cdda2wav -D <replaceable>/dev/acd0 -t 7</replaceable></userinput></screen>
-
- <para>Alternately, <command>dd</command> can be used to extract
- audio tracks on <acronym>ATAPI</acronym> drives, as described
- in <xref linkend="duplicating-audiocds"/>.</para>
- </sect2>
-
- <sect2 xml:id="mp3-encoding">
- <title>Encoding and Decoding MP3s</title>
-
- <para><application>Lame</application> is a popular
- <acronym>MP3</acronym> encoder which can be installed from the
- <package>audio/lame</package> port. Due to patent issues, a
- package is not available.</para>
-
- <para>The following command will convert the ripped
- <acronym>WAV</acronym> file
- <filename><replaceable>audio01.wav</replaceable></filename> to
- <filename><replaceable>audio01.mp3</replaceable></filename>:</para>
-
- <screen>&prompt.root; <userinput>lame -h -b <replaceable>128</replaceable> --tt "<replaceable>Foo Song Title</replaceable>" --ta "<replaceable>FooBar Artist</replaceable>" --tl "<replaceable>FooBar Album</replaceable>" \
---ty "<replaceable>2014</replaceable>" --tc "<replaceable>Ripped and encoded by Foo</replaceable>" --tg "<replaceable>Genre</replaceable>" <replaceable>audio01.wav audio01.mp3</replaceable></userinput></screen>
-
- <para>The specified 128&nbsp;kbits is a standard
- <acronym>MP3</acronym> bitrate while the 160 and 192 bitrates
- provide higher quality. The higher the bitrate, the larger
- the size of the resulting <acronym>MP3</acronym>. The
- <option>-h</option> turns on the
- <quote>higher quality but a little slower</quote>
- mode. The options beginning with <option>--t</option>
- indicate <acronym>ID3</acronym> tags, which usually contain
- song information, to be embedded within the
- <acronym>MP3</acronym> file. Additional encoding options can
- be found in the <application>lame</application> manual
- page.</para>
-
- <para>In order to burn an audio <acronym>CD</acronym> from
- <acronym>MP3</acronym>s, they must first be converted to a
- non-compressed file format. <application>XMMS</application>
- can be used to convert to the <acronym>WAV</acronym> format,
- while <application>mpg123</application> can be used to convert
- to the raw Pulse-Code Modulation (<acronym>PCM</acronym>)
- audio data format.</para>
-
- <para>To convert <filename>audio01.mp3</filename> using
- <application>mpg123</application>, specify the name of the
- <acronym>PCM</acronym> file:</para>
-
- <screen>&prompt.root; <userinput>mpg123 -s <replaceable>audio01.mp3</replaceable> &gt; <replaceable>audio01.pcm</replaceable></userinput></screen>
-
- <para>To use <application>XMMS</application> to convert a
- <acronym>MP3</acronym> to <acronym>WAV</acronym> format, use
- these steps:</para>
-
- <procedure>
- <title>Converting to <acronym>WAV</acronym> Format in
- <application>XMMS</application></title>
-
- <step>
- <para>Launch <application>XMMS</application>.</para>
- </step>
-
- <step>
- <para>Right-click the window to bring up the
- <application>XMMS</application> menu.</para>
- </step>
-
- <step>
- <para>Select <literal>Preferences</literal> under
- <literal>Options</literal>.</para>
- </step>
-
- <step>
- <para>Change the Output Plugin to <quote>Disk Writer
- Plugin</quote>.</para>
- </step>
-
- <step>
- <para>Press <literal>Configure</literal>.</para>
- </step>
-
- <step>
- <para>Enter or browse to a directory to write the
- uncompressed files to.</para>
- </step>
-
- <step>
- <para>Load the <acronym>MP3</acronym> file into
- <application>XMMS</application> as usual, with volume at
- 100% and EQ settings turned off.</para>
- </step>
-
- <step>
- <para>Press <literal>Play</literal>. The
- <application>XMMS</application> will appear as if it is
- playing the <acronym>MP3</acronym>, but no music will be
- heard. It is actually playing the <acronym>MP3</acronym>
- to a file.</para>
- </step>
-
- <step>
- <para>When finished, be sure to set the default Output
- Plugin back to what it was before in order to listen to
- <acronym>MP3</acronym>s again.</para>
- </step>
- </procedure>
-
- <para>Both the <acronym>WAV</acronym> and <acronym>PCM</acronym>
- formats can be used with <application>cdrecord</application>.
- When using <acronym>WAV</acronym> files, there will be a small
- tick sound at the beginning of each track. This sound is the
- header of the <acronym>WAV</acronym> file. The
- <package>audio/sox</package> port or package can be used to
- remove the header:</para>
-
- <screen>&prompt.user; <userinput>sox -t wav -r 44100 -s -w -c 2 <replaceable>track.wav track.raw</replaceable></userinput></screen>
-
- <para>Refer to <xref linkend="creating-cds"/> for more
- information on using a <acronym>CD</acronym> burner in
- &os;.</para>
- </sect2>
- </sect1>
-
- <sect1 xml:id="video-playback">
- <info>
- <title>Video Playback</title>
-
- <authorgroup>
- <author>
- <personname>
- <firstname>Ross</firstname>
- <surname>Lippert</surname>
- </personname>
- <contrib>Contributed by </contrib> <!--in June 2002-->
- </author>
- </authorgroup>
- </info>
-
- <para>Before configuring video playback, determine the model and
- chipset of the video card. While
- <application>&xorg;</application> supports a wide variety of
- video cards, not all provide good playback performance. To
- obtain a list of extensions supported by the
- <application>&xorg;</application> server using the card, run
- <command>xdpyinfo</command> while
- <application>&xorg;</application> is running.</para>
-
- <para>It is a good idea to have a short MPEG test file for
- evaluating various players and options. Since some
- <acronym>DVD</acronym> applications look for
- <acronym>DVD</acronym> media in <filename>/dev/dvd</filename> by
- default, or have this device name hardcoded in them, it might be
- useful to make a symbolic link to the proper device:</para>
-
- <screen>&prompt.root; <userinput>ln -sf /dev/cd0 /dev/dvd</userinput></screen>
-
- <para>Due to the nature of &man.devfs.5;, manually created links
- will not persist after a system reboot. In order to recreate
- the symbolic link automatically when the system boots, add the
- following line to <filename>/etc/devfs.conf</filename>:</para>
-
- <programlisting>link cd0 dvd</programlisting>
-
- <para><acronym>DVD</acronym> decryption invokes certain functions
- that require write permission to the <acronym>DVD</acronym>
- device.</para>
-
- <para>To enhance the shared memory
- <application>&xorg;</application> interface, it is recommended
- to increase the values of these &man.sysctl.8;
- variables:</para>
-
- <programlisting>kern.ipc.shmmax=67108864
-kern.ipc.shmall=32768</programlisting>
-
- <sect2 xml:id="video-interface">
- <title>Determining Video Capabilities</title>
-
- <indexterm><primary>XVideo</primary></indexterm>
- <indexterm><primary>SDL</primary></indexterm>
- <indexterm><primary>DGA</primary></indexterm>
-
- <para>There are several possible ways to display video under
- <application>&xorg;</application> and what works is largely
- hardware dependent. Each method described below will have
- varying quality across different hardware.</para>
-
- <para>Common video interfaces include:</para>
-
- <orderedlist>
- <listitem>
- <para><application>&xorg;</application>: normal output using
- shared memory.</para>
- </listitem>
-
- <listitem>
- <para>XVideo: an extension to the
- <application>&xorg;</application> interface which
- allows video to be directly displayed in drawable objects
- through a special acceleration. This extension provides
- good quality playback even on low-end machines. The next
- section describes how to determine if this extension is
- running.</para>
- </listitem>
-
- <listitem>
- <para><acronym>SDL</acronym>: the Simple Directmedia Layer
- is a porting layer for many operating systems, allowing
- cross-platform applications to be developed which make
- efficient use of sound and graphics.
- <acronym>SDL</acronym> provides a low-level abstraction to
- the hardware which can sometimes be more efficient than
- the <application>&xorg;</application> interface. On &os;,
- <acronym>SDL</acronym> can be installed using the
- <package>devel/sdl20</package> package or port.</para>
- </listitem>
-
- <listitem>
- <para><acronym>DGA</acronym>: the Direct Graphics Access is
- an <application>&xorg;</application> extension which
- allows a program to bypass the
- <application>&xorg;</application> server and directly
- alter the framebuffer. As it relies on a low-level
- memory mapping, programs using it must be run as
- <systemitem class="username">root</systemitem>. The
- <acronym>DGA</acronym> extension can be tested and
- benchmarked using &man.dga.1;. When
- <command>dga</command> is running, it changes the colors
- of the display whenever a key is pressed. To quit, press
- <keycap>q</keycap>.</para>
- </listitem>
-
- <listitem>
- <para>SVGAlib: a low level console graphics layer.</para>
- </listitem>
- </orderedlist>
-
- <sect3 xml:id="video-interface-xvideo">
- <title>XVideo</title>
-
- <para>To check whether this extension is running, use
- <command>xvinfo</command>:</para>
-
- <screen>&prompt.user; <userinput>xvinfo</userinput></screen>
-
- <para>XVideo is supported for the card if the result is
- similar to:</para>
-
- <screen>X-Video Extension version 2.2
- screen #0
- Adaptor #0: "Savage Streams Engine"
- number of ports: 1
- port base: 43
- operations supported: PutImage
- supported visuals:
- depth 16, visualID 0x22
- depth 16, visualID 0x23
- number of attributes: 5
- "XV_COLORKEY" (range 0 to 16777215)
- client settable attribute
- client gettable attribute (current value is 2110)
- "XV_BRIGHTNESS" (range -128 to 127)
- client settable attribute
- client gettable attribute (current value is 0)
- "XV_CONTRAST" (range 0 to 255)
- client settable attribute
- client gettable attribute (current value is 128)
- "XV_SATURATION" (range 0 to 255)
- client settable attribute
- client gettable attribute (current value is 128)
- "XV_HUE" (range -180 to 180)
- client settable attribute
- client gettable attribute (current value is 0)
- maximum XvImage size: 1024 x 1024
- Number of image formats: 7
- id: 0x32595559 (YUY2)
- guid: 59555932-0000-0010-8000-00aa00389b71
- bits per pixel: 16
- number of planes: 1
- type: YUV (packed)
- id: 0x32315659 (YV12)
- guid: 59563132-0000-0010-8000-00aa00389b71
- bits per pixel: 12
- number of planes: 3
- type: YUV (planar)
- id: 0x30323449 (I420)
- guid: 49343230-0000-0010-8000-00aa00389b71
- bits per pixel: 12
- number of planes: 3
- type: YUV (planar)
- id: 0x36315652 (RV16)
- guid: 52563135-0000-0000-0000-000000000000
- bits per pixel: 16
- number of planes: 1
- type: RGB (packed)
- depth: 0
- red, green, blue masks: 0x1f, 0x3e0, 0x7c00
- id: 0x35315652 (RV15)
- guid: 52563136-0000-0000-0000-000000000000
- bits per pixel: 16
- number of planes: 1
- type: RGB (packed)
- depth: 0
- red, green, blue masks: 0x1f, 0x7e0, 0xf800
- id: 0x31313259 (Y211)
- guid: 59323131-0000-0010-8000-00aa00389b71
- bits per pixel: 6
- number of planes: 3
- type: YUV (packed)
- id: 0x0
- guid: 00000000-0000-0000-0000-000000000000
- bits per pixel: 0
- number of planes: 0
- type: RGB (packed)
- depth: 1
- red, green, blue masks: 0x0, 0x0, 0x0</screen>
-
- <para>The formats listed, such as YUV2 and YUV12, are not
- present with every implementation of XVideo and their
- absence may hinder some players.</para>
-
- <para>If the result instead looks like:</para>
-
- <screen>X-Video Extension version 2.2
-screen #0
-no adaptors present</screen>
-
- <para>XVideo is probably not supported for the card. This
- means that it will be more difficult for the display to meet
- the computational demands of rendering video, depending on
- the video card and processor.</para>
- </sect3>
- </sect2>
-
- <sect2 xml:id="video-ports">
- <title>Ports and Packages Dealing with Video</title>
-
- <indexterm><primary>video ports</primary></indexterm>
- <indexterm><primary>video packages</primary></indexterm>
-
- <para>This section introduces some of the software available
- from the &os; Ports Collection which can be used for video
- playback.</para>
-
- <sect3 xml:id="video-mplayer">
- <title><application>MPlayer</application> and
- <application>MEncoder</application></title>
-
- <para><application>MPlayer</application> is a command-line
- video player with an optional graphical interface which aims
- to provide speed and flexibility. Other graphical
- front-ends to <application>MPlayer</application> are
- available from the &os; Ports Collection.</para>
-
- <indexterm><primary>MPlayer</primary></indexterm>
-
- <para><application>MPlayer</application> can be installed
- using the <package>multimedia/mplayer</package> package or
- port. Several compile options are available and a variety
- of hardware checks occur during the build process. For
- these reasons, some users prefer to build the port rather
- than install the package.</para>
-
- <para>When compiling the port, the menu options should be
- reviewed to determine the type of support to compile into
- the port. If an option is not selected,
- <application>MPlayer</application> will not be able to
- display that type of video format. Use the arrow keys and
- spacebar to select the required formats. When finished,
- press <keycap>Enter</keycap> to continue the port compile
- and installation.</para>
-
- <para>By default, the package or port will build the
- <command>mplayer</command> command line utility and the
- <command>gmplayer</command> graphical utility. To encode
- videos, compile the <package>multimedia/mencoder</package>
- port. Due to licensing restrictions, a package is not
- available for <application>MEncoder</application>.</para>
-
- <para>The first time <application>MPlayer</application> is
- run, it will create <filename>~/.mplayer</filename> in the
- user's home directory. This subdirectory contains default
- versions of the user-specific configuration files.</para>
-
- <para>This section describes only a few common uses. Refer to
- mplayer(1) for a complete description of its numerous
- options.</para>
-
- <para>To play the file
- <filename><replaceable>testfile.avi</replaceable></filename>,
- specify the video interfaces with <option>-vo</option>, as
- seen in the following examples:</para>
-
- <screen>&prompt.user; <userinput>mplayer -vo xv <replaceable>testfile.avi</replaceable></userinput></screen>
-
- <screen>&prompt.user; <userinput>mplayer -vo sdl <replaceable>testfile.avi</replaceable></userinput></screen>
-
- <screen>&prompt.user; <userinput>mplayer -vo x11 <replaceable>testfile.avi</replaceable></userinput></screen>
-
- <screen>&prompt.root; <userinput>mplayer -vo dga <replaceable>testfile.avi</replaceable></userinput></screen>
-
- <screen>&prompt.root; <userinput>mplayer -vo 'sdl:dga' <replaceable>testfile.avi</replaceable></userinput></screen>
-
- <para>It is worth trying all of these options, as their
- relative performance depends on many factors and will vary
- significantly with hardware.</para>
-
- <para>To play a <acronym>DVD</acronym>, replace
- <filename><replaceable>testfile.avi</replaceable></filename>
- with <option>dvd://<replaceable>N</replaceable> -dvd-device
- <replaceable>DEVICE</replaceable></option>, where
- <replaceable>N</replaceable> is the title number to play and
- <replaceable>DEVICE</replaceable> is the device node for the
- <acronym>DVD</acronym>. For example, to play title 3 from
- <filename>/dev/dvd</filename>:</para>
-
- <screen>&prompt.root; <userinput>mplayer -vo xv dvd://3 -dvd-device /dev/dvd</userinput></screen>
-
- <note>
- <para>The default <acronym>DVD</acronym> device can be
- defined during the build of the
- <application>MPlayer</application> port by including the
- <varname>WITH_DVD_DEVICE=/path/to/desired/device</varname>
- option. By default, the device is
- <filename>/dev/cd0</filename>. More details can be found
- in the port's
- <filename>Makefile.options</filename>.</para>
- </note>
-
- <para>To stop, pause, advance, and so on, use a keybinding.
- To see the list of keybindings, run <command>mplayer
- -h</command> or read mplayer(1).</para>
-
- <para>Additional playback options include <option>-fs
- -zoom</option>, which engages fullscreen mode, and
- <option>-framedrop</option>, which helps performance.</para>
-
- <para>Each user can add commonly used options to their
- <filename>~/.mplayer/config</filename> like so:</para>
-
- <programlisting>vo=xv
-fs=yes
-zoom=yes</programlisting>
-
- <para><command>mplayer</command> can be used to rip a
- <acronym>DVD</acronym> title to a <filename>.vob</filename>.
- To dump the second title from a
- <acronym>DVD</acronym>:</para>
-
- <screen>&prompt.root; <userinput>mplayer -dumpstream -dumpfile out.vob dvd://2 -dvd-device /dev/dvd</userinput></screen>
-
- <para>The output file, <filename>out.vob</filename>, will be
- in <acronym>MPEG</acronym> format.</para>
-
- <para>Anyone wishing to obtain a high level of expertise with
- &unix; video should consult <link
- xlink:href="http://www.mplayerhq.hu/DOCS/">mplayerhq.hu/DOCS</link>
- as it is technically informative. This documentation should
- be considered as required reading before submitting any bug
- reports.</para>
-
- <indexterm>
- <primary>mencoder</primary>
- </indexterm>
-
- <para>Before using <command>mencoder</command>, it is a good
- idea to become familiar with the options described at <link
- xlink:href="http://www.mplayerhq.hu/DOCS/HTML/en/mencoder.html">mplayerhq.hu/DOCS/HTML/en/mencoder.html</link>.
- There are innumerable ways to improve quality, lower
- bitrate, and change formats, and some of these options may
- make the difference between good or bad performance.
- Improper combinations of command line options can yield
- output files that are unplayable even by
- <command>mplayer</command>.</para>
-
- <para>Here is an example of a simple copy:</para>
-
- <screen>&prompt.user; <userinput>mencoder <replaceable>input.avi</replaceable> -oac copy -ovc copy -o <replaceable>output.avi</replaceable></userinput></screen>
-
- <para>To rip to a file, use <option>-dumpfile</option> with
- <command>mplayer</command>.</para>
-
- <para>To convert
- <filename><replaceable>input.avi</replaceable></filename> to
- the MPEG4 codec with MPEG3 audio encoding, first install the
- <package>audio/lame</package> port. Due to licensing
- restrictions, a package is not available. Once installed,
- type:</para>
-
- <screen>&prompt.user; <userinput>mencoder <replaceable>input.avi</replaceable> -oac mp3lame -lameopts br=192 \
- -ovc lavc -lavcopts vcodec=mpeg4:vhq -o <replaceable>output.avi</replaceable></userinput></screen>
-
- <para>This will produce output playable by applications such
- as <command>mplayer</command> and
- <command>xine</command>.</para>
-
- <para><filename><replaceable>input.avi</replaceable></filename>
- can be replaced with <option>dvd://1 -dvd-device
- /dev/dvd</option> and run as <systemitem
- class="username">root</systemitem> to re-encode a
- <acronym>DVD</acronym> title directly. Since it may take a
- few tries to get the desired result, it is recommended to
- instead dump the title to a file and to work on the
- file.</para>
- </sect3>
-
- <sect3 xml:id="video-xine">
- <title>The <application>xine</application> Video
- Player</title>
-
- <para><application>xine</application> is a video player with a
- reusable base library and a modular executable which can be
- extended with plugins. It can be installed using the
- <package>multimedia/xine</package> package or port.</para>
-
- <para>In practice, <application>xine</application> requires
- either a fast CPU with a fast video card, or support for the
- XVideo extension. The <application>xine</application> video
- player performs best on XVideo interfaces.</para>
-
- <para>By default, the <application>xine</application> player
- starts a graphical user interface. The menus can then be
- used to open a specific file.</para>
-
- <para>Alternatively, <application>xine</application> may be
- invoked from the command line by specifying the name of the
- file to play:</para>
-
- <screen>&prompt.user; <userinput>xine -g -p <replaceable>mymovie.avi</replaceable></userinput></screen>
-
- <para>Refer to <link
- xlink:href="http://www.xine-project.org/faq">
- xine-project.org/faq</link> for more information and
- troubleshooting tips.</para>
- </sect3>
-
- <sect3 xml:id="video-ports-transcode">
- <title>The <application>Transcode</application>
- Utilities</title>
-
- <para><application>Transcode</application> provides a suite of
- tools for re-encoding video and audio files.
- <application>Transcode</application> can be used to merge
- video files or repair broken files using command line tools
- with stdin/stdout stream interfaces.</para>
-
- <para>In &os;, <application>Transcode</application> can be
- installed using the <package>multimedia/transcode</package>
- package or port. Many users prefer to compile the port as
- it provides a menu of compile options for specifying the
- support and codecs to compile in. If an option is not
- selected, <application>Transcode</application> will not be
- able to encode that format. Use the arrow keys and spacebar
- to select the required formats. When finished, press
- <keycap>Enter</keycap> to continue the port compile and
- installation.</para>
-
- <para>This example demonstrates how to convert a DivX file
- into a PAL MPEG-1 file (PAL VCD):</para>
-
- <screen>&prompt.user; <userinput>transcode -i <replaceable>input.avi</replaceable> -V --export_prof vcd-pal -o output_vcd</userinput>
-&prompt.user; <userinput>mplex -f 1 -o <replaceable>output_vcd.mpg output_vcd.m1v output_vcd.mpa</replaceable></userinput></screen>
-
- <para>The resulting <acronym>MPEG</acronym> file,
- <filename><replaceable>output_vcd.mpg</replaceable></filename>,
- is ready to be played with
- <application>MPlayer</application>. The file can be burned
- on a <acronym>CD</acronym> media to create a video
- <acronym>CD</acronym> using a utility such as
- <package>multimedia/vcdimager</package> or
- <package>sysutils/cdrdao</package>.</para>
-
- <para>In addition to the manual page for
- <command>transcode</command>, refer to <link
- xlink:href="http://www.transcoding.org/cgi-bin/transcode">transcoding.org/cgi-bin/transcode</link>
- for further information and examples.</para>
- </sect3>
- </sect2>
- </sect1>
-
- <sect1 xml:id="tvcard">
- <info>
- <title>TV Cards</title>
-
- <authorgroup>
- <author>
- <personname>
- <firstname>Josef</firstname>
- <surname>El-Rayes</surname>
- </personname>
- <contrib>Original contribution by </contrib>
- </author>
- </authorgroup>
-
- <authorgroup>
- <author>
- <personname>
- <firstname>Marc</firstname>
- <surname>Fonvieille</surname>
- </personname>
- <contrib>Enhanced and adapted by </contrib> <!-- in January 2004-->
- </author>
- </authorgroup>
- </info>
-
- <indexterm>
- <primary>TV cards</primary>
- </indexterm>
-
- <para>TV cards can be used to watch broadcast or cable TV on a
- computer. Most cards accept composite video via an
- <acronym>RCA</acronym> or S-video input and some cards include a
- <acronym>FM</acronym> radio tuner.</para>
-
- <para>&os; provides support for PCI-based TV cards using a
- Brooktree Bt848/849/878/879 video capture chip with the
- &man.bktr.4; driver. This driver supports most Pinnacle PCTV
- video cards. Before purchasing a TV card, consult &man.bktr.4;
- for a list of supported tuners.</para>
-
- <sect2>
- <title>Loading the Driver</title>
-
- <para>In order to use the card, the &man.bktr.4; driver must be
- loaded. To automate this at boot time, add the following line
- to <filename>/boot/loader.conf</filename>:</para>
-
- <programlisting>bktr_load="YES"</programlisting>
-
- <para>Alternatively, one can statically compile support for
- the TV card into a custom kernel. In that case, add the
- following lines to the custom kernel configuration
- file:</para>
-
- <programlisting>device bktr
-device iicbus
-device iicbb
-device smbus</programlisting>
-
- <para>These additional devices are necessary as the card
- components are interconnected via an I2C bus. Then, build and
- install a new kernel.</para>
-
- <para>To test that the tuner is correctly detected, reboot the
- system. The TV card should appear in the boot messages, as
- seen in this example:</para>
-
- <programlisting>bktr0: &lt;BrookTree 848A&gt; mem 0xd7000000-0xd7000fff irq 10 at device 10.0 on pci0
-iicbb0: &lt;I2C bit-banging driver&gt; on bti2c0
-iicbus0: &lt;Philips I2C bus&gt; on iicbb0 master-only
-iicbus1: &lt;Philips I2C bus&gt; on iicbb0 master-only
-smbus0: &lt;System Management Bus&gt; on bti2c0
-bktr0: Pinnacle/Miro TV, Philips SECAM tuner.</programlisting>
-
- <para>The messages will differ according to the hardware. If
- necessary, it is possible to override some of the detected
- parameters using &man.sysctl.8; or custom kernel configuration
- options. For example, to force the tuner to a Philips SECAM
- tuner, add the following line to a custom kernel configuration
- file:</para>
-
- <programlisting>options OVERRIDE_TUNER=6</programlisting>
-
- <para>or, use &man.sysctl.8;:</para>
-
- <screen>&prompt.root; <userinput>sysctl hw.bt848.tuner=6</userinput></screen>
-
- <para>Refer to &man.bktr.4; for a description of the available
- &man.sysctl.8; parameters and kernel options.</para>
- </sect2>
-
- <sect2>
- <title>Useful Applications</title>
-
- <para>To use the TV card, install one of the following
- applications:</para>
-
- <itemizedlist>
- <listitem>
- <para><package>multimedia/fxtv</package>
- provides TV-in-a-window and image/audio/video capture
- capabilities.</para>
- </listitem>
- <listitem>
- <para><package>multimedia/xawtv</package>
- is another TV application with similar features.</para>
- </listitem>
- <listitem>
- <para><package>audio/xmradio</package>
- provides an application for using the FM radio tuner of a
- TV card.</para>
- </listitem>
- </itemizedlist>
-
- <para>More applications are available in the &os; Ports
- Collection.</para>
- </sect2>
-
- <sect2>
- <title>Troubleshooting</title>
-
- <para>If any problems are encountered with the TV card, check
- that the video capture chip and the tuner are supported by
- &man.bktr.4; and that the right configuration options were
- used. For more support or to ask questions about supported TV
- cards, refer to the &a.multimedia.name; mailing list.</para>
- </sect2>
- </sect1>
-
- <sect1 xml:id="mythtv">
- <title>MythTV</title>
-
- <para>MythTV is a popular, open source Personal Video Recorder
- (<acronym>PVR</acronym>) application. This section demonstrates
- how to install and setup MythTV on &os;. Refer to <link
- xlink:href="http://www.mythtv.org/wiki/">mythtv.org/wiki</link>
- for more information on how to use MythTV.</para>
-
- <para>MythTV requires a frontend and a backend. These components
- can either be installed on the same system or on different
- machines.</para>
-
- <para>The frontend can be installed on &os; using the
- <package>multimedia/mythtv-frontend</package> package or port.
- <application>&xorg;</application> must also be installed and
- configured as described in <xref linkend="x11"/>. Ideally, this
- system has a video card that supports X-Video Motion
- Compensation (<acronym>XvMC</acronym>) and, optionally, a Linux
- Infrared Remote Control (<acronym>LIRC</acronym>)-compatible
- remote.</para>
-
- <para>To install both the backend and the frontend on &os;, use
- the <package>multimedia/mythtv</package> package or port. A
- &mysql; database server is also required and should
- automatically be installed as a dependency. Optionally, this
- system should have a tuner card and sufficient storage to hold
- recorded data.</para>
-
- <sect2>
- <title>Hardware</title>
-
- <para>MythTV uses Video for Linux (<acronym>V4L</acronym>) to
- access video input devices such as encoders and tuners. In
- &os;, MythTV works best with <acronym>USB</acronym> DVB-S/C/T
- cards as they are well supported by the
- <package>multimedia/webcamd</package> package or port which
- provides a <acronym>V4L</acronym> userland application. Any
- Digital Video Broadcasting (<acronym>DVB</acronym>) card
- supported by <application>webcamd</application> should work
- with MythTV. A list of known working cards can be found at
- <link
- xlink:href="https://wiki.freebsd.org/WebcamCompat">wiki.freebsd.org/WebcamCompat</link>.
- Drivers are also available for Hauppauge cards in the
- <package>multimedia/pvr250</package> and
- <package>multimedia/pvrxxx</package> ports, but they provide a
- non-standard driver interface that does not work with versions
- of MythTV greater than 0.23. Due to licensing restrictions,
- no packages are available and these two ports must be
- compiled.</para>
-
- <para>The <link
- xlink:href="https://wiki.freebsd.org/HTPC">wiki.freebsd.org/HTPC</link>
- page contains a list of all available <acronym>DVB</acronym>
- drivers.</para>
- </sect2>
-
- <sect2>
- <title>Setting up the MythTV Backend</title>
-
- <para>To install MythTV using binary packages:</para>
-
- <screen>&prompt.root; <userinput>pkg install mythtv</userinput></screen>
-
- <para>Alternatively, to install from the Ports Collection:</para>
-
- <screen>&prompt.root; <userinput>cd /usr/ports/multimedia/mythtv</userinput>
-&prompt.root; <userinput>make install</userinput></screen>
-
- <para>Once installed, set up the MythTV database:</para>
-
- <screen>&prompt.root; <userinput>mysql -uroot -p &lt; /usr/local/share/mythtv/database/mc.sql</userinput></screen>
-
- <para>Then, configure the backend:</para>
-
- <screen>&prompt.root; <userinput>mythtv-setup</userinput></screen>
-
- <para>Finally, start the backend:</para>
-
- <screen>&prompt.root; <userinput>sysrc mythbackend_enable=yes</userinput>
-&prompt.root; <userinput>service mythbackend start</userinput></screen>
- </sect2>
- </sect1>
-
- <sect1 xml:id="scanners">
- <info>
- <title>Image Scanners</title>
-
- <authorgroup>
- <author>
- <personname>
- <firstname>Marc</firstname>
- <surname>Fonvieille</surname>
- </personname>
- <contrib>Written by </contrib> <!-- in August 2004-->
- </author>
- </authorgroup>
- </info>
-
- <indexterm>
- <primary>image scanners</primary>
- </indexterm>
-
- <para>In &os;, access to image scanners is provided by
- <application>SANE</application> (Scanner Access Now Easy), which
- is available in the &os; Ports Collection.
- <application>SANE</application> will also use some &os; device
- drivers to provide access to the scanner hardware.</para>
-
- <para>&os; supports both <acronym>SCSI</acronym> and
- <acronym>USB</acronym> scanners. Depending upon the scanner
- interface, different device drivers are required. Be sure the
- scanner is supported by <application>SANE</application> prior
- to performing any configuration. Refer to <link
- xlink:href="http://www.sane-project.org/sane-supported-devices.html">
- http://www.sane-project.org/sane-supported-devices.html</link>
- for more information about supported scanners.</para>
-
- <para>This chapter describes how to determine if the scanner has
- been detected by &os;. It then provides an overview of how to
- configure and use <application>SANE</application> on a &os;
- system.</para>
-
- <sect2 xml:id="scanners-kernel-usb">
- <title>Checking the Scanner</title>
-
- <para>The <filename>GENERIC</filename> kernel includes the
- device drivers needed to support <acronym>USB</acronym>
- scanners. Users with a custom kernel should ensure that the
- following lines are present in the custom kernel configuration
- file:</para>
-
- <programlisting>device usb
-device uhci
-device ohci
-device ehci
-device xhci</programlisting>
-
- <para>To determine if the <acronym>USB</acronym> scanner is
- detected, plug it in and use <command>dmesg</command> to
- determine whether the scanner appears in the system message
- buffer. If it does, it should display a message similar to
- this:</para>
-
- <screen>ugen0.2: &lt;EPSON&gt; at usbus0</screen>
-
- <para>In this example, an &epson.perfection;&nbsp;1650
- <acronym>USB</acronym> scanner was detected on
- <filename>/dev/ugen0.2</filename>.</para>
-
- <para>If the scanner uses a <acronym>SCSI</acronym> interface,
- it is important to know which <acronym>SCSI</acronym>
- controller board it will use. Depending upon the
- <acronym>SCSI</acronym> chipset, a custom kernel configuration
- file may be needed. The <filename>GENERIC</filename> kernel
- supports the most common <acronym>SCSI</acronym> controllers.
- Refer to <filename>/usr/src/sys/conf/NOTES</filename> to
- determine the correct line to add to a custom kernel
- configuration file. In addition to the
- <acronym>SCSI</acronym> adapter driver, the following lines
- are needed in a custom kernel configuration file:</para>
-
- <programlisting>device scbus
-device pass</programlisting>
-
- <para>Verify that the device is displayed in the system message
- buffer:</para>
-
- <screen>pass2 at aic0 bus 0 target 2 lun 0
-pass2: &lt;AGFA SNAPSCAN 600 1.10&gt; Fixed Scanner SCSI-2 device
-pass2: 3.300MB/s transfers</screen>
-
- <para>If the scanner was not powered-on at system boot, it is
- still possible to manually force detection by performing a
- <acronym>SCSI</acronym> bus scan with
- <command>camcontrol</command>:</para>
-
- <screen>&prompt.root; <userinput>camcontrol rescan all</userinput>
-Re-scan of bus 0 was successful
-Re-scan of bus 1 was successful
-Re-scan of bus 2 was successful
-Re-scan of bus 3 was successful</screen>
-
- <para>The scanner should now appear in the
- <acronym>SCSI</acronym> devices list:</para>
-
- <screen>&prompt.root; <userinput>camcontrol devlist</userinput>
-&lt;IBM DDRS-34560 S97B&gt; at scbus0 target 5 lun 0 (pass0,da0)
-&lt;IBM DDRS-34560 S97B&gt; at scbus0 target 6 lun 0 (pass1,da1)
-&lt;AGFA SNAPSCAN 600 1.10&gt; at scbus1 target 2 lun 0 (pass3)
-&lt;PHILIPS CDD3610 CD-R/RW 1.00&gt; at scbus2 target 0 lun 0 (pass2,cd0)</screen>
-
- <para>Refer to &man.scsi.4; and &man.camcontrol.8; for more
- details about <acronym>SCSI</acronym> devices on &os;.</para>
- </sect2>
-
- <sect2>
- <title><application>SANE</application> Configuration</title>
-
- <para>The <application>SANE</application> system provides the
- access to the scanner via backends (<package>graphics/sane-backends</package>).
- Refer to <link
- xlink:href="http://www.sane-project.org/sane-supported-devices.html">http://www.sane-project.org/sane-supported-devices.html</link>
- to determine which backend supports the scanner. A
- graphical scanning interface is provided by third party
- applications like <application>Kooka</application>
- (<package>graphics/kooka</package>) or
- <application>XSane</application>
- (<package>graphics/xsane</package>).
- <application>SANE</application>'s backends are enough to test
- the scanner.</para>
-
- <para>To install the backends from binary package:</para>
-
- <screen>&prompt.root; <userinput>pkg install sane-backends</userinput></screen>
-
- <para>Alternatively, to install from the Ports Collection</para>
-
- <screen>&prompt.root; <userinput>cd /usr/ports/graphics/sane-backends</userinput>
-&prompt.root; <userinput>make install clean</userinput></screen>
-
- <para>After installing the
- <package>graphics/sane-backends</package> port or package, use
- <command>sane-find-scanner</command> to check the scanner
- detection by the <application>SANE</application>
- system:</para>
-
- <screen>&prompt.root; <userinput>sane-find-scanner -q</userinput>
-found SCSI scanner "AGFA SNAPSCAN 600 1.10" at /dev/pass3</screen>
-
- <para>The output should show the interface type of the scanner
- and the device node used to attach the scanner to the system.
- The vendor and the product model may or may not appear.</para>
-
- <note>
- <para>Some <acronym>USB</acronym> scanners require firmware to
- be loaded. Refer to sane-find-scanner(1) and sane(7) for
- details.</para>
- </note>
-
- <para>Next, check if the scanner will be identified by a
- scanning frontend. The <application>SANE</application>
- backends include <command>scanimage</command> which can be
- used to list the devices and perform an image acquisition.
- Use <option>-L</option> to list the scanner devices. The
- first example is for a <acronym>SCSI</acronym> scanner and the
- second is for a <acronym>USB</acronym> scanner:</para>
-
- <screen>&prompt.root; <userinput>scanimage -L</userinput>
-device `snapscan:/dev/pass3' is a AGFA SNAPSCAN 600 flatbed scanner
-&prompt.root; <userinput>scanimage -L</userinput>
-device 'epson2:libusb:000:002' is a Epson GT-8200 flatbed scanner</screen>
-
- <para>In this second example,
- <literal>epson2</literal> is
- the backend name and
- <literal>libusb:000:002</literal> means
- <filename>/dev/ugen0.2</filename> is the device node used by the
- scanner.</para>
-
- <para>If <command>scanimage</command> is unable to identify the
- scanner, this message will appear:</para>
-
- <screen>&prompt.root; <userinput>scanimage -L</userinput>
-
-No scanners were identified. If you were expecting something different,
-check that the scanner is plugged in, turned on and detected by the
-sane-find-scanner tool (if appropriate). Please read the documentation
-which came with this software (README, FAQ, manpages).</screen>
-
- <para>If this happens, edit the backend configuration file in
- <filename>/usr/local/etc/sane.d/</filename> and define the
- scanner device used. For example, if the undetected scanner
- model is an &epson.perfection;&nbsp;1650 and it uses the
- <literal>epson2</literal> backend, edit
- <filename>/usr/local/etc/sane.d/epson2.conf</filename>. When
- editing, add a line specifying the interface and the device
- node used. In this case, add the following line:</para>
-
- <programlisting>usb /dev/ugen0.2</programlisting>
-
- <para>Save the edits and verify that the scanner is identified
- with the right backend name and the device node:</para>
-
- <screen>&prompt.root; <userinput>scanimage -L</userinput>
-device 'epson2:libusb:000:002' is a Epson GT-8200 flatbed scanner</screen>
-
- <para>Once <command>scanimage -L</command> sees the scanner, the
- configuration is complete and the scanner is now ready to
- use.</para>
-
- <para>While <command>scanimage</command> can be used to perform
- an image acquisition from the command line, it is often
- preferable to use a graphical interface to perform image
- scanning. Applications like <application>Kooka</application>
- or <application>XSane</application> are popular scanning
- frontends. They
- offer advanced features such as various scanning modes, color
- correction, and batch scans. <application>XSane</application>
- is also usable as a <application>GIMP</application> plugin.</para>
- </sect2>
-
- <sect2>
- <title>Scanner Permissions</title>
-
- <para>In order to have access to the scanner, a user needs read
- and write permissions to the device node used by the scanner.
- In the previous example, the <acronym>USB</acronym> scanner
- uses the device node <filename>/dev/ugen0.2</filename> which
- is really a symlink to the real device node
- <filename>/dev/usb/0.2.0</filename>. The symlink and the
- device node are owned, respectively, by the <systemitem
- class="groupname">wheel</systemitem> and <systemitem
- class="groupname">operator</systemitem> groups. While
- adding the user to these groups will allow access to the
- scanner, it is considered insecure to add a user to
- <systemitem class="groupname">wheel</systemitem>. A better
- solution is to create a group and make the scanner device
- accessible to members of this group.</para>
-
- <para>This example creates a group called <systemitem
- class="groupname"><replaceable>usb</replaceable></systemitem>:</para>
-
- <screen>&prompt.root; <userinput>pw groupadd usb</userinput></screen>
-
- <para>Then, make the <filename>/dev/ugen0.2</filename> symlink
- and the <filename>/dev/usb/0.2.0</filename> device node
- accessible to the <systemitem
- class="groupname">usb</systemitem> group with write
- permissions of <literal>0660</literal> or
- <literal>0664</literal> by adding the following lines to
- <filename>/etc/devfs.rules</filename>:</para>
-
- <programlisting>[system=5]
-add path ugen0.2 mode 0660 group usb
-add path usb/0.2.0 mode 0666 group usb</programlisting>
-
- <note>
- <para>It happens the device node changes with the addition or
- removal of devices, so one may want to give access to all
- USB devices using this ruleset instead:</para>
-
- <programlisting>[system=5]
-add path 'ugen*' mode 0660 group usb
-add path 'usb/*' mode 0666 group usb</programlisting>
- </note>
-
- <para>Refer to &man.devfs.rules.5; for more information about
- this file.</para>
-
- <para>Next, enable the ruleset in /etc/rc.conf:</para>
-
- <programlisting>devfs_system_ruleset="system"</programlisting>
-
- <para>And, restart the &man.devfs.8; system:</para>
-
- <screen>&prompt.root; <userinput>service devfs restart</userinput></screen>
-
- <para>Finally, add the users to <systemitem
- class="groupname"><replaceable>usb</replaceable></systemitem>
- in order to allow access to the scanner:</para>
-
- <screen>&prompt.root; <userinput>pw groupmod usb -m <replaceable>joe</replaceable></userinput></screen>
-
- <para>For more details refer to &man.pw.8;.</para>
- </sect2>
- </sect1>
-</chapter>