Error opening MIDI stream, error Code: 4 - The sample buffer was lost'.

It seems you're using an AdBlocker or JavaScript is disabled!

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

This 10 seconds wait is to let you update your AdBlocker whitelist...

Got it, show me the content...
Please enable JavaScript!
Posts: 12
Joined: February 24, 2016 - 21:35
Error opening MIDI stream, error Code: 4 - The sample buffer was lost'.

Since the installation of Ver 2.1.1,  I'm always getting the following error when I'm trying to run a MIDI-file:

'Error opening MIDI stream, error Code: 4.

Description: BASS_ERROR_BUFLOST: The sample buffer was lost'.

What a hek is this error - I never got it with any previous version BEFORE Ver 2.1.1 ...?

Posts: 1535
Joined: March 25, 2012 - 01:19
Re: Error opening MIDI stream, error Code: 4 - The sample buffer was lost'.

VMS version 2.1.1 does not exist (see VMS Version history).
Could you please report which is the last version working (no erorrs) and the first not working (with the error)?

Maybe something gone wrong during an upgrade.
One thing to try could be to completely reset VMS configuration:

  • close VMS (right click on its systray icon then select Exit)
  • open configuration file (usually C:\Program Files\VirtualMIDISynth\VirtualMIDISynth.conf) and clear it up (DO NOT DELETE THE FILE, only clear its content), then save it as empty
  • restart VMS and it will ask to add at least one Soundfont
  • set desired configuration then click Apply
  • a default config file will be created

Another thing to try could be to completely remove VMS, check if its folder has been removed (no stale config around) then reinstall the newer 2.3.0 version.

Finally, that error could be thrown at multiple points.
When do you receive it? When play starts or when the MIDI client opend the virtual device?

Posts: 12
Joined: February 24, 2016 - 21:35
Re: Error opening MIDI stream, error Code: 4 - The sample buffer was lost'.

I'm sorry - I made a typo-error, I was referring to Ver 2.2.1: does the same advice you sent me below apply to my problem described above?

NOTE: I've just yesterday downloaded & successfully installed the most recent Ver 2.3.0, and I'm glad that the VMS started working OK.  However - what should I do if the same Error-Code 4 with the 'opening MIDI stream and 'sample buffer was lost' reappears - anything to do...?

Many thanks for your prompt help...!

Posts: 1535
Joined: March 25, 2012 - 01:19
Re: Error opening MIDI stream, error Code: 4 - The sample buffer was lost'.

2.3.0 fixed some issues with memory allocation; it also updated the underlying BASS library.
Both these changes could have fixed the bug you've experienced.

thorsak wrote:
what should I do if the same Error-Code 4 with the 'opening MIDI stream and 'sample buffer was lost' reappears - anything to do...?

Keep updated to the latest VMS version and feel free to update this thread if the bug reappears ;)

Posts: 12
Joined: February 24, 2016 - 21:35
Re: Error opening MIDI stream, error Code: 4 - The sample buffer was lost'.

Hi:

Yesterday (Thursday) after installation of the new Ver 2.3.0 the MIDI was working OK but today I have similar problems with opeing MIDI stream (NO SOUND from MIDI-files playback but my PC-sound is working!): is there any ongoing problem or bug with the new Ver 2.3.0...?

Posts: 12
Joined: February 24, 2016 - 21:35
Re: Error opening MIDI stream, error Code: 4 - The sample buffer was lost'.

Hi:

Further to the above error I have found that VMS Ver 2.3.0 altered my coniguration setting for Output Audio Device yestered during start up the VMS that's why I suddenly lost MIDI-sound: I HATE if a Program do ANY change of configuration settings WITHOUT the user's consent - any explanation for this, is there a bug in the new VMS Ver 2.3.0 causing this error...?

Posts: 1535
Joined: March 25, 2012 - 01:19
Re: Error opening MIDI stream, error Code: 4 - The sample buffer was lost'.
thorsak wrote:
I have found that VMS Ver 2.3.0 altered my coniguration setting for Output Audio Device

Do you mean VMS configuration of Output Device, not the Windows one?

If so, yes, there was a breaking change in 2.3.0 about Output Device configuration... let me try to explain.

2.3.0 introduced a new feature:
>> If output device is selected and Windows default output device is changed while playing, VMS will automatically switch to the new default device
which required a breaking change in how VMS initializes BASS library.

To make a long story short, the available devices returned by BASS were renumbered and a new (special < default >) device was added at first position.
This renumbering could have lead to unexpected device selection for users after upgrade; they were risking nothing critical, but simply have their devices assignment "shuffled".
This is mitigated by the fact that single-output-device-users should have been automatically "remapped" to the device (even if they specifically selected their single device).

Fixing this in newer setup could have lead to worst issues in case an user downgrades to <2.3.0; newer setups will fix device ID but the previous ones don't...
Additionally, newer setups should fix it only the first time version crosses the "2.3.0 limit".

So my options were:

  • add a fix task to setup, considering previous-version/new-version jump
  • clear configuration when installing 2.3.0 (but what shall I do in 2.4.0+..., and what if an user upgrades directly from 2.1.0 to 2.4.0?), but this is unacceptable
  • leave the user with a probably-working configuration, hope they try the newer installed VMS just after installing it and - if it does not work -  check their selected Output Device and fix it

After much thought I decided that the less-worst decision was the latter, so that's what I did.
I also thought about adding some explanation to version history; but think about part of this same post included there... it whould have been too much technical for users and 99% of them would have ignored it.

thorsak wrote:
I HATE if a Program do ANY change of configuration settings WITHOUT the user's consent

I agree and, as far as I can, I always do flawless upgrades between versions (except from 1.x to 2.x, obviously).

Sorry for your drawback ;)

Posts: 12
Joined: February 24, 2016 - 21:35
Re: Error opening MIDI stream, error Code: 4 - The sample buffer was lost'.

Hi:

Thanks for your clear and detailed explanation - unfortunately, such crucial info often arrives later after the shock of losing a MIDI-sound in a newly installed VMS version... I understand the complexity of similar version changes BUT: I still feel that there should be an abbreviated notice/advice about this 'configuration abnormality' - perhaps in the New Version notes, and if many users don't read them that's their problem if they then experience 'similar shock' and lose valuable time in trying to find out why the New Version 'worked yesterday but stopped working today...'.

Anyway, I strongly feel that such notice would be very appreciated by majority of great VMS users when they are busy working on new MIDI-arrangements for their gigs.

Thanks for your consideration.

Tony H.

Posts: 1535
Joined: March 25, 2012 - 01:19
Re: Error opening MIDI stream, error Code: 4 - The sample buffer was lost'.

Ok, I understand your point of view.

I'll try to add as much as possible details in next version history updates, maybe with a link to a dedicated forum thread with further details.

Posts: 12
Joined: February 24, 2016 - 21:35
Re: Error opening MIDI stream, error Code: 4 - The sample buffer was lost'.

Many thanks for your consideration - and yes, this problem appears to be related only to VMS configuration of Output Device NOT the Windows one.

Thanks.