Last Comment Bug 658060 - The Preferences Popup Windows Sound play button is not enabled.
: The Preferences Popup Windows Sound play button is not enabled.
Status: RESOLVED FIXED
:
Product: SeaMonkey
Classification: Client Software
Component: Preferences (show other bugs)
: SeaMonkey 2.1 Branch
: All All
: -- normal (vote)
: seamonkey2.4
Assigned To: Ian Neal
:
Mentors:
Preferences -> Privacy and Security -...
Depends on:
Blocks: 662757
  Show dependency treegraph
 
Reported: 2011-05-18 13:59 PDT by Peter Brown
Modified: 2011-09-25 16:15 PDT (History)
9 users (show)
iann_bugzilla: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
fixed
fixed


Attachments
Simple fix for play sound button patch [Checked in: trunk Comment 20, aurora/beta Comment 22] (841 bytes, patch)
2011-05-23 13:50 PDT, Ian Neal
mnyromyr: review+
philip.chee: approval‑comm‑aurora+
philip.chee: approval‑comm‑beta+
Details | Diff | Review

Description Peter Brown 2011-05-18 13:59:44 PDT
User-Agent:       Mozilla/5.0 (OS/2; Warp 4.5; rv:2.0.1) Gecko/20110513 Firefox/4.0.1 SeaMonkey/2.1
Build Identifier: Mozilla/5.0 (OS/2; Warp 4.5; rv:2.0.1) Gecko/20110513 Firefox/4.0.1 SeaMonkey/2.1

Play a Sound is checked (ticked actually) and:-

1] with "System beep" selected when I click the "Play" button no sound is heard

2] if I select "Custom sound file" and then click the "Browse..." nothing happens ie no file dialog allowing me to select a sound file.


However, this seems to only affect 1 of my 3 Profiles so I would take a guess that this is, somehow, a Profile related problem.

The question is: What do I need to do to fix this problem?

Reproducible: Always

Steps to Reproduce:
1. Open Preferences -> Privacy and Security -> Popup Windows
2. With "Play an sound" checked(ticked) and "System beep" selected no sound occurs when clicking the "Play" button
3. With "Play an sound" checked(ticked) and "Custom sound file" selected no file chooser dialog appears when clicking on the "Browse" button


Expected Results:  
For 2. above the System beep should have played.

