Serious MIDI latency problem

Hello everybody!

I have a serious - and somewhat strange - MIDI latency-problem, resembling that described by a member called 2211 in a post titled “Midi Latency Issues with Cubase 6.5” Steinberg Forums.

As for 2211, he experience that Cubase “first it plays fine, and nice and tight, then after a little while (anything from 15 minutes to a couple of hours) there is a latency lag when i try to play in any midi notes.”

As for me, the latency comes and goes in periods. If I play the keyboard continously for 15 minutes, the situation is usually that Cubase plays fine for a little while - then suddely intoduces a latency at at least a 1/3 of a second (which is impossible to play with) - and then suddenly swaps back to “normal”, and so on in intervals of abaout 3 and a half minutes. I do not touch or change anything in Cubase when the phenomenons happen.

Now, one may think that the cycling periods of gross MIDI-latency are due to something going on in the background on my PC. At least that was the first thing I thought about.

So I launched the Task Manager and a little program called DPC Latency Checker which can be freely downloaded from http://www.thesycon.de/deu/latency_check.shtml.

I ran them simultaneously for about 2 hours. Nothing strange to view in Task Manager. And in DPC Latency Checker, all the “bars” kept waving under the bottom green line, and the program said:

“This machine should be able to handle real-time audio and/or video without drop-outs.”

Yes. So if it should be able to handle real-time audio, it should certainly be able to handle just MIDI!

I tried the Constrain Delay Compensation button mentioned by tpmears (Steinberg Forums). It may affect performance when using VST-instruments (as the Owners Manual says). But for me, it made no impact at all - as I expected, since I’m not playing a VST-instrument, but a rack of physical synthesizers connected to individual ports on my MIDI-interface.

My setup is like this: Cubase 6.5.4 64, Lenovo ThinkPad T520 with Core i7, 8 Gb RAM, Win7 64Pro, MR816x soundcard, ESI/M-Audio MIDI-interfaces, keyboard connected via USB. The audio-output of the synths are connected directely to a physical, ANALOGUE mixer. So there is no room fro latency in the synth-sounds: The sounds come out of the speakers in the same moment the instruments get a note-on message feeded to their MIDI-inputs - every time.

So how on earth do Cubase attain to introduce half a second of latency into a MIDI signal-stream when NOTHING else is runing? There’s only one simple MIDI-track in Cubase. And it’s one and only duty, is to pass a note-on message from the keyboard to the selected MIDI Out port - which is a very simple task!

When I started MIDI-sequencing in the 80s, we used an IBM 8086 PC with 512kb of RAM running MS-DOS + Voyetra Sequencer Plus MkIII and connected the synth-gear via a Roland MPU 401 MIDI interface. And we never had a single MIDI-problem. We never experienced latency at all.

Later I swapped to Logic. Then the problems of latency arised in respect of audio-recording and VST-instruments. But I never experienced any latency in a pure MIDI-configuration, where the audio-output of the synths are connected directely to the mixer.

The first time I experienced MIDI-latency, was after I swapped to Cubase.

So why am I so sure that the problems have to to with Cubase, and not with some background-stuff running on my PC? Well, at least I’m pretty sure that the problem only occurs when running Cubase - regardeless of what the source of the problem is. That is because I downloaded a tiny program called MidiRouter from http://www.pcmus.com/Free-Midi-Software.htm (no install - no drivers):

MidiRouter lets you rout a connected keyboard to one of the present MIDI Out ports. I tried it, and - voilà!!! - no latency at all, just like in the old days :smiley:

So, for the first time in a while, I have been able to actually PLAY my synths without knowing that the latency-demon will possess my MIDI-stream at any time. After about 4 hours, I launched Cubase to check. Just like before: MIDI-latency coming and going in predictible waves. It’s really annoying - at least if you want to use the software for recording music played by real human hands.

So: Does anyone know a a solution to this problem…?

Have you experimented with the “WindowsMIDI” vs. “DirectMusic” ports and the “Use System Timestamp” properties?
It sounds like Cubase and the rack synthesizers are drifting apart in their synchronization.
I am also curious if you record MIDI during the drift, and then play back if the drift is there. In other words is it recording with good timing within Cubase but just drifting as it passes the MIDI to the rack, etc.
HTH
J.L.

Synchronization? Cubase isn’t doing anything. It’s not recording and not playing back. In the situations I have described, it is only a matter of passing the MIDI in signal from the keyboard to the MIDI out port on the interface, while I play the keyboard in real-time - and monitor the audio-output of the synths via an analogue mixer which Cubase knows nothing about. That is: Cubase’s only task is to act as a MIDI-cable between the keyboard and the synthesizers MIDI in port.

I have tried the “Use System Timestamp” option. But will it not only affect the situation when Cubase is playing back something?

