muse-sequencer / muse

MusE is a digital audio workstation with support for both Audio and MIDI
https://muse-sequencer.github.io/
Other
660 stars 71 forks source link

Bug affecting synth setups and templates when closing Muse project and opening new one #430

Closed asbaklm closed 3 years ago

asbaklm commented 8 years ago

This seems to be a new bug, wasn't present before.

Example

A Fluidsynth GM player template is created with FluidSynth saved as the 'Useable devices' and it's the first Device under 'Device Port Assignment' Drum channel set to 10, Fluid R3 GM soundfont loaded. Save template. Close project, the click on File, New, Fluidsynth template

Problem

It won't load the soundfont or MIDI channel setup.

When you close and restart Muse application and load the same template, it now will load the soundfont and MIDI channel setup.

Problem seems to occur when a project in Muse is closed and a new one is opened.

The same thing happens with a med project. It loads the correct synth configuration when a project is loaded after starting Muse.

When loading the same project after the previous project window was closed, the synth configuration data is gone.

asbaklm commented 8 years ago

To view the problem:

It assumes that a GM instrument template using Fluidsynth as the GM synth was created beforehand, and that a GM Soundfont was loaded into Fluidsynth and saved.

Muse was then restarted, a "New" project was opened using the GM template. A MIDI file was imported and it was saved as a Muse Project.

Then close the Project and create a New Project again using the GM template. However, now the Fluidsynth Plugin has lost its Soundfont.

Go to Configure Midi Devices, Midi Ports and Synthesizers. Navigate to Fluidsynth in Usable Devices

Go to Usable Devices, Open the Fluidsynth GUI. The "Loaded Soundfonts" are missing. For some reason Fluidsynth (and possibly other devices) are losing their configuration data.

The only way to restore this is to restart Muse, and to load the template again. This is something that I think used to work but stopped working a month or two ago.

asbaklm commented 8 years ago

Update

Part of this problem seems to be cause by filename handling. To avoid problems with soundfonts not being displayed in Fluidsynth, ensure that soundfonts have .sf2 extensions and not .SF2. Removing spaces from soundfont names may also be beneficial.

So for example, if the soundfonts have .SF2 extensions instead of .sf2, it causes a problem for the MESS Fluidsynth plugin to find the .soundfont when a new project template is loaded and midi file is imported.

Why this doesn't happen the first time after muse is started I don't know. For some reason, Fluidsynth MESS can find the .SF2 named soundfonts immediately after starting Muse, but not once a project has been closed and a new one has been opened.

Also, perhaps having spaces in the soundfont names could cause issues but I'm not sure about this.

asbaklm commented 8 years ago

Unfortunately this still doesn't resolve the original problem, that Fluidsynth loses its soundfont when closing a project and opening a new project using a template with Fluidsynth configured in it.

It only works if one either then manually loads in the Soundfont, or one restarts Muse.

spamatica commented 8 years ago

Hi, I've been trying to provoke this but actually this works for me :/ .. so there must be some other parameter.

The soundfont I load is FluidR3 GM.SF2 and located in my $HOME under audio/audio_sf2/sf_download. This configuration I save as a template in the user template folder. Now, without restarting MusE I click new and select the template. The loaded template is OK and can play a few notes I left in the template.

Raking my brain what else to test.. Do you have a non english language set in the operating system? What is printed in the terminal when it loads the template? It should print the name of the soundfont it wants to load I believe.

asbaklm commented 8 years ago

Hi there!

My system is set to English. I load the template in the same way that you do, it is saved in my user templates. I renamed the file to FluidR3_GM.sf2 just in case there could be issues with spaces or filename extensions.

My soundfonts are in ~/Samples/sf2 and I have rwx permissions to it.

This is what it prints in the terminal, as you can see it works fine the first time, but on subsequent loads of template it starts failing. Not always on the second attempt, sometimes on the third attempt etc. The problem seems to be erratic, I cannot reliably reproduce it.

fluidsynth sampleRate 48000 projPathPtr . SOUNDFONT FILENAME + PATH /home/music/Samples/sf2/FluidR3_GM.sf2 JACK: buffersize changed 64 Config File

I've removed the contents of what I posted earlier because I got fooled by a "red herring". What I thought was "the fix", had no effect when I tested again later today.

asbaklm commented 8 years ago

