|< Free Open Study >|| |
Many people use their computers to create and manage various types of content (such as images from a digital camera, art work, home movies, and so on), as well as for entertainment (such as computer games and digital video). This section will describe how the case study system is used for these types of activities and detail the software required to do so.
If you have a digital camera, then there's a chance that you will be interested in this crazy notion of transferring the photographs stored in it to your computer's storage. If that sounds like you, this section will be of interest, since it describes how to retrieve images from a digital camera using the gphoto program.
Digital cameras invariably come with software to manage the photographs in the camera. Typically the software allows you to view small "thumbnail" versions of the photos, copy some or all to your computer's disk, delete photographs, and so on. However, few (if any) camera manufacturers have Linux versions of their software. That's great, since you can use the open source gphoto program instead! The current version of gphoto is at the 2.0 level; however, the 2.0 version is very different from the previous versions (which were a sort of alpha version, in the 0.4x and 0.5x series). The main difference between the two versions is that the older versions provided a full-fledged graphical program and environment very similar to the software produced by the manufacturers for other operating systems. The newer 2.0 version has no graphical interface, and is instead focused on providing the ability to manage cameras from the command line, as well as a set of libraries that other programs can use to build custom interfaces.
Meanwhile, KDE 3.0 (which is included with Red Hat Linux 7.3) comes with a software program called Kamera, which uses the gphoto libraries to provide integrated support for digital cameras within the Konqueror browser. (Konqueror is KDE's standard browser for the web, filesystems, and so on.) This was another (albeit minor) reason for the selection of KDE for the case study. Instructions for using this functionality are included with the documentation for KDE, which is easily available within the system, but generally it's as simple as using KDE's tools to configure the gphoto libraries, and then entering the URL gphoto:/ into Konqueror.
Once you've downloaded the digital photographs from the camera to the computer, you'll want to manipulate them—that is, to do things such as cropping them, resizing them, changing the color and brightness, and so on. There is a wide variety of software available that does this, and most digital cameras come with at least a minimal program for editing photos. Again, this software seldom works with Linux systems. Fortunately, the GNU Image Manipulation Program (GIMP) was created to address just this issue.
The GIMP is not nearly as crippled as its name might imply. In fact, most users seem to agree that the GIMP is at least as functional as its commercial competitors, and many feel that the GIMP is superior in some ways. The GIMP is fairly easy to get started with, but it is a very complicated piece of software (as truly powerful programs usually are).
An RPM package of the GIMP is included with Red Hat Linux 7.3, and is probably installed by default on your system, unless you explicitly unselected it. Running the GIMP should be no problem, but mastering it is another matter! You can get started by visiting the user's manual at the GIMP's site, http://www.gimp.org.
The section "Using a CD Writer" earlier in this chapter discussed how to configure your CD writer hardware for use with Linux. (In brief, the kernel treats it as a SCSI device through the ide-scsi emulation kernel module.) However, that only gets the hardware working; you now need to access the hardware.
As with digital cameras, CD writers usually come with software for using the drive, but typically there is no Linux version of this software. Fortunately, a number of open source programs exist that let you use your CD writing hardware. The programs used on the case study system are mkisofs, cdrecord, and xcdroast.
The two most common types of CDs are music CDs and data discs that use the standard ISO-9660 CD filesystem format (perhaps with extensions). The mkisofs program creates ISO-9660 filesystems, and the cdrecord program burns them to actual media. The xcdroast program is a front-end to these other tools, and provides a graphical interface similar to programs you would find on Windows systems.
If you're creating a data CD, the first step is to generate an ISO-9660 filesystem image for it. This is a normal file on your hard drive which itself contains a filesystem that can be burned to a CD. The mkisofs program, included with Red Hat Linux 7.3, is used for this, and it's a fairly straightforward program. It should be installed on most desktop configurations, but if it's not you can install it through the usual means.
Using mkisofs is usually quite simple, though it has a lot of options. In the simplest form, you just invoke it with the name of a directory that mkisofs is to place into the ISO-9660 image. Don't be overwhelmed by the large number of command-line options, since you won't use most of them. The most common options are -J and -R, which respectively instruct mkisofs to create the ISO-9660 image with "Joliet" and "Rock Ridge" extensions to the standard; and the -o <filename> argument, which instructs mkisofs to generate the ISO-9660 image in the indicated file. People frequently give ISO-9660 image files an extension of .iso, but this is not a formal standard of any sort.
When you run it, mkisofs will copy all the files in the directory you specified (as well as all its subdirectories) into the image file you specified. Once it's finished, you can burn the image to CD, or test it by using the -o loop argument to mount, which causes mount to mount a file as a volume via the loopback kernel module. For example, the following commands will create an ISO-9660 image in /tmp/foo.iso from the contents of the directory /home/foo and mount it (to test it) on the directory /mnt/foo:
$ mkisofs -R -J -o /tmp/foo.iso /home/foo $ mount -o loop -t iso9660 -r /tmp/foo.iso /mnt/foo
The -o loop argument to mount requires that the loopback block device driver, which is a kernel module named "loop", be available to the kernel; this is the case with the default kernel from Red Hat Linux 7.3.
The cdrecord program is used to burn data onto actual CD media, and is capable of creating both music CDs (that you would be able to play in most recent standard CD players) and data CDs (such as from an ISO-9660 image file created with mkisofs). Like mkisofs, cdrecord should be included with most desktop installations of Red Hat Linux.
Invoking cdrecord involves giving it a file or list of files that it is to burn to a CD, specifying which CD writer device hardware to use and giving the format of the CD (such as data or audio). Again, cdrecord has many options, but generally you won't need most of them. For example, to burn the image created in the previous example onto a CD, you might use a command such as this one:
$ cdrecord dev=1,1,0 -data /tmp/foo.iso
The only tricky issue with this command is the dev= argument. This argument tells cdrecord which device on the SCSI bus to use to create the CD. This is obviously not in the format you're used to (such as, for example, /dev/sda), but fortunately cdrecord can lookup all SCSI devices for you. Just run the command cdrecord -scanbus, and it will locate all available SCSI devices and display their human-readable identifiers. You should be able to easily identify your CD writer in the list, and use its descriptor in the dev= argument to cdrecord.
As you've probably noticed, cdrecord and mkisofs can be pretty complicated programs. You should now be able to figure them out without too much trouble, of course, but you may prefer a graphical user interface. If that's you, then you'll want to try xcdroast.
The xcdroast program is a graphical front end to mkisofs and cdrecord, and it lets you create and burn both data and audio CDs by gathering the options it needs to pass to those programs, and then executing them for you. Again, xcdroast is included with Red Hat Linux 7.3. If you prefer a graphical environment, then you should check out this program; it really can make the process of authoring CDs quite painless.
Many users enjoy listening to music while they work, and one of the most popular formats is the MP3 standard. A similar standard is the Ogg Vorbis format; the Xiphophorous company has a project named "Ogg" that produces (among other things) a compressed digital audio format named "Vorbis." The Ogg Vorbis standard is a fully open project, whereas certain aspects of the MP3 standard are encumbered by various companies' patents. (For more information, see Xiphophorous' web site at http://www.xiph.org.) This section will discuss programs that can play Ogg Vorbis and MP3 files.
Red Hat Linux includes the mpg321 program for playing MP3 files. (The RPM package is mpg321.) You can play back any MP3 files you have simply by running the command mpg321 <filename>. You can also specify a list of files, and commandline options are also available to randomize the order songs are played, and so on.
Commands such as mpg321 -z *.mp3 work very well for playing MP3s, but the mpg321 package contains no program to encode MP3 files. If you wish to encode MP3 files, you'll have to use another program. Unfortunately, the process of encoding MP3 files is the aspect of MP3s for which some companies hold patents, so free MP3 encoders can be hard to come by. The LAME project is an MP3 encoder, but a package for it is not included with Red Hat Linux 7.3. However, you can still install it yourself (using the techniques in Chapters 8 through 13), and you can find it at http://www.mp3dev.org/mp3/.
Recall that the Ogg Project produces an audio coder/decoder (codec) specification known as Vorbis. The Ogg Vorbis codec is roughly similar to MP3, but is based on different algorithms and technologies, and so is not encumbered by the patents that encumber MP3.
There are three relevant RPM packages for Vorbis: libvorbis, libvorbis-devel, and simply vorbis. The first two contain the shared libraries that allow other programs (such as XMMS, discussed later) encode and decode Vorbis files. The vorbis package contains command-line playback and encoding tools.
The command to play Ogg Vorbis files is ogg123. This program is very similar to mpg321 in its command-line syntax, as was intended, since many users were already familiar with mpg321 (and the program that mpg321 itself was inspired by, mpg123, which is not discussed in this book). The command ogg123 -z *.ogg plays all Vorbis files in the current directory in a random order, and is similar to the mpg321 command.
Unlike mpg321, the Ogg Vorbis package also includes a program to encode Vorbis files from the standard .WAV format for uncompressed digital audio. The program is named oggenc, and, as a typical command-line program, its workings should be very familiar by now.
The library packages (libvorbis and libvorbis-devel) are used by other applications to integrate support for the Ogg Vorbis codec. For example, the XMMS program (discussed in the next section) makes use of these libraries to enable it to play back Vorbis files as well as MP3 files. (These RPMs are also used by the vorbis package itself.)
If you like encoding your music CDs to a more portable format, then you may wish to investigate Ogg Vorbis as an alternative to MP3. Vorbis' advantages are that it is at least as high quality as MP3 (and better in some opinions), and that it is a fully open standard, as well as open source. If this is important to you, you should look into the Ogg Project and its tools.
The X Multimedia System (or XMMS for short) is a graphical interface used to play a variety of files. It's similar in appearance to the popular WinAMP music player available for Windows systems, and supports many file formats. Notably, it supports both MP3 and Ogg Vorbis, the two formats discussed earlier. XMMS also provides some interesting "eye candy" features to visualize the music as it's played.
If you prefer to use a graphical program to manage playlists of music files, or wish to mix MP3 and Vorbis files together into a single playlist, then you should consider XMMS. Other graphical programs that accomplish the same task are available for Linux systems, but XMMS has the virtue of being included with Red Hat Linux. For this case study, XMMS is more than adequate and is in fact quite nice.
Just as many users enjoy listening to digital audio files, many enjoy watching digital video files. There's a lot of activity in this area currently, and several options to choose from among open source players and commercial versions. First, this section will discuss the actual players used by the case study system, and then point out a few other options.
Some video codec standards are open standards, such as MPEG (Motion Picture Expert Group), whereas others are controlled tightly by their owners to dictate who can and can't use them. Unfortunately, it seems that most codecs fall in to the latter category, and because they are not open, it's difficult at best to write software to play them. Fortunately, that's where the avifile program comes in.
The avifile project produces a media player program that actually reads binary dynamic link library (DLL) files from Microsoft's Windows operating systems, and accesses the codec implementations contained in the libraries. This is an interesting approach, because it means that avifile can play back video files encoded to a certain format without actually having to implement the codec directly. However, this isn't a foolproof approach, and obviously it only works for codecs for which DLLs are available and whose licenses permit them to be used in this manner.
Despite its limitations, avifile is quite functional, and is therefore used on the case study system. It's not included in Red Hat Linux (though it is included in some other distributions such as Debian GNU/Linux and Mandrake Linux), but it isn't too difficult to install. The only caveat is that when you build the program, you have to specify the name of a directory where the Windows DLL files will be installed, so it's important to make this decision upfront.
A major disadvantage of avifile is that it can be rather difficult to build. It also doesn't play MPEG files, meaning you need a separate program for that purpose. However, avifile is functional, if you can get past the difficulties in using it on a Red Hat System.
One minor disadvantage of avifile is that it doesn't play MPEG files. Thus, a separate program is required for these files. Fortunately, Red Hat Linux does include a capable MPEG player, in the form of the smpeg package, which installs a program named plaympeg.
The smpeg package is actually a part of the SDL project, which is a multimedia library mentioned in a bit more detail in the next section. You won't have any trouble at all using the plaympeg program once you have the package installed.
The two programs just mentioned are, obviously, two different programs. This means that you have to pay attention to which type of video file you're currently trying to play, and select the right program to play it. Additionally, many current media players can "stream" video data from servers and play them live. This can be difficult or sometimes impossible with either avifile or smpeg. For this reason, users who view video files frequently may find these programs to be unsatisfactory.
Other solutions are available, but generally they aren't free. For example, CodeWeavers, Inc. has a product known as CrossOver Plugin, which is a plug-in to the Mozilla and Netscape 6.x browsers. This plug-in is a sort of meta–plug-in that allows plug-ins for Windows browsers to function within Mozilla and Netscape on Linux systems. This includes, among other things, Microsoft's Windows Media Player. This product is not free, but it may be worth the cost for some users. The product can be found at http://www.codeweavers.com/products/crossover/.
There are many other applications available as well. KDE, for example, has a built-in media player, but it generally isn't as capable as avifile. Similarly, the Xine program has a very attractive user interface and can play both MPEG files and AVI files, but it can't play some of the newer codecs. You may wish to spend a little quality time with your favorite search engine looking into the other options that exist. There is a lot of activity in this area, and you might find something that works for you.
One of the final indicators that an operating system has entered the desktop mainstream is when commercial games are widely available for it. Linux can be used as a desktop system (as this chapter demonstrates), but it's probably too soon to say that it's become mainstream in that capacity. As a result, there are commercial games for Linux, but honestly not that many.
Some game companies' strategies include Linux, and they have produced profitable games on this platform. Of note are id Software's so-called "First Person Shooter" (FPS) games, such as Doom, the Quake Series, and so on. These games run well on Linux, and even have support for 3D hardware acceleration. Nor is id Software alone; many other companies have had their games ported to Linux. Unfortunately, these games can be sometimes hairy to install, to say the least. For example, supporting 3D graphics hardware was mentioned earlier in this chapter; that is frequently but one of many obstacles to overcome before you can get most games running on Linux systems. In a nutshell, commercial games on Linux aren't quite to the point where installation is painless. (Of course, since you've read Chapters 8 through 13, that should be easy for you, but it's usually not as easy as just installing an RPM!)
However, that's generally true of mainstream commercial games. If you're not an avid gamer interested in the latest and greatest games, you may actually be surprised by the number of desktop-type games available for Linux. You can find a vast array of card games, puzzle games, simple arcade games, and so on available for KDE and GNOME. Additionally, there are several efforts to produce commercially viable open-source multimedia engines for Linux. Notably, the Simple DirectMedia Layer (SDL) found at http://www.libsdl.org is a set of libraries for developing multimediaintensive applications such as media players and games, on a variety of operating systems; Red Hat Linux includes RPM packages for these libraries. Many free games, and even some commercial games, are being developed on this API.
The bottom line is that if you're a hardcore gamer, you might be disappointed by the state of gaming on Linux. If you are really just looking for some casual diversions, though, there's probably more than enough for you. If you're interested in learning more, a great site to visit is the Linux gaming forum at http://www.linuxgames.com. For this case study, it so happens that I get my gaming fix from some of the old classics like NetTrek, so many of these issues don't come into play.
In the next section, we move from play to work. You'll read about some interesting tricks and immensely useful techniques that you can take advantage of, now that you've set up your Linux system.
|< Free Open Study >|| |