Closed Bug 1270110 Opened 4 years ago Closed 3 years ago

[Linux] Speech synthesis: The narration can't be started anymore after you click any button from Narrate panel

Categories

(Toolkit :: Reader Mode, defect, P5, major)

x86
Linux
defect

Tracking

()

VERIFIED FIXED
mozilla50
Tracking Status
firefox47 --- wontfix
firefox48 --- wontfix
firefox49 + verified
firefox50 + verified

People

(Reporter: cbadau, Assigned: eeejay)

Details

(Keywords: qablocker, Whiteboard: [reader-mode-narrate])

Attachments

(2 files)

[Affected versions]:
- latest Nightly 49.0a1
- latest DevEDition 48.0a2
- Firefox 47 Beta 2 
- Firefox 47.0a1

[Affected platforms]:
- Ubuntu 13.10 32bit

[Steps to reproduce]:
1. Set media.webspeech.synth.enabled to true.
2. Open http://blog.monotonous.org/2016/03/07/narrate-a-new-feature-in-firefox-nightly/
3. Switch to reader mode by clicking the book icon in the location bar.
4. In the left toolbar, click the third icon from the top (the "Narrate" icon). 
5. Click the Start button. 
6. After few seconds/minutes, click any other button (Stop, Forward, Back, Speed). 

[Expected result]:
- The buttons properly work and all the actions (start, stop, forward, back, speed) are properly executed. 

[Actual result]:
- The narration stops and you can't start it anymore. The buttons don't work anymore. You need to restart the browser to start again the narration (speech synthesis). 

[Regression range]:
- This is not a regression since this is also reproducible in Nightly 03-07-2016 (when the feature was implemented). 

[Additional notes]:
- The issue is NOT reproducible on Windows 7 64bit and Mac OSX 10.9.5.
[Tracking Requested - why for this release]:
High impact issue which makes the narration unusable until a browser restart on linux
I don't think this matters for 47/48 since the feature is aimed at releasing in 49. Tracking for 49/50
I've retested on latest Aurora 49.0a2 (2016-07-07) and I have the following results: 
- on Ubuntu 13.10 x86 - the issue is reproducible
- on Ubuntu 12.04 LTS x86 - the issue is reproducible
- on Ubuntu 12.04 LTS x64 - the issue is reproducible
- on Ubuntu 14.04 LTS x64 - the issue is NOT reproducible
- on Ubuntu 16.04 x64 - the issue is NOT reproducible
NI+ to make sure Eitan sees this bug.
Flags: needinfo?(eitan)
Priority: -- → P5
Whiteboard: [reader-mode-narrate]
fyi, i'm digging into this. Having a hard time making a local build that runs on ubuntu 13.10. But we should have something soon.
Assignee: nobody → eitan
Flags: needinfo?(eitan)
libspeechd does not have a version getter function, so we need to look for a recent
API addition to know we are on a newer version.

Review commit: https://reviewboard.mozilla.org/r/64638/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/64638/
Attachment #8771513 - Flags: review?(bugs)
Attachment #8771514 - Flags: review?(gijskruitbosch+bugs)
I decided to not make a workaround, but instead disable our speechd synth service on older distros (and in turn disable Narrate).

The affected versions of Ubuntu are at least 3 years old, not supported, and are generally a very tiny fraction of our base.
Comment on attachment 8771513 [details]
Bug 1270110 - Bail on unsupported libspeechd versions.

https://reviewboard.mozilla.org/r/64638/#review61696

This is rs+. Please add some comment why we try to look for spd_get_volume.
Attachment #8771513 - Flags: review?(bugs) → review+
Comment on attachment 8771514 [details]
Bug 1270110 - Hide narrate button if no synth voices are present in browser.

https://reviewboard.mozilla.org/r/64640/#review61762

The frontend code makes some sense to me. Will this break tests on unsupported platforms?

Note though that Ubuntu 12.04 LTS is going to be supported until 2017 still. I'm OK with just not supporting narrate there, but I figured I should point this out. It might also be an interesting web compat thing for webspeech generally that we might need to note on MDN or whatever. Not sure what the libspeechd support ranges are on non-Ubuntu distros (Debian stable? Red Hat?).