What's strange is that as is shown in the logs it works the first time, it (sometimes) works the second time (finds the sf2) but on this occasion, the third time I closed the template and loaded a "New" template, it shows an error to find the soundfont even though that same soundfont loaded the previous two times.

fluidsynth sampleRate 48000 projPathPtr . SOUNDFONT FILENAME + PATH /home/music/Samples/sf2/FluidR3_GM.sf2 JACK: buffersize changed 64 Config File </home/music/.config/MusE/MusE.cfg> buildMidiEventList: unknown Meta 0x2 2 unabsorbed, adding instead to track: buildMidiEventList: unknown Meta 0x54 84 unabsorbed, adding instead to track:untitled

\ (muse3:7853): CRITICAL **: fluid_synth_cc: assertion 'num >= 0 && num <= 127' failed FluidSynth::setController() - error processing controller event: fluidsynth sampleRate 48000 projPathPtr .

SOUNDFONT FILENAME + PATH /home/music/Samples/sf2/FluidR3_GM.sf2 JACK: buffersize changed 64 Config File </home/music/.config/MusE/MusE.cfg> fluidsynth sampleRate 48000 projPathPtr .

SOUNDFONT FILENAME + PATH /home/music/Samples/sf2/FluidR3_GM.sf2 fluidsynth: error: Unable to open file "" fluidsynth: error: Couldn't load soundfont file fluidsynth: error: Failed to load SoundFont "" JACK: buffersize changed 64 Config File </home/music/.config/MusE/MusE.cfg> Muse: fluidsynth error: Failed to load SoundFont ""

asbaklm commented 8 years ago

Some guesses...

Maybe some process is sometimes "preventing access" to the soundfont during the time it is supposed to be loaded by the Muse template into Fluidsynth? For example, maybe some kind of "sleep" event may be useful after triggering the process to load the template and how soon thereafter it will then load Fluidsynth and the soundfont into Fluidsynth

Or maybe a slight pause between loading Fluidsynth into the track and then loading the soundfont into Fluidsynth.

When the soundfont doesn't want to load via the template I can manually load it into Fluidsynth without seeing errors, but something still prevents it from being loaded from the template.

spamatica commented 8 years ago

Hello again.. wierd. It does give some indications of memory corruption.. Could you try running muse and disabling plugins? E.g muse3 -pNI2 to disable all but internal plugins. Myself I believe I have a problem with some native VST plugins on my system causing corruption when MusE loads them to inspect them. More testing is needed there.

2016-02-04 19:28 GMT+01:00 asbaklm notifications@github.com:

Some guesses...

Maybe some process is sometimes "preventing access" to the soundfont during the time it is supposed to be loaded by the Muse template into Fluidsynth?

Or maybe there is some other issue with how Fluidsynth loads soundfonts?

When the soundfont doesn't want to load via the template I can manually load it into Fluidsynth without seeing errors, but something still prevents it from being loaded from the template.

— Reply to this email directly or view it on GitHub https://github.com/muse-sequencer/muse/issues/430#issuecomment-179983548 .

asbaklm commented 8 years ago

Hi there

I get this, it looks like it still "loses" the soundfont. First time the GM template is loaded it works. Second time, it can't find the soundfont.

$muse3 -pNI2 Config File </home/music/.config/MusE/MusE.cfg> LOCALE en_GB Denormal protection enabled. string2sysex: Cannot convert string to sysex r ct bn bt f7 Trying RTC timer... got timer = 74 Aquired timer frequency: 2048 Connected to session bus, unique name is ":1.50" JACK: buffersize changed 64 starting with template /usr/local/share/muse-3.0/templates/default.med JACK: buffersize changed 64 fluidsynth sampleRate 48000 projPathPtr . SOUNDFONT FILENAME + PATH /home/music/Samples/sf2/FluidR3_GM.sf2 JACK: buffersize changed 64 Config File </home/music/.config/MusE/MusE.cfg>

\ (muse3:4639): CRITICAL **: fluid_synth_cc: assertion 'num >= 0 && num <= 127' failed FluidSynth::setController() - error processing controller event:

