Difference between revisions of "Disable PC speaker beep"

From ArchWiki
Jump to: navigation, search
(Introduction: Clarity rewrite)
m
(41 intermediate revisions by 17 users not shown)
Line 1: Line 1:
[[Category:Sound (English)]]
+
[[Category:Sound]]
[[Category:HOWTOs (English)]]
+
[[bg:Disable PC Speaker Beep]]
{{i18n|Disable PC Speaker Beep}}
+
[[cs:Disable PC Speaker Beep]]
 
+
[[es:Disable PC Speaker Beep]]
 +
[[ja:Disable PC Speaker Beep]]
 +
[[ko:Disable PC Speaker Beep]]
 +
[[ru:Disable PC Speaker Beep]]
 +
[[uk:Disable PC Speaker Beep]]
 +
[[zh-CN:Disable PC Speaker Beep]]
 
== Introduction ==
 
== Introduction ==
  
 
The computer often seems to make beep noises or other sounds at various times, whether we want them or not. They come from various sources, and as such, you may be able to configure if or when they occur.
 
The computer often seems to make beep noises or other sounds at various times, whether we want them or not. They come from various sources, and as such, you may be able to configure if or when they occur.
 +
 +
Further, the sounds from the computer can be heard from the built-in case speaker, or the speakers which are plugged into the sound card.  This article deals primarily with the former.
  
 
The sounds are caused by the BIOS (Basic Input/Output System), the OS (Operating System), the DE (Desktop Environment), or various software programs. The BIOS is a particularly troublesome problem because it is kept inside an EPROM chip on the motherboard, and the only direct control the user has is by turning the power on or off.  Unless the BIOS setup has a setting you can adjust or you wish to attempt to reprogram that chip with the proper light source, it is not likely you will be able to change it at all. BIOS-generated beep sounds are not addressed here, except to say that unplugging your computer case speaker will stop all such sounds from being heard.  (Do so at your own risk.)
 
The sounds are caused by the BIOS (Basic Input/Output System), the OS (Operating System), the DE (Desktop Environment), or various software programs. The BIOS is a particularly troublesome problem because it is kept inside an EPROM chip on the motherboard, and the only direct control the user has is by turning the power on or off.  Unless the BIOS setup has a setting you can adjust or you wish to attempt to reprogram that chip with the proper light source, it is not likely you will be able to change it at all. BIOS-generated beep sounds are not addressed here, except to say that unplugging your computer case speaker will stop all such sounds from being heard.  (Do so at your own risk.)
Line 13: Line 20:
 
One should also note that the option of turning off a particular instance of a sound, while leaving the others operational, is possible if one can identify which portion of the environment is the source of the particular sound generation. This can make a very customized selection of attention-getting sounds possible. Please feel free to add your findings to this wiki page when you find particular examples of settings combinations which may be useful for other users.
 
One should also note that the option of turning off a particular instance of a sound, while leaving the others operational, is possible if one can identify which portion of the environment is the source of the particular sound generation. This can make a very customized selection of attention-getting sounds possible. Please feel free to add your findings to this wiki page when you find particular examples of settings combinations which may be useful for other users.
  
== Globally ==
+
==Globally==
 +