::: toolkit/components/narrate/NarrateControls.jsm:132
(Diff revision 1)
>  
>    // The rate is stored as an integer.
>    rateRange.value = branch.getIntPref("rate");
>  
> +  if (this._setupVoices(branch.getCharPref("voice"))) {
> +    dropdown.querySelector("#narrate-toggle").hidden = false;

Nit:
```

dropdown.querySelector("#narrate-toggle").hidden =
  !this._setupVoices(branch.getCharPref("voice"));
```

Can you also add a comment in front of this indicating that we're disabling the entire feature if no voices are available?

::: toolkit/components/narrate/NarrateControls.jsm:164
(Diff revision 1)
> -          Services.prefs.getCharPref("narrate.voice"));
>          break;
>      }
>    },
>  
> -  _getVoiceOptions: function() {
> +  _setupVoices: function(selectedVoice) {

Please add a docstring in front of this method that indicates it returns true/false depending on whether voices are available.

::: toolkit/components/narrate/NarrateControls.jsm:182
(Diff revision 1)
> -    options.unshift({
> +      options.unshift({
> -      label: gStrings.GetStringFromName("defaultvoice"),
> +        label: gStrings.GetStringFromName("defaultvoice"),
> -      value: "automatic"
> +        value: "automatic"
> -    });
> +      });
> +      this.voiceSelect.addOptions(options, selectedVoice);
> +      return true;

Nit: remove this...

::: toolkit/components/narrate/NarrateControls.jsm:185
(Diff revision 1)
> -    });
> +      });
> +      this.voiceSelect.addOptions(options, selectedVoice);
> +      return true;
> +    }
>  
> -    return options;
> +    return false;

