I’ve been building a snap of CorsixTH - a re-implementation of the old DOS game Theme Hospital. One of the greatest games of all time, and made even better by the CorsixTH developers
Unfortunately I’ve hit a stumbling block and wondered if someone was able to help my post-Christmas brain out.
The game works perfectly, but without audio, because the lua scripting system uses timidity to play midi files, and the configuration for the timidity midi system is over in /etc/timidity, which the snap can’t access. Am I gonna have to build Timidity from source, and coerce the config file location, or is there some better way?
Here’s the console output when you run corsixth in a terminal.
An error has occurred!
Almost anything can be the cause, but the detailed information below can help the developers find the source of the error.
Running: The callback handler.
A stack trace is included below, and the handler has been disconnected.
/snap/corsixth/x8/CorsixTH/Lua/audio.lua:580: Could not load music file 'Sound/Midi/MEND.XMI' (/etc/timidity/freepats.cfg: Permission denied)
stack traceback:
[C]: in function 'yield'
/snap/corsixth/x8/CorsixTH/Lua/app.lua:915: in function </snap/corsixth/x8/CorsixTH/Lua/app.lua:910>
The yaml I’m using to build trunk is below. To test this you’ll need the original Theme Hospital game, which is excellent, and available DRM-free on GOG (currently on sale for only £1.19, which is an absolute bargain for this much fun. The GOG download contains the old DOS version (packaged for Windows and OSX) which works fine under DOSBox on Linux - or - eventually - with this snap
I’ve just spent some time trekking through the code of SDL and Timidity… Unfortunately it doesn’t look like there’s any way to override the configuration file with an environment variable. You could try copying the timidity.cfg into the snap’s $HOME directory as it appears that timidity will look for a user-level config there. Looks like it expects to find it at $HOME/.timidity.cfg. (Line 2541 in https://sourceforge.net/p/timidity/git/ci/master/tree/timidity/timidity.c)
Whilst timidity might be a problem, using your snapcraft.yaml I don’t get any sound in the intro videos either. I don’t think timidity is involved there. Perhaps there is a deeper error affecting all sound?
Ah, you’re right. I only have audio in the initial intro video and sound effects if I install in devmode. Midi music never works. Next step is strace it to see why I guess.
do any of our audio interfaces (alsa/pulse) even have midi support at all yet ? IIRC that requires special device access … (but that should also show denials in syslog)
There’s a TIMIDITY_CFG environment variable which can be used for the custom timidity.cfg path. This suppresses the Could not load music file 'Sound/Midi/MEND.XMI' (/etc/timidity/freepats.cfg: Permission denied) error messages but I still can’t get any actual midi sound. Harrumph.