\ (muse3:4639): CRITICAL **: fluid_synth_cc: assertion 'num >= 0 && num <= 127' failed FluidSynth::setController() - error processing controller event: fluidsynth sampleRate 48000 projPathPtr . SOUNDFONT FILENAME + PATH /home/music/Samples/sf2/FluidR3_GM.sf2 fluidsynth: error: Unable to open file "" fluidsynth: error: Couldn't load soundfont file fluidsynth: error: Failed to load SoundFont "" JACK: buffersize changed 64 Config File </home/music/.config/MusE/MusE.cfg> Muse: fluidsynth error: Failed to load SoundFont ""

spamatica commented 8 years ago

Hi,

2016-02-05 22:23 GMT+01:00 asbaklm notifications@github.com:

Hi there

I get this, it looks like it still "loses" the soundfont. First time the GM template is loaded it works. Second time, it can't find the soundfont.

Okay, hmm. I need to try more but I don't think I can reproduce this.. Would you mind rebuilding with debug? If it is due to memory corruption, which seems likely.. it would probably not behave the same when built with debug since memory might be allocated differently.

$muse3 -pNI2 Config File LOCALE en_GB Denormal protection enabled. string2sysex: Cannot convert string to sysex r ct bn bt f7 Trying RTC timer... got timer = 74 Aquired timer frequency: 2048 Connected to session bus, unique name is ":1.50" JACK: buffersize changed 64 starting with template /usr/local/share/muse-3.0/templates/default.med JACK: buffersize changed 64 fluidsynth sampleRate 48000 projPathPtr . SOUNDFONT FILENAME + PATH /home/music/Samples/sf2/FluidR3_GM.sf2 JACK: buffersize changed 64 Config File

SOUNDFONT FILENAME + PATH /home/music/Samples/sf2/FluidR3_GM.sf2

fluidsynth: error: Unable to open file ""

Odd

fluidsynth: error: Couldn't load soundfont file fluidsynth: error: Failed to load SoundFont "" JACK: buffersize changed 64 Config File Muse: fluidsynth error: Failed to load SoundFont ""

I see you are running with extremely small jack buffers. Not that it should interfere but do try running with something bigger to rule out problems with it. On this machine it's impossible to go that low, jack goes nuts :P

/Robert

— Reply to this email directly or view it on GitHub https://github.com/muse-sequencer/muse/issues/430#issuecomment-180559678 .

asbaklm commented 8 years ago

Hi there Robert

For running with small buffers, please experience the POWER of the Behringer UMC 404! :zap:

I tried to compile the debug version but it keeps failing to compile on this machine. I'm not sure what the problem is, it may be that there are "mixed" libraries from Ubuntu dev packages and from packages I compiled myself.