However, I tried to record a little, using an arpeggiator synced to Cubase’s MIDI clock. The synth have a echo-effect, also synced to Cubase’s MIDI clock. For a few minutes everything worked flawlessly. When the latency-demon entered the MIDI stream, the notes I played were seriously delayed - but the MIDI-clock signals generated by Cubase was apparently not affected - because the echoes suddenly went out of sync with the notes.

I also had two MIDI tracks playing back: One with a Bass Drum playing a VST Sampler, and another playing a ryhtmic pattern on one of the external synths. None of them were affected by the latency-demon - only the incoming signal from my keyboard.

But: I checked what I had recorded, as you suggested. And guess what: All the recorded notes were in perfect time - also during the latency-periods - so it’s apparently only the part of the incoming MIDI-stream that Cubase passes out again - or “through” - that is affected…

OK, so that seems to suggest that the MIDI is being delayed at the INPUT side of Cubase. Could be a problem in the transfer of the notes from Windows to Cubase. Please see if you are using the “Windows MIDI” or “Direct Music” MIDI port and try using the opposite one. I have read several “articles” (in the knowledge base, etc.) about these two different “protocols” and the problems.

I thought so myself. Until I tried what you suggested: To record something during the latency-periods.

I guess you didn’t see the last paragraph in my former comment, because I had it open for editing while you posted yours.

But I tried it many times now:

I have the bass-drum playing a VST Sampler from one track. I record an outboard-synth on another track. Straight 1/4th notes precisely on the beat. I continue when the latency-period occurs. The monitored notes are delayed seriously (must turn down the volume to keep playing in beat).

Then I check the recording. Everything is in perfect beat. I hit a note on the keyboard - latency still there. I play back the material recorded during the latency-period. No latency at all. I hit a note on the keyboard again - latency still there.

This shows that the MIDI signals cannot possibly be delayed at the INPUT side of Cubase. The incoming signal isn’t delayed at all (as the recording shows) - even during the latency-periods. Nor are the MIDI output stream from recorded tracks. It is - apparently - only the part of an incoming MIDI-stream that Cubase passes out again - or “through” - that is affected.

