https://build.opensuse.org/project/show/home:13ilya
I did not understand how dosbox integration works, or rather, where do I need to register CM32L_CONTROL.ROM and CM32L_PCM.ROM so that dosbox can see them?
I patched dosbox, compiled it with libmt32emu support, indicated in dosbox config (~/.dosbox/dosbox-0.74-3.conf)
mpu401 = intelligent
mididevice = mt32
midiconfig = 128: 0
But when starting dune2 (if you don't start mt32emu-qt before), dosbox writes
MIXER: Got different values from SDL:freq 48000, blocksize 64
MT32: Control ROM file not found
MIDI: Can't open device: mt32 with config: 128: 0.
MT32: Control ROM file not found
ALSA: Client initialised [128: 0]
MIDI: Opened device: alsa
And sound. of course not.
If you run mt32emu-qt before that, then it, as without this integration, creates a 128: 0 or 129: 0 device if fluidsynth is running with GM and there is sound.
I thought this integration would save me from having to run mt32emu-qt before starting dosbox, but I haven't figured out how to set it up yet. I didn't find the instruction.
Indeed, DOSBox integrated with mt32emu will save you from running external applications, that's the point.
Right, DOSBox-mt32-patch/README only contains a brief word about how to build that stuff, assuming that the DOSBox config that can be written after patching provides necessary hints on which configuration can be set up. Specifically, please find the help for the mt32.romdir option that allows to configure the ROMs directory.
Hope this helps.
It didn't help me much.
1 What kind of documentation are you talking about? You don't have any man files in your project.
The Wiki section is empty, README.txt doesn't.
I just looked at the source code and realized what mt32.romdir is.
2 At the same time, it is not clear why not make the default search for roms in the same directory where the config is located, or "~ / .dosbox"?
3 For some reason, you cannot specify a value for mt32.romdir "." or "~ / .dosbox", only the absolute path "/home/user/.dosbox" is very inconvenient.
4 And finally, when dosbox find roms, the sound has extraneous silks. When using mt32emu-qt + dosbox, the sound is clear without extraneous silks.
I'm talking about the descriptions of all available DOSBox properties which get dumped when one creates the DOSBox config file anew.
The default is the current directory the DOSBox process is started from for historical reasons. Given the possibility to specify a custom directory, I don't immediately see a reason for changing that.
Interesting, I'd like to have a look at this thing, thanks.
This is likely caused by the way DOSBox mixer works. I personally was disappointed by the output quality of the signal resampler, so now the mt32emu library can utilize its own resampler if you change the configuration option mt32.rate (and mt32.src.quality).
I hope it is clearer now :)
The fact is that in Linux, user configs are not updated. They are created only when they exist, and it is unlikely that someone will delete their working config.
Moreover, many users use localized configs from the dosbox site.
So the average user will not see the description of mt32 options.
It is necessary somehow in the README, at least to mention them, put in a patch, for example, config-mt32.txt so that the maintainer can put it in the dosbox package and a user who does not install dosbox from scratch can see it.
5 In the code, only valid roms names are hard-coded CM32L_CONTROL.ROM / CM32L_PCM.ROM in upper case only, and if at least 1 letter case changes, the rum will not be detected. Why so? In mt32emu-qt I can set any name, especially since the control rom is distributed under the name "CM32L_CONTROL.1989-12-05.v1.02.ROM" ( https://drive.google.com/drive/folders/0B5j-_ZMS8_UoY2MxOWRmMzktZmZhOS00M2EwLWFkZGItODNmODY4ZjU5Y2Vi ).
Maybe then it is better to make 2 options for the path to CONTROL rom and PCM rom?
I really don't know why the old stuff searches for ROMs with hardcoded names, sorry. As for having separate directories, I agree. CM-32L ROMs have priority, so if both recognisable ROM sets are in a single directory, one has no choice really. So, better to have MT-32 ROMs in another directory. I agree that sucks, we should rather have 2 additional options to allow the user to specify filenames for the control and PCM ROMs.
I always specify the rate 48000 wherever possible, changing it from 44100, because I know that my built-in sound card (this applies to all built-in sound cards) cannot reproduce the 44100, which is a relic of the past AudioCD. And in dosbox I also indicated 48000 everywhere.
I also specified "mt32.rate = 48000" and mt32.src.quality = 3 but that didn't change much.
I've tried to specify 44100 everywhere and even the weird 49716.
Surprisingly, with a value of 49716 I got the best results, the cods are significantly reduced, but sometimes they still slip. While on mt32emu-qt, the sound is perfectly smooth at any rate.
I would be happy with a console utility similar to fluidsynth, which would accept the parameters of the path to roms, rate, port (128: 0), port name, possibly log-file. which would just create a midi-port (128: 0) to which dosbox and aplaymidi (like fluidsynth) connected, almost like mt32emu-qt, but without a gui that can be run as a systemd service from a separate user (this is customary in Linux).
There is a similar utility within mt32emu_alsadrv project. I have a plan to refactor mt32emu-qt, split out services away from UI and introduce a purely CLI thing. But I have no idea when it may come true...
It would be great!
Last edit: Илья Индиго 2020-10-22
As for the sample rate mess, the row
MIXER: Got different values from SDL:freq 48000, blocksize 64looks somewhat suspicious to me. Maybe the mixer works in a different rate so resampling is involved? In any case, I cannot really comment on how DOSBox works.
64 is period_size option in alsa config.
The default is 1024, but console emulators (mednafen) ask for at least 256, and fludsynth (through which General Midi works) is exactly 64 (it works fine with any values, but swears in the logs), and I specify it 64.
It turns out that this was the reason for the clicks, raised period_size to 128 and now mt32 worked fine with clear sound. :-)
Last edit: Илья Индиго 2020-10-22
Many thanks to you!
The problem is solved, I hope this will help someone, and even more I hope that people will not have to deal with this and everything will work out of the box. :-)
Perhaps, if someone finds time to document it one day :)
I added mt32emu to openSUSE and got your patch accepted in dosbox (not upstream, only openSUSE).
https://build.opensuse.org/package/show/multimedia:libs/mt32emu
https://build.opensuse.org/package/show/Emulators/dosbox
MT-32 in dosbox on openSUSE (Tembleweed and Leap 15.3) is now supported out of the box.
I also wrote a detailed instruction about setting midi (MT-32 and GM) in dosbox, I think it will be useful to you.
https://build.opensuse.org/package/view_file/Emulators/dosbox/CONFIG-midi-mt32-gm?expand=1
It would also be great if this or a similar manual, modified if necessary, is provided with your patch.
Last edit: Илья Индиго 2020-11-07