VOGONS


First post, by Akuma

User metadata
Rank Member
Rank
Member

Blues Brothers: Jukebox Adventures by Titus 1993

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 ?

Attachments

  • Filename
    ALMOST_REC.FLAC
    File size
    820.23 KiB
    Downloads
    74 downloads
    File comment
    Bad
    File license
    Fair use/fair dealing exception
  • Filename
    ALMOST.FLAC
    File size
    899.27 KiB
    Downloads
    54 downloads
    File comment
    Good
    File license
    Fair use/fair dealing exception

Reply 1 of 9, by _Rob

User metadata
Rank Member
Rank
Member

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.

Reply 2 of 9, by Akuma

User metadata
Rank Member
Rank
Member

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 ?

Reply 3 of 9, by keropi

User metadata
Rank l33t++
Rank
l33t++
Akuma wrote 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)

Attachments

  • Filename
    blues2.mp3
    File size
    3.36 MiB
    Downloads
    53 downloads
    File comment
    BB2 CT1350B
    File license
    Public domain

🎵 🎧 PCMIDI MPU , OrpheusII , Action Rewind , Megacard and 🎶GoldLib soundcard website

Reply 4 of 9, by Akuma

User metadata
Rank Member
Rank
Member

@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.

Reply 5 of 9, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

Akuma - excellent find!

Opening your FLAC in audacity shows its waveform is brutally DC shifted in the negative:

Screenshot at 2020-06-22 06-26-53.png
Filename
Screenshot at 2020-06-22 06-26-53.png
File size
28.07 KiB
Views
1046 views
File license
Public domain

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:

Filename
Prehistorik_2-Bad.flac
File size
115.39 KiB
Downloads
47 downloads
File license
Fair use/fair dealing exception

(Bad in-game audio)

Filename
Prehistorik_2-OST_Extract.flac
File size
2.47 MiB
Downloads
47 downloads
File license
Fair use/fair dealing exception

(Good, DIET-extracted Tracker playback)

It's also got a bad case of the DC shifts:

Screenshot at 2020-06-22 06-35-24.png
Filename
Screenshot at 2020-06-22 06-35-24.png
File size
28.25 KiB
Views
1046 views
File license
Public domain

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.

2020-06-21_07-36.png
Filename
2020-06-21_07-36.png
File size
6.85 KiB
Views
1045 views
File license
Public domain

If you want to try it out, insert these couple lines after line 490 in src/hardware/sblaster.cpp in DOSBox-SVN:

// use the first sample in the series as our datum
const uint8_t datum = sb.dma.buf.b8[0];

// If the centerline is at 127, how far off is our datum?
const int8_t correction_to_centerline = 127 - datum;

// Add our "correction to the centerline" to each sample in the chunk
for (i = 0; i < read; i++)
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.

Reply 6 of 9, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

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.

I'm not sure how to hack the game itself though, but presumably a fix would be relatively portable across both games (maybe more Titus games around that timeframe too - https://www.mobygames.com/browse/games/dos/ti … interactive-sa/).

ripsaw8080: curious what your thoughts are and if you think there's a possibilities for patching.

Edit: here's a link to details and unpackers for Titus's SQZ format used in Blues Brothers and Prehistorik 2: http://www.shikadi.net/moddingwiki/Titus_Inte … SQZ_Compression

Reply 7 of 9, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

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.

Reply 8 of 9, by Akuma

User metadata
Rank Member
Rank
Member

@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 😒