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

Chocolate Doom freezes and has to be SIGKILL'd when exiting with snd_musiccmd set. #1563

Open
KynikossDragonn opened this issue Dec 22, 2022 · 8 comments

Comments

@KynikossDragonn
Copy link

Background

Version of Chocolate Doom: 3.0.1

Operating System and version: Void Linux (Linux Kernel 6.0.13)

Game: Doom

Any loaded WADs and mods (please include full command line): $ chocolate-doom -iwad /usr/share/games/doom/doom2.wad -merge ~/.config/gzdoom/H2H-XMAS.wad

snd_musiccmd "fluidsynth -inq -a pipewire -c 2 -r 48000 -z 512 /usr/share/soundfonts/vcgs4mv4.sf2"

Bug description

Observed behavior: Chocolate Doom remains stuck in the background will not respond to ^C or SIGTERM, can only be SIGKILL'd if you're using a external command to handle music as specified in snd_musiccmd

Expected behavior: Chocolate Doom should beable to exit cleanly no matter what is used for snd_musiccmd

@rfomin
Copy link
Contributor

rfomin commented Dec 22, 2022

MusicCMD_Play() can be problematic: libsdl-org/SDL_mixer#415

I suggest removing this feature.

@KynikossDragonn
Copy link
Author

Is there a way to use "Native MIDI" on Linux and have it just talk to a fluidsynth process I spawn in a terminal like I do with DOSBox? Because the docs tell me to attempt using snd_musiccmd otherwise I have no choice but to make a timidity.cfg for Chocolate Doom to find.

And the soundfont I use does not like TiMidity++ at all, atleast from what happened when I tried to use it under GZDoom.

@rfomin
Copy link
Contributor

rfomin commented Dec 23, 2022

Is there a way to use "Native MIDI" on Linux and have it just talk to a fluidsynth process I spawn in a terminal like I do with DOSBox?

But why do you need a FluidSynth process? SDL_Mixer can work with FluidSynth directly, you can change the sound font using the SDL_SOUNDFONTS environment variable.

Also in current master you can set FluidSynth soundfont via chocolate-setup:
image

@KynikossDragonn
Copy link
Author

KynikossDragonn commented Dec 23, 2022

Having access to a separate process allows me to run the "reset" command if notes get stuck, and I can fine tune the gain, chorus, reverb properties in real time when needed.

I guess the Chocolate Doom package on Void Linux isn't being built with fluidsynth support because I don't see that in my setup:
Screenshot_2022-12-22_20-39-10

EDIT: Just to clarify when I run a fluidsynth process interactively the following stuff is read in ~/.fluidsynth

gain 0.6
interp 1
set synth.chorus.active 1
set synth.chorus.level 1.0
set synth.chorus.nr 2
set synth.chorus.speed 0.6
set synth.polyphony 512
set synth.reverb.active 0
set synth.reverb.damp 0.1
set synth.reverb.level 0.9
set synth.reverb.room-size 0.8
set synth.reverb.width 100.0

These are options that are always read when the fluidsynth process itself is started but anything using fluidsynth as a library will never read these commands. If stuff starts clipping inside of the synth itself I can't re-adjust the gain to compensate (because for some reason FluidSynth has no concept of automatic gain control) and certain soundfonts sound better with different settings for the chorus and reverb units as well. Some soundfonts I prefer to not even have to reverb on whatsoever.

@rfomin
Copy link
Contributor

rfomin commented Dec 23, 2022

Well, this looks like an issue with SDL_Mixer that is out of our control.

I guess the Chocolate Doom package on Void Linux isn't being built with fluidsynth support because I don't see that in my setup

It looks like version v3.0.1, I was talking about the latest development version. However, the developing version also does not have the ability to fine-tune the chorus, reverb, etc.

@KynikossDragonn
Copy link
Author

Oh sorry I completely misread you were talking about a git build instead.

It's a bummer though that SDL_Mixer doesn't allow changing FluidSynth's parameters, but I guess it's a PSA to not use snd_musiccmd unless it's a process that does what that issue says it has to do? (The whole "call exec*() or _exit() immediately" part)

@rfomin
Copy link
Contributor

rfomin commented Dec 23, 2022

I guess it's a PSA to not use snd_musiccmd unless it's a process that does what that issue says it has to do? (The whole "call exec*() or _exit() immediately" part)

I'm not sure, I'm not a Linux development expert. I can't reproduce these issues on the old Debian VM I have.

@mikeday0
Copy link
Contributor

If you select Native Midi in chocolate-setup and set the environmental variable SDL_SOUNDFONTS to your soundfont path, SDL_Mixer should use FluidSynth. (Assuming it was compiled with FluidSynth support.) As noted, you can't currently adjust the FluidSynth parameters when using it through SDL_Mixer.

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

No branches or pull requests

3 participants