And return !!options.length; here.
Attachment #8771514 - Flags: review?(gijskruitbosch+bugs) → review+
(In reply to :Gijs Kruitbosch from comment #11)
> Comment on attachment 8771514 [details]
> Bug 1270110 - Hide narrate button if no synth voices are present in browser.
> 
> https://reviewboard.mozilla.org/r/64640/#review61762
> 
> The frontend code makes some sense to me. Will this break tests on
> unsupported platforms?
> 

The tests don't rely on system synth services, so they should still pass everywhere.

> Note though that Ubuntu 12.04 LTS is going to be supported until 2017 still.
> I'm OK with just not supporting narrate there, but I figured I should point
> this out. It might also be an interesting web compat thing for webspeech
> generally that we might need to note on MDN or whatever. Not sure what the
> libspeechd support ranges are on non-Ubuntu distros (Debian stable? Red
> Hat?).

Good points.. Linux is so fragmented we can't guarantee support everywhere. Might be worth saying speech-dispatcher 0.8.2 and higher.
Comment on attachment 8771513 [details]
Bug 1270110 - Bail on unsupported libspeechd versions.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64638/diff/1-2/
Comment on attachment 8771514 [details]
Bug 1270110 - Hide narrate button if no synth voices are present in browser.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64640/diff/1-2/
Pushed by eisaacson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/67c98d7f2d47
Bail on unsupported libspeechd versions. r=smaug
https://hg.mozilla.org/integration/autoland/rev/ea595eb22b9c
Hide narrate button if no synth voices are present in browser. r=Gijs
https://hg.mozilla.org/mozilla-central/rev/67c98d7f2d47
https://hg.mozilla.org/mozilla-central/rev/ea595eb22b9c
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Hi Eitan,
Since this patch also affects 49, are you also considering to uplift this patch to 49?
Flags: needinfo?(eitan)
Comment on attachment 8771513 [details]
Bug 1270110 - Bail on unsupported libspeechd versions.

Approval Request Comment
[Feature/regressing bug #]: 1270110
[User impact if declined]: Users on older Linux distributions will have speech synthesis go into an unrecoverable state.
[Describe test coverage new/current, TreeHerder]: No new test coverage. This simply removes speech synthesis voices on older versions.
[Risks and why]: 
[String/UUID change made/needed]: None
Flags: needinfo?(eitan)
Attachment #8771513 - Flags: approval-mozilla-release?
Attachment #8771513 - Flags: approval-mozilla-beta?
Attachment #8771513 - Flags: approval-mozilla-release? → approval-mozilla-aurora?
Comment on attachment 8771514 [details]
Bug 1270110 - Hide narrate button if no synth voices are present in browser.

Approval Request Comment
[Feature/regressing bug #]: 1270110
[User impact if declined]: Users on older Linux distributions will have a broken Narrate feature.
[Describe test coverage new/current, TreeHerder]: No new test coverage. This simply removes speech synthesis voices on older versions.
[Risks and why]: 
[String/UUID change made/needed]: None
Attachment #8771514 - Flags: approval-mozilla-beta?
Attachment #8771514 - Flags: approval-mozilla-aurora?
Flags: qe-verify+
Comment on attachment 8771514 [details]
Bug 1270110 - Hide narrate button if no synth voices are present in browser.

Regression, Aurora50+, Beta49+
Attachment #8771514 - Flags: approval-mozilla-beta?
Attachment #8771514 - Flags: approval-mozilla-beta+
Attachment #8771514 - Flags: approval-mozilla-aurora?
Attachment #8771514 - Flags: approval-mozilla-aurora+
Attachment #8771513 - Flags: approval-mozilla-beta?
Attachment #8771513 - Flags: approval-mozilla-beta+
Attachment #8771513 - Flags: approval-mozilla-aurora?
Attachment #8771514 - Flags: approval-mozilla-aurora+
QA Contact: camelia.badau
I've tested on latest Aurora 50.0a2 (buildID: 20160810004000) and Firefox 49 Beta 2 (buildID: 20160808002253) and I have the following results: 
- on Ubuntu 13.10 x86 - the "Narrate" button is hidden
- on Ubuntu 12.04 LTS x86 - the "Narrate" button is hidden
- on Ubuntu 12.04 LTS x64 - the "Narrate" button is hidden
- on Ubuntu 14.04 LTS x64 - the "Narrate" button is hidden - I think that the button should be visible here, because synth voices are present in browser
- on Ubuntu 16.04 x64 - the "Narrate" button is visible

What do you think about the behaviour from Ubuntu 14.04 LTS x64? Shouldn't the "Narrate" button be visible here?
Flags: needinfo?(eitan)
(In reply to Camelia Badau, QA [:cbadau] from comment #23)
> I've tested on latest Aurora 50.0a2 (buildID: 20160810004000) and Firefox 49
> Beta 2 (buildID: 20160808002253) and I have the following results: 
> - on Ubuntu 13.10 x86 - the "Narrate" button is hidden
> - on Ubuntu 12.04 LTS x86 - the "Narrate" button is hidden
> - on Ubuntu 12.04 LTS x64 - the "Narrate" button is hidden
> - on Ubuntu 14.04 LTS x64 - the "Narrate" button is hidden - I think that
> the button should be visible here, because synth voices are present in
> browser
> - on Ubuntu 16.04 x64 - the "Narrate" button is visible
> 
> What do you think about the behaviour from Ubuntu 14.04 LTS x64? Shouldn't
> the "Narrate" button be visible here?

Camelia,

Can you please type this in a terminal of the 14.04 test machine you are using, and paste the output here?

speech-dispatcher --version
Flags: needinfo?(eitan) → needinfo?(camelia.badau)
Ritu,

Why did you cancel the approval flag for aurora? We now have this in beta, nightly but not aurora.
Flags: needinfo?(rkothari)
(In reply to Eitan Isaacson [:eeejay] from comment #25)
> Ritu,
> 
> Why did you cancel the approval flag for aurora? We now have this in beta,
> nightly but not aurora.

Hi Eitan, if you look at comment 16, this landed in Nightly50. So this is already in Aurora50 and Nightly51 and only needed to be uplifted to Beta49.
Flags: needinfo?(rkothari)
(In reply to Ritu Kothari (:ritu) from comment #26)
> (In reply to Eitan Isaacson [:eeejay] from comment #25)
> > Ritu,
> > 
> > Why did you cancel the approval flag for aurora? We now have this in beta,
> > nightly but not aurora.
> 
> Hi Eitan, if you look at comment 16, this landed in Nightly50. So this is
> already in Aurora50 and Nightly51 and only needed to be uplifted to Beta49.

Ah, perfect. Thanks!
(In reply to Eitan Isaacson [:eeejay] from comment #24)
> (In reply to Camelia Badau, QA [:cbadau] from comment #23)
> > I've tested on latest Aurora 50.0a2 (buildID: 20160810004000) and Firefox 49
> > Beta 2 (buildID: 20160808002253) and I have the following results: 
> > - on Ubuntu 13.10 x86 - the "Narrate" button is hidden
> > - on Ubuntu 12.04 LTS x86 - the "Narrate" button is hidden
> > - on Ubuntu 12.04 LTS x64 - the "Narrate" button is hidden
> > - on Ubuntu 14.04 LTS x64 - the "Narrate" button is hidden - I think that
> > the button should be visible here, because synth voices are present in
> > browser
> > - on Ubuntu 16.04 x64 - the "Narrate" button is visible
> > 
> > What do you think about the behaviour from Ubuntu 14.04 LTS x64? Shouldn't
> > the "Narrate" button be visible here?
> 
> Camelia,
> 
> Can you please type this in a terminal of the 14.04 test machine you are
> using, and paste the output here?
> 
> speech-dispatcher --version

This is the output: speech-dispatcher 0.8
Flags: needinfo?(camelia.badau)
(In reply to Camelia Badau, QA [:cbadau] from comment #28)
> (In reply to Eitan Isaacson [:eeejay] from comment #24)
> > (In reply to Camelia Badau, QA [:cbadau] from comment #23)
> > > I've tested on latest Aurora 50.0a2 (buildID: 20160810004000) and Firefox 49
> > > Beta 2 (buildID: 20160808002253) and I have the following results: 
> > > - on Ubuntu 13.10 x86 - the "Narrate" button is hidden
> > > - on Ubuntu 12.04 LTS x86 - the "Narrate" button is hidden
> > > - on Ubuntu 12.04 LTS x64 - the "Narrate" button is hidden
> > > - on Ubuntu 14.04 LTS x64 - the "Narrate" button is hidden - I think that
> > > the button should be visible here, because synth voices are present in
> > > browser
> > > - on Ubuntu 16.04 x64 - the "Narrate" button is visible
> > > 
> > > What do you think about the behaviour from Ubuntu 14.04 LTS x64? Shouldn't
> > > the "Narrate" button be visible here?
> > 
> > Camelia,
> > 
> > Can you please type this in a terminal of the 14.04 test machine you are
> > using, and paste the output here?
> > 
> > speech-dispatcher --version
> 
> This is the output: speech-dispatcher 0.8

That version of speech dispatcher is too old. When you tested it earlier, maybe you applied updates to the vm first?
I didn't change anything. I've retested now on Ubuntu 14.04 LTS x64 with "speech-dispatcher 0.8" version: 
- on Aurora 49.0a2 (2016-08-27): the issue is NOT reproducible, everything works fine (the "Narrate" button is visible here)
- on Aurora 50.0a2: the "Narrate" button is hidden
> I didn't change anything. I've retested now on Ubuntu 14.04 LTS x64 with
> "speech-dispatcher 0.8" version: 
> - on Aurora 49.0a2 (2016-08-27): the issue is NOT reproducible, everything
> works fine (the "Narrate" button is visible here)
> - on Aurora 50.0a2: the "Narrate" button is hidden

What do you think? 
What should I do with this issue? Should I fill a follow-up bug for Ubuntu 14.04 x64 and close this one?
Flags: needinfo?(eitan)
(In reply to Camelia Badau, QA [:cbadau] from comment #31)
> > I didn't change anything. I've retested now on Ubuntu 14.04 LTS x64 with
> > "speech-dispatcher 0.8" version: 
> > - on Aurora 49.0a2 (2016-08-27): the issue is NOT reproducible, everything
> > works fine (the "Narrate" button is visible here)
> > - on Aurora 50.0a2: the "Narrate" button is hidden
> 
> What do you think? 
> What should I do with this issue? Should I fill a follow-up bug for Ubuntu
> 14.04 x64 and close this one?

I don't think there is anything we can do in this case. We can't detect precise libspeechd versions, we are detecting version 0.8.2 because of the symbols that were added.

Version 0.8.2 might be an arbitrary cutoff, but at least it is conservative enough that we know it is supported. Also, the narrate function isn't actually broken in 14.04, it is simply not available.
Flags: needinfo?(eitan)
Marking the issue as VERIFIED FIXED based on the above comment.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.