Sound notification for new mail always starts with a blop

Bug #45591 reported by Bazon
12
Affects Status Importance Assigned to Milestone
Mozilla Thunderbird
Fix Released
Medium
mozilla-thunderbird (Ubuntu)
Fix Released
Low
Mozilla Bugs

Bug Description

If you choose to hear a user selected new mail sound (Thunderbird > Edit > Preferences > General > When new messages arrive: Play a sound > Advanced > Custom .wav file), this sound always bengins with a "blop".
(A sort of a square-formed switch-on signal, sounds similar to dropping a needle on a vinyl record too hard)

I even edited the wav file to begin smooth ("fade in" effect in audacity) and if I play the file on a normal audio-player, there is no blop!

So there seems to be a kind of problem with integrating Thunderbirds sound into the system ESD sound.

Revision history for this message
In , Bigelephant (bigelephant) wrote :

This is not a mozilla problem, but a linux sound driver problem in general. On
my system, every time the system sound device is opened, there is a crackle.
OSS and ALSA do that; maybe other drivers (eg commercial OSS) change that.

Revision history for this message
In , Ben-bucksch (ben-bucksch) wrote :

No, XMMS (WinAMP clone), which uses OSS, doesn't exhibit this behaviour.

Revision history for this message
In , Ben-bucksch (ben-bucksch) wrote :

Well, there are some cracks but
- rarely (only sometimes during skipping tracks)
- minimal (much less volume; shorter)

Revision history for this message
In , Kevin Brosnan (kbrosnan) wrote :

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

Revision history for this message
In , Joey Minta (jminta) wrote :

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

Revision history for this message
In , Ud3 (ud3) wrote :

This is a mozilla problem, not a driver problem.
The GTK(2) widget's nsSound::Play function (actually, its helper function nsSound::OnStreamComplete) sends the whole WAV file - including header and trailing garbage - to ESD, while ESD expects just the samples.

See
  http://lxr.mozilla.org/mozilla/source/widget/src/gtk/nsSound.cpp#130
or
  http://lxr.mozilla.org/mozilla/source/widget/src/gtk2/nsSound.cpp#134

Revision history for this message
In , Ben-bucksch (ben-bucksch) wrote :

Changing component, owner, milestone, to reflect today

Revision history for this message
In , Ud3 (ud3) wrote :

Created attachment 215756
Send only sample data, not WAV file headers to ESD

Revision history for this message
Bazon (bazonbloch) wrote :

If you choose to hear a user selected new mail sound (Thunderbird > Edit > Preferences > General > When new messages arrive: Play a sound > Advanced > Custom .wav file), this sound always bengins with a "blop".
(A sort of a square-formed switch-on signal, sounds similar to dropping a needle on a vinyl record too hard)

I even edited the wav file to begin smooth ("fade in" effect in audacity) and if I play the file on a normal audio-player, there is no blop!

So there seems to be a kind of problem with integrating Thunderbirds sound into the system ESD sound.

Revision history for this message
In , Mwu-mozilla (mwu-mozilla) wrote :

Created attachment 233004
Do proper WAV file parsing

This works similarly to the previous patch, except it cleans up the code a bit, does more sanity checking and isn't bit rotted. Thanks to Uwe Dannowski for the analysis and initial patch.

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

+ if (i + audio_len >= dataLen)
+ audio_len = (dataLen - i) - 1;

Why are you dropping the last byte of the file?

+ for (PRUint32 j = 0; j < audio_len - 1; j += 2) {

I'd prefer "j + 2 <= audio_len"

+ } else
+ i++;

I'd prefer braces around the i++. Also, is it really correct to scan through the WAV file looking for the string "fmt "? Aren't there other chunks that could have binary data in them that happens to contain the string "fmt "?

Revision history for this message
In , Mwu-mozilla (mwu-mozilla) wrote :

(In reply to comment #10)
> + if (i + audio_len >= dataLen)
> + audio_len = (dataLen - i) - 1;
>
> Why are you dropping the last byte of the file?
>
Opps. I knew something was a bit off about this code.. Thanks

> Also, is it really correct to scan through
> the WAV file looking for the string "fmt "? Aren't there other chunks that
> could have binary data in them that happens to contain the string "fmt "?
>
I've added a check which makes sure we only parse one fmt chunk. It is fairly unlikely that fmt wouldn't the first chunk, so this should work out.

Revision history for this message
In , Mwu-mozilla (mwu-mozilla) wrote :

Created attachment 233589
Do proper WAV file parsing, v2

Updated w/ roc's comments.

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

Is there no way to do a proper "skip to the next chunk" operation as we search for the "fmt " chunk?

Revision history for this message
In , Mwu-mozilla (mwu-mozilla) wrote :

Created attachment 233669
Do proper WAV file parsing, v3

Properly skip unknown chunks, eliminate unused block_align variable.

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

Comment on attachment 233669
Do proper WAV file parsing, v3

excellent!

Revision history for this message
In , Mwu-mozilla (mwu-mozilla) wrote :

Checking in widget/src/gtk2/nsSound.cpp;
/cvsroot/mozilla/widget/src/gtk2/nsSound.cpp,v <-- nsSound.cpp
new revision: 1.15; previous revision: 1.14
done

Revision history for this message
In , Mwu-mozilla (mwu-mozilla) wrote :

Comment on attachment 233669
Do proper WAV file parsing, v3

This patch has been baking for a while and there has been no regressions AFAIK. It makes the gtk2 nsSound code actually parse WAV files instead of sending the whole file to the sound card.

Revision history for this message
In , Mike Connor (mconnor) wrote :

Comment on attachment 233669
Do proper WAV file parsing, v3

a=mconnor on behalf of drivers for checkin to the 1.8 branch

Revision history for this message
In , Beltzner (beltzner) wrote :

Not going to block release on this ... but we did approve the patch.

Revision history for this message
In , Mwu-mozilla (mwu-mozilla) wrote :

Checking in widget/src/gtk2/nsSound.cpp;
/cvsroot/mozilla/widget/src/gtk2/nsSound.cpp,v <-- nsSound.cpp
new revision: 1.12.20.2; previous revision: 1.12.20.1
done

Revision history for this message
In , Adam Guthrie (ispiked) wrote :

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

Revision history for this message
Olek Wojnar (olekw) wrote :

I noticed this bug too. Looks like it has already been resolved upstream though.

Could someone please update upstream status since it won't let me do so?
Status = Resolved/Fixed
Importance = Normal
This can be verified at the posted link.

Thanks!

Changed in thunderbird:
status: Unknown → Fix Released
Revision history for this message
John Vivirito (gnomefreak) wrote :

Is this still an issue for you? We are trying to trying sort out the older Mozilla issues and would like to know if this still happens.

Changed in mozilla-thunderbird:
assignee: nobody → mozilla-bugs
status: Unconfirmed → Needs Info
Revision history for this message
Bazon (bazonbloch) wrote : Re: [Bug 45591] Re: Sound notification for new mail always starts with a blop

John Vivirito schrieb:
> Is this still an issue for you?
Sorry, I can't tell you, momentary I'm not using Ubuntu, I only got an
outdated version.

> We are trying to trying sort out the
> older Mozilla issues and would like to know if this still happens.
>
> ** Changed in: mozilla-thunderbird (Ubuntu)
> Assignee: (unassigned) => Mozilla Bugs
> Status: Unconfirmed => Needs Info
>
>

Revision history for this message
In , Adam Guthrie (ispiked) wrote :

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

Revision history for this message
Sarah Kowalik (hobbsee-deactivatedaccount) wrote :

looks fixed.

Changed in mozilla-thunderbird:
status: Incomplete → Fix Released
Revision history for this message
In , tuharsky (tuharsky) wrote :

With Thunderbird 2.0.0.6 in Ubuntu 7.10 b1, the bug still there.

Revision history for this message
In , tuharsky (tuharsky) wrote :

Sorry, that was for another bug.

Changed in thunderbird:
importance: Unknown → Medium
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.