Disable PC Speaker
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 or headphones which are plugged into the sound card (in which case the noise may be unexpectedly loud). 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.
The PC speaker can be disabled by unloading the
# rmmod pcspkr
# echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf
Blacklisting it on the kernel command line is yet another way. Simply add
modprobe.blacklist=pcspkr to your bootloader's kernel line.
$ xset -b
You can add this command to a startup file, such as xprofile to make it permanent.
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
set bell-style none
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
Scroll to PC beep and press 'M' to mute. Save your alsa settings:
# alsactl store
$ gsettings set org.gnome.desktop.wm.preferences audible-bell false
Cinnamon seems to play a "water drop" sound. To disable it, set in dconf:
$ dconf write /org/cinnamon/desktop/wm/preferences/audible-bell false
Append this line to
gtk-error-bell = 0
Add the same line to the [Settings] section of
[Settings] gtk-error-bell = 0
This is documented in the Gnome Developer Handbook.
Beep is an advanced PC speaker beeping program. It is useful for situations where no sound card and/or speakers are available, and simple audio notification is desired.
Install the package.
Access for non-root users
beep will fail if not run by the root. Other users may call it using sudo. To let group
sudo beep without a password (for example to use it in scripts),
/etc/sudoers should be edited:
%users ALL=(ALL) NOPASSWD: /usr/bin/beep
or, to let only a single user do that:
username ALL=(ALL) NOPASSWD: /usr/bin/beep
Another way is setting the sticky bit on
# chmod 4755 /usr/bin/beep
Note however that this way anyone can execute
/usr/bin/beep with root permissions. The change also creates a difference between local copy and the package, which will be reported by
Unmuting in alsamixer
You should also unmute the Beep channel using
You may need to press
F6 and select your card. scroll to the Beep channel using the arrow keys and press
M to unmute the channel. notice that the "MM" label below the channel will change to "00". you can also use
↑ to increase the volume of the channel.
Esc to close alsamixer.
You can also save your settings to ALSA Mixer to make it permanent:
# alsactl -f /var/lib/alsa/asound.state store
Tips and Tricks
While many people are happy with the traditional beep sound, some may like to change its properties a bit. The following example plays slighly higher and shorter sound and repeats it two times.
# beep -f 5000 -l 50 -r 2