So it seems like the problem is related to something within Cubase. At least, when testing my system’s “through-capabilities” using MidiRouter (http://www.pcmus.com/Free-Midi-Software.htm) there is no latency at all - hour after hour - confirming the diagnosis from the DPC Latency Checker (http://www.thesycon.de/deu/latency_check.shtml), that my system shouldn’t experience any “through-problems” what so ever.

So I more and more doubt that the problem basically is related to something in Windows…

I have to think this is related to the latency problem discussed in the thread:

which I’m having as well. Does it do it if you create a fresh project? (I know that’s not a solution.)

The problem remains in all projects all the time - new or old.

It’s really strange. Right now I tried this:

I have to MIDI-tracks playing bass-drum and bass. The first to a VST Sampler, and the second to a outboard synth.

During a “no latency-period” I recorded a straight 1/4th note pattern to a track outputing MIDI to a Virus B.

When a latency-period occured, I played back the three tracks, while recording a second track for the Virus B. Now I could hear everything playing in perfect time - also the previously recorded Virus B track - while the monitoring of the ongoing recording of the second Virus B track had serious latency.

And this is really strange: There is no latency in the signal stream between Cubase and the MIDI-port connected to my Virus B. That’s why the recorded track can play back in perfect time, and in perfect sync with the VST bass-drum - even during the “latency periods”.

So Cubase in some way manages to delay the through-signal only - because the recorded material (input signal) of the same session is in perfect time, even when the MIDI through signal is delayed…

I was wandering if a upgrade to 7.0 could solve the problem - but I’m not so convinced… :wink:

It is a very interesting problem.
The only thing I can think of is that if Cubase runs low on processing time, it decides that the “through” MIDI is lower priority (as long as it properly records it first). But you describe it as a somewhat steady pattern rather than just random and sporadic latency.
I wish I could help more but don’t know what else to suggest (other than a support ticket).
J.L.

Well. I have an Intel Core i7 2620M / 2.7 GHz. The Task-Manager tells me it only uses between 5 an 25% during the whole session. And the total memory-usage is only 2.5 of the 8 gigs installed. When the latency-periods occur, there are no peaks or changes in the resource-usage of processor or memory. So I was beginning to suspect more esoteric problems - like Cubase is incompatible with my specific processor-speed or something - which I in fact really don’t believe it is.

However, it could look like Cubase acts like it runs low on processing time - even if it doesn’t - and decides that the “through” MIDI is lower priority.

So - as you say - “interesting” problem… :wink:

@Morganix: What audio I/O are you using? and what MIDI interface are you using?

If you are using a USB MIDI interface, go into “Control Panel/System/Device Manager”

Expand the section labeled “Universal Serial Controllers”

Right-Click on each USB device, choose the “Power Management” tab

Uncheck the checkbox labelled “Allow Windows to turn this device off to save power”.

Go through all of your USB ports and do this. This should help. Then, make sure that hibernation support is turned off, as well as -NOT- allowing Windows to power down the drive.

At the moment, I’m using two M-Audio Midisport 4X4 Anniversary Edition USB Interfaces. Most power-management-stuff was turned off from before - except for the “Universal Serial Controllers” you mention. So I did as you said.

I also turned off a few extra things, so now my DPS-throughput is even faster than before. I have watched the Checker look like this for two hours:

While watched the Checker, I opened Abelton Live 8, which I have installed, but never used. So I played my keyboard using the same MIDI-setup as I use in Cubase - with no latency, while I watched the checker :smiley:

So the issue is really strange. It seems to be no problems neither or the input- nor output-side of my system.

And the latency-problem does in fact not really influence neither the input stream, nor the output-stream (from recorded tracks) in Cubase either - but only the through signal. Because when the latency period occur, I can do this:

  1. Start playback of audio tracks and
  2. MIDI tracks routed to internal VST-synths + external synth-modules simultaneously
  3. and hear that everything is in sync
  4. Record (with volume down) accurate 1/4th notes from my keyboard, routed to an external synth
  5. Check the recorded track and verify that the notes were recorded exactly in time and
  6. playback all tracks (including the new recording) and find that everything is in perfect beat
  7. turn up the volume and hear that latency is still there - on the through signal only

So even the track recorded during a latency-period, records with no latency. Then it cannot possibly be any latency on the input side of Cubase? The same track also plays back with no latency during the latency period - while the through signal from the keyboard suffers of the described problem (simultaneously!). Then there cannot possibly be any latency on the output side either? Thus, it very much seems like the issue we talk about is something happening within Cubase.

And after a little while - the latency magically disappeares…

So it seems like both the computer and Cubase are fully capable of doing the job. Cubase just doesn’t feel like it, in certain intervals…

Since obviously not all Cubase-users experience this problem, the only thing I can guess right now, is that Cubase doesn’t work properly in certain environments - be it a certain processor-speed, chip-set, other installed apps/drivers etc (which may be totally wrong). However, no matter what it is, it does not seem to be what can be called a flaw with the system/setup - since everything else, including Abelton Live, works perfectly…

@morganix: I found this on M-Audio’s site

Hope this helps.

Thank you for the input! I will look into that as soon as possible - which will be on monday, because of the KOMA Festival here in Oslo… :smiley:

I use a M-Audio MIDISPORT 1X1 and was not having issues, but caught this post and updated the drivers. Thanks for the post on the M-Audio drivers, Miki. :sunglasses:

Yeah, +1 here!

Edit: Ehm, spoke too soon, I get a Runtime Error here… Oh well, 6.1.2 works fine anyway.

After your post about the known latency-issues, I had to investigate a little further. In your link, the advice from M-Audio is to “install the latest drivers”.

However, I already had the latest drivers. I bought my Anniversary Editions by the end of April this year, and downloaded the 6.1.3 Installer, because it is the most recent release (and I run Win 7/64 SP1).

I bought them because I had broken the USB-port on a ESI M8U interface. I got the M8U back from service a few days ago. So I connected it to see if the latency-problem would affect the M8U too.

I connected a JP-8080 to the ESI, and a Virus B to one of the Anniversary Editions. Each of the interfaces connected to its own USB-port. In Cubase, I set up two MIDI tracks for recording, routing one to the M8U and one to a Anniversary, and giving both tracks input from the keyboard. The latency-demon kicked in periodically, as before, in the MIDI Through-signal passed through the Anniversary - but not in the signal passed through the M8U!

So now it was at last clear that the problem was related to the Anniversary Editions - even if the issue only materialized in Cubase - and not in Abelton Live or MidiRouter.

So what to do? The only advice from M-Audio was to “install the latest drivers”. Well, I already did. But since the issue obviously was connected to the Anniversary Editions, I took the only advice - disconnected the Anniversaries, and installed the drivers once again.

When I connected the Anniversaries again, both interfaces popped up with a “02” before the name, suggesting that the OS knew about another “instance” or something. Anyway, I tested them for quite a while - and the latency-problems were apparently gone!

Under the installation, everything was just like the first time. And Device Manager announced - just like the first time - “This device is working properly”. Well, things were obviously working more properly now.

I must say It was a relief to find out were the demon was hidden! So thanks Miki! You pushed me along the right path!

It was almost impossible to discern the cause of the problem in this rather strange circumstances: No latency in the MIDI-signal sent from a recorded track - while there is latency on the through-signal from the keyboard, but not in the recording of the same signal. While I still not know the actual cause of the problem, I now know the source of the problem!

My feelings towards the Anniversaries right now isn’t too warm. I think they behave a little strange. At least I don’t think I will use them as my main interfaces. So I uninstalled the drivers and everything related to them. I suspect the ESI M8U to be more stable and unproblematic. Never had a single problem with it in any OS or DAW till now. And it’s just plug and play:smiley:

@Morganix: I so glad that you got your MIDI issues sorted out. :slight_smile:

Best of luck and lots of fun. :slight_smile:

:Miki.