bell.ogg is unresponsive (outside HIG response times) [regression]

Bug #430203 reported by Paul Sladen
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Metacity
Fix Released
Medium
metacity (Fedora)
Fix Released
Medium
metacity (Ubuntu)
Fix Released
Low
Unassigned
ubuntu-sounds (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: ubuntu-sounds

The instantaneous beep in the default Ubuntu 9.10 preview install has been switched to a slow firing, and slow to repeat sound:

  /usr/share/sounds/ubuntu/stereo/bell.ogg

the easiest way to cause this sound to be played in anger is to open a Terminal (eg. gnome-terminal) and hit the backspace.

There is an audible delay in the latency until the sound is played and approximately 1 second until the sound is replayed (despite the key repeat likely firing at over 25 Hz.

Viewing the Vorbis file with ogginfo and mhWavedit shows that it is is approximately 900 milliseconds in length!

  $ ogginfo /usr/share/sounds/ubuntu/stereo/bell.ogg | grep Playback
 Playback length: 0m:00.882s

The file consists of ~50 milliseconds of silence, ~200 milliseconds of actual sound and then a further ~650 milliseconds of silence.

Ideally the white space should be trimmed to the *absolute maximum*. The sound needs to play *immediately* to meet the requirements set of the HIG for interactive feedback (100 millisecond upper bound).

If further delays are being introduced by the Vorbis loading then this sound (which should be immediate and responsive) should probably be converted to an uncompressed format.

Failing that, the sound could be reverted to the previous short and quick 'bip' sound used previously.

Revision history for this message
In , Davide (davide-redhat-bugs) wrote :

Description of problem:

If multiple alert-triggering events occur too close in time, the alert sound is only played upon the first event, whereas no alert sound is played for the remaining alert-triggering events.

Consider the case of two successive alert-triggering events. If the delay between the two alert events is longer than the duration of the alert sound, two distinct alert sounds are played. If, however, the second alert event is triggered before the sound for the first alert event has finished playing, no alert sound for the second alert event is played. If more than two event-triggering events occur within a time window shorter than the duration of the alert sound, only one alert sound is played. This is bad because all alerts but the first one essentially vanish.

In a situation where an alert is triggered every time a given key is pressed, pressing the key twice must lead to two alert sounds, no matter how quickly the two keypresses are done. This way, the user receives feedback on each of the two keypresses. Issuing a single alert sound would leave the user without feedback about the second keypress.

In order to combine the two alert sounds, two solutions come to my mind:
1. the first alert sound is interrupted and the second alert sound is played immediately afterwards
2. the second alert sound is superimposed to the first one
Note that when the system beep was used for alerts (prior to the introduction of libcanberra (*), I think), solution 1 was in place. The first beep would be interrupted to give way to the second beep. The user would (sloppily speaking) hear "Bee-beeeeep" and hence receive the information that two separate beeps had been issued.

(*) Thanks to bug 498594, this situation can currently be observed by turning the desktop effects on.

Version-Release number of selected component (if applicable):

As in the 2009-04-30 rawhide. In particular:
libcanberra-0.12-1.fc11.x86_64
pulseaudio-0.9.15-11.fc11.x86_64
alsa-lib-1.0.19-3.fc11.x86_64

How reproducible:

always

Steps to Reproduce:

1. Ensure desktop effects are disabled (see bug 498594) and that the sound theme is set to
"Default"
2. Open a gnome-terminal window
3. Push the "down" arrow very quickly two times within the gnome-terminal window to trigger two consecutive alert events
4. Keep the "down" arrow pressed to trigger a large number of consecutive alert events

Actual results:

In step 3, a single alert sound is heard.
In step 4, the alert sound is played periodically, with the period equal to the duration of the alert sound.

Expected results:

In step 3, two alert sounds be heard (either with the first one being interrupted to give way to the second one, as in solution 1, or with the second one superimposing on the first one, as in solution 2).
In step 4, multiple alert sounds be heard (again, either according to solution 1 or to solution 2), with the speed at which new alert sounds are started being equal to the keypress repeat speed specified in the keyboard preferences.

Revision history for this message
In , Davide (davide-redhat-bugs) wrote :

I found more information to support my request. The GNOME Human Interface Guidelines contain the following:
(Source:
http://library.gnome.org/devel/hig-book/stable/feedback-response-times.html.en)

"Verify that your application provides feedback within 100 milliseconds (0.1 second) after each key press, movement of the mouse, or other physical input from the user."

In the scenario described in the bug report, this clearly does not happen.

I hope that libcanberra is the correct component to report the bug against.

Revision history for this message
In , Bug (bug-redhat-bugs) wrote :

This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Revision history for this message
In , Lennart (lennart-redhat-bugs) wrote :

This is actually a "feature" in metacity:

http://git.gnome.org/cgit/metacity/tree/src/core/display.c#n2387

It limits bell events to once per second.

It was added due to this:

http://bugzilla.gnome.org/show_bug.cgi?id=322032
http://bugzilla.gnome.org/show_bug.cgi?id=170006

I do think that rate limiting is probably a good idea though once per second is a bit to much of a limitation, and I was annoyed of this myself too.

Will reassign now. The metacity folks should decide if increasing the rate limit from 1/s to maybe 1/100ms would be ok.

Davide, you probably should open a upstream bug about this too. Even better, provide a patch.

Revision history for this message
In , Lennart (lennart-redhat-bugs) wrote :

OK, I have now prepped the trivial patch for upstream and opened a bz report there:

http://bugzilla.gnome.org/show_bug.cgi?id=593355

Revision history for this message
In , Lennart (lennart-redhat-bugs) wrote :

I committed this to fedora's metacity now too. But unfortunately that fails to build due to some dep problem between openssl and evolution-data-server.

Revision history for this message
In , Davide (davide-redhat-bugs) wrote :

Lennart, thanks for taking the time for fixing this bug. Although I now recognize that the fix is very simple, I would not have known which part of the code to look at. My guess that the bug lies in libcanberra was wrong.

Revision history for this message
In , Davide (davide-redhat-bugs) wrote :

Now that the terminal bell started working again, at least in metacity (see my comment in bug 520137), I can confirm that the fix solved the issue in rawhide. The bug is still present in F11.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-sounds - 0.11

---------------
ubuntu-sounds (0.11) karmic; urgency=low

  * Encode dialog-ready into ogg, now that gdm uses libcanberra for the login
    sound
  * debian/links: Symbolically link dialog-question to system-ready, for gdm
    login use
  * Remove silence at the beginning and end of the bell sound (LP: #430203)

 -- Luke Yelavich <email address hidden> Wed, 23 Sep 2009 11:38:52 +1000

Changed in ubuntu-sounds (Ubuntu):
status: New → Fix Released
Revision history for this message
In , Owen (owen-redhat-bugs) wrote :

*** Bug 516816 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Owen (owen-redhat-bugs) wrote :

Not going to backport to F11

Revision history for this message
Robert Schroll (rschroll) wrote :

The original report raised three issues:
1) There was silence before and after the sound in bell.ogg.
2) There may be a delay in loading bell.ogg for playback.
3) The bell was only repeated at a rate of 1/s.
The fix to ubuntu-sounds only addressed (1). The linked bug addresses (3). (This fix hasn't made it into Karmic; I don't know about Lucid.)

Not addressed yet is whether (2) is a real issue or not. The playback does feel slightly sluggish to me (mostly the first time the bell is played), but I don't have any hard data on it.

Revision history for this message
Pedro Villavicencio (pedro) wrote :

so is this a metacity issue? does applying the upstream patch fixes the issue for you?

Changed in metacity (Ubuntu):
status: New → Fix Committed
importance: Undecided → Low
Revision history for this message
Robert Schroll (rschroll) wrote :

> so is this a metacity issue?

This is most definitely a metacity issue. The rate limiting does not occur in compiz, nor does it occur in a simple xterm session.

> does applying the upstream patch fixes the issue for you?

Dunno. Is there an easy way to do this? I tried apt-getting the source, making the change by hand, and building, using the Ubuntu Wiki's PackageUpdate guide. But on `debuild -S -sa`, I get an error, the relevant portion of which seems to be:

debian/rules:3: /usr/share/cdbs/1/rules/debhelper.mk: No such file or directory
debian/rules:4: /usr/share/cdbs/1/rules/simple-patchsys.mk: No such file or directory
debian/rules:5: /usr/share/cdbs/1/class/gnome.mk: No such file or directory
debian/rules:6: /usr/share/cdbs/1/rules/utils.mk: No such file or directory
debian/rules:7: /usr/share/gnome-pkg-tools/1/rules/uploaders.mk: No such file or directory
debian/rules:8: /usr/share/gnome-pkg-tools/1/rules/gnome-version.mk: No such file or directory
make: *** No rule to make target `/usr/share/gnome-pkg-tools/1/rules/gnome-version.mk'. Stop.
dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit status 2
debuild: fatal error at line 1334:
dpkg-buildpackage -rfakeroot -d -us -uc -S -sa failed

Given that I don't know what debuild is trying to do to begin with, I have no idea how to fix this. But given that (1) the bug only reveals itself under metacity, (2) the bug has been reported and fixed on the metacity bug tracker, and (3) the fix is both simple and not present in the Karmic source, I think it's fairly clear that this is the problem.

Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote : Re: [Bug 430203] Re: bell.ogg is unresponsive (outside HIG response times) [regression]

On Tue, Dec 15, 2009 at 12:16 AM, Robert Schroll <email address hidden> wrote:
> Dunno.  Is there an easy way to do this?  I tried apt-getting the
> source, making the change by hand, and building, using the Ubuntu Wiki's
> PackageUpdate guide.  But on `debuild -S -sa`, I get an error, the
> relevant portion of which seems to be:
>
> debian/rules:3: /usr/share/cdbs/1/rules/debhelper.mk: No such file or directory
> debian/rules:4: /usr/share/cdbs/1/rules/simple-patchsys.mk: No such file or directory
> debian/rules:5: /usr/share/cdbs/1/class/gnome.mk: No such file or directory
> debian/rules:6: /usr/share/cdbs/1/rules/utils.mk: No such file or directory
> debian/rules:7: /usr/share/gnome-pkg-tools/1/rules/uploaders.mk: No such file or directory
> debian/rules:8: /usr/share/gnome-pkg-tools/1/rules/gnome-version.mk: No such file or directory
> make: *** No rule to make target `/usr/share/gnome-pkg-tools/1/rules/gnome-version.mk'.  Stop.
> dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit status 2
> debuild: fatal error at line 1334:
> dpkg-buildpackage -rfakeroot -d -us -uc -S -sa failed

You seem to not have cdbs, a build dependency for metacity, installed. Run:

sudo apt-get build-dep metacity

That will install all needed build dependencies.

Revision history for this message
Robert Schroll (rschroll) wrote :

> You seem to not have cdbs, a build dependency for metacity, installed.

Thanks - that did it!

I can confirm that this change does fix issue (3) in Karmic.

As an editorial aside, I'd like to note that this was an insanely complicated way to adjust a setting that would be better set in a configuration file, for a feature (rate-limiting the system bell) that seems outside the bailiwick of a window manager. Is there a reason for all of this complexity?

Changed in metacity (Fedora):
status: Unknown → Fix Released
Revision history for this message
Robert Schroll (rschroll) wrote :

As best I can read the code, this rate limiting in metacity affects audible and visual bells identically. Thus, this change should allow metacity to flash a visible bell at 10 Hz. (I can't figure out how to enable the visual bell in 9.10, so I can't actually test this.) This seems like a bad idea, especially where epileptics are concerned.

In my uniformed opinion, the responsibility for making system bell sounds should be moved out of metacity. Then the rate limiting can be left at 1Hz for the visual bell, while the audible bell can repeat as fast as possible. A patch I just submitted to bug #486154 removes metacity's ability to capture audible bell events, leaving the PC speaker or pulse audio's module-x11-bell with the responsibility for handling audible bell events. That could be a solution to this bug as well.

Revision history for this message
Paul Sladen (sladen) wrote : Re: [Bug 430203] Metacity bell diversion

> removes metacity's ability to capture audible bell events, leaving the
> PC speaker or pulse audio's module-x11-bell with the responsibility

This does sound sensible. Always did wonder what a WM was doing meddling
in the first place...

Changed in metacity:
importance: Unknown → Medium
status: Unknown → Fix Released
Changed in metacity (Fedora):
importance: Unknown → Medium
Changed in metacity (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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