VMS sometimes fails to connect with dosbox at startup

Please let our ADS show!

This sites offers only FREE software and it's supported by a few advertisement boxes (no intrusive popups).
Please:

  • disable your AdBlocker by adding CoolSoft website to whitelist
  • give the proper cookie consent
  • enable JavaScript for this website

This seconds wait is to let you update your browser configuration...

Ok, I've done the required changes... now show me your content!
!!! Please enable JavaScript !!!
Posts: 4
Joined: 9 Maggio 2018 - 01:05
VMS sometimes fails to connect with dosbox at startup

Very similar to this report https://coolsoft.altervista.org/en/forum/thread/633

As seen in this video, the device becomes free 8 seconds after starting dosbox.
https://youtu.be/gUisX3-If-g

Changes of this happening is about 30%, and seems completely random.

Also tested with antivirus turned off, makes no difference.

If VMS survives this inital phase, it'll run fine.

Only happens with newer versions, VMS 1.17.1 works every time.

Posts: 1972
Joined: 25 Mar 2012 - 01:19
Re: VMS sometimes fails to connect with dosbox at startup

Do you confirm that latest version (2.4.0) has this bug?

It could be difficult for me to replicate it on my side, due to the high configuration options of DosBox; could you please upload somewhere a preconfigured DosBox + Test game ready to show the bug?

Posts: 4
Joined: 9 Maggio 2018 - 01:05
Re: VMS sometimes fails to connect with dosbox at startup

Yes, I can reproduce this problem in versions 2.4.0 and 2.3.2. Microsoft GS Wavetable Synth, Munt, and VMS 1.17.1 works ok.

Here is the preconfigured DosBox which reproduces this bug on my system. It is configured to use midi device #0.
https://mega.nz/#!J8gWWTaK!PBDnRlCFOLfyxGW2tqR7Xg4rebYYh62Rae4D5imYC48

Run dosbox.exe, wait 8 seconds, and watch the About window on the VMS panel.
I ran it 10 times, and 7 times the VMS "disconnected" after 8 seconds, and turned "free" on About window.

This only seems to happen if Dosbox does not use the midi device within few seconds after running.
For example in my linked Setup program, if you immediately select "Test Midi" to play a midi file, then VMS works fine for the rest of the Dosbox session.

Posts: 1972
Joined: 25 Mar 2012 - 01:19
Re: VMS sometimes fails to connect with dosbox at startup

I've tried your preconfigured DosBox on my side but wasn't able to reproduce the bug.
Anyway I've noticed that sometimes DosBox opens the MIDI device at startup, then it "stucks" the device for seconds (maybe it's a multi-thread task and the driver one is much more lower than others).

I suppose this is a watchdog timeout issue:
VMS has a "watchdog" between the driver part (the one loaded by DosBox in its process space) and the synth (the process starting with the Systray icon).
Watchdog is a safebelt used to protect VMS against MIDI clients that crash or stop unexpectedly without properly closing the MIDI device (and maybe leaving some notes playing).
If VMS doesn't receive any message from each MIDI client within the watchdog time, it marks the client as dead and releases the device.
When MIDI client is not using/playing the device but the device is still kept open (think about a paused MIDI player), the driver sends an "I'm alive" message to the synth to keep it alive.
If MIDI client process is doing some initialization things (as I suppose DosBox is, during its startup), maybe this causes the watchdog to trigger.

Watchdog default timelimit is 8 seconds, and this should be big enough for most of the setups.
You could try to increase it up to 60 seconds:

  • close VMS (no systray icon must be visible)
  • open VirtualMIDISynth.conf configuration file in VMS installation folder (make a backup copy if you like)
  • add a new key WatchdogTimeout under [Advanced] section
  • set it to the number of milliseconds you want to set the watchdog to (1s = 1000ms, so 20 seconds = 20000)

Your modified VirtualMIDISynth.conf file should read like this:

[Advanced]
...
WatchdogTimeout=20000
...
Posts: 4
Joined: 9 Maggio 2018 - 01:05
Re: VMS sometimes fails to connect with dosbox at startup

WatchdogTimeout=20000 indeed delays the disconnection time to 20 seconds, although it's still seemingly random whether this happens or not.

Watchdog timeout also seems to be the cause of this problem https://coolsoft.altervista.org/en/forum/thread/633 as the disconnection happens 8 seconds after startup in the video https://youtu.be/_o-MLJddYKQ

I'll stick to the Legacy version with DosBox, as it works 100% of the time, but I would be happy to test any possible fixes if you want (since you weren't able to reproduce the bug).

Thank you for your time, responses and this amazing program.

Posts: 1972
Joined: 25 Mar 2012 - 01:19
Re: VMS sometimes fails to connect with dosbox at startup

I've fixed a bug in driver<-->server watchdog that caused unexpected client disconnection.
It seems to me that this bug is also related to that.

The fix has been applied to the current 2.5.x beta version here.
Please test it and report your feedback in this thread.

Posts: 4
Joined: 9 Maggio 2018 - 01:05
Re: VMS sometimes fails to connect with dosbox at startup

No more connection loss between DosBox and VMS, thanks.

Posts: 1972
Joined: 25 Mar 2012 - 01:19
Re: VMS sometimes fails to connect with dosbox at startup

Thanks for reporting it ;)