Author Topic: Frame drops with MOD pattern display  (Read 1240 times)

spiral

  • Posts: 7
Frame drops with MOD pattern display
« on: 20 Sep '15 - 14:23 »
I'm trying to achieve smoother scrolling for the MOD pattern display, to optimise the visualisation for capturing with a screen recorder. However, I'm currently experiencing a persistent tendency of frames being dropped. I figured this symptom could be eased by upping the visualisation framerate under Appearance in the options, which makes a world of a difference between a setting of 10 and 60 (the latter matching my system's refresh rate). But still, there are a few frames that drop every now and then with the casual tracker module. The problem seems to also increase with the number of channels present in the module. For instance, the module attached to this post (featuring 29 channels) gives me multiple frame drops per second. This is of course judging by eye in real time, and not while capturing or running other heavy applications. However, while I'm not much of a computer wiz, I haven't observed anything suspicious going on with the CPU usage in the task manager, during playback. XMplay occupies less than 1% of the processor, so I'm not sure what could be the cause of any visual performance issue ?

Dotpitch

  • Posts: 2871
Re: Frame drops with MOD pattern display
« Reply #1 on: 20 Sep '15 - 21:31 »
Would that be similar to this thread or this one? You can increase the vis refresh rate beyond your screen rate, perhaps that helps.

Do the frames drop at a specific position in the song?

spiral

  • Posts: 7
Re: Frame drops with MOD pattern display
« Reply #2 on: 21 Sep '15 - 07:29 »
Yeah, those threads were actually mine. I've tried enabling Boost mode, but didn't notice any difference. I've also tried setting the refresh rate up to 125, but there seems to be no visible difference after 60. The frame drops appear at random. Could it have something to do with how things are handled on multi-core processors ? Just throwing in a random guess here. In any case, my system is an Acer Aspire V5-573G notebook running Windows 8 64-bit on an Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz (4 CPUs), ~2.4GHz, with 8 GB RAM.

So does anyone else notice frame drops in the MOD pattern display visualiser ? I reckon it might take a keen eye to notice at first, but I've also observed that it becomes significantly more apparent with modules that play at faster tempos. If you download this module by Jeroen Tel and skip to 02:36, I think most people should be able to notice a significant jitter in the pattern scrolling.

piovrauz

  • Posts: 967
Re: Frame drops with MOD pattern display
« Reply #3 on: 21 Sep '15 - 08:54 »
Tried that track.
I'm not capturing the screen but I do see some drops with refresh rate set to 60Hz on that position.
If I set the refresh rate 120 and I see no drops, and the CPU/GPU are like 1%, unused.
On a side note, there's no noticeable visual difference on vis when upping the refresh rate.
I don't use those much tough.
Maybe it's the plugin interface that's just old?
Oh, if you can't manage capturing the mod pattern with xmplay you could try with OpenMPT too.
(Maybe not fullscreen)

saga

  • Posts: 2181
Re: Frame drops with MOD pattern display
« Reply #4 on: 21 Sep '15 - 13:10 »
Of course I cannot know for sure, but I'm relatively certain that:
1) The number of rendered audio channels should be quite neglectable, as you say the CPU load stays pretty low.
2) XMPlay should render a complete pattern and then just scroll through it, so the only hiccups should only happen at pattern transitions.

I can observe that the pattern vis indeed takes a while to switch between patterns in that module, but that's not "jitter" - it just takes a while to render the complete pattern into a bitmap. There's probably not that much Ian can do about that, unless he finds a stupid bottleneck in his pattern drawing code. :) However, for the rest of the pattern, I cannot notice any jitter, it just scrolls through smoothly.

spiral

  • Posts: 7
Re: Frame drops with MOD pattern display
« Reply #5 on: 21 Sep '15 - 14:31 »
I tried upping the refresh rate to 120 during the fast part of the aforementioned module, and I see too that the jitter is reduced significantly. The only exception I have observed is less frequent frame drops, which are far more subtle than the skips I observe with 60.

The patterns themselves appear to render instantly in my end, so it's only the scrolling that appears a little inconsistent for me. Again, my eyes me be accustomed to spot these kind of things more easily, considering I sometimes work with motion visuals – so there could be a chance that we may be observing the same thing, but perceiving it differently. I think the easiest way to spot any skips would be by leaning away from the screen and focusing on the pattern data as it scrolls upwards.

In any case, I've uploaded another reference module, that I find to be a good example. It runs smooth for the most part in my end, especially when compared to the module in the opening post; but there are still subtle lags occurring at random during each pattern.
« Last Edit: 21 Sep '15 - 14:41 by spiral »

