Bug 752167 - timidity ignores /etc/timidity.cfg from fluid-soundfont-lite-patches
Summary: timidity ignores /etc/timidity.cfg from fluid-soundfont-lite-patches
Alias: None
Product: Fedora
Classification: Fedora
Component: timidity++
Version: 16
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Jindrich Novy
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2011-11-08 17:50 UTC by Pavel Roskin
Modified: 2013-07-02 23:53 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-11-09 08:41:58 UTC

Attachments (Terms of Use)

Description Pavel Roskin 2011-11-08 17:50:50 UTC
Description of problem:

/etc/timidity.cfg is not used by timidity unless /etc/timidity++.cfg is removed.  /etc/timidity++.cfg is part of the timidity++ package.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

1. Install timidity++, fluid-soundfont-lite-patches and kmid2 (just to have some MIDI file)
2. Run
strace timidity /usr/share/kde4/apps/kmid/haendel_hallelujah.mid 2>&1 |grep /etc/timidity
Actual results:

stat("/etc/timidity++.cfg", {st_mode=S_IFREG|0644, st_size=44, ...}) = 0
open("/etc/timidity++.cfg", O_RDONLY)   = 3

Expected results:

stat("/etc/timidity.cfg", {st_mode=S_IFREG|0644, st_size=64173, ...}) = 0
open("/etc/timidity.cfg", O_RDONLY)     = 3

That's what I would see if I remove /etc/timidity++.cfg

Additional info:

First of all, /etc/timidity++.cfg should belong to fluid-soundfont-gm, as that file refers to the soundfont from that package.

One simple solution would be to make fluid-soundfont-gm and fluid-soundfont-lite-patches both provide /etc/timidity++.cfg and conflict with each other.  timidity++ should require either of those files.

Another simple solution would be to make timidity prefer /etc/timidity.cfg over /etc/timidity++.cfg and to keep the packages as is.  That's what the packages of fluid-soundfont-lite-patches might have expected.  That would be friendlier to the users.

A sophisticated solution would be to make timidity read all files under /etc/timidity.d and make soundfonts install different files into that directory.  Then timidity should decide which soundfont is better.

Some relevant discussion can be found in bug #701858

Comment 1 Hans de Goede 2011-11-09 08:41:58 UTC
So first of all let me explain why things are done the way they are:

The behavior of timidity preferring /etc/timidity++.cfg over /etc/timidity.cfg is intentional. timidity is not the only user of "timidity" patches nor has it been for a long time. Various other softsynths, like the midi support build into the SDL_mixer and allegro gaming library also need instrument patches and they use /etc/timidity.cfg to get these patches.

Unlike timidity++, they only support GUS format .pat instrument patches, just like the original timidity. timidity++ however also supports sf2 format soundfonts, which are a lot better.

Hence timidity (which really is timidity++) has been patched in Fedora to use /etc/timidity++.cfg, and ships with a /etc/timidity++.cfg which contains this single line:
soundfont /usr/share/soundfonts/default.sf2

/usr/share/soundfonts/default.sf2 gets provided by the virtual soundfont2-default provides. fluid-soundfont-gm provides soundfont2-default and a /usr/share/soundfonts/default.sf2 symlink

This whole exercise leaves the overloaded /etc/timidity.cfg config file free for use by applications which only expect old style gus format patches, which currently are:
[hans@shalem ~]$ sudo repoquery -q --whatrequires timidity++-patches

Note that SDL_mixer is not on this list, technically it requires them too, but since most SDL-mixer apps don't use midi files and the large size of the patches, the requires has been moved to the the apps themselves for those who need the midi support.

Also note that the timidity++-patches virtual provides is a poorly chosen name, since this are actually regular timidity patches not timidity++ patches, but the name has grown to be the way it is historically.

So long story short, the use of /etc/timidity.cfg has grown over time, changing
its meaning from "timidity's config file" to "config file for apps / libs which need instrument patches for softsynth midi playback", that together with the
fact that some of those apps now support sf2 format soundfonts where as most only support the old timidity.cfg syntax with GUS patches, the meaning now a days is:

"config file for apps / libs which need instrument patches in GUS format for softsynth midi playback"

"config file for apps / libs which need instrument patches for softsynth midi playback and preferably in sf2 format"


Secondly as for your bug report, you write:

"Steps to Reproduce:

1. Install timidity++, fluid-soundfont-lite-patches and kmid2 (just to have
some MIDI file)"

You cannot just install timidity++ and fluid-soundfont-lite-patches, without
also getting fluid-soundfont-gm, since timidity++ requires soundfont2-default and fluid-soundfont-gm is the only package providing that. If you have
timidity++ without having fluid-soundfont-gm, you either have found a yum/rpm bug, or you've forced things with --nodeps.

And once you've both timidity++ and fluid-soundfont-gm, timidity++ will not only work fine (no need to remove /etc/timidity++.cfg) , it will also sound a whole lot better then when using the GUS format patches (and also use less diskspace).

Conclusion -> this is not a bug.

Comment 2 Pavel Roskin 2011-11-09 16:56:23 UTC
I meant "install with dependencies", obviously.  It was confusing that I install a huge soundfont that provides a config file for timidity, and timidity keeps using whatever it used before.  So, it's not a bug, it's a quirk.  Thanks for the detailed explanation!

Note You need to log in before you can comment on or make changes to this bug.