Failure to apply exportMp3BitRate from ~/.config/MuseScore/MuseScore2.ini

• Jun 16, 2018 - 12:39
Reported version
2.3
Type
Functional
Severity
S4 - Minor
Status
closed
Project

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

Status (old) needs info fixed
Status needs info fixed

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

Status (old) fixed active
Status fixed active
Reported version 2.2 2.3

I don't understand why it works on Windows but not on Linux.

In reply to 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)

Status (old) active closed
Status active closed

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.