Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » [RetroHack] Start of competition

This thread is locked; no one can reply to it. rss feed Print
[RetroHack] Start of competition
Thomas Harte
Member #33
April 2000
avatar

Quote:

Also in the game I can't here distortion any longer, and still no overruns or audible delay - so very nice

That's good news. I guess the latency problems were, as I alleged, all in Allegro's AUDIOSTREAMs not matching their documentation. And the "sound going wrong after 3 minutes" was all mine.

Any chance of also trying the code attached to this post? It should reduce latency within the RetroHack code to a maximum of about 60ms (versus ~93ms in the test version 1.2 from last night). After that it's up to Allegro.

Elias
Member #358
May 2000

Still works here. [edit:] But then, what would be interesting is, how does it affect Windows - the distortion I got here in Linux with multiple AY buffers likely was unrelated to the audio streams code.

--
"Either help out or stop whining" - Evert

Paul Pridham
Member #250
April 2000
avatar

Thomas, I just tried the latest version under Win2K, and the sound is much better now. Latency is hardly noticeable, and there was no skipping in Elias's crazy "boot" screen anymore.

Could the fix be patched into Allegro?

Thomas Harte
Member #33
April 2000
avatar

Okay then, the new code is version 1.2 of the RetroHack simulation library. The only difference between that code and the one linked via my post above is that I've incremented the version number in the header — though I don't suppose that makes any odds since I've not really told anyone that the version numbers are there...

Quote:

Could the fix be patched into Allegro?

It could, but it's so extremely trivial to set up a voice/SAMPLE combo to do the same thing as AUDIOSTREAMS but without the "6 buffers at once" broken functionality that I assume once Elias works out why the code doesn't just work in this way (which'd be about 50 lines of code in total) in general then there'll turn out to be some significant reason or another.

Elias
Member #358
May 2000

Well, I don't have Windows so hard for me to test it. Basically, if someone with Windows could try replacing this in stream.c:

   if (len >= i)
      bufcount = 1;
   else
      bufcount = (i + len-1) / len;

with this:

   bufcount = 1;

And confirm audio streams still work, then we could commit that change.

--
"Either help out or stop whining" - Evert

Jakub Wasilewski
Member #3,653
June 2003
avatar

Quote:

Well, I don't have Windows so hard for me to test it [...]

I used the Retrohack library itself to test if AUDIOSTREAMs still work, didn't really have time to whip up my own example.

There are minor problems with palyback after making the change indicated - once in a while (3, maybe 4 times in a minute, but not at any regular intervals) you can distinctly hear the audio looping, as if the buffer wasn't properly filled so the same data was played twice or thrice.

There are no such problems when using standard Allegro 4.2.1.

That's WinXP SP 2 + Allegro 4.2.1.

---------------------------
[ ChristmasHack! | My games ] :::: One CSS to style them all, One Javascript to script them, / One HTML to bring them all and in the browser bind them / In the Land of Fantasy where Standards mean something.

Elias
Member #358
May 2000

Hm, with which version of RH was that test? And does RH 1.2 work without problems?

--
"Either help out or stop whining" - Evert

Jakub Wasilewski
Member #3,653
June 2003
avatar

I only now checked out the 1.2 Thomas posted. The only difference between them is the volume of the sound produced - 1.2 is significantly louder.

My results are:

RH 1.1 + vanilla 4.2.1 = normal sound
RH 1.1 + patched 4.2.1 = quirky sound with momentary repeats. Sometimes this gets so severe that it makes the distortion really severe, as if it was playing half of the buffers it got or something.

RH 1.2 = louder sound than in RH 1.1, otherwise perfect with both versions of Allegro (patched and vanilla).

The distortions for the patched versions seem to increase in severity when CPU load rises for a moment (even minor things like an IM notification popping up on the tray is enough).

---------------------------
[ ChristmasHack! | My games ] :::: One CSS to style them all, One Javascript to script them, / One HTML to bring them all and in the browser bind them / In the Land of Fantasy where Standards mean something.



Go to: