Linux > Linux and audio >
The PC speaker "beep" aka alerts / audio alerts.
Researched for naim on PCLinuxOS (version not recorded)
Testing if you can beep ∞
There is an "alert" escape code. You can use it like so:
echo -e "\a"
I recommend you begin by trying in a proper shell, and not a terminal from within X.
- Press
control-alt-f1
and log in at the console. - Then try the above command.
-
To get back, log out and then press
alt-f7
.
If you get no sound at the console, then begin troubleshooting the console before X.
If yo you do get sound at the console, then obviously you can skip console troubleshooting and go straight into troubleshooting X and any terminal(s) you use.
- Applications:
beep
is installed in some distributions, but not PCLinuxOS. =/- Various alerts and beeps are available in most programming languages, but I'd prefer a simple standalone application.
Instructions ∞
Walk through each of these items in turn.
Computer ∞
- Some computers have no PC speaker.
-
The PC speaker may be physically disconnected.
CMOS ∞
Some CMOS' have the PC speaker disabled.
Check yours. For most, they press delete on startup. Check your bootup messages to learn how you can do this.
Be careful, and don't change other settings if you don't know what you're doing.
kernel module ∞
Some people have the PC speaker compiled as a kernel module rather than having it compiled in. So it may not be loaded. Check if it exists as a module.
modprobe -l|grep $MODULE
Or for the cut-and-paste types..
MODULE=pcspkr # MODULE="usb-interface" # for testing with a module which I know exists # MODULE="xcbc" # for testing with a module which I know exists if [ "`modprobe -l|grep $MODULE`" ]; then echo "$MODULE is a kernel module." # I'm not sure how to test if a module is actually loaded. # modprobe -r $MODULE --dry-run 2> /dev/null; result=$? # if [ "$result" -ne 0 ]; then # echo "$MODULE is a kernel module, and it is not loaded" # else # # got a 0 # echo "$MODULE is a kernel module, and it is loaded" # fi else echo "$MODULE is not a kernel module" fi
Someone else's code has this to disable the beep. I'm not sure what it means. I cannot try it, because pcspkr is not a module for me.
(echo '#!/bin/sh'; echo 'modprobe -r pcspkr') > /etc/sysconfig/modules/pcspkr.modules chmod +x /etc/sysconfig/modules/pcspkr.modules
Another note says to disable the beep, check /etc/modprobe.d/blacklist
for "blacklist pcspkr" and then run rmmod pcspkr
.inputrc ∞
(.inputrc)
To disable it..
set bell-style visible
or
set bell-style none
... then log out and back in. But you'll have to add this to every account you want to disable it for. Adding it to /etc/inputrc
didn't work for me. I think because I'm using Red Hat Linux 5.2 (kernel 2.0.34) on here.
-
I added the line "set bell-style none" to the file
~/.inputrc
then logged out and back in and it worked right away. But you'll have to add
zsh ∞
(Zsh)
unsetopt beep
X ∞
(X)
xset b on
This doesn't work for me.
etc ∞
To disable it in all terminals, edit ~/.profile
or /etc/profile
with:
setterm -bfreq 0
Resources ∞
Last updated 2021-01-21 at 05:34:26
ported