System bell completely silent because PulseAudio sample file undefined by default

Bug #769314 reported by Robert Schroll on 2011-04-23
This bug affects 43 people
Affects Status Importance Assigned to Milestone
gnome-media (Ubuntu)
pulseaudio (Ubuntu)
unity (Ubuntu)

Bug Description

Binary package hint: unity

This bug is about problems using the system bell in Unity or another Compiz-based environment. For problems using the system bell in Ubuntu Classic/Metacity or another Metacity-based environment, please see bug #486154.

The system bell (that beep when you backspace on an empty line on a terminal, i.e.) is badly broken using the Unity environment in the Natty beta 2. By default, no sound is produced, and several misconfigurations make it difficult to produce sound either from the PC speaker or Pulse Audio's module-x11-bell. Not knowing what the desired behavior is, I can't say exactly what needs to be fixed. But the combination of the following issues makes the system quite obviously broken.

1) pcskpr is blacklisted.
The pcspkr module is necessary for the PC speaker to produce sound. It is blacklisted, so regular users cannot turn the bell on. It would be nice for this to be fixed, but the attitudes displayed in #77010 suggest that it won't be. Nonetheless, I note it here because it interacts with some of the following.

2) The X bell volume is set to 0. (no more true in xenial)
As reported by `xset q`, the bell volume is 0 when Unity is started. Both the PC speaker and module-x11-bell respect this setting, so the volume must be turned up (with `xset b on` or `xset b 100`) for either to work. Since both the PC speaker and module-x11-bell are disabled by default, this setting only serves to frustrate attempts to turn them on; it never prevents unwanted sound.

3) module-x11-bell is loaded by /usr/bin/start-pulseaudio-x11
This is a system file, not a user file, so users cannot decide whether they want this module loaded or not. They could write a script to unload the module at login (and hope the module number doesn't vary between boots), but it would be much cleaner to have the modules loaded from a user file, possibly with defaults if the user file doesn't exist.

4) Sample bell.ogg is not loaded.
When module-x11-bell is loaded, it is told to use the sample bell.ogg. But no sample is loaded into Pulse Audio. Thus, module-x11-bell traps system bell events (keeping them from going to the PC speaker) without producing any sound. If module-x11-bell is loaded, the sample it calls on should be loaded as well. (To fix this, run `pactl upload-sample /usr/share/sounds/ubuntu/stereo/bell.ogg bell.ogg`.)

5) gnome-volume-control doesn't.
The "Sound Effects" tab of gnome-volume-control offers to set the volume and sound for system bell events, but these have no effect. This is because gnome-volume-control is trying to control system bells through metacity. Ideally, it should be rewritten to control module-x11-bell instead, but a temporary fix could be to simply disable this tab.

6) System bell settings don't transfer to the Ubuntu Classic environment.
Because that is using metacity, which has it's own set of problems. See bug #486154.

This has been from testing in a VM (virtualbox), but all of these behaviors have also been seen in Compiz in various previous versions of Ubuntu running on various hardware.

I have reported this bug against several components, as it is really an integration issue. The eventual fix may not involve your component, but please do not mark this bug as invalid until we have at least a roadmap for fixing it. Otherwise, I fear responsibility will be passed from component to component without anything being fixed. Rationales:
Unity - As the overarching environment, Unity should be responsible for getting everything integrated. Additionally, some of the problems relate to session startup settings.
Pulse Audio - module-x11-bell is not loaded intelligently or correctly.
Gnome Media - Own gnome-volume-control.

Versions (but note the same behavior has been seen in many earlier versions):
unity: 3.8.10-0ubuntu2
pulseaudio: 1:0.9.22+stable-queue-24-g67d18-0ubuntu3
gnome-media: 2.32.0-0ubuntu7

Related branches

pablomme (pablomme) wrote :

I believe this is an amalgamation of bug #486154 (bad pcspkr beep integration with pulseaudio, roughly) and bug #537703 (pulseaudio bell not triggered from compiz). I'm not sure if you add anything else - you may want to flag this as a duplicate of one of the others, or to specify more clearly what it is exactly that you want fixed.

Robert Schroll (rschroll) wrote :

Thanks for the fast reply. As I note in this bug and in bug #486154, that bug is primarily focused on the system bell in Metacity. We did uncover problems under Compiz, but I thought it would be better to split them out into their own bug. This is that bug. Hopefully, unlike #486154, this one is solvable.

Thanks for bringing #537703 to my attention. I remain firmly of the position that Compiz is behaving exactly correctly - window managers should not be mucking about with audio. This is why I specifically did not file this bug against Compiz. I will let #537703 know about this bug, and if they believe a solution to this one is a solution to both, then we can mark one as a duplicate. But if they're looking for a fix to Compiz, then these need to remain separate.

