HOME

TheInfoList



OR:

A PC speaker is a
loudspeaker A loudspeaker (commonly referred to as a speaker or, more fully, a speaker system) is a combination of one or more speaker drivers, an enclosure, and electrical connections (possibly including a crossover network). The speaker driver is an ...
built into some
IBM PC compatible An IBM PC compatible is any personal computer that is hardware- and software-compatible with the IBM Personal Computer (IBM PC) and its subsequent models. Like the original IBM PC, an IBM PC–compatible computer uses an x86-based central p ...
computers. The first
IBM Personal Computer The IBM Personal Computer (model 5150, commonly known as the IBM PC) is the first microcomputer released in the IBM PC model line and the basis for the IBM PC compatible ''de facto'' standard. Released on August 12, 1981, it was created by a ...
, model 5150, employed a standard 2.25 inch magnetic driven (dynamic) speaker. More recent computers use a tiny moving-iron or piezo speaker instead. The speaker allows software and
firmware In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, h ...
to provide auditory
feedback Feedback occurs when outputs of a system are routed back as inputs as part of a chain of cause and effect that forms a circuit or loop. The system can then be said to ''feed back'' into itself. The notion of cause-and-effect has to be handle ...
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.


Use cases


BIOS/UEFI error codes

The PC speaker is used during the power-on self-test (POST) sequence to indicate errors during the boot process. Since it is active before the
graphics card A graphics card (also called a video card, display card, graphics accelerator, graphics adapter, VGA card/VGA, video adapter, display adapter, or colloquially GPU) is a computer expansion card that generates a feed of graphics output to a displa ...
, 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 possible with just ROM and the CPU registers. Usually, different error codes will be signalled by specific beeping patterns, such as e.g. "one beep; pause; three beeps; pause; repeat". These patterns are specific to the BIOS/UEFI manufacturer and are usually documented in the technical manual of the motherboard.


Software

Several programs, including music software, operating systems or games, could play
pulse-code modulation Pulse-code modulation (PCM) is a method used to digitally represent analog signals. It is the standard form of digital audio in computers, compact discs, digital telephony and other digital audio applications. In a PCM stream, the amplitud ...
(PCM) sound through the PC speaker using special ''Pulse-width Modulation'' techniques explained later in this article.


Games

The PC speaker was often used in very innovative ways to create the impression of
polyphonic Polyphony ( ) is a type of musical texture consisting of two or more simultaneous lines of independent melody, as opposed to a musical texture with just one voice ( monophony) or a texture with one dominant melodic voice accompanied by chords ...
music or sound effects within computer games of its era, such as the
LucasArts Lucasfilm Games (known as LucasArts between 1990 and 2021) is an American video game brand licensing, licensor, former video game developer and video game publisher, publisher, and a subsidiary of Lucasfilm. It was founded in May 1982 by George ...
series of adventure games from the mid-1980s, using swift
arpeggio An arpeggio () is a type of Chord (music), chord in which the Musical note, notes that compose a chord are individually sounded in a progressive rising or descending order. Arpeggios on keyboard instruments may be called rolled chords. Arpe ...
s. Several games such as '' Space Hulk'' and '' Pinball Fantasies'' were noted for their elaborate sound effects; ''Space Hulk'', in particular, even had full speech. However, because the method used to reproduce PCM was very sensitive to timing issues, these effects either caused noticeable sluggishness on slower PCs or sometimes failed on faster PCs (that is, significantly faster than the program was originally developed for). Also, it was difficult for programs to do much else, even update the display, during the playing of such sounds. Thus, when sound cards (which can output complex sounds independent from the CPU once initiated) became mainstream in the PC market after 1990, they quickly replaced the PC speaker as the preferred output device for sound effects. Most newly-released PC games stopped supporting the speaker during the second half of the 1990s.


Other programs

Several programs, including MP (Module Player, 1989), Scream Tracker, Fast Tracker, Impulse Tracker, and even
device driver In the context of an operating system, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton. A driver provides a software interface to hardware devices, enabli ...
s for
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
and
Microsoft Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
, could play PCM sound through the PC speaker. 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 Skype () was a proprietary telecommunications application operated by Skype Technologies, a division of Microsoft, best known for IP-based videotelephony, videoconferencing and voice calls. It also had instant messaging, file transfer, ...
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, the amplifier is turned off or headphones are plugged in). In the 1990s, a
computer virus A computer virus is a type of malware that, when executed, replicates itself by modifying other computer programs and Code injection, inserting its own Computer language, code into those programs. If this replication succeeds, the affected areas ...
for Microsoft DOS named "Techno" appeared, playing a melody through the PC speaker while printing the word "TECHNO" on the screen until filled.


Pinouts