The PC speaker can be disabled by [[Kernel modules#Removal|unloading]] the {{ic|pcspkr}} module:
 +
# rmmod pcspkr
  
You can completely disable the PC speaker module at startup by adding {{Codeline|!pcspkr}} to the [[rc.conf#Hardware|{{Codeline|MODULES}} array]] in {{Filename|/etc/rc.conf}}:
+
[[Kernel modules#Blacklisting|Blacklisting]] the {{ic|pcspkr}} module will prevent [[udev]] from loading it at boot:
MODULES=( ... !pcspkr ... )
+
  
If {{Codeline|<nowiki>lsmod | grep snd-pcsp</nowiki>}} returns something, also add {{Codeline|!snd-pcsp}}:
+
# echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf
MODULES=( ... !snd-pcsp ... )
+
 
+
In [http://bbs.archlinux.org/viewtopic.php?pid=557665#p557665 this] forum thread, it's recommended to add both.
+
  
 
== Locally ==
 
== Locally ==
Line 29: Line 34:
 
  $ xset -b
 
  $ xset -b
  
You can add this command to a startup file such as [[xprofile]] to make it permanent.
+
You can add this command to a startup file, such as [[xprofile]] to make it permanent.
  
 
=== In console ===
 
=== In console ===
  
You can add this command in {{Filename|/etc/profile}} or a dedicated file like {{Filename|/etc/profile.d/disable-beep.sh}} (must be executable):
+
You can add this command in {{ic|/etc/profile}} or a dedicated file like {{ic|/etc/profile.d/disable-beep.sh}} (must be executable):
 
  setterm -blength 0
 
  setterm -blength 0
  
Another way is to add or uncomment this line in {{Filename|/etc/inputrc}} or {{Filename|~/.inputrc}}:
+
Another way is to add or uncomment this line in {{ic|/etc/inputrc}} or {{ic|~/.inputrc}}:
 
  set bell-style none
 
  set bell-style none
  
 
=== Using ALSA ===
 
=== Using ALSA ===
 
+
{{Tip|For most Intel's cards, if you do not see PC Speaker in alsamixer's default device, then try selecting "HDA Intel PCH" device by pressing F6. It is listed as "Beep" there. This is because PulseAudio proxy controls may not list all PC Speakers.}}
 
Try muting the PC Speaker:
 
Try muting the PC Speaker:
 
  $ amixer set 'PC Speaker' 0% mute
 
  $ amixer set 'PC Speaker' 0% mute
Line 46: Line 51:
 
For certain sound cards, it is the PC Beep:
 
For certain sound cards, it is the PC Beep:
 
  $ amixer set 'PC Beep' 0% mute
 
  $ amixer set 'PC Beep' 0% mute
 +
 +
Or merely Beep:
 +
$ amixer set 'Beep' 0% mute
  
 
You can also use alsamixer for a console GUI
 
You can also use alsamixer for a console GUI
Line 53: Line 61:
 
  # alsactl store
 
  # alsactl store
  
In order for this method to work, {{Codeline|alsa}} must be in your [[rc.conf#Daemons|{{Codeline|DAEMONS}} array]] in {{Filename|/etc/rc.conf}}. Not every card has PC Speaker / PC Beep slider in alsamixer.
+
{{Note|Not every sound card creates a PC Speaker or PC Beep slider control in alsamixer.}}
 +
 
 +
=== In GNOME/Metacity ===
 +
 
 +
In Gconf set '''{{ic|/apps/metacity/general/audible_bell}}'''  to  '''{{ic|false}}:'''
 +
$ gconftool-2 -s -t string /apps/metacity/general/audible_bell false
 +
 
 +
=== GTK+ ===
  
== Resources ==
+
Append this line to your .gtkrc-2.0 and to the [Settings] section of $XDG_CONFIG_HOME/gtk-3.0/settings.ini:
 +
gtk-error-bell = 0
  
Have a look at these {{Codeline|man}} pages for further information: {{Codeline|xset(1)}}, {{Codeline|setterm(1)}}, {{Codeline|readline(3)}}.
+
==See also==
 +
* Have a look at these {{ic|man}} pages for further information: {{ic|xset(1)}}, {{ic|setterm(1)}}, {{ic|readline(3)}}.
 +
* [[Kernel modules]]

Revision as of 01:17, 5 February 2013

Introduction

The computer often seems to make beep noises or other sounds at various times, whether we want them or not. They come from various sources, and as such, you may be able to configure if or when they occur.

Further, the sounds from the computer can be heard from the built-in case speaker, or the speakers which are plugged into the sound card. This article deals primarily with the former.

The sounds are caused by the BIOS (Basic Input/Output System), the OS (Operating System), the DE (Desktop Environment), or various software programs. The BIOS is a particularly troublesome problem because it is kept inside an EPROM chip on the motherboard, and the only direct control the user has is by turning the power on or off. Unless the BIOS setup has a setting you can adjust or you wish to attempt to reprogram that chip with the proper light source, it is not likely you will be able to change it at all. BIOS-generated beep sounds are not addressed here, except to say that unplugging your computer case speaker will stop all such sounds from being heard. (Do so at your own risk.)

However, everything else which can cause a sound to come out of the computer case speaker can be handled with the suggestions listed below.

One should also note that the option of turning off a particular instance of a sound, while leaving the others operational, is possible if one can identify which portion of the environment is the source of the particular sound generation. This can make a very customized selection of attention-getting sounds possible. Please feel free to add your findings to this wiki page when you find particular examples of settings combinations which may be useful for other users.

Globally

The PC speaker can be disabled by unloading the pcspkr module:

# rmmod pcspkr

Blacklisting the pcspkr module will prevent udev from loading it at boot:

# echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf

Locally

In X

$ xset -b

You can add this command to a startup file, such as xprofile to make it permanent.

In console

You can add this command in /etc/profile or a dedicated file like /etc/profile.d/disable-beep.sh (must be executable):

setterm -blength 0

Another way is to add or uncomment this line in /etc/inputrc or ~/.inputrc:

set bell-style none

Using ALSA

Tip: For most Intel's cards, if you do not see PC Speaker in alsamixer's default device, then try selecting "HDA Intel PCH" device by pressing F6. It is listed as "Beep" there. This is because PulseAudio proxy controls may not list all PC Speakers.

Try muting the PC Speaker:

$ amixer set 'PC Speaker' 0% mute

For certain sound cards, it is the PC Beep:

$ amixer set 'PC Beep' 0% mute

Or merely Beep:

$ amixer set 'Beep' 0% mute

You can also use alsamixer for a console GUI

$ alsamixer

Scroll to PC beep and press 'M' to mute. Save your alsa settings:

# alsactl store
Note: Not every sound card creates a PC Speaker or PC Beep slider control in alsamixer.

In GNOME/Metacity

In Gconf set /apps/metacity/general/audible_bell  to  false:

$ gconftool-2 -s -t string /apps/metacity/general/audible_bell false

GTK+

Append this line to your .gtkrc-2.0 and to the [Settings] section of $XDG_CONFIG_HOME/gtk-3.0/settings.ini:

gtk-error-bell = 0

See also

  • Have a look at these man pages for further information: xset(1), setterm(1), readline(3).
  • Kernel modules