For 3. above a file dialog should appear allowing the selection of a sound file.
Comment 1 Philip Chee 2011-05-19 01:31:31 PDT
Ah is this a OS/2 specific problem?
Comment 2 Peter Brown 2011-05-19 03:19:16 PDT
(In reply to comment #1)
> Ah is this a OS/2 specific problem?

No idea - but doubt it.

It is a Profile specific problem is my best guess as it only affects 1 of my 3 Profiles.

What files in a Profile would affect the behaviour of this section of the Preferences interface?
Comment 3 Steve Wendt 2011-05-19 20:49:39 PDT
Works for me, but Peter mentioned in the newsgroups that he already tried removing xul.mfl.  I don't know what to else to suggest - maybe startupCache?

If we can't narrow down the profile problem, we should probably resolve as WORKSFORME.
Comment 4 Philip Chee 2011-05-20 05:49:44 PDT
I'd try renaming prefs.js (make sure you have a backup!)
If that works, copy half of the saved prefs.js back, do a bisect until you isolate the problem.
Comment 5 Peter Brown 2011-05-20 15:56:13 PDT
By backing up the prefs.js file then deleting the original prefs.js file I may have found the cause of this problem by comparing the old prefs.js with a newly generated prefs.js.

The difference between the 2 prefs.js files are that the old prefs.js has this line

user_pref("privacy.popups.showBrowserMessage", false);

Also the user_pref("privacy.popups.sound_url" values are different; the old prefs.js shows drive:\path data in an OS/2 and Windows style

user_pref("privacy.popups.sound_url", "H:\\MMOS2\\SOUNDS\\eeeooop.wav");

whereas the new prefs.js shows it as a url starting with file:///

user_pref("privacy.popups.sound_url", "file:///H:/MMOS2/SOUNDS/boo.wav");


Copying the "file:///H:/MMOS2/SOUNDS/boo.wav" over the "H:\\MMOS2\\SOUNDS\\eeeooop.wav" in the old prefs.js and then using the old prefs.js there is no longer a problem with playing the popup windows sound or browsing to find a custom sound file.
Comment 6 Philip Chee 2011-05-21 10:10:12 PDT
Was the profile inherited from SeaMonkey 2.0 (or migrated from SeaMonkey 1.x)?
Did the old URL "H:\\etc" used to work under older versions of SeaMonkey?

I ask this because in Windows and Linux feeding an incorrect url to the OS filepicker would eventually timeout (this might take up to 30 minutes in Windows) but in the end the filepicker will show up. Of course OS/2 might never time out.
Comment 7 Peter Brown 2011-05-21 14:11:19 PDT
This profile was used with Seamonkey 1.x, migrated to Seamonkey 2.0 - and on.

Yes, it used to work under older versions of Seamonkey but, I have to admit, I have no idea when it stopped working - I'm blocking popups and if no sound happens when that happens I have no idea that a popup has been blocked.

What I do find strange is:-

1] this blocked the filepicker from working at all - well, it did not appear onscreen. I would have expected an invalid url to simply be ignored - after all, we are trying to select a different file so the current value is not really relevant.

2] this also prevented the "System beep" from being played.
Comment 8 Philip Chee 2011-05-21 22:58:38 PDT
Well all we do (or Gecko does) is to pass the currently defined url as the starting point or hint to the OS file picker. Then it's up to the OS to handle things and return something sensible to us. In Windows, the OS will churn for a while looking for an invalid url then decide to open the file picker anyway but with the default directory (or MRU) open. I have no idea what the OS/2 file manager does - probably fail silently.
Comment 9 Philip Chee 2011-05-21 22:59:20 PDT
I assume you already checked the Error Console for any relevant error messages?
Comment 10 Dave Yeo 2011-05-22 00:23:00 PDT
(In reply to comment #8)
> Well all we do (or Gecko does) is to pass the currently defined url as the
> starting point or hint to the OS file picker. Then it's up to the OS to
> handle things and return something sensible to us. In Windows, the OS will
> churn for a while looking for an invalid url then decide to open the file
> picker anyway but with the default directory (or MRU) open. I have no idea
> what the OS/2 file manager does - probably fail silently.

Most of the OS/2 API really doesn't care what the directory separater is and I'm quite surprised to see this failure. Of course the oldest parts of OS/2 was written by Microsoft so ...
Unluckily due to an IRQ conflict I can't test as sound is totally broken here.
I'll note that Mozilla handles broken sound much better then most apps. (running with reduced functionality instead of hanging).
Comment 11 Peter Brown 2011-05-22 09:17:58 PDT
(In reply to comment #9)
> I assume you already checked the Error Console for any relevant error
> messages?

Sorry Philip but I did not think to check that at the time and I do not currently see any entry that I think could be related...

I thought I'd make a copy of the current log entries but that is far more difficult than it needs to be because part way through copying each entry and pasting into a text file my system seems to lose the ability to copy from the error console.

However, I have discovered that if I type something in here then go back to the copying process it works again for a few more entries.

I'll clear the error console, reinstate the prefs.js that seemed to have the problem and then check for entries in the error console.
Comment 12 Peter Brown 2011-05-22 09:49:29 PDT
I reinstated the old prefs.js, started Seamonkey, opened Preferences, Privacy and Security, Popup Windows and checked that:-

1] Play a sound is selected

2] Custom sound is selected - no filename showing though; when using the prefs.js without the problem the sound file name is displayed below the Custom sound file option.

3] No sound when I click the "Play" button

4] The "Browse" button does not work

5] When I select System beep it does not play when I click the "Play" button


Entries in error console:-

Warning: Warning: Ignoring obsolete chrome registration modifier 'xpcnativewrappers=no'.
Source File: i:\Mozilla\SeaMonkey\Profiles\vb5bjd6y.losepete\extensions\inspector@mozilla.org.xpi:chrome.manifest
Line: 45

Could not read chrome manifest file 'i:\Mozilla\SeaMonkey\Profiles\vb5bjd6y.losepete\extensions\en-GB@dictionaries.addons.mozilla.org\chrome.manifest'.

Warning: Expected declaration but found '*'.  Skipped to next declaration.
Source File: file:///i:/Mozilla/SeaMonkey/Profiles/vb5bjd6y.losepete/chrome/userChrome.css
Line: 39

Warning: Expected declaration but found '*'.  Skipped to next declaration.
Source File: file:///i:/Mozilla/SeaMonkey/Profiles/vb5bjd6y.losepete/chrome/userChrome.css
Line: 40

Warning: Expected ',' or '{' but found '/'.  Ruleset ignored due to bad selector.
Source File: file:///i:/Mozilla/SeaMonkey/Profiles/vb5bjd6y.losepete/chrome/userChrome.css
Line: 42

Error: aElement is null
Source File: chrome://communicator/content/pref/preferences.js
Line: 49

Error: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIFileProtocolHandler.getFileFromURLSpec]"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: chrome://communicator/content/pref/pref-popups.js :: ReadSoundLocation :: line 152"  data: no]
Source File: chrome://global/content/bindings/preferences.xml
Line: 406

