duganchen / dosbox

GNU General Public License v2.0
28 stars 10 forks source link

Delay on startup from trying to start Jack #10

Closed magicmyth closed 7 years ago

magicmyth commented 7 years ago

I've manage to build this dosbox fork with SDL2 without any issue but when I launch an app with it it takes a bit longer to start because it searches for jackd. The output from the terminal is

SDL: Current window pixel format: SDL_PIXELFORMAT_RGB888
MIXER: Got different values from SDL: freq 44100, blocksize 512
ALSA:Can't subscribe to MIDI port (65:0) nor (17:0)
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
exec of JACK server (command = "/usr/bin/jackd") failed: No such file or directory
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
fluidsynth: error: Failed to connect to Jack server.
MIDI:fluidsynth: Can't create audio driver
MIDI: Opened device:none

If I configure fluidsynth to be used in my conf file then the delay goes and I get no warnings in the terminal. How can I avoid the search for jack if I don't intend to use fluidsynth on a dos app?

This is on KDE Neon 5.10 (Ubuntu 16.04 base).

duganchen commented 7 years ago

I have zero experience with Jack, and I'll need community help to fix this.

magicmyth commented 7 years ago

Afraid I don't really know much about Jack myself. Never used it for anything. Just rely on Alsa and Pulseaudio.

I have just fiddled a bit and found I don't need to enable the full fluidsync setup. Simply adding fluid.driver=pulseaudio to the midi section avoids the problem. Hopefully that can help narrow down this minor issue.

magicmyth commented 7 years ago

It seems on Ubuntu fluidsynth always defaults to Jack even if it is not installed. If I run fluidsynth from the command line I get the same error messages if I don't set the audio driver to pulseaudio (or alsa). I was under the impression that the fluidsynth driver in DosBox needed to be explicitly enabled (mididevice=fluidsynth) but it seems it is on by default. Thus to avoid the startup delay it seems setting mididevice=none is all that is needed. Note that setting the mididevice to anything other than none seems to load the fluidsynth driver.

I think for now it would be worth adding a note ENHANCEMENTS.md that mididevice=none is needed in order to disable fluidsynth when built in.

duganchen commented 7 years ago

Thanks! Done.