In some applications, the PC speaker is affixed directly to the computer's
motherboard A motherboard, also called a mainboard, a system board, a logic board, and informally a mobo (see #Nomenclature, "Nomenclature" section), is the main printed circuit board (PCB) in general-purpose computers and other expandable systems. It ho ...
; 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 or .


Pulse-width modulation

The PC speaker is normally meant to reproduce a
square wave Square wave may refer to: *Square wave (waveform) A square wave is a non-sinusoidal waveform, non-sinusoidal periodic waveform in which the amplitude alternates at a steady frequency between fixed minimum and maximum values, with the same ...
via only 2 levels of output (two voltage levels, typically 0 V and 5 V), driven by channel 2 of the Intel 8253 (PC, XT) or 8254 (AT and later) Programmable Interval Timer operating in mode three (square wave signal). The speaker hardware itself is directly accessible via PC I/O port 61H (61
hexadecimal Hexadecimal (also known as base-16 or simply hex) is a Numeral system#Positional systems in detail, positional numeral system that represents numbers using a radix (base) of sixteen. Unlike the decimal system representing numbers using ten symbo ...
) via bit 1 and can be physically manipulated for 2 levels of output (i.e. 1- bit sound). 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.), it is possible to drive the speaker to various intermediate output levels, functioning as a crude
digital-to-analog converter In electronics, a digital-to-analog converter (DAC, D/A, D2A, or D-to-A) is a system that converts a digital signal into an analog signal. An analog-to-digital converter (ADC) performs the reverse function. DACs are commonly used in musi ...
. 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 amplifier An audio power amplifier (or power amp) electronic amplifier, amplifies low-power electronic audio signals, such as the signal from a radio receiver or an electric guitar pickup (music technology), pickup, to a level that is high enough for dr ...
s.) With the PC speaker this method achieves limited quality playback, but a commercial solution named RealSound used it to provide improved sound on several games. Obtaining a high fidelity sound output using this technique requires a switching frequency much higher than the audio frequencies meant to be reproduced (typically with a ratio of 10:1 or more), and the output voltage to be bipolar, in order to make better use of the output devices' dynamic range and power. On the PC speaker, however, the output voltage is either zero or at a Transistor-Transistor Logic ( TTL) level (unipolar). The quality depends on a trade-off between the PWM
carrier frequency In telecommunications, a carrier wave, carrier signal, or just carrier, is a periodic waveform (usually sinusoidal) that conveys information through a process called ''modulation''. One or more of the wave's properties, such as amplitude or fre ...
(effective
sample rate In signal processing, sampling is the reduction of a continuous-time signal to a discrete-time signal. A common example is the conversion of a sound wave to a sequence of "samples". A sample is a value of the signal at a point in time and/or ...
) and the number of output levels (effective bit depth). The clock rate of the PC's programmable interval timer which drives the speaker is fixed at 1,193,180 Hz, and the product of the audio sample rate times the maximum DAC value must equal this. Typically, a 6-bit DAC with a maximum value of 63 is used at a sample rate of 18,939.4 Hz, producing poor but recognizable audio. The audio fidelity of this technique is further decreased by the lack of a properly sized dynamic loudspeaker, specially in modern machines and particularly laptops that use a tiny moving-iron speaker (often confused with
piezoelectric Piezoelectricity (, ) is the electric charge that accumulates in certain solid materials—such as crystals, certain ceramics, and biological matter such as bone, DNA, and various proteins—in response to applied stress (mechanics), mechanical s ...
). The reason for this is that PWM-produced audio requires a low-pass filter before the final output in order to suppress switching noise and high harmonics. A normal dynamic loudspeaker does this naturally, but the tiny metal diaphragm of the moving-iron speaker will let much switching noise pass, as will many direct couplings (though there are exceptions to this, e.g. filtered "speaker in" ports on some motherboards and sound cards). This use of the PC speaker for complex audio output became less common with the introduction of Sound Blaster and other
sound card A sound card (also known as an audio card) is an internal expansion card that provides input and output of audio signals to and from a computer under the control of computer programs. The term ''sound card'' is also applied to external audio ...
s.


See also

* Intel 8253 * RealSound *
Loudspeaker enclosure A loudspeaker enclosure or loudspeaker cabinet is an enclosure (often rectangular box-shaped) in which speaker drivers (e.g., woofers and tweeters) and associated electronic hardware, such as crossover circuits and, in some cases, power am ...


Notes


External links


Smacky
Open-source C++ software for playing (monophonic) music on the PC speaker.
Site for old PC without sound cards


by Mark Feldman for ''PC-GPE''. *Programming the PC Speaker, by Phil Inch

(includes a very detailed explanation of how to play back PCM audio on the PC speaker, and why it works)

A freeware to use the PC speaker to make music (superseded b
BaWaMI


by Frank Buß. APIs for beeping.
Commandline PC speaker program for Linux
https://web.archive.org/web/20030820082835/http://ftp.falsehope.com/pub/beep/ FTP]
Practical article on implementing a Linux Kernel Driver

Timing on the PC family under DOS
(Sections 7.5, 7.29, 7.30, and 10.7 – 10.7.4 in particular) {{DEFAULTSORT:Pc Speaker Legacy hardware Loudspeakers Computer-related introductions in 1981