Error: uncaught exception: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIFileProtocolHandler.getFileFromURLSpec]"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: chrome://communicator/content/pref/pref-popups.js :: SelectSound :: line 166"  data: no]

Error: uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsISound.play]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: chrome://communicator/content/pref/pref-popups.js :: PlaySound :: line 182"  data: no]

Error: aElement is null
Source File: chrome://communicator/content/pref/preferences.js
Line: 49

Error: uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsISound.play]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: chrome://communicator/content/pref/pref-popups.js :: PlaySound :: line 182"  data: no]

Error: uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsISound.play]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: chrome://communicator/content/pref/pref-popups.js :: PlaySound :: line 182"  data: no]

Error: aElement is null
Source File: chrome://communicator/content/pref/preferences.js
Line: 49

Error: uncaught exception: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIFileProtocolHandler.getFileFromURLSpec]"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: chrome://communicator/content/pref/pref-popups.js :: SelectSound :: line 166"  data: no]

aus2-community.mozilla.org : server does not support RFC 5746, see CVE-2009-3555


In the above the Messages and Warnings are the same as when using the prefs.js that works.

I suspect the errors listed are related to this Popup Windows problem with the exception of:-

Error: aElement is null
Source File: chrome://communicator/content/pref/preferences.js
Line: 49

This error also occurs in the working prefs.js
Comment 13 Philip Chee 2011-05-23 09:24:55 PDT
it looks like we need to check that we get back a valid url here:
gFileHandler.getFileFromURLSpec(aElement.value)
and here:
sound.play(gIOService.newURI(soundUrl, null, null));
Comment 14 Ian Neal 2011-05-23 13:09:09 PDT
(In reply to comment #13)
> it looks like we need to check that we get back a valid url here:
> gFileHandler.getFileFromURLSpec(aElement.value)
> and here:
> sound.play(gIOService.newURI(soundUrl, null, null));

The SM1.x->SM2.x profile migration should have correctly converted the relevant prefs from strings to fileUrls. For some reason either that conversion did not happen or the parts of the new prefs.js were overwritten in some way.

I'll do some more digging into the other errors.
Comment 15 Ian Neal 2011-05-23 13:40:04 PDT
(In reply to comment #12)
> 
> I suspect the errors listed are related to this Popup Windows problem with
> the exception of:-
> 
> Error: aElement is null
> Source File: chrome://communicator/content/pref/preferences.js
> Line: 49
> 
> This error also occurs in the working prefs.js

This error is generate because "previewSound" was renamed to "playSoundButton" in the fix to bug 170924 but the equivalent code in pref-popups.js was not changed http://mxr.mozilla.org/comm-central/source/suite/common/pref/pref-popups.js#145

From reading around if a valid URLSpec is not passed in then we get an assert so there will be a number of ways of tackling that.
Comment 16 Ian Neal 2011-05-23 13:47:15 PDT
This issue around not being able to play the sound in the popups pref pane should be relnoted.
Comment 17 Ian Neal 2011-05-23 13:50:25 PDT
Created attachment 534553 [details] [diff] [review]
Simple fix for play sound button patch [Checked in: trunk Comment 20, aurora/beta Comment 22]
Comment 18 Jens Hatlak (:InvisibleSmiley) 2011-05-24 14:33:40 PDT
(In reply to comment #16)
> This issue around not being able to play the sound in the popups pref pane
> should be relnoted.

Relnoted, see bug 656719 comment 23.
Comment 19 Ian Neal 2011-06-08 02:26:20 PDT
Rest of issues spun off into bug 662757, this bug is just for fixing the play button not being enabled correctly.
Comment 20 Ian Neal 2011-06-08 02:28:49 PDT
Comment on attachment 534553 [details] [diff] [review]
Simple fix for play sound button patch [Checked in: trunk Comment 20, aurora/beta Comment 22]

http://hg.mozilla.org/comm-central/rev/7f3f984ba3a1

It would be good to get this simple, very low risk into both aurora and beta.
Comment 21 Philip Chee 2011-06-08 03:15:54 PDT
Comment on attachment 534553 [details] [diff] [review]
Simple fix for play sound button patch [Checked in: trunk Comment 20, aurora/beta Comment 22]

Simple regression fix. Looks low risk a-comm-aurora=me a-comm-beta=me
Comment 22 Ian Neal 2011-06-08 03:30:34 PDT
Comment on attachment 534553 [details] [diff] [review]
Simple fix for play sound button patch [Checked in: trunk Comment 20, aurora/beta Comment 22]

http://hg.mozilla.org/releases/comm-aurora/rev/00d7788a15d7
http://hg.mozilla.org/releases/comm-beta/rev/1bde52433d6c

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