Failure to apply exportMp3BitRate from ~/.config/MuseScore/MuseScore2.ini
MuseScore 2.2.1
(build OS: Ubuntu 14.04.1 LTS, Arch.: x86_64, MuseScore version (64-bit): 2.2.1, revision: 51b8386)
Symptom:
After changing the MP3 export bit rate to 256 under Edit/Preferences/Export, MuseScore exports MP3 as required. However, after subsequent restart, MuseScore MP3 export uses a bit rate of 128 (and this is what is shown in Edit/Preferences/Export), even though the value of 256 is held in ~/.config/MuseScore/MuseScore2.ini.
Investigation:
I can change the 'Sample Rate' and 'MP3 bit rate' values under Edit/Preferences/Export and the values I select are stored correctly in the .ini.
~/.config/MuseScore/MuseScore2.ini shows the values I use:
exportAudioSampleRate=44100
exportMp3BitRate=256
These values are correctly used on exporting to MP3 until I close MuseScore. However, on restart, MuseScore correctly reads the value I have set in exportAudioSampleRate and displays it in Edit/Preferences/Export 'Sample Rate' but MuseScore always shows 128 in Edit/Preferences/Export 'Bit Rate' regardless of the value in the .ini file's exportMp3BitRate. Futhermore, MP3 export disregards the bit rate value in the .ini file.
This suggests:
1. The .ini file is being read correctly (presumably with a library method).
2. The default start-up value of exportAudioSampleRate is being overwritten as expected with the value in the .ini file.
3. The default start-up value of exportMp3BitRate is not being overwritten with the value in the .ini file and so the required value is not used in export operations.
This should be a simple fix in the code that assigns .ini values to live preferences.
Comments
Seems to work just fine in a 2.3 nightly builds on Windows, could you please test a 2.3 nighly AppImage on Linux?
There was a related bug that got fixed (#272042: Saved preferences override command line options) in master and 2.3, possibly it fixed this one on the passing (most probably this part of it)
Actually I'm pretty sure this is fixed in 2.3 and master (see above), reopen if you still can reproduce with the latest development builds
In reply to Seems to work just fine in a… by Jojo-Schmitz
Hi,
I downloaded this:
http://ftp.osuosl.org/pub/musescore-nightlies/linux/x86_64/MuseScoreNig…
and saw exactly the same problem.
Then I downloaded this:
http://ftp.osuosl.org/pub/musescore-nightlies/linux/x86_64/MuseScoreNig…
And it looks like it's fixed!
So, not fixed in 2.3 for Linux, but fixed in 3.0 for linux.
Hope that helps.
(I'm on linux mint 17.3, by the way)
I don't understand why it works on Windows but not on Linux.
In reply to (No subject) by Jojo-Schmitz
Yes, it's a puzzle. Looking at the code segment you highlighted, I assume the preferences structure comes from the .ini file. There is a section of code higher up (if (parser.isSet("S")) {...}) which conditionally assigns the value of 128 to preferences.exportMp3BitRate. Obviously, I don't know what "S" refers to but if that differs between Windows and linux it could explain why the .ini value gets lost. Also the value temp (which is involved in determining the value of preferences.exportMp3BitRate) appears to be used differently in that section, relying on a prior setting from a previous code segment.
"S" refers to the command line option -S, to load a style file, totally unrelated to mp3 bitrate, only listed in the diff for context purposes. The command line option -b is for setting the bit rate, and indeed that should override the preferences (rather than vice versa, this is what that issue was about)
2.3.1 was end of line for MuseScore 2.x. Since we cannot reproduce on master, I close this issue. Please reopen if you can reproduce in master.