It looks like some kind of issue with jack includes. arggggghhh :(

The release version compiles OK though.

asbaklm commented 8 years ago

Debug fails with this error, not sure how to resolve it.

In file included from /home/music/src/muse/muse3/muse/vstnative.cpp:45:0: /home/music/src/muse/muse3/muse/driver/jackaudio.h: In member function ‘virtual void MusECore::JackAudioDevice::setPortName(void, const char_)’: /home/music/src/muse/muse3/muse/driver/jackaudio.h:129:58: warning: ‘int jack_port_set_name(jack_portt, const char_)’ is deprecated (declared at /usr/local/include/jack/jack.h:899) [-Wdeprecated-declarations] virtual void setPortName(void* p, const char* n) { jack_port_set_name((jack_portt)p, n); } ^ /home/music/src/muse/muse3/muse/driver/jackaudio.h:129:95: warning: ‘int jack_port_set_name(jack_portt, const char)’ is deprecated (declared at /usr/local/include/jack/jack.h:899) [-Wdeprecated-declarations] virtual void setPortName(void p, const char* n) { jack_port_set_name((jack_port_t*)p, n); }

spamatica commented 8 years ago

Ah yes, that can happen. When you compile debug we set -Werror which causes all warnings to be treated as errors. If you remove this in CMakeLists.txt the compile should work better.

/Robert

2016-02-06 21:09 GMT+01:00 asbaklm notifications@github.com:

Debug fails with this error, not sure how to resolve it.

In file included from /home/music/src/muse/muse3/muse/vstnative.cpp:45:0: /home/music/src/muse/muse3/muse/driver/jackaudio.h: In member function ‘virtual void MusECore::JackAudioDevice::setPortName(void, const char_)’: /home/music/src/muse/muse3/muse/driver/jackaudio.h:129:58: warning: ‘int jack_port_set_name(jack_portt, const char_)’ is deprecated (declared at /usr/local/include/jack/jack.h:899) [-Wdeprecated-declarations] virtual void setPortName(void* p, const char* n) { jack_port_set_name((jack_port_t

_)p, n); } ^ /home/music/src/muse/muse3/muse/driver/jackaudio.h:129:95: warning: ‘int jack_port_set_name(jack_portt, const char )’ is deprecated (declared at /usr/local/include/jack/jack.h:899) [-Wdeprecated-declarations] virtual void setPortName(void p, const char n) { jack_port_set_name((jack_port_t)p, n); }

— Reply to this email directly or view it on GitHub https://github.com/muse-sequencer/muse/issues/430#issuecomment-180848410 .

asbaklm commented 8 years ago

Thanks! Now we're in business. :)

I tried 4 or 5 times to reproduce the problem with the debug build and couldn't. Strange, hehe Here is the gdb log.

muse3_gdb_log.zip

asbaklm commented 8 years ago

Update: I eventually managed to reproduce it with dbg

SOUNDFONT FILENAME + PATH /home/music/Samples/sf2/FluidR3_GM.sf2 [New Thread 0x7fff9b7fe700 (LWP 12911)] fluidsynth: error: Unable to open file "" fluidsynth: error: Couldn't load soundfont file fluidsynth: error: Failed to load SoundFont "" [Thread 0x7fff9b7fe700 (LWP 12911) exited] [New Thread 0x7fffc9d48700 (LWP 12912)] JACK: buffersize changed 128 [New Thread 0x7fff9b7fe700 (LWP 12913)] [New Thread 0x7fffb2280700 (LWP 12914)] Config File </home/music/.config/MusE/MusE.cfg> Muse: fluidsynth error: Failed to load SoundFont "" [New Thread 0x7fffb1a7f700 (LWP 12915)] [New Thread 0x7fff9a0c0700 (LWP 12916)] [Thread 0x7fffb127e700 (LWP 12908) exited] [Thread 0x7fffb1a7f700 (LWP 12915) exited] [Thread 0x7fff9a0c0700 (LWP 12916) exited] +extra note-off! 87496 pitch 62 velo 0 +extra note-off! 87496 pitch 62 velo 0 +extra note-off! 87496 pitch 74 velo 0 +extra note-off! 87496 pitch 74 velo 0 +extra note-off! 87525 pitch 74 velo 0 +extra note-off! 87525 pitch 74 velo 0 +extra note-off! 87525 pitch 74 velo 0 +extra note-off! 87525 pitch 62 velo 0 +extra note-off! 87525 pitch 62 velo 0 [New Thread 0x7fff9a0c0700 (LWP 12918)] [New Thread 0x7fffb1a7f700 (LWP 12919)] [New Thread 0x7fffb127e700 (LWP 12920)] [Thread 0x7fff9a0c0700 (LWP 12918) exited] [Thread 0x7fffb127e700 (LWP 12920) exited] [Thread 0x7fffb2280700 (LWP 12914) exited] [Thread 0x7fffc9d48700 (LWP 12912) exited] [Thread 0x7fff9b7fe700 (LWP 12913) exited] fluidsynth sampleRate 48000 projPathPtr . SOUNDFONT FILENAME + PATH /home/music/Samples/sf2/FluidR3_GM.sf2 [New Thread 0x7fff9b7fe700 (LWP 12921)] fluidsynth: error: Unable to open file "" fluidsynth: error: Couldn't load soundfont file fluidsynth: error: Failed to load SoundFont "" [Thread 0x7fff9b7fe700 (LWP 12921) exited] [New Thread 0x7fffc9d48700 (LWP 12922)] JACK: buffersize changed 128 [New Thread 0x7fff9b7fe700 (LWP 12923)] [New Thread 0x7fffb2280700 (LWP 12924)] Config File </home/music/.config/MusE/MusE.cfg> Muse: fluidsynth error: Failed to load SoundFont "" [Thread 0x7fffb1a7f700 (LWP 12919) exited]

github-actions[bot] commented 3 years ago

This issue is stale because it has been open one year with no activity. Remove Stale label or comment or it will be closed in 30 days.

github-actions[bot] commented 3 years ago

Issue has been closed automatically after two years of inactivity. Feel free to reopen if the issue is still relevant for current MusE version.