orca --setup, tab "Voice": Language setting not saved

Bug #1849461 reported by Bastiaan Stougie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
orca (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

$ lsb_release -rd
Description: Ubuntu 19.10
Release: 19.10

$ apt-cache policy orca
orca:
  Installed: 3.34.0-1ubuntu3
  Candidate: 3.34.0-1ubuntu3
  Version table:
 *** 3.34.0-1ubuntu3 500
        500 http://be.archive.ubuntu.com/ubuntu eoan/main amd64 Packages
        500 http://be.archive.ubuntu.com/ubuntu eoan/main i386 Packages
        100 /var/lib/dpkg/status

$ orca --setup

In the "Voice" tab, if I change only the Language setting from default value "en" to for example "nl" and press "OK", the voice does not change and when I run orca --setup again, the language setting is back to the original value "en".

Revision history for this message
Bastiaan Stougie (ghengiz-cohen) wrote :
Download full text (3.4 KiB)

I traced this to a problem in "/usr/lib/python3/dist-packages/orca/backends/gsettings_backend.py". It does not store the Language setting unless also one of "Rate", "Pitch", or "Volume" in the "Voice" tab are changed.

I changed the code in settings_manager.py to use the json backend, and examined the resulting json configuration file:

    "profiles": {
        "default": {
            "speechServerFactory": "orca.speechdispatcherfactory",
            "speechServerInfo": [
                "Default Synthesizer",
                "default"
            ],
            "voices": {
                "default": {
                    "established": false,
                    "family": {
                        "name": "Dutch",
                        "lang": "nl",
                        "dialect": "",
                        "variant": "none"
                    }

So json_backend.py can independently store or retrieve the modified Language setting under "family", while "established" is false (meaning none of "Rate", "Pitch", and "Volume" settings have been modified).

gsettings_backend.py should also independently store and retrieve the Language setting if none of "Rate", "Pitch", and "Volume" settings have been modified. I changed the code as follows to do so:

$ diff orca-patched/orca/backends/gsettings_backend.py /usr/lib/python3/dist-packages/orca/backends/gsettings_backend.py
468,476c468,475
< if voiceEstablished == True or voiceGSettingsFamily.get_boolean('family-set') == True:
< if voiceEstablished == True:
< if appSpecific == False and voiceSetting.__contains__('established'):
< voiceSetting.pop('established')
< for setting in ['average-pitch', 'gain', 'rate']:
< if voiceGSettings.get_user_value(setting) is not None:
< gSettingsVal = voiceGSettings.get_double(setting)
< debug.println(debug.LEVEL_FINEST, 'INFO: GSettings backend: Getting voice setting for voice %s with name %s = %s' % (voice, setting, gSettingsVal))
< voiceSetting[setting] = gSettingsVal
---
> if voiceEstablished == True:
> if appSpecific == False and voiceSetting.__contains__('established'):
> voiceSetting.pop('established')
> for setting in ['average-pitch', 'gain', 'rate']:
> if voiceGSettings.get_user_value(setting) is not None:
> gSettingsVal = voiceGSettings.get_double(setting)
> debug.println(debug.LEVEL_FINEST, 'INFO: GSettings backend: Getting voice setting for voice %s with name %s = %s' % (voice, setting, gSettingsVal))
> voiceSetting[setting] = gSettingsVal
619,622c618,621
< if voiceSettings[voice].__contains__('family'):
< for setting in ['name', 'locale', 'dialect']:
< voiceFamilyGSettings.set_string(setting, voiceSettings[voice]['family'].get(setting))
< voiceFamilyGSettings.set_boolean('family-set', True)
---
> i...

Read more...

Revision history for this message
Bastiaan Stougie (ghengiz-cohen) wrote :

Sorry about the unformatted code above, I'm new to this. Attached to this comment is a patch created with "diff -u".

Revision history for this message
Bastiaan Stougie (ghengiz-cohen) wrote :

Sorry about the unformatted code above, I'm new to this. Attached to this comment is a patch created with "diff -u".

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for the bug report and the patch. The backend was not maintained and buggy so it was removed in the recent upload, which fixes the issue https://launchpad.net/ubuntu/+source/orca/3.35.3-1ubuntu1
Would still be useful to do a stable update with the fix though

Changed in orca (Ubuntu):
importance: Undecided → Low
status: New → Fix Released
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.