Modem-HOWTO: Modems for a Linux PC

Next Previous Contents

## 2. Modems for a Linux PC

## 2.1 Many Winmodems Will Not Work with Linux

Unfortunately, some software modems (winmodems) will not work with Linux due to lack of Linux drivers. Configuring the software modems that can be made to work with Linux ranges from very easy (automatically) to difficult, depending on both the modem, your skills, and how easy it is to find info about your modem --info that is not all in this HOWTO. If you buy a new one that you're not sure will work under Linux, try to get an agreement that you can return it for a refund if it doesn't work out.

Even if your modem works with Linux it can't be used until the serial port it's located on is enabled and made known to the operating system. For a detailed explanation of this (or if boot-time messages don't show your modem's serial port) study this HOWTO or see Plug-and-Play-HOWTO.

## 2.2 External vs. Internal

A modem for a PC may be either internal, external serial, or external USB. The internal one is installed inside of your PC (you must remove screws, etc. to install it). An external one just plugs in to a cable: USB cable (USB modem) or to the serial port (RS-232 serial modem). As compared to external serial modems, the internal modems are less expensive, are less likely to to suffer data loss due to buffer overrun, and usually use less electricity. An internal modem obviously doesn't use up any desk space.

External serial modems are usually easier to install and usually has less configuration problems provided the serial port you'll connect it to is configured OK. External USB modems are more likely to be winmodems and are reportedly usually more difficult to deal with than external serial modems. External modems have lights which may give you a clue as to what is happening and aid in troubleshooting. The fact that the serial port and modem can be physically separated also aids in troubleshooting. External modems are easy to move to another computer. If you need to turn the power off to reset your modem (this is seldom necessary) then with an external you don't have to power down the entire PC.

Unfortunately, most external serial modems have no switch to turn off the power supply when not in use and thus are likely to consume a little electricity even when turned off (unless you unplug the power supply from the wall). Each watt they draw usually costs you over $1/yr. Another possible disadvantage of an external is that you will be forced to use an existing serial port which may not support a speed of over 115,200 bps (although as of late 2000 most new internal modems don't either --but some do). For details Can't Set a High Enough Speed

## 2.3 Is a Driver Needed ?

Any modem, of course, needs the serial driver that comes with Linux (either built into the kernel or as a module). For PCI, this driver should also detect the modem but it's not really a modem driver since it just detects which serial port the modem is on.

But what about modem drivers? Any software modem (winmodem, linmodem) must have a modem driver (if it exists for Linux). Hardware modems don't really need any modem driver unless you want to use special features such as voice and "modem on hold".

Software modems require software to run them and obviously do need a driver. The drivers for MS Windows are *.exe programs which will not run under Linux. So you must use a Linux driver (if it exists). See Software-based Modems (winmodems, linmodems)

## 2.4 External Modems

### Do they all work under Linux?

At one time (2002 ?) all external modems would work under Linux. But then came the controllerless external modem which wouldn't. If the box says it requires Windows with no mention of Linux it could mean just that. Could it be that Windows software is provided for "modem on hold" and for use as an answering machine, etc., but that otherwise it will work under Linux? Linux may not support these features very well if at all. If this is a recent version of Modem-HOWTO, let me know of your experience with this.

### PnP External Modems

Many external modems are labeled "Plug and Play" (PnP). If they are hardware modems, they should all work as non-PnP modems. While the serial port itself may need to be configured (IRQ number and IO address) unless the default configuration is OK, an external modem uses no such IRQ/IO configuration. You just plug the modem into the serial port.

The PnP modem has a special PnP identification built into it that can be read (thru the serial port) by a PnP operating system. Such an operating system would then know that you have a modem on a certain port and would also know the id number. If it's a controllerless modem, it could try to locate a driver for it. It could also tell application programs what port your modem is on (such as /dev/ttyS2 or COM3). But Linux may not be able to do this. Thus you may need to configure your application program manually by giving it the ttyS number (such as /dev/ttyS2). Some programs like wvdial can probe for a modem on various ports.

### Cabling & Installation

Connecting an external modem is simple compared to connecting most other devices to a serial port that require various types of "null modem" cables (which will not work for modems). Modems use a straight through cable, with no pins crossed over. Most computer stores should have one. Make sure you get the correct gender and number of pins. Hook up your modem to one of your serial ports. If you are willing to accept the default IRQ and IO address of the port you connect it to, then you are ready to start your communication program and configure the modem itself.

### What the Lights (LED's) Mean (for some external modems)

- TM Test Modem
- AA Auto Answer (If on, your modem will answer an incoming call)
- RD Receive Data line = RxD
- SD Send Data line = TxD
- TR data Terminal Ready = DTR (set by your PC)
- RI Ring Indicator (If on, someone is "ringing" your modem)
- OH Off Hook (If off, your modem has hung up the phone line)
- MR Modem Ready = DSR ??
- EC Error Correction
- DC Data Compression
- HS High Speed (for this modem)

## 2.5 Internal Modems

An internal modem is installed in a PC by taking off the cover of the PC and inserting the modem card into a vacant slot on the motherboard. There are modems for PCI slots, other modems for the older ISA slots, and ARM software "modems" for the new small AMR slot. Only some newer PCs will have ARM slots. While external modems plug into the serial port (via a short cable) the internal modems have the serial port built into the modem. In other words, the modem card is both a serial port and a modem.

Setting the IO address and IRQ for a serial port was formerly done by jumpers on the card. These are little black rectangular "cubes" about 5x4x2 mm in size which push in over pins on the card. Plug-and-Play modems (actually the serial port part of the modems) don't use jumpers for setting these but instead are configured by sending configuration commands to them over the bus inside the computer. Such configuration commands can be sent by a PnP BIOS, by the isapnp program (for the ISA bus only), by setpci (PCI bus: can't set IRQs), or by newer serial of how to configure the ones that don't get io-irq configured by the serial driver.

