The music crackles and pops and seems to be initialized at 8khz !?
I attached a fair use FLAC sample of how it should sound (mod2wav) and a dosbox recording. (latest SVN)
Can't tell if this is normal behavior but I remember it to play proper in the past.
Since I do not own old hardware anymore, I cant test this.
Is this: a bug in the game? , dosbox related? or just my own memory dropping bits ?
I tried DOSBox, SVN, ECE and X and it behaves the same with default settings.
I also tried using various SB models, and using nuked. But none of that seemed to give any real improvement.
Using core=normal also did not help, but it did help somewhat to drastically lower the cycles value. Still I was not able to eliminate the pops and cracks.
The game lists Adlib and Sound Blaster support, which probably means just Adlib.
Thanks for testing, but it uses a mod file for music so Adlib is out of the question.
Although it sounds like it. You can use: DIET.EXE -RA ALMOST.MOD to retrieve the original mod file and play it in MOD Master.
What I can't figure out is why the SB is at 8khz as this game was released in 1993.
This has to be a bug.
Akumawrote on 2020-05-21, 08:08:Thanks for testing, but it uses a mod file for music so Adlib is out of the question.
Although it sounds like it. You can use: D […] Show full quote
Thanks for testing, but it uses a mod file for music so Adlib is out of the question.
Although it sounds like it. You can use: DIET.EXE -RA ALMOST.MOD to retrieve the original mod file and play it in MOD Master.
What I can't figure out is why the SB is at 8khz as this game was released in 1993.
This has to be a bug.
@keropi: can you take a look on real hardware ?
sorry I did not see that request, I was only tipped today about it (send me a pm next time 😀 )
OK so the game is broken. The recording I upload here is from a 486slc33 + SB2.0 CT1350B , the playback has issues, it speeds up and eventually the system locks up.
it's just bad programming in the end.... (also in-game the same playback issues exist)
@keropi: I will but it wasn't high priority 😁, thanks for testing.
I hope I can find a way to init the SB with a higher bitrate 44.1 or 22.5.
This should resolve a lot of clicking and popping..
But I know nothing of SB, so its going to take a while and progress is slow.
Opening your FLAC in audacity shows its waveform is brutally DC shifted in the negative:
So this explains why louder sounds will crackle out (when their samples hit the wall in the negative direction), while in the positive positive direction they approach the centerline and simply become inaudible. Argh.
It turns out another 1993 game by Titus is similarly plagued by this: Prehistorik 2, which was pointed out by woj1993 from another forum:
After some experimenting it's possible to take the amplitude of the first sample of each DMA block of audio, compute the difference back up to the zeroline, and use that to correct it and subsequent samples before they're sent to the mixer. This corrects the DC-offset.
1// use the first sample in the series as our datum 2const uint8_t datum = sb.dma.buf.b8[0]; 3 4// If the centerline is at 127, how far off is our datum? 5const int8_t correction_to_centerline = 127 - datum; 6 7// Add our "correction to the centerline" to each sample in the chunk 8for (i = 0; i < read; i++) 9 sb.dma.buf.b8[i] += correction_to_centerline;
It's too bad Titus' internal MOD tracker player and/or SB driver are so broken.. the original audio sure sounds great.
Last edited by krcroft on 2020-06-22, 15:28. Edited 3 times in total.
I also suspect that if either game can be hacked to request a 4-bit DMA transfer mode (or maybe 3-bit DMA) instead of the current 0x14 Single-Cycle 8-Bit DMA mode, then the audio stream will be similarly DC-corrected per the ADPCM codec; however I doubt we can fix the mono @ 8kHz aspect given that's what's coming out of their player.
Unfortunately hacking the the DC offsets in Blues Brothers Jukebox Adventure using the suggested hack for Prehistorik 2 doesn't work quite as well, and the audio is still left sounding broken, but in a different way. Also similarly, the 4-bit DMA transfer mode for BB JA also isn't nearly as effective as it is for Prehistorik 2. Argh. These are some sadly very broken games. It's too bad - they've got a lot of character. I suppose the better route is use Titus's original Amiga versions.
@krcroft:
Thank you very much, that is some extensive research my friend 😁
I think the SB can be initialized with a higher sample rate (from what I read in the developers manual)
So that would technically be a doable patch. But other things have their priority now, so this will just take a while 😒