Proposal Easy cfg Reset

From Audacity Wiki
Revision as of 16:53, 31 July 2019 by James (talk | contribs) (Old now irrelevant text.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Proposal pages help us get from feature requests into actual plans. This proposal page is about adding a "Reset Preferences" command to Audacity.
Proposal pages are used on an ongoing basis by the Audacity development team and are open to edits from visitors to the wiki. They are a good way to get community feedback on a proposal.

  • Note: Proposals for Google Summer of Code projects are significantly different in structure, are submitted via Google's web app and may or may not have a corresponding proposal page.
bug 363 enh request has some relevant discussion.

The Problem

The audacity.cfg file can become corrupt leading to unexpected behaviours in Audacity that can only be fixed by "initializing" the contents of that file to NewPrefsInitialized=1. Trashing the file is not an option as Audacity may read previously-installed 1.2.x preferences and that preferences file may be corrupt. So the user must edit the audacity.cfg in a plain text editor and overwrite the file in its original location without changing the file extension. On Windows and Linux the user must show hidden files in order to open audacity.cfg.

Peter 12Nov14: Actually with the 2.0 & 2.1.x now it is a valid option just to trash the .cfg file as we no longer try to inherit obsolete settings from any previous use of 1.2.x


  • VST plug-ins can stop Audacity starting properly, so a feature within Audacity, for example menu item or preferences reset-button on its own is not enough.
  • Display preferences can leave Audacity not appearing, i.e. underneath other windows, or on a second monitor tha tis not there, so again features to resolve this within Audacity on their own will not be enough.
    • However a way to start Audacity that safely goes to the preferences page before loading preferences would solve such 'can't start' issue.

Peter 14Feb16: As a Mac-virgin (only in my 24th hour of use right now) I found it virtually impossible to find where Audacity on a Mac was storing my audacity.cfg file so that I can easily reset it (for testing in my case). Even after reading the Manual I needed a helping hand from Steve by email - and even then I floundered around for the best part of an hour trying to find it.
  • Ok solved for me now as I have a link to the Audacity folder on my Mac desktop (via an "Alias") so I can go there easily and delete the .cfg file - but we really should make this easier for others to do.
  • Gale: 14Feb16: I think many agree it should be easier on Mac but as for the docs, what was the difficulty with Go > Go to Folder?
    • Peter 15Feb16: I didn't read the Warning note - my eyes only saw the Windows advice and glossed over the Mac stuff - maybe we can make that stand ou more. Plus (as a Mac-Virgin) I'm still struggling with Finder and the like - and with the fact that unless Finder is the active app then its menu with the necessary "Go" doesn't show on the screen ;-)
    • Peter 15Feb16: And I never found it that easy on Windows until I place a similar shortcut on my desktoip to the appropriete folder.

The Proposal

An easy way for users to reset the audacity.cfg file to a clean state - in effect setting the contents to "NewPrefsInitialized=1" or filling it with the default values that Audacity would use on first launch when it finds an audacity.cfg file that contains only "NewPrefsInitialized=1".

This is listed as #363 P4 enhancement on Bugzilla.

  • Two buttons within Audacity on each Preferences pane
    • a) reset audacity.cfg - a global Preferences reset
    • b) "Reset" or "Defaults" button to reset only Preferences shown on that pane
  • or, a new "Reset" Preferences pane (with partial or full wipe)
  • A method for both Mac and Windows including zip users to reset .cfg when Audacity won't launch/visibly crashes on launch.

  • Or a global reset tool (a menu item and/or a separate small app) that offers a dialog with a reset of:
    • Preferences (default = on)
    • Pluginsettings (default = off)
    • Pluginregistry (default = off)

Proposal JC (choices by James)


Do not edit this 'Proposal JC' section.
Instead, if you disagree, start your own section.

  • A "Manage Preferences" pane in preferences, with a brief explanation.
  • The language setting moves to this page.
  • There is a Reset button and a drop down with choices:
    • Everything (this is the default, and includes effects)
    • Preferences (just the Preferences)
    • Effects (just the Effects)
    • to <name of config> (this/these appear if, e.g., a teacher has set up alternative configs)

  • Special start-up (to overcome can't start problems). If you launch Audacity with shift held down, or if Audacity is started with a command line with -reset in it:
    • Audacity will start on the manage preferences page, before having loaded the preferences and plug ins.
  • These should also bypass and clear the lock file.
  • As a stretch goal, we can also sometimes detect if Audacity failed to start properly the previous time, and go straight to the "Manage Preferences" page in that case.

There is no 'Are you Sure?' prompt in any of these cases.

Alternative configs are a feature for advanced users. They are set up by going into the config directory and making a copy of the existing audacity.cfg files but with a new name. Extra directives can be added into these that also take plug in information.

Audacity may need to be restarted for those preferences that are already 'restart required'. Over time we would like to fix all cases of 'restart required'. The manual should mention this and explain what is not reset until a restart.

Developer/QA Backing

  • Peter 31Jul19: I support the "Global resets" a command with a dialog that offers prefs and /or plugins resets.
  • Peter 14Apr11: this was discussed earlier by QA folk on the Forum where there was almost unanimous support for this (with a couple of partial votes): Bill, Koz, Bruno, Peter, Ed 0.75, Steve 0.5 - see this forum thread:
    • Peter 12Nov14: +1 for a new "Reset" Preferences pane (with partial or full wipe) - but also +1 for two buttons within Audacity a) reset audacity.cfg b) "Defaults" button to reset listed Preferences only (especially if that is easier and quicker to do).
      • +1 for a method for both Mac and Windows including zip users to reset .cfg when Audacity won't launch/visibly crashes on launch. This has been discussed before that thread above as well.
      • -1 for a new menu item to reset
  • Gale: +1 for two buttons within Audacity a) reset audacity.cfg b) "Defaults" button to reset listed Preferences only, combined with a method for both Mac and Windows including zip users to reset .cfg when Audacity won't launch/visibly crashes on launch. This has been discussed before that thread above as well.
  • James: +1 on a reset button.
    • Also +1 on making VST safer and +1 on safe-mode after an abnormal terminate or on special-launch.
  • Ed: +1 on the general concept (the +.75 was for the offered implementation)
  • Bill Wharrie:
    • +1 for a flexible reset system i.e. one where the user can choose a complete wipe, or remove/reset-to-default some defined subset of preferences
    • +1 for being able to start Audacity in "safe" mode or similar, which would involve launching with a modifier key held down and would temporarily or permanently reset preferences.


An external reset app

A small app that we can ship alongside Audacity that the user can run to force a total reset (needed sometimes as explained above "Display preferences can leave Audacity not appearing") and thus the user would never see Audacity running, let alone get access to Preferences.

As of 26 November 2014 there are two configuration files which seem to have the possibility of causing Audacity to not launch (or launch in an unusable condition): audacity.cfg & plug-inregistry.cfg. These configuration files can be stored in either or both of two filesystem locations (the default or in a Portable Settings folder).

Given that these files are tiny, the external application could create a date-named (audacity26November2014.cfg) backup by renaming the current file instead of deleting it.

Ed 14Nov14 : an alternate possible solution for the cases where Audacity opens but is invisible, opens but its title bar is hidden behind the Mac title bar or Windows taskbar when docked at the top or opens briefly but self-terminates, would be to use a new command line switch (or maybe 2 - one to restore to defaults and another to allow the user to control the effects).

  • Gale 14Nov14: Does the user trigger the switch with a modified click on the executable? That saves a second app, but is probably undiscoverable by "normal" users without reading the docs.
    • Ed 26Nov14 : Not triggered by a modified click on the executable - requires Audacity to be started from a terminal/command line.
      • Gale 28Nov14: Which means most users can't use it. Have a look at the dialogue when you SHIFT-click on the Firefox executable.

External application design details

The original design criterion was a single button which deleted the default location (e.g. C:\Users\UserName\AppData\Roaming\Audacity) audacity.cfg file; at that time there was no such thing as plug-inregistry.cfg. This design (as well as an expansion to three buttons: "both", "audacity" & "plug-inregistry") with two wxWidgets-based applications to test is discussed in this forum thread: Until page 10 of that thread no consideration was given for Portable Settings.

  • Gale 28Nov14: IMHO we should not design this for bugs in plug-inregistry.cfg. If audacity.cfg is deleted or initialised, the user is offered a plug-in rescan. In that dialogue, the checkmarked effects only should be loaded, unless user presses Cancel. Pluginregistry.cfg should not continue to enable all its cached plug-ins as if Register Effects had not appeared. We may want to store a list of "bad" plug-ins somewhere however.

This external application could also be made more "surgical"; an early example was given which had panes for each of the Preferences pages allowing the user to reset only specified items to default. This was considered way too complicated, especially for an external application. However, given that one of the easiest ways to cause Audacity to be unavailable even though it launches successfully is to close it while its last open Project is on a secondary monitor then disconnect that secondary monitor, having a button which does nothing but cause Audacity to open in its default size and location might make sense.

  • Gale 28Nov14: Yes that might make sense, but the case for a button to set Language to English is probably equal or higher priority:
  • Gale 28Nov14: Another option not raised elsewhere in this Proposal is to use the existing Windows installer feature to reset Audacity by writing "resetPrefs.txt" to the folder the external reset app runs from. This seems quite attractive for Windows. If on Mac we can write inside the folder the app runs from, it will work there too.
    • We can run the appropriate reset for the version of Audacity, so if run in 2.0.6 or earlier the replaced audacity.cfg will have "NewPrefsInitialized=1", otherwise not.
    • If there is a "Portable Settings folder", the audacity.cfg in that (which is the one that matters) gets reset, though not the one in the application data folder.
    • We get a ready-made prompt dialogue (Yes or No to reset Prefs when restarting Audacity) that should work cross-platform. I've tested it on Mac by adding resetPrefs.txt to the "Resources" folder in the bundle, and it seems to work fine.
    • We can change the current code in Prefs.cpp to do what we like if Audacity finds resetPrefs.txt, then the Windows installer would do the same as the external app (assuming we want consistency between the two).
  • Gale 28Dec14: QA consensus currently favors a separate app for Windows and Mac that would be distributed with the Audacity application. This app would write "resetPrefs.txt" to the folder the app is in (or on Mac to "/" within the folder the app is in). This approach ensures the correct "NewPrefsInitialized=1" is written to .cfg if the app is actually used to reset Audacity 2.0.6 or earlier.

A "Reset" button in Preferences panes

Rds.png Credits: Image by Ed

A "Reset" pane in Preferences

The avoids adding another menu command at the expense of a new prefs pane. What would this pane look like? What would it say and what steps would the user need to perform in order to reset preferences.

  • Gale: I think a Prefs pane would look pretty bare with just that. If we want more than an Edit menu button, then this Prefs pane could have e.g. save a copy of current .cfg. (and reload it), a bit like a "Theme" - could be e.g. a particular set of floated toolbars; or direct editing of .cfg.
    • James: Another option, we could put it on a general panel.
  • Peter 13Nov14: I would also support James' idea of a General Panel carrying a reset which would reset all Prefs (The problem with this approach would be that it would only be a Preferences reset and not a full reset to "factory settings" as the Toolbars would not be reset). Building on James' idea I would propose a "Reset" pane in Preferences with checkboxes for each Preference (by pane name). Such a pane would look far from bare like that, countering Gales's misgivings. This could avoid us having to put a Reset button on each individual pane.
    • Though I still like the possible option of additionally having Reset button on each of the Preferences dialogs as the user could then observe the default values being reset. We could avoid wordiness on the pane by having hover-help pop-ups with any dire warnings we want (is that possible with buttons?)

A "Reset Preferences" menu command

  • Peter 13Nov14: -1 I do not support a new Menu command for this, for a start it would end up being too blunt a tool and furthermore it would add unnecessarily to the Menu structure (which is almost somewhat over-burdened). Plus I don't se a logical place for it to live in the current menu tree.

Where does it go in the menu structure and how does it behave? What warnings are given and how are they worded?

  • There is consensus that some warning at least should be given.
    • A UI Q&A site has some recommendations about 'are you sure' wording. The gist is to keep it short, be specific and label the buttons specifically, not just Yes/No.

Current suggested wording:

Title: Reset Audacity Preferences?
Reset Preferences?  

We could have a hyperlink to online help. Specifically NOT local help in case the location for that is messed up. Hyperlink won't help if the user does not have a normal browser, but could help many users.

  • Bill: I prefer "Reset" over "Delete". It's what we're doing, and I believe most apps use that word.
    • +1. So do I. James 16:53, 14 April 2011 (UTC)
    • +1 Ed
    • +1 Peter

Alternative suggested wording:

Title: Reset Audacity Preferences?
Reset Audacity preferences to default values?
[Reset|Cancel] where Cancel is the default
  • James: A bit wordy? 'Audacity' becomes 'verbosity'? See the tip in the UX link.
    • Gale: I think a little "verbosity" could be needed until we have a help system or specific help button. Thinking about it, "Preferences" is a little misleading. Cfg covers more than what is exposed in the Preferences. "Restore default settings?"
    • James: Then for consistency we should change 'preferences' to 'settings' throughout.... to me there is not enough in it to make the change. Would having the help hyperlink I suggested be enough to mollify you over the shorter prompt?
      • Gale: Hyperlink and shorter text and not in its own pane are all OK for me.
      • Ed: +1 hyperlink. +1 "settings" over "preferences"

Proposed Patches

Gale 28Dec14: A patch has been attached to Bug 363 that provides a "Reset" button in all Preferences panes. This asks for confirmation of reset, exits Audacity on "Yes", asks for "Save Changes?" then after Audacity is quit, rewrites audacity.cfg to "NewPrefsInitialized=1". If there is a "Portable Settings" folder then audacity.cfg in that folder is initialized.

The patch does not delete audacity.cfg (which is all that's wanted assuming user runs 2.1.0 or later after the reset, but which can't be 100% guaranteed).