1. ISA bus: Use "isapnp" which may be run automatically at every boot-time
2. Let a PnP BIOS do it, and then maybe tell setserial the IO and IRQ
3. PCI bus: Use lspci -vv to look at it and setpci to configure the IO only (can't set the IRQ).

See Quick Install for more details, especially for the PCI bus.

## 2.6 Software-based Modems (winmodems, linmodems)

### Introduction to software modems (winmodems)

Software modems turn over some (or even almost all) of the work of the modem to the main processor (CPU) chip of your computer (such as a Pentium chip). This requires special software (a modem driver) to do the job. Until late 1999, such software was released only for MS Windows and wouldn't work with Linux. Even worse was that the maker of the modem kept the interface to the modem secret so that no one could write a Linux driver for it (even though a few volunteers were willing to write Linux drivers).

But things have improved some since then so that today (late 2001) many such modems do have a linux driver. There is no standard interface so that different brands/models of software-modems need different drivers (unless the different brands/models happen to use the same chipset internally). But some drivers may not work perfectly nor have all the features that a MS Windows driver has.

Another name for a software modem (used by MS) is "driver-based modem". The conventional hardware-based modem (that works with Linux) doesn't need a modem driver (but does use the Linux serial driver) After about mid-1998 most new internal modems were software modems.

Software modems fall into 2 categories: linmodems and winmodems. Winmodems will only work under MS Windows. Linmodems will work under Linux. They formerly were mostly winmodems so some also call them "winmodems". The term "Winmodem" is also a trademark for a certain model of "winmodem" but that's not the meaning of it in this document.

### Linmodems

In late 1999, two software-based modems appeared that could work under Linux and were thus called "linmodems". Lucent Technologies (LT) unofficially released a Linux binary-only code to support most of its PCI modems. PC-TEL (includes "Zoltrix") introduced a new software-based modem for Linux. After that, interest increased for getting winmodems to work under linux. There is a GPL'ed driver for Intel's (Modem Silicon Operations) MD563x HaM chipset (nee Ambient division of Cirrus Logic). As of mid-2001 there are also drivers for: Conexant HSF and HCF, Motorola SM56 (support terminated), ESS (ISA only), and IBM's Mwave for Thinkpads 600+. See http://linmodems.org.

What percent of software modems now (2001) work under Linux? Well, there's a number of modem chips not supported: Lucent/Agere ARM (Scorpio), 3COM/US Robotics, some SmartLink (3 different chipsets), Ambient HSP, and possibly others. So it seems that over half the software modem chips were supported as of late 2001. As of 2005 it seems that the situation has gotten worse. Why? Well, Linux on the Desktop didn't grow as fast as expected and many PC users went for higher speed cable modems and DSL.

Another reason is that many of the drivers were written years ago and will only work for older versions of the Linux kernels. The driver code is secret and the companies don't want to update drivers for hardware they are no longer selling.

Be warned in advance that determining if your modem is a linmodem may not be very easy. You may need to first find out what chipset you have and who makes it. Just knowing the brand and model number of your modem may not be sufficient. One method is to download the scanModem tool from http://linmodems.org but the results may be hard to decipher and you may need to ask for help from the linmodems mailing list. Another way to find this out using say "lspci -v" and then looking up the chip maker using the long modem number. This requires checking a database or searching the Internet. Still another way is to look at the fine print on the chips on the modem card. All this is not always simple. It could happen that you will put a lot of effort into this only to get the bad news that your modem isn't supported. But even if it is supported, support may only be for an old version of the kernel. See Linmodem-HOWTO for more details.

### Linmodem sites and documentation

- Linmodem-HOWTO
- Winmodems-and-Linux-HOWTO (not as well written as Linmodem-HOWTO)
- http://linmodems.org is a project to turn winmodems into linmodems. Has a mailing list.
- Conexant+Rockwell-modem-HOWTO
- old modem list Has links to linmodem info, but not maintained after 2003.
- PCTel-HSP-MicroModem-Configuration-mini-HOWTO

### Software-based modem types

There are two basic types of software modems. In one type the software does almost all of the work. The other is where the software only does the "control" operations (which is everything except processing the digital waveshapes --to be explained later). Since the hardware doesn't do the control it's called a "controllerless" modem. The first type is an all-software modem (sometimes just called a software modem).

For both of these types there must be analog hardware in the modem (or on the motherboard) to generate an electrical waveshape to send out the phone line. It's generated from a digital signal (which is sort of a "digital waveshape"). It's something like the digital electronics creates a lot of discrete points on graph paper and then the modem draws a smooth voltage curve thru them. There must also be hardware to convert the incoming waveshape to digital. This is just analog-to-digital conversion (and conversely). It's done by a codec (coder-decoder).

The incoming digital waveshape must be converted to a data byte stream. This is part of the demodulation process. Recall that these data bytes have likely been compressed, so they are not at all like the original message. Turning data bytes into a digital waveshape is part of the modulation process. Even after demodulation is done, the modem can't just send the resulting incoming data byte stream to the serial port input buffers, but must first do decompression, error correction, and convert from serial to the parallel bus of the computer. But the modem may get the CPU to do the actual work. It's the reverse sequence for an outgoing data byte stream.

The difference between the two types of software-based modems is where the digital modulation takes place. In the all-software modem this modulation is done in the CPU and it's called a Host Signal Processor (HSP). In the controllerless modem it's done in the modem but all other digital work is done by the CPU. This other digital work consists of dealing with AT-commands, data compression, error correction, and simulating a serial port. In the all-software modem, there are still two items handled by hardware: the A/D conversion of waveshapes by the codec and echo cancellation.

### Is this modem a software modem?

How do you determine if an internal modem is a software modem? First see if the name, description of it, or even the name of the MS Windows driver for it indicates it's a software modem: HSP (Host Signal Processor) , HCF (Host Controlled Family), HSF (Host Signal Family), controllerless, host-controlled, host-based, and soft-... modem. If it's one of these modem it will only work for the cases where a Linux driver is available. Since software modems cost less, a low price is a clue that it's a software modem.

If you don't know the model of the modem and you also have Windows on your Linux PC, click on the "Modem" icon in the "Control Panel". Then see the modem list (not maintained after 2003). If the above doesn't work (or isn't feasible), you can look at the package the modem came in (or a manual). Read the section on the package that says something like "Minimum System Requirements" or just "System Requirements".

A hardware modem will work fine on old CPUs (such as the 386 or better). So if it requires a modern CPU (such as a Pentium or other "high speed" CPU of say over 150 MHz) this is a clue that it's a all-software modem. If it only requires a 486 CPU (or better) then it's likely a host-controlled software modem. Saying that it only works with Windows is also bad news. However, even in this case there may be a Linux driver for it or it could be a mistake in labeling.

Otherwise, it may be a hardware modem if it fails to state explicitly that you must have Windows. By saying it's "designed for Windows" it may only mean that it fully supports Microsoft's plug-and-play which is OK since Linux uses the same plug-and-play specs (but it's harder to configure under Linux). Being "designed for Windows" thus gives no clue as to whether or not it will work under Linux. You might check the Website of the manufacturer or inquire via email. Some manufacturers are specifically stating that certain models work under Linux. Sometimes they are linmodems that require you to obtain and install a certain linmodem driver.

### Should I get a software modem?

Only if you know there is a Linux driver for it that works OK. But there may be a problem if the driver isn't being maintained and as a result doesn't work with future versions of the kernel. Also, the driver may not have full functionality. Besides the problems of getting a satisfactory driver, what are the pros and cons of software modems? Since the software modem uses the CPU to do some (or all) of its work, the software modem requires less on-board electronics on the modem card and thus costs less. At the same time, the CPU work load is increased by the modem which may result in slower operation.

The percentage of loading of the CPU by the modem depends on both what CPU you have and whether or not it's an all-software modem. For a modern CPU and a modem that only uses the CPU as a controller, there's little loss of performance. Even if it's an all-software modem, you will not suffer a loss of performance if there are no other CPU-intensive tasks are running at the same time. Of course, when you're not using the software modem there is no degradation in performance at all.

Is the modem cost savings worth it? In many cases yes, especially if you don't use the modem much and/or are not running any other CPU intensive tasks when the modem is in use. The savings in modem cost could be used for a better CPU which would speed things up a little. But the on-board electronics of a hardware modem can do the job more efficiently than a general purpose CPU (except that it's not efficient at all when it's not in use). So if you use the modem a lot it's probably better to avoid all-software modems.

## 2.7 PCI Modems

A PCI modem card is one which inserts into a PCI-bus slot on the motherboard of a PC. While many PCI winmodems will not work under Linux (no driver available) other PCI modems will work under Linux. The Linux serial driver has been modified to support certain PCI hardware modem cards (but not winmodems/linmodems). If it's a linmodem, it will work only if you install a certain linmodem driver. If the Linux serial driver supports your hardware modem then the driver will set up the PnP configuration for you. See PCI Bus Support Underway. If no special support for your PCI hardware modem is in the Linux serial driver it may still work OK but you have to do some work to configure it.

## 2.8 AMR Modems

These are mainly used in laptops. They are all winmodems that insert into a special AMR (Audio Modem Riser) slot on the motherboard. Audio cards or combined audio-modem cards are sometimes used in this slot. The slot's main use is for HSF type modems where the CPU does almost all of the work. This results in a small "modem" card and thus a short AMR slot. The motherboard has a codec which takes digital output from the CPU and generates analog voltage waves at the ARM slot (and conversely). Thus the "modem" that plugs into the slot has little to do except to interface the telephone line with the codec. Linux supports at least one AMR modem. lspci -v should display it.

## 2.9 USB Modems

USB = Universal Serial Bus. Most USB modems are winmodems, so many will not work with Linux. Linux has support for modems that conform to the USB Communication Device Class Abstract Control Model (= USB CDC ACM). There's a module for ACM named acm.o. See the /usb/acm.txt document in the kernel documentation directory (/usr/share/doc/kernel-doc-2.6.x in Debian, perhaps /usr/doc/kernel... in some distributions). The ACM "serial port" for the first (0th) such modem is: /dev/usb/acm/0 or possibly /dev/usb/ttyACM0. This should be the case regardless of whether or not you use the new "device file system". It's not really a serial port, but the driver makes it look like a serial port to software which uses the modem.

Since the bandwidth on the USB is high it's possible to send a lot more that just data to a USB modem. This means that it's feasible to create a USB winmodem where the driver does most of the modem's work on the CPU and sends the results to the modem. So beware of USB winmodems (unless they have Linux support).

## 2.10 Which Internal Modems might not work with Linux

- Software-based Modems (winmodems, linmodems) Only about half have a Linux driver available.
- MWave and DSP Modems might work, but only if you first start Windows/Dos each time you power on your PC.
- Modems with Old Rockwell (RPI) Drivers work but with reduced performance.

### MWave and some DSP Modems

Note that there's now a Linux driver for the ACP (Mwave) modem used in IBM Thinkpads 600+. See the mini-HOWTO: ACP-Modem.

While hardware modems used use DSPs (Digital Signal Processors) some of these DSPs are programmed by a driver which must be downloaded from the hard disk to the DSPs memory just before using the modem. Unfortunately, such downloading is normally done by Dos/Windows programs (which doesn't work for Linux). But there has been substantial success in getting some of these modems to work with Linux. For example, there is a Linux driver available to run a Lucent (DSP) modem.

Ordinary modems that work fine with Linux (without needing a driver for the modem) often have a DSP too (and may mention this on the packaging), but the program that runs the DSP is stored inside the modem. These work fine under Linux. An example of a DSP modem that has problems working under Linux is the old IBM's Aptiva MWAVE.

One way to get some DSP modems to work with Linux is to boot from DOS (if you have it on your Linux PC). You first install the driver under DOS (using DOS and not Window drivers). Then start Dos/Windows and start the driver for the modem so as to program the DSP. Then without turning off the computer, start Linux.

One may write a "batch" file (actually a script) to do this. Here is an example but you must modify it to suit your situation.

> `

>     rem mwave is a batch file supplied by the modem maker
>     call c:\mww\dll\mwave start
>     rem loadlin.exe is a DOS program that will boot Linux from DOS (See
>     rem Config-HOWTO).
>     c:\linux\loadlin f:\vmlinuz root=/dev/hda3 ro

> `

One may create an icon for the Window's desktop which points to such a batch file and set the icon properties to "Run in MSDOS Mode". Then by clicking on this icon one sets up the modem and goes to Linux. Another possible way to boot Linux from DOS is to press CTRL-ALT-DEL and tell it to reboot (assuming that you have set things up so that you can boot directly into Linux). The modem remains on the same com port (same IO address) that it used under DOS.

The Newcom ifx modem needs a small kernel patch to work correctly since its simulation of a serial port is non-standard. The patch and other info for using this modem with Linux is at http://quinine.pharmacy.ohio-state.edu/~ejolson/linux/newcom.html.

### Old Rockwell (RPI) Drivers

Some older Rockwell chips need Rockwell RPI (Rockwell Protocol Interface) drivers for compression and error correction. They can still be used with Linux even though the driver software works only under MS Windows. This is because the MS Windows software (which you don't have) does only compression and error correction. If you are willing to operate the modem without compression and error correction then it's feasible to use it with Linux. To do this you will need to disable RPI by sending the modem (via the initialization string) a "RPI disable" command each time you power on your modem. On my old modem this command was +H0. Not having data compression available makes it slower to get webpages but is just as fast when downloading files that are already compressed.

Next Previous Contents