Bug 498608 - A single alert sound is played upon multiple quick alert-triggering events
Summary: A single alert sound is played upon multiple quick alert-triggering events
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: metacity
Version: 11
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 516816 (view as bug list)
Depends On: 520144
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-05-01 13:20 UTC by Davide Cescato
Modified: 2009-11-16 16:27 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-11-16 16:27:19 UTC


Attachments (Terms of Use)

Description Davide Cescato 2009-05-01 13:20:42 UTC
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.

Comment 1 Davide Cescato 2009-06-06 08:50:40 UTC
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.

Comment 2 Bug Zapper 2009-06-09 14:56:44 UTC
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

Comment 3 Lennart Poettering 2009-08-28 03:35:06 UTC
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.

Comment 4 Lennart Poettering 2009-08-28 03:52:48 UTC
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

Comment 5 Lennart Poettering 2009-08-28 15:43:59 UTC
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.

Comment 6 Davide Cescato 2009-08-29 10:37:34 UTC
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.

Comment 7 Davide Cescato 2009-09-15 16:17:32 UTC
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.

Comment 8 Owen Taylor 2009-11-16 16:26:41 UTC
*** Bug 516816 has been marked as a duplicate of this bug. ***

Comment 9 Owen Taylor 2009-11-16 16:27:19 UTC
Not going to backport to F11


Note You need to log in before you can comment on or make changes to this bug.