saga

  • Posts: 2181
Re: Frame drops with MOD pattern display
« Reply #6 on: 21 Sep '15 - 14:54 »
My classic advice for "debugging" random jitter which so far has always worked:
1) Turn off wifi drivers (this one is super important!).
2) Close any applications you don't need (e.g. web browser).
3) Disconnect any unused devices.
Does it help? If yes, you have run into the fact that no modern desktop OS is a realtime operating system and thus doesn't give you any guarantee regarding the timely execution of scheduled events, and that many wifi drivers add horrible DPC latency spikes.

piovrauz

  • Posts: 967
Re: Frame drops with MOD pattern display
« Reply #7 on: 21 Sep '15 - 16:23 »
Latency eh? And we're not even talking about AV playback here...
Well, it's modern OS right?

Question: maybe rendering the pattern in advance would help?
Like a vis Buffer? If there isn't one already. I don't know.
(well, I don't really car, biased point of view :P)

saga

  • Posts: 2181
Re: Frame drops with MOD pattern display
« Reply #8 on: 21 Sep '15 - 17:21 »
Latency eh? And we're not even talking about AV playback here...
Why? It's exactly that, just that your video is pattern content and not some decoded movie frame.

Question: maybe rendering the pattern in advance would help?
I am relatively sure that this is what XMPlay must be doing, hence my last two comments above. xmp-openmpt does the same because re-rendering the entire pattern every frame is just not feasible.

piovrauz

  • Posts: 967
Re: Frame drops with MOD pattern display
« Reply #9 on: 21 Sep '15 - 18:35 »
@saga -> I meant A/V synch, with subs, also when streaming. It's a pain to get it right sometime .
              There's a nice tool to check latency for that (DPC Latency Checker), but I guess most recent PC pass that check?

@spiral -> about that (xmp-openmpt): did you try using that plugin?
              Just to see if something changes for the better? Or for the worse?

spiral

  • Posts: 7
Re: Frame drops with MOD pattern display
« Reply #10 on: 22 Sep '15 - 06:31 »
I did some testing by shutting down background processes and disabling the wireless drivers, but the performance of the MOD pattern visualiser remained unchanged. I also installed the xmp-openmpt plugin, but the respective MOD pattern visualiser won't load when it's selected (just stays with the native one).

Either way, since the random hiccups are most easily seen at higher scroll speeds, I've edited the ticks per row of the previously uploaded module. I recall having noticed this issue on a previous computer, too, so I believe it ultimately might boil down to the MOD pattern rendering engine itself.
« Last Edit: 22 Sep '15 - 06:52 by spiral »

saga

  • Posts: 2181
Re: Frame drops with MOD pattern display
« Reply #11 on: 22 Sep '15 - 08:34 »
Quote
but I guess most recent PC pass that check?
No, DPC latency has nothing to do with how fast your computer is, but more how crappy your drivers are. And they still are crappy (or even crappier?) these days.

Quote
but the respective MOD pattern visualiser won't load when it's selected (just stays with the native one).
You will have to add MOD XM S3M IT to the prioritised formats for the plugin, obviously it can only use its visualizer when XMPlay doesn't process these files itself.

spiral

  • Posts: 7
Re: Frame drops with MOD pattern display
« Reply #12 on: 23 Sep '15 - 11:26 »
I repeated the aforementioned procedure, setting the xmp-openmpt plugin to override XM files. According to what I have observed, the performance of the OpenMPT pattern display is pretty much identical to the performance of the native MOD pattern display.

Ian @ un4seen

  • Administrator
  • Posts: 20426
Re: Frame drops with MOD pattern display
« Reply #13 on: 29 Sep '15 - 15:38 »
I suspect the issue is just that the monitor's refresh rate (and XMPlay's vis refresh rate) doesn't match the file's row rate. For example, in the JT_BREEZ.XM case, it has a Tempo of 125 and a TicksPerRow of 2 at 02:36, which means that each row takes 40ms (2500*TicksPerRow/Tempo). Your monitor probably has a refresh rate of 60Hz, which means a refresh every 16.6ms. 40/16.6=2.4, so the pattern display will stay at some rows for 2 frames (33.2ms) and at other rows for 3 frames (49.8ms). That's a pretty big deviation. It becomes less significant as the row rate is reduced, so you probably won't notice a problem with lower Tempo and/or higher TicksPerRow values.