We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5512

Summary: Consider restoring previous default paths for timidity.cfg
Product: SDL_mixer Reporter: Ralph Versteegen <teeemcee>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED WONTFIX QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sezeroz
Version: unspecified   
Hardware: All   
OS: Linux   

Description Ralph Versteegen 2021-01-29 00:28:29 UTC
The patch at bug 4896 (hg 89f446aae9b5) changed how timidity.cfg is found, so that on Unix fewer default locations are searched. This change hasn't made its way into a release yet. The patch was generally an improvement, but it does break MIDI playback for some people for whom it worked before, like myself. So I wonder whether it would be better to add back the old default paths to avoid breakage, because you already have two defaults as a fallback anyway:
/etc/timidity.cfg
/etc/timidity/freepats.cfg  (new since 89f446aae9b5)

Previously it used to also look for
/usr/share/timidity/timidity.cfg
/usr/local/share/timidity/timidity.cfg
/usr/local/lib/timidity/timidity.cfg

Also, I get the impression that Ubuntu uses /etc/timidity/timidity.cfg + /etc/timidity/freepats.cfg


In my case /etc/timidity.cfg uses the FluidR3 soundfonts which SDL_mixer's obsolete TiMidity fork (apparently from 26 years ago, wow!) doesn't support, while my /usr/share/timidity/timidity.cfg is Freepats.

I note that even TiMidity++ 2.13.2 from 2004 supports soundfonts so it's unfortunate that SDL_mixer doesn't support using the system's ALSA MIDI sequencer, so that such things wouldn't be SDL_mixer problem anymore.

(SDL_mixer's FluidSynth backend doesn't work out of the box for me either, because it only looks for /usr/share/sounds/sf2/FluidR3_GM.sf2 (which I placed at a nonstandard location, /usr/local/share/timidity/). Speaking of, you could add FluidR3 GS.sf2 as a default too?)
Comment 1 Ozkan Sezer 2021-01-29 17:09:13 UTC
(In reply to Ralph Versteegen from comment #0)
>  but it does break MIDI playback for some people for whom it worked before

Not sure that I want to 'fix' this:  Why do you not use the
'--with-timidity-cfg=FILE' configury switch to customize for
your own setup?
Comment 2 Ralph Versteegen 2021-01-30 12:19:42 UTC
(In reply to Ozkan Sezer from comment #1)
> Not sure that I want to 'fix' this:  Why do you not use the
> '--with-timidity-cfg=FILE' configury switch to customize for
> your own setup?

That's just one solution, which requires recompiling SDL_mixer (which the large majority of users are not going to do), although other solutions don't.

However I guess generally the library will be compiled by Linux/BSD/etc distro package maintainers who would customise config to match whereever that distro puts the instrument patches... a fact I honestly hadn't considered, since I use Slackware and had to install patches myself.

Anyway, I'm not asking you to do something about this, as I fixed my own problem myself. I really only wanted to bring it up as a suggestion and leave it you.
Comment 3 Ozkan Sezer 2021-01-30 13:41:15 UTC
Closing this as WONTFIX for now.
Comment 4 Sam Lantinga 2021-01-30 20:36:04 UTC
Just to double check, if you set the TIMIDITY_CFG environment variable, does SDL_mixer do the right thing without being recompiled?
Comment 5 Ozkan Sezer 2021-01-30 20:37:39 UTC
(In reply to Sam Lantinga from comment #4)
> Just to double check, if you set the TIMIDITY_CFG environment variable,
> does SDL_mixer do the right thing without being recompiled?

Yes, that's the idea.  Ralph: please confirm that it works for you, too.
Comment 6 Ralph Versteegen 2021-01-30 22:46:40 UTC
Yes, can confirm TIMIDITY_CFG works (though I added /etc/timidity/freepats.cfg as a more robust fix). I'll re-close this.