Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Make FluidSynth logging less noisy by default #2729

Open
wants to merge 1 commit into
base: master
from

Conversation

@eriktorbjorn
Copy link
Member

@eriktorbjorn eriktorbjorn commented Jan 13, 2021

I'm using a SoundFont file called 8MBGMSFX.SF2 that was included with my old SoundBlaster sound card. You'd think that would be as close to an official SoundFont that you can find, and yet I'm still getting a bunch of annoying warnings when the FluidSynth driver is initialized:

fluidsynth: warning: Instrument 'Piano 1': Some invalid generators were discarded
fluidsynth: warning: Instrument 'Piano 2': Some invalid generators were discarded
fluidsynth: warning: Instrument 'Piano 3': Some invalid generators were discarded
fluidsynth: warning: Instrument 'Honky-tonk': Some invalid generators were discarded

And then when the drive is de-initialized:

fluidsynth: warning: No preset found on channel 0 [bank=0 prog=34]
fluidsynth: warning: No preset found on channel 1 [bank=0 prog=73]
fluidsynth: warning: No preset found on channel 2 [bank=0 prog=45]
fluidsynth: warning: No preset found on channel 3 [bank=0 prog=71]
fluidsynth: warning: No preset found on channel 4 [bank=0 prog=65]
fluidsynth: warning: No preset found on channel 5 [bank=0 prog=89]
fluidsynth: warning: No preset found on channel 6 [bank=0 prog=92]
fluidsynth: warning: No preset found on channel 7 [bank=0 prog=86]
fluidsynth: warning: No preset found on channel 8 [bank=0 prog=48]
fluidsynth: warning: No preset found on channel 9 [bank=128 prog=0]
fluidsynth: warning: No preset found on channel 10 [bank=0 prog=16]
fluidsynth: warning: No preset found on channel 11 [bank=0 prog=11]
fluidsynth: warning: No preset found on channel 12 [bank=0 prog=11]
fluidsynth: warning: No preset found on channel 13 [bank=0 prog=57]
fluidsynth: warning: No preset found on channel 14 [bank=0 prog=58]
fluidsynth: warning: No preset found on channel 15 [bank=0 prog=0]

This proof-of-concept patch re-routes FluidSynth logging to a custom function, that only prints the messages when running ScummVM in debug mode. The messages are then presented like this:

FluidSynth: Instrument 'Piano 1': Some invalid generators were discarded
FluidSynth: Instrument 'Piano 2': Some invalid generators were discarded
FluidSynth: Instrument 'Piano 3': Some invalid generators were discarded
FluidSynth: Instrument 'Honky-tonk': Some invalid generators were discarded

Since I've only ever seen warnings, I'm not sure what would cause the other log levels. My mapping to ScummVM debug levels / warnings / errors is therefore a bit arbitrary. But I think it would be a good idea to silence these warnings by default, so I'm submitting this for discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.