> specify more clearly what it is exactly that you want fixed.

I would like a sensible default for handling the system bell that is easy to customize. We need to decide what that default is before we can figure out what needs to be fixed. This is my attempt to get the relevant parties together to make that decision.

Bilal Akhtar (bilalakhtar) wrote :

Doesn't seem to be a Unity bug. Can be reproduced in a Classic Desktop environment as well.

Changed in unity (Ubuntu):
status: New → Invalid
Changed in unity:
status: New → Invalid
Robert Schroll (rschroll) wrote :

The same problem does exist in Ubuntu Classic/Compiz, though not in Ubuntu Classic/Metacity. (I had been unaware of the Compiz variant until you pointed it out.) As this is an integration problem, I thought the desktop environment would be a good umbrella organization to organize the response. Is there some "desktop experience" project that would be a better fit?

description: updated
Dimitris Kogias (dimitris-k) wrote :

Symptoms look identical to bug 301174. Also, FWIW, the sound preferences tab fails to control volume, but does control muting, of the alert sound after the manual xset and pactl steps from the description are followed.

up to date Natty on Thinkpad, default Ubuntu sound theme.

Luke Yelavich (themuso) wrote :

The problem is that compiz does not have anything that talks to libcanberra to play a sound event. The solution here is to write a compiz plugin that listens for the system bell event, and calls libcanberra. I intend to try to put a plugin together in the near future, but if someone beats me to it, I won't be bothered.

Robert Schroll (rschroll) wrote :

I'm afraid I still fail to see why the correct solution here is to produce duplicate code in each window manager instead of letting the sound system handle it. But if we must add this functionality to Compiz, please please please give it an off switch.


Thomas Hood (jdthood) wrote :

> 5) gnome-volume-control doesn't.
> The "Sound Effects" tab of gnome-volume-control
> offers to set the volume and sound for system bell
> events, but these have no effect. This is because
> gnome-volume-control is trying to control system
> bells through metacity. Ideally, it should be rewritten
> to control module-x11-bell instead, but a temporary
> fix could be to simply disable this tab.

In natty, on the Sound Effects tab there is no control for system bell events. So this part of the report seems fixed.

FYI, on a fresh natty install, as a workaround, to enable beeps (e.g., terminal bells) permanently I created a ~/.xprofile file with:

pactl upload-sample /usr/share/sounds/gnome/default/alerts/glass.ogg bell.ogg
xset b 100

Robert Schroll (rschroll) wrote :

> In natty, on the Sound Effects tab there is no control for system bell
> events. So this part of the report seems fixed.

I just updated my Natty VM, and the Sound Preferences dialog still has a "Sound Effects" tab that offers to set the alert sound and volume. I just created a new user, and he has it too, so it's not some hold-over from a previous configuration. Could you have changed some settings to hide this?

Thomas Hood (jdthood) wrote :

Yes, there is an "Alert volume" slider with "Mute" button. I didn't realize that you were referring to this when you said "system bell" --- I didn't know that they were the same thing. My apologies. It's true that this slider has no effect on the volume of the sound that gets played when the workaround ("pactl upload-sample..." and "xset b 100") is applied.

Regarding the workaround, I have since discovered that "pactl upload-sample /usr/share/sounds/gnome/default/alerts/glass.ogg bell.ogg" has to go in ~/.xprofile and "xset b 100" has to go in ~/.bashrc.

On my laptop the bell is also getting muted upon resume.I had to make following /etc/pm/sleep.d script to override that:
case "$1" in
  resume|thaw) { sleep 5; DISPLAY=:0 xset b 100; } & ;;

Is there any more elegant solution for that?

Thomas Hood (jdthood) wrote :

"gconf-editor | desktop | gnome | peripherals | keyboard | bell_mode := on" seems to have the same effect as "xset b 50" and is presumably a more general solution.

Thanks! That's what I was looking for. Works both for startup and resume. Sample upload is still required.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-media (Ubuntu):
status: New → Confirmed
Changed in pulseaudio (Ubuntu):
status: New → Confirmed

I think I'm suffering from this in 12.04. That is to say, I get no sound when I backspace an empty line in a terminal, and I have set "alert sound" to "Glass" and the Alert volume to maximum. I can hear the sound when selecting it, but I never hear it in use.

Also, FWIW, when I log in using Gnome Shell instead of Unity *then* I can hear the ("Glass") alert sound from the terminal.

Jonas G. Drange (jonas-drange) wrote :

Fresh 12.10 install. Error persist and commands:

pactl upload-sample actual-bell.ogg bell.ogg
xset b 100

must be run both on startup and wake. This is a papercut that cuts deeply for users that depend on the bell (like me).

I will be available for testing.

Vladimir Pycha (vpycha) wrote :

The following fixed it for me, in Ubuntu 12.04 Precise, using Gnome Classic/Compiz:

1) Add the following 2 lines to file /etc/pulse/

load-sample-lazy bell-windowing-system /usr/share/sounds/ubuntu/stereo/bell.ogg
load-module module-x11-bell sample=bell-windowing-system

2) Run "pulseaudio -k" to restart pulseaudio.

That is, I just followed this post:

There is still no bell in gterm on Ubuntu 14.04. Workaround in #18 does not help.

Workaround in #10 does work in Ubuntu 14.04. After applying it, there is a bell sound in gterm.

(#18 is also good, but note that in that example "actual-bell.ogg" must be a path to a real ogg file, while "bell.ogg" seems to be a build-in identifier which must not be touched.)

Daniel Hahler (blueyed) on 2014-11-07
Changed in pulseaudio (Ubuntu):
status: Confirmed → Triaged
Daniel Hahler (blueyed) wrote :

Here is a trivial debdiff for pulseaudio, which uploads the bell.ogg sample.

Changed in pulseaudio (Ubuntu):
importance: Undecided → High
tags: added: patch
David D Lowe (flimm) wrote :

I just want to say, what a superbly written bug report, and I hope this gets fixed.

Alberto Mardegan (mardy) wrote :

This is still broken in 14.04. The workaround from point #4 fixes the issue for me:

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

Nicola Larosa (teknico) wrote :

Some additional information.

In the patch to /usr/bin/start-pulseaudio-x11:

line #9 should say "sample=x11-bell", rather than "sample=bell.ogg".

One additional change is needed to /etc/pulse/

line #29 should be uncommented, to load an audio file as a sample named "x11-bell".

Note that line #178 in the same file would use the "x11-bell" sample name: however it should NOT be uncommented, as explained in comments right above. module-x11-bell will be loaded by X running the /usr/bin/start-pulseaudio-x11 command, via /etc/xdg/autostart/pulseaudio.desktop .

Nicola Larosa (teknico) on 2015-12-14
Changed in pulseaudio (Ubuntu):
status: Triaged → In Progress
Michael J. Ford (finlstrm) wrote :

This bug is still present in Ubuntu 14.04 "pulseaudio-module-x11" version "1:4.0-0ubuntu11.1"

Worked around by running the following steps as outline here:

1. Load the module pcspkr in /etc/modprobe.d/blacklist.conf (comment it out)
2. Remove the package pulseaudio-module-x11 (that seems to absorb all XBell events)
3. Place options snd-hda-intel beep_mode=2 into /etc/modprobe.d/enable-beep.conf
4. reboot

Iiro Laiho (iiro) wrote :

Present in 16.04.

Is the silence of the X11 bell intentional behavior? This is a really weird case. I mean, the bug has been open for longer than half a decade and triaged for a couple of years as well. The fix also is very simple and there are proposed patches.

The attachment "debdiff for pulseaudio: upload bell.ogg" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

Iiro Laiho (iiro) on 2017-02-03
summary: - System bell broken in Natty/Unity (despite heroic...)
+ System bell completely silent because PulseAudio sample file undefined
+ by default
Iiro Laiho (iiro) on 2017-02-03
tags: added: xenial
description: updated
Changed in pulseaudio (Ubuntu):
importance: High → Medium
Changed in gnome-media (Ubuntu):
importance: Undecided → Medium
Changed in unity (Ubuntu):
importance: Undecided → Medium
Changed in pulseaudio (Ubuntu):
status: In Progress → Confirmed
Michael Terry (mterry) wrote :

I've uploaded a version of Daniel Hahler's patch in comment #22 to zesty. Worked for me, I was able to hear the bell in gnome-terminal.

I believe that's the last piece of this puzzle? I'll unsubscribe the sponsors team. Please re-subscribe if there's more to do that is ready to be uploaded.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:10.0-1ubuntu2

pulseaudio (1:10.0-1ubuntu2) zesty; urgency=medium

  * debian/patches/0006-load-module-x11-bell.patch:
    - Upload bell.ogg sample via pactl for module-x11-bell. Original patch
      by Daniel Hahler. (LP: #769314)
  * debian/control:
    - Add ubuntu-sounds to Suggests list, since it ships the sound used by
      default in above patch now.

 -- Michael Terry <email address hidden> Wed, 29 Mar 2017 14:24:19 -0400

Changed in pulseaudio (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.