Install a touchscreen" onclick="tagshow(event)" class="t_tag">touchscreen for Linux
How to set up and configure a PSOne LCD with touchscreen input
Historically, the lack of friendly interfaces has been an obstacle to making Linux® a commercially viable product for end users, but with available GUIs, that's yesterday's news. What's the next step in creating an easy-to-use Linux-based product for consumers? Imagine adding a user-oriented LCD touchscreen. A touchscreen facade can make back-end Linux applications very usable in such devices as custom digital media centers (either in the home or in automobiles), DVRs and PVRs, and even control interfaces for household robots. The potential uses are limited only by the imagination. In this article, get an overview for installing an LCD taken from a Sony PSOne, creating a modeline, and installing a touchscreen -- all for Linux.
KDE, GNOME/Nautilus, OpenWindows, WINE, etc. -- plenty of GUIs make it easier for users to access the power and elegance of Linux applications. What component can be added to this mix to insinuate Linux even more firmly into the consumer device arena? A touchscreen. With a touchscreen, a Linux device can become a controller for a slew of devices such as a digital video recorder, a TiVo-like personal video recorder, a media center, a smart-house system, or even a control interface to a toaster. The possibilities are boundless.
Touchscreens come in a variety of pre-packaged and separately packaged solutions. They have been around almost as long as CRTs and now show up in LCDs as well. In some cases, the touchscreen is already integrated into the display unit. In others (as discussed in this article), they are separate units that must be matched in size and intended function.
This article gives you an overview of the steps to prepare to install and configure the LCD (the image screen), the modeline (a configuration line that tells the server how to drive the monitor), and the touchscreen (for input). It also gives you some resources to answer other questions that might come up when you start to integrate a touchscreen.
Installing the LCD
The touchscreen is for input only; therefore, you need something behind it to display an image. Besides displaying the user interface, the display is used for calibration, which can be done in these two main ways:
- The easier route is to acquire an LCD screen from any of various vendors and hook it up to a PC system. Just ensure the connections will work with your video card, either directly or with an adapter.
- The more difficult route, and the one described in this article, is to acquire a PSOne LCD for a fairly small price. This will require some soldering and cable splicing, which is not overly difficult if you follow one of the guides available for this modification . Going this route and using a PSOne LCD will require a video card with a CSYNC (composite sync) signal -- most ATI and Matrox cards have this. You can build a circuit that generates a CSYNC signal for cards that don't do this already , but it is generally easier to just purchase a card that already generates it.
Connecting the power
The LCD needs power to function and backlight the display. Just as with the LCD installation, there is an easy way and a hard way:
- The easy way is to purchase an LCD that can be plugged into a wall outlet or car adapter, depending on your needs. Plugging into a wall outlet is simple, since the PC generally requires wall power also.
- The difficult way (and the way I chose) is to purchase a car power adapter from eBay. It uses 12 volts, which is a voltage also provided inside an ordinary computer case via the power supply. I simply followed the guide "Hooking up a Neon Light," since they are functionally the same . After making the changes, it will plug directly into a PC power supply. Again, you'll have to do some cable splicing and soldering, but in the end you avoid having to use an additional wall outlet.
Now for the modeline.
Remind me: What's a modeline?
A modeline is a configuration line in a configuration file that provides information to the server about a connected computer monitor and how to drive it at a specified display resolution. (Originally it was XF86Config in XFree86.) Now, in many Linux/UNIX® versions, modelines are no longer needed since the server calculates the configuration at startup based on other factors, such as:
- Generic and intuitive settings in the server configuration file
- Monitor capabilities acquired via an EDID query
EDID (Extended Display Identification Data) is a VESA standard data format that contains basic information about a monitor and its capabilities, including vendor information, maximum image size, color characteristics, factory pre-set timings, frequency range limits, and character strings for the monitor name and serial number. The information is stored in the display and is used to communicate with the system through a Display Data Channel (DDC), which rests between the monitor and the PC graphics adapter. The latest version of EDID can be used in CRT displays, LCD displays, and future display types because EDID offers general descriptions of almost all display parameters.
An individual modeline has 10 parameters, beginning with a label for the resolution being specified. The second parameter specifies the rate of the pixel clock in megahertz. Following are two groups of four numbers. The first group specifies the x-resolution (width) and related parameters; the second specifies the y-resolution (height). For options, extra parameters for controlling horizontal and vertical synchronization can be added, and there are also options for interlaced and doublescan modes.
So why bother with modelines? For obsolete, unusual, or insufficiently finely tuned display hardware, manually setting modelines may be the only available solution.
Determining the proper modeline
If you took the easy route for hooking up the LCD, your screen may be recognized automatically when the Linux OS boots; if so, you are ready to set up the touchscreen. If you took the more difficult route, or if your LCD wasn't automatically recognized, you may need to build a custom modeline. Various modelines may be gathered by querying Google, by checking manufacturers' specifications, or by trying various included ones in the proper configuration file. If you are installing a PSOne LCD, the easiest way to arrive at a proper modeline is to use a Windows based-PC and the PowerStrip tool (which provides advanced, multi-display, programmable hardware support to a wide range of video cards; ).
If you know the native resolution for the LCD, you should start with that. For the PSOne LCD, you should start with 640x480i (Arcade). From there, you may need to adjust the scan rate (a setting that the PowerStrip tool allows you to modify) until you get a stable picture.
Table 1 lists appropriate modelines for various video cards for a PSOne LCD -- I found these by searching the Internet. I do not have access to all these various cards, so the only one I can vouch for is the ATI 9600XT that I use. If you find these in error or would like to contribute to this list, please send me an e-mail.
Table 1. Linux modelines
| Card |
NTSC/PAL |
Modeline |
| Matrox Mystique |
NTSC |
"640x480" 12.954 640 680 744 816 480 496 504 528 interlace +hsync +vsync |
| Matrox Millenium G200 |
NTSC |
"640x480" 13.193 640 688 752 832 480 492 500 524 interlace -hsync -vsync |
| Matrox Millenium G200 |
PAL |
"720x576" 14.875 720 736 800 896 576 602 606 668 interlace +hsync +vsync |
| ATI 7000 |
NTSC |
"640x480" 12.175 640 664 720 784 480 486 493 524 interlace +hsync +vsync |
| ATI 7000 |
PAL |
"720x576" 14.950 720 763 859 920 576 580 584 588 interlace +hsync +vsync |
| ATI 9600XT |
NTSC |
"640x480" 13.582 640 704 768 864 480 486 493 524 interlace -hsync -vsync |
| ATI 9700 |
PAL |
"720x576" 14.881 720 781 829 960 576 606 610 646 interlace +hsync +vsync |
| EPIA 800 |
NTSC |
"640x480" 13.678 640 672 736 800 480 486 494 524 interlace composite |
[此贴子已经被作者于2007-3-30 14:39:51编辑过]