Disable/change audio bell

The audio bell is painfully loud when I use my headphones on my laptop. I successfully disabled it in the terminal using [cmd=]kbdcontrol -b 0.0[/cmd]. For Xorg I tried [cmd=]xset -b[/cmd], however it disables it only in some cases, like pressing backspace on an empty line in xterm. In other cases, like when there is no match when I do a "find" in Firefox, it still painfully beeps.

If I understand correctly, this beep is handled at a lower level, and bypasses the audio driver. The mixer settings have no effect on its volume. I do not know what system interface it uses exactly, however. If I knew, I could recompile the relevant parts.

Q: How can I globally (in the order of preference):

  1. customize the beep with an arbitrary PCM audio?
  2. get it affected by the mixer volume?
  3. turn it off?

Any help is welcome!

P.S. This is my day 3 using FreeBSD, and this is the first UNIX-like system I own.
 
You can disable bell if you set MIB hw.syscons.bell value to 0. Just type # sysctl hw.syscons.bell=0

To save changes permanently after reboot your machine # echo "hw.syscons.bell=0" >> /etc/sysctl.conf
 
The proposed solution stopped working in FreeBSD 11.0. Now I managed to disable it through # sysctl kern.vt.enable_bell=0, or to make it permanent: # echo "kern.vt.enable_bell=0" >> /etc/sysctl.conf.

If there is a "more correct" way of doing it, you are welcome to share.
 
The proposed solution stopped working in FreeBSD 11.0. Now I managed to disable it through # sysctl kern.vt.enable_bell=0, or to make it permanent: # echo "kern.vt.enable_bell=0" >> /etc/sysctl.conf.

If there is a "more correct" way of doing it, you are welcome to share.

According to the vt(4) man page you can add
Code:
kern.vt.enable_bell=0
in loader.conf(5) or sysctl.conf(5).
 
  • Thanks
Reactions: hph
Back
Top