Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
PC speaker
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Internal loudspeaker built into some (older) IBM PC-compatible computers}} {{Distinguish|Computer speakers}} {{Use dmy dates|date=January 2016}} {{Infobox Computer Hardware Generic | name = PC speaker | image =File:PC-Speaker IMG 8161 (cropped).JPG | caption =Dynamic speaker with 4-pin connector | invent-date = 1981 | invent-name = [[IBM]] | conn1 = Motherboard | via1_1 = | via1_2 = | conn2 = | via2_1 = | via2_2 = | via2_3 = | via2_4 = | class-name = Use | class1 = [[loudspeaker]] built into most [[IBM PC compatible]] computers | manuf1 = several }} A '''PC speaker''' is a [[loudspeaker]] built into some [[IBM PC compatible]] computers. The first [[IBM Personal Computer]], model [[IBM Personal Computer#Models|5150]], employed a standard 2.25 inch magnetic driven (dynamic) speaker.<ref>{{Cite book |url=https://minuszerodegrees.net/manuals/IBM_5150_Technical_Reference_6322507_APR84.pdf |title=IBM 5150 Technical Reference |publisher=IBM |year=1984 |pages=1–25}}</ref> More recent computers use a tiny [[Moving iron speaker|moving-iron]] or [[Piezoelectric loudspeaker|piezo]] speaker instead.<ref>{{cite book |last=Rosenthal |first=Morris |title=Computer Repair with Diagnostic Flowcharts |edition=Revised |publisher=Foner Books |date=August 2008 |page=9 |url=http://www.fonerbooks.com/pcrepair.htm |isbn=978-0-9723801-7-1}}</ref> 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 [[Intel 8254|8254]] chip.<ref name="pit">{{Cite web |title=Bran's Kernel Development Tutorial: The Programmable Interval Timer |url=http://www.osdever.net/bkerndev/Docs/pit.htm |access-date=2023-01-23 |website=www.osdever.net}}</ref> == Use cases == === BIOS/UEFI error codes === {{See also|Power-on self-test#Progress and error reporting}} The PC speaker is used during the [[power-on self-test]] (POST) sequence to indicate errors during the [[booting|boot process]]. Since it is active before the [[video card|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 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]] (PCM) sound through the PC speaker using special ''Pulse-width Modulation'' techniques explained later in this article. ==== Games ==== {{listen |type = music |filename = Paratrooper (video game intro music).ogg |title = "Paratrooper intro" |description = A fragment of [[Johann Sebastian Bach|J.S. Bach]]'s [[Toccata and Fugue in D minor, BWV 565|BWV 565]] played through PC speaker as intro to the video game ''[[Paratrooper (video game)|Paratrooper]]'' (1982)}} The PC speaker was often used in very innovative ways to create the impression of [[polyphony|polyphonic]] music or sound effects within computer games of its era, such as the [[LucasArts]] series of adventure games from the mid-1980s, using swift [[arpeggio]]s. {{Citation needed|date=May 2009}} Several games such as ''[[Space Hulk (1993 video game)|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]], [[FastTracker 2|Fast Tracker]], [[Impulse Tracker]], and even [[device driver]]s for [[Linux]]<ref>{{cite web|last=Sergeev |first=Stas |title=PC-Speaker PCM driver for Linux |url=http://geocities.com/stssppnn/pcsp.html |access-date=2009-02-15 |archive-url=https://web.archive.org/web/20091026062530/http://geocities.com/stssppnn/pcsp.html |archive-date=26 October 2009 |url-status=unfit }}</ref> and [[Microsoft Windows]], 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]] 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]] for [[Microsoft DOS]] named "Techno" appeared, playing a melody through the PC speaker while printing the word "TECHNO" on the screen until filled.<ref>{{cite web |last1=Nastasi |first1=Alison |title=The World's Worst Computer Viruses Illustrated |url=https://www.flavorwire.com/468318/the-worlds-worst-computer-viruses-illustrated |website=Flavorwire |access-date=11 September 2021 |language=en |date=2014-07-19}}</ref> ==Pinouts== [[File:JPANEL MB IMG 1121.JPG|thumb|4-pin speaker connector (marked SPK) on motherboard]] [[File:PC-Speaker IMG 9311-9312.JPG|thumb| Tiny [[Moving iron speaker|moving-iron]] 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 [[Gender of connectors and fasteners|female connector]] of the speaker connects to [[pin header]]s on the motherboard, which are sometimes labeled {{Smallcaps|SPEAKER}} or {{Smallcaps|SPKR}}. {| class="wikitable" style="text-align:center" |+ 4-pin, 3-wire PC speaker pinout<ref>{{Cite book |last=Ögren |first=Joakim |url=http://www.accum.se/~stric/tmp/hwb13pdf/hwbook.pdf#page=290 |title=The Hardware Book |year=1997 |pages=290}}</ref><ref>{{Cite book |url=http://www.lamals.cz/ceniky/datasheety/motherboard/asus/p5kpl_am_se_manual.pdf#page=22 |title=ASUS P5KPL-AM SE Motherboard manual |publisher=ASUSTek Computer Inc. |year=2008 |page=1-13 |access-date=27 February 2017 |archive-url=https://web.archive.org/web/20171013012706/http://www.lamals.cz/ceniky/datasheety/motherboard/asus/p5kpl_am_se_manual.pdf#page=22 |archive-date=13 October 2017 |url-status=dead}}</ref> ! Pin Number ! Pin Name ! Pin Function |- | 1 | -SP | Speaker negative |- | 2 | GND or KEY | Ground, or unwired key |- | 3 | GND | [[Ground (electricity)|Ground]] |- | 4 | +SP5V | Speaker positive +5V DC |} ==Pulse-width modulation== The PC speaker is normally meant to reproduce a [[Square wave (waveform)|square wave]] 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]]) 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 (signal processing)|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]]. This technique is called [[pulse-width modulation]] (PWM) and allows approximate playback of [[pulse-code modulation|PCM audio]]. (A more refined version of this technique is used in [[Class-D amplifier|class D]] [[audio amplifier]]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 electricity transmission|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 ([[Transistor–transistor logic|TTL]]) level (unipolar). The quality depends on a trade-off between the PWM [[carrier frequency]] (effective [[sample rate]]) and the number of output levels (effective [[Audio bit depth|bit depth]]). The clock rate of the PC's [[programmable interval timer]] which drives the speaker is fixed at 1,193,180 Hz,<ref name="pit" /> and the product of the audio sample rate times the maximum DAC value must equal this. Typically, a 6-bit DAC<ref>{{Cite web |last=Leonard |first=Jim |date=2022 |title=IBM PC Sound Ramblings - The Best Sound You've Never Heard |url=http://www.oldskool.org/sound/pc/#digitized |access-date=2022-08-31 |website=The Oldskool PC}}</ref> with a maximum value of 63 is used at a sample rate of 18,939.4 Hz, producing poor but recognizable audio.<ref>{{cite web |author=Schlunder |first=Edward |date=2006-11-18 |title=Resistor/Pulse Width Modulation DAC |url=http://www.k9spud.com/digital-to-analog-converters/resistor-pwm |archive-url=https://web.archive.org/web/20170317074148/http://www.k9spud.com/digital-to-analog-converters/resistor-pwm |archive-date=2017-03-17 |website=K9spud Microcontroller Electronics}}</ref> 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|moving-iron]] speaker (often confused with [[Piezoelectric loudspeaker|piezoelectric]]). 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]]s. ==See also== * [[Intel 8253]] * [[RealSound]] * [[Loudspeaker enclosure]] ==Notes== {{reflist}} ==External links== *[http://smacky.sourceforge.net/ Smacky] Open-source C++ software for playing (monophonic) music on the PC speaker. *[http://spkcorner.tripod.com/ Site for old PC without sound cards]. *[https://web.archive.org/web/20151208061729/https://courses.engr.illinois.edu/ece390/resources/sound/speaker.txt.html Programming the PC Speaker], by Mark Feldman for ''PC-GPE''. *Programming the PC Speaker, by Phil Inch: [https://web.archive.org/web/20140307023908/http://fly.srk.fer.hr/GDM/articles/sndmus/speaker1.html part 1], [https://web.archive.org/web/20140307043446/http://fly.srk.fer.hr/GDM/articles/sndmus/speaker2.html part 2] (includes a very detailed explanation of how to play back PCM audio on the PC speaker, and why it works) *[http://robbi-985.homeip.net:8000/hosted_programs/update/bmm/index.html Bleeper Music Maker] A freeware to use the PC speaker to make music (superseded by [http://robbi-985.homeip.net:8000/hosted_programs/update/bawami/ BaWaMI]) *[http://www.frank-buss.de/beep/index.html Beep for Linux and Windows], by Frank Buß. APIs for beeping. *[http://www.johnath.com/beep/ Commandline PC speaker program for Linux][https://web.archive.org/web/20030820082835/http://ftp.falsehope.com/pub/beep/ FTP] *[https://web.archive.org/web/20040820223947/http://linuxgazette.net/issue69/mathew.html Practical article on implementing a Linux Kernel Driver] * [http://www.phatcode.net/articles.php?id=246 Timing on the PC family under DOS] (Sections 7.5, 7.29, 7.30, and 10.7 – 10.7.4 in particular) {{PC sound standards}} {{DEFAULTSORT:Pc Speaker}} [[Category:Legacy hardware]] [[Category:Loudspeakers]] [[Category:Computer-related introductions in 1981]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Distinguish
(
edit
)
Template:Infobox Computer Hardware Generic
(
edit
)
Template:Listen
(
edit
)
Template:PC sound standards
(
edit
)
Template:Reflist
(
edit
)
Template:See also
(
edit
)
Template:Short description
(
edit
)
Template:Smallcaps
(
edit
)
Template:Use dmy dates
(
edit
)