Closed
Bug 68804
Opened 23 years ago
Closed 17 years ago
Sound output cracks
Categories
(Core :: Widget: Gtk, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: BenB, Assigned: mwu)
References
Details
(Keywords: fixed1.8.1, platform-parity)
Attachments
(1 file, 3 obsolete files)
6.72 KB,
patch
|
roc
:
review+
roc
:
superreview+
mconnor
:
approval1.8.1+
|
Details | Diff | Splinter Review |
Reproduce: 1. Get new mil in Mailnews Actual result: A sound is plyed, if new mail "arrived". But before the sound plays, a crack can be heared in the speakers. Sophisticated speakers don't like that at all, it also sounds unprofessional. Expected result: Clear, sharp output of the soundfile, and only that. Linux. (What is the component for GFX?)
Reporter | ||
Updated•23 years ago
|
Keywords: mozilla1.0
Comment 1•23 years ago
|
||
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.
Reporter | ||
Comment 2•23 years ago
|
||
No, XMMS (WinAMP clone), which uses OSS, doesn't exhibit this behaviour.
Reporter | ||
Comment 3•23 years ago
|
||
Well, there are some cracks but - rarely (only sometimes during skipping tracks) - minimal (much less volume; shorter)
Keywords: pp
Comment 4•18 years ago
|
||
*** Bug 217803 has been marked as a duplicate of this bug. ***
Comment 5•18 years ago
|
||
*** Bug 290953 has been marked as a duplicate of this bug. ***
Comment 6•18 years ago
|
||
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
Reporter | ||
Comment 7•18 years ago
|
||
Changing component, owner, milestone, to reflect today
Assignee: slogan → nobody
Component: XPCOM → Widget: Gtk
QA Contact: kandrot → gtk
Target Milestone: Future → ---
Comment 8•18 years ago
|
||
Assignee | ||
Updated•17 years ago
|
Assignee: nobody → michael.wu
Assignee | ||
Comment 9•17 years ago
|
||
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.
Attachment #215756 -
Attachment is obsolete: true
Attachment #233004 -
Flags: superreview?(roc)
Attachment #233004 -
Flags: review?(roc)
+ 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 "?
Assignee | ||
Comment 11•17 years ago
|
||
(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.
Assignee | ||
Comment 12•17 years ago
|
||
Updated w/ roc's comments.
Attachment #233004 -
Attachment is obsolete: true
Attachment #233589 -
Flags: superreview?(roc)
Attachment #233589 -
Flags: review?(roc)
Attachment #233004 -
Flags: superreview?(roc)
Attachment #233004 -
Flags: review?(roc)
Is there no way to do a proper "skip to the next chunk" operation as we search for the "fmt " chunk?
Assignee | ||
Comment 14•17 years ago
|
||
Properly skip unknown chunks, eliminate unused block_align variable.
Attachment #233589 -
Attachment is obsolete: true
Attachment #233669 -
Flags: superreview?(roc)
Attachment #233669 -
Flags: review?(roc)
Attachment #233589 -
Flags: superreview?(roc)
Attachment #233589 -
Flags: review?(roc)
Comment on attachment 233669 [details] [diff] [review] Do proper WAV file parsing, v3 excellent!
Attachment #233669 -
Flags: superreview?(roc)
Attachment #233669 -
Flags: superreview+
Attachment #233669 -
Flags: review?(roc)
Attachment #233669 -
Flags: review+
Assignee | ||
Updated•17 years ago
|
Whiteboard: [checkin needed]
Assignee | ||
Comment 16•17 years ago
|
||
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
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Assignee | ||
Comment 17•17 years ago
|
||
Comment on attachment 233669 [details] [diff] [review] 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.
Attachment #233669 -
Flags: approval1.8.1?
Assignee | ||
Updated•17 years ago
|
Flags: blocking1.8.1?
Comment 18•17 years ago
|
||
Comment on attachment 233669 [details] [diff] [review] Do proper WAV file parsing, v3 a=mconnor on behalf of drivers for checkin to the 1.8 branch
Attachment #233669 -
Flags: approval1.8.1? → approval1.8.1+
Comment 19•17 years ago
|
||
Not going to block release on this ... but we did approve the patch.
Flags: blocking1.8.1? → blocking1.8.1-
Assignee | ||
Comment 20•17 years ago
|
||
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
Keywords: fixed1.8.1
Comment 21•17 years ago
|
||
*** Bug 354743 has been marked as a duplicate of this bug. ***
Comment 23•16 years ago
|
||
With Thunderbird 2.0.0.6 in Ubuntu 7.10 b1, the bug still there.
Comment 24•16 years ago
|
||
Sorry, that was for another bug.
See Also: → https://launchpad.net/bugs/45591
You need to log in
before you can comment on or make changes to this bug.
Description
•