PC speaker

PC speaker
Dynamic speaker with 4-pin connector
Date invented 1981
Invented by IBM
Connects to Motherboard
Use loudspeaker built into most IBM PC compatible computers
Common manufacturers several

A PC speaker is a loudspeaker built into most IBM PC compatible computers. The first IBM Personal Computer, model 5150, employed a standard 2.25 inch magnetic driven (dynamic) speaker.[1] More recent computers use a piezoelectric speaker instead.[2] The speaker allows software and firmware to provide auditory feedback to a user, such as to report a hardware fault. A PC speaker generates waveforms using the programmable interval timer, an Intel 8253 or 8254 chip.[3]

Usage

BIOS error codes

The PC speaker is used during power-on self-test (POST) sequence to indicate errors during the boot process. Since it is active before the graphics card, it can be used to communicate "beep codes" related to problems that prevent the much more complex initialization of the graphics card to take place. For example, the Video BIOS usually cannot activate a graphics card unless working RAM is present in the system, while beeping the speaker is doable with just ROM and the CPU registers. Usually, different error codes will be signaled by specific beeping patterns, such as e.g. "one beep; pause; three beeps; pause; repeat". These patterns are specific to the BIOS manufacturer and are usually documented in the technical manual of the motherboard.

Games

The PC speaker was often used in very innovative ways to create the impression of polyphonic music or sound effects within computer games of its era, such as the LucasArts series of adventure games from the mid-1990s, using swift arpeggios. Several games such as Space Hulk and Pinball Fantasies were noted for their elaborate sound effects; Space Hulk, in particular, even had full speech.

Other programs

Several programs, including MP (Module Player, 1989), ScreamTracker, Fast Tracker, Impulse Tracker, and even device drivers for Linux[4] and Microsoft Windows, could play pulse-code modulation (PCM) sound through the PC speaker using special techniques explained later in this article.

Modern Microsoft Windows systems have PC speaker support as a separate device with special capabilities – that is, it cannot be configured as a normal audio output device. Some software uses this special sound channel to produce sounds. For example, Skype can use it as a reserve calling signal device for the case where the primary audio output device cannot be heard (for example because the volume is set to the minimum level or the amplifier is turned off).

Pinouts

4-pin speaker connector (marked SPK) on motherboard
Piezoelectric PC speaker uses 4-pin 2-wire connection

In some applications, the PC speaker is affixed directly to the computer's motherboard; in others, including the first IBM Personal Computer, the speaker is attached by wire to a connector on the motherboard. Some PC cases come with a PC speaker preinstalled. A wired PC speaker connector may have a two-, three-, or four-pin configuration, and either two or three wires. The female connector of the speaker connects to pin headers on the motherboard, which are sometimes labeled SPEAKER or SPKR.

4-pin, 3-wire PC speaker pinout[5][6]
Pin Number Pin Name Pin Function
1 -SP Speaker negative
2 GND or KEY Ground, or unwired key
3 GND Ground
4 +SP5V Speaker positive +5V DC

Pulse-width modulation

The PC speaker is normally meant to reproduce a square wave via only 2 levels of output (the speaker is driven by only two voltage levels, typically 0 V and 5 V). However, by carefully timing a short pulse (i.e. going from one output level to the other and then back to the first), and by relying on the speaker's physical filtering properties (limited frequency response, self-inductance, etc.), the end result corresponds to intermediate sound levels, functioning as a crude digital-to-analog converter. This technique is called pulse-width modulation (PWM) and allows approximate playback of PCM audio. (A more refined version of this technique is used in class D audio amplifiers.)

With the PC speaker, this method achieves limited quality playback; the quality depends on a trade-off between the PWM carrier frequency (effective sample rate) and the number of output levels (effective bitrate). The clock rate of the PC's programmable interval timer which drives the speaker is fixed at 1,193,182 Hz,[3] and the product of the audio sample rate times the maximum DAC value must equal this. Typically, a 6-bit DAC[7] with a maximum value of 63 is used at a sample rate of 18,939.4 Hz, producing poor but recognizable audio.[8]

This use of the PC speaker for complex audio output became less common with the introduction of the Sound Blaster and other sound cards.

See also

Notes

  1. "Specifications of the IBM 5150 PC" (PDF). Archived from the original on 22 February 2012. Retrieved 2011-02-04.
  2. Rosenthal, Morris (August 2008). Computer Repair with Diagnostic Flowcharts (Revised ed.). Foner Books. p. 9. ISBN 978-0-9723801-7-1.
  3. 1 2 "The PIT: A System Clock". Osdever.net. Retrieved 2011-02-04.
  4. Sergeev, Stas. "PC-Speaker PCM driver for Linux". Archived from the original on 26 October 2009. Retrieved 2009-02-15.
  5. Ögren, Joakim. "The Hardware Book" (PDF).
  6. ASUS P5KPL-AM SE Motherboard manual (PDF).
  7. http://www.oldskool.org/sound/pc/#digitized
  8. Edward Schlunder (2006-11-18). "Resistor/Pulse Width Modulation DAC". Archived from the original on 2017-03-17.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.