AppImage factory reset and initial execution initializes Soundfont path with temp dir that will be invalid in future executions
Reproduction steps:
- download nighly AppImage from https://bintray.com/musescore
- reset preferences.ini by executing AppImage using any of the following manners:
- on a system that has never executed a development musescore version, OR
- execute with factory reset, OR
- rm -f pathtoMuseScoreDevelopment.ini, OR
- on a machine that may have dev preferences set already, but goto Preferences->"Reset to Default Settings"
Undesired Result: if user is on a fresh system or otherwise doesn't have any soundfonts in ~/Documents/MuseScoreDevelopment/Soundfonts, then user will not have any soundfonts available, so playback will be silent.
Expected Behavior: User has default soundfont that was included with AppImage always avialable.
Comments
See me comments in https://github.com/Musescore/musescore/pull/2398 when I discovered this issue. I notice the problem is that the line that performs initialization of soundfont directory uses mscoreGlobalShare, which is going to be different upon every execution
Note: none of the other folders in Preferences dialog window show the part containing mscoreGlobalShare.
I think the solution is to have the Soundfont folderlist be consistent with the other Preferences folders (e.g. Templates & Styles), so that Preferences::sfPath won't contain any mscoreGlobalShare path in the actual stored string. However, whenever sfPath is read, will need to add the default mscoreGlobalShare folder.
Solution could be to make the SoundFont path relative to the default location, and only check outside $GlobalShare/sounds if an absolute path is given.
well the way I've fixed it now is to not even include mscoreGlobalShare/sounds inside the soundfont path string that gets stored. So now soundfont path is like template or style path. So it is just going to always be assumed that mscoreGlobalShare/sounds is always one of the search folders, and there will be no way for user to remove (or modify) mscoreGlobalShare/sounds from the soundfont path. I think that covers what you are saying "make the SoundFont path relative to the default location, and only check outside $GlobalShare/sounds if an absolute path is given".
Yes, that's exactly it.
I've been trying to track down for the last couple hours why my PR:
https://github.com/musescore/MuseScore/pull/2400
always produces a crash when I go to Preferences and press the folder button (on any tab) which crashes upon opening the file viewer (on both my arch linux i686 and armv7). I'm going to take a break and look again later.
I should make this PR 2400 as "ready for review", after PR 2406 (#99626: Make Preferences Choose Folder dialog obey the MuseScore.ini "nativeDialogs" boolean.) is accepted:
https://github.com/musescore/MuseScore/pull/2400
Fixed in branch master, commit ff749fd292
fix #99236 remove mscoreGlobalShare/sound from soundfont path
Preferences::sfPath is renamed "mySoundfontsPath", which adheres to same naming scheme for myPluginsPath and myTemplatesPath, and now only stores the user-specified soundfont folders (no longer stores mscoreGlobalShare/sound). Any synthesizers loading soundfonts must make sure to look in mscoreGLobalShare/sound in addition to mySoundfontsPath. Removing mscoreGlobalShare/sound from the stored path fixes a bug with portable AppImages, which use a different temporary directory for mscoreGlobalShare on every execution.
Fixed in branch master, commit bec7074c52
Merge pull request #2400 from ericfont/99236-mySoundfontPath
fix #99236 remove mscoreGlobalShare/sound from soundfont path
Fixed in branch 2.0.3, commit cd49abf02a
fix #99236 remove mscoreGlobalShare/sound from soundfont path
Preferences::sfPath is renamed "mySoundfontsPath", which adheres to same naming scheme for myPluginsPath and myTemplatesPath, and now only stores the user-specified soundfont folders (no longer stores mscoreGlobalShare/sound). Any synthesizers loading soundfonts must make sure to look in mscoreGLobalShare/sound in addition to mySoundfontsPath. Removing mscoreGlobalShare/sound from the stored path fixes a bug with portable AppImages, which use a different temporary directory for mscoreGlobalShare on every execution.
I'm verifying the I get proper update behavior for sfPath->mySoundfontsPath when I run the i686 linux AppImage 2.0.3 nightly for 20160226 4e025g6 (which includes this commit) starting with sfPath filled.
and I'm verifying that this bug #99236: AppImage factory reset and initial execution initializes Soundfont path with temp dir that will be invalid in future executions is indeed fixed in that AppImage.
Automatically closed -- issue fixed for 2 weeks with no activity.