Enable system beep in Ubuntu

35

19

I have tried to get the system beep working, but with no success. I used echo -e '\a' and the beep application.

I have tried entering modprobe pcspkr at the command line, and made sure pcspkr is not listed on the modprobe blacklist. I also enabled

  • from the Gnome Desktop: System → Sound → System Beep → Enable audible beep,
  • from a Terminal window: Edit → General → Terminal bell.

This did not fix the issue, though.

My computer is an IBM Thinkpad, iSeries laptop. I know my hardware speaker works, because if on startup the battery is low, it will beep.

Melissa W

Posted 2009-08-14T05:01:56.400

Reputation:

See http://askubuntu.com/q/19906/367990

– Byte Commander – 2017-01-06T18:17:56.103

Answers

12

This might be a possible solution

What happens sometimes is the pcspkr might be added to blacklist, to remove it from the blacklist

Edit /etc/modprobe.d/blacklist and remove these lines if they exist : (NOTE: You need to edit /etc/modprobe.d/blacklist.conf instead)

# get rid of system beep

blacklist pcspkr

Reboot to deactivate this line.To disable the speaker (that emits the beep), add these lines and reboot.

This might solve your problem. Can provide more information if we know the system details.

If that doesn't solve your problem try running sudo modprobe pcspkr .

Saeros

Posted 2009-08-14T05:01:56.400

Reputation: 229

This is the default for 10.04 – charlesbridge – 2010-05-27T20:21:33.970

2I did check the blacklist, but it wasn't listed. – None – 2009-08-14T11:44:19.990

1Sadly, did not help. – Tal Weiss – 2012-02-20T08:33:16.733

Why rebooting? Just load the module manually. – Pascal Thivent – 2009-10-13T13:36:07.820

how to load module manually? – sites – 2013-01-11T14:36:32.197

Running modprobe pcspkr worked for enabling those horrible beeps on my Ubuntu Raring system. – robru – 2013-04-24T05:12:40.223

1@Robru Thanks that worked. Added it to the answer. – Ufoguy – 2014-01-27T16:31:45.330

8

My laptop doesn't have a PC speaker, so I needed a software-only solution. I found an article about setting up GNOME to play an audio file for the system beep.

The idea is to set up xkbevd(1) to run a command when a certain event occurs; in this case, the event Bell. For Ubuntu 9.04 Jaunty (and possibly previous versions as well), many of the sound files provided are in ogg vorbis format instead of wave, so depending on which sound you want to play on a terminal bell, using aplay(1) may not work. If you don't already have it, you'll need to install the vorbis-tools package:

sudo aptitude install vorbis-tools

After that, you'll need to create ~/.xkb/xkbevd.cf (note the spelling, the article has a typo here) and insert the following:

soundDirectory="/usr/share/sounds/"
soundCmd="ogg123 -q"

Bell() "ubuntu/stereo/bell.ogg"

In order to have the daemon run on login, you can edit your profile as the article suggests, or you can add it to your Startup Applications (System -> Preferences ->Startup Applications). Click on Add to create a new startup program, set the Name to XKB Event Daemon, the command to xkbevd -bg, and the comment to Software terminal bell.

Jason Owen

Posted 2009-08-14T05:01:56.400

Reputation: 490

2use this if you don't want the bell sound to queue: Bell() shell "(if [ ! -e /run/lock/bell_playing ]; then touch /run/lock/bell_playing; paplay /usr/share/sounds/ubuntu/stereo/bell.ogg; rm /run/lock/bell_playing; fi ) &" – Janus Troelsen – 2012-10-10T23:16:21.897

6

I had the same problem. For me, it was solved by opening "alsamixer" on the console and unmuting the "Beep" slider.

maxauthority

Posted 2009-08-14T05:01:56.400

Reputation: 61

This worked great for me on Ubuntu 10.04 – Rian Sanderson – 2011-12-28T01:39:26.313

5

  • Check if pcspkr module is currently loaded

    $ lsmod | grep pcspkr
    pcspkr 10496 0

  • Check if there are any related errors in /var/log/dmesg

    $ sudo grep pcspkr /var/log/dmesg
    [ 15.620198] input: PC Speaker as /devices/platform/pcspkr/input/input8

If there's still no clue, do a full manual check of /var/log/dmesg for other errors. A quick grep of the other logs in /var/log/* with today's timestamp might also turn up something.

The above steps are just to help you narrow down the possible issue. With these kind of problems, it can be difficult to guess the answer right off the bat.

user4358

Posted 2009-08-14T05:01:56.400

Reputation:

4

On Ubuntu 14.04 (and perhaps others), the module-x11-bell module tries to play a bell.ogg sample, which is not loaded in PulseAudio's sample cache. As a workaround to load it manually, type this in a terminal:

pactl upload-sample /usr/share/sounds/ubuntu/stereo/bell.ogg bell.ogg

To make this permanent, add the above line inside .xprofile in your home directory (create it if it doesn't exist already).

This command will tell you whether the sample is loaded or not:

pactl list samples

Whyte

Posted 2009-08-14T05:01:56.400

Reputation: 41

3

Try this:

sudo modprobe pcspkr

nano.galvao

Posted 2009-08-14T05:01:56.400

Reputation: 133

this works on Dell Latitude 5480 + Ubuntu 16 , together with apt-get installing beep as explained. – axd – 2017-12-12T13:36:25.663

3

First, you need to be sure the right module is loaded. If not, the sound control center won't do nothing AFAIK (and even if the module is loaded, I don't know if the bugs mentioned in this thread are solved in Jaunty).

What version of Ubuntu are you using? Prior to Jaunty, the module was name snd_pcspkr.

Can you give us the output of:

lsmod | grep pcspkr

Can you give us the output of:

grep pcspkr /etc/modprobe.d/blacklist*

BTW, pcspkr is blacklisted by default again in Karmic.

Pascal Thivent

Posted 2009-08-14T05:01:56.400

Reputation: 1 492

2

http://ubuntu-virginia.ubuntuforums.org/showthread.php?t=1315929

Post number 6 solved it for me. In short do the following in a terminal:

  1. run 'alsamixer'
  2. move to PC Beep
  3. press m to unmute
  4. set volume
  5. press escape

Leo

Posted 2009-08-14T05:01:56.400

Reputation: 21

Thanks - this worked in Ubuntu 12.04. Critical in my case was the need to unmute the beep in alsamixer. How do we find out if we have a pc speaker? (And what was the plan on the developer side anyway in terms of disabling beeping by default?) – nealmcb – 2014-05-07T14:54:55.860

2

I installed beep with:

sudo aptitude install beep

Now I can call beep from shell or script with

beep
beep -r 3

This program can do much more. See man beep.

pjw

Posted 2009-08-14T05:01:56.400

Reputation: 121

1

For me the solution was a combination of the posts from Leo and nana.galvao:

  • run alsamixer, unmute Beep and set a decent volume.
  • sudo modprobe pcspkr
  • and of course install the beep package with sudo apt-get install beep

David Nouls

Posted 2009-08-14T05:01:56.400

Reputation: 111

0

The command beep didn't work for me so I came up with an own solution:

alias beep="mplayer -ao alsa $HOME/bin/alert.wav &>/dev/null"

Where alert.wav is a short audio file. Usage:

$ sleep 2; beep

See my blog post about it here.

Jabba

Posted 2009-08-14T05:01:56.400

Reputation: 144

1Doesn't that play it in the speakers and not the buzzer? – Ufoguy – 2014-01-27T16:33:09.443

0

I've been researching this problem for a week or so, and I've discovered one of the two machines that I wanted to make beep does not have a built in pc-speaker (weird). So check if there is one.

user261590

Posted 2009-08-14T05:01:56.400

Reputation: