VOGONS

Common searches


Audiopack revival

Topic actions

Reply 201 of 301, by Glidos

User metadata
Rank l33t
Rank
l33t

Just thinking, how much messing around will Glidos need to do in the CD audio driver hook? The current code just makes up for deficiences in mscdex (or what ever its called). It just makes the CD play how it is supposed to. There's no mapping to mp3 at the moment.

I seem to be picking up play commands with start and duration specified in frames. I don't see track numbers. I'm wondering about making your changes work with Glidos, but without the user needing to use a CD with extra tracks.

Reply 202 of 301, by KMO

User metadata
Rank Newbie
Rank
Newbie

I worked for Acorn, and its successors. We never met, but I recognised your name.

What are the MSCDEX deficiencies? What is Glidos already doing?

Basically, you'll need to intercept enough of the MSCDEX interface to fool TR into thinking you have CD audio tracks.

The audio system uses the following INT 2Fh/1510h commands:

03h Ioctl Input
0Ch Ioctl Output
83h Seek
84h Play Audio
85h Stop Audio

The Input ioctls it uses are:

6 Device Status
9 Change Status
10 Audio Disk Info
11 Audio Track Info
12 QChannel Info

It also thinks about using output Ioctl:

3 Control Audio

to change the volume but doesn't get around to it.

Audio Disk Info must return the range of track numbers available - report the highest numbered and lowest numbered MP3 you have. This will ensure compatibility with people with old Audio Packs if we upgrade to doing extra sounds. It will resort to internal audio or ignore a trigger if a CD track isn't available.

Audio Track Info should return a start address for the given track. It's this value that gets passed to the Play command, and it always tells the Play command to play the whole track by giving the length as (address of next track - address of this track). For the last track, it plays up to the leadout address given by Audio Disk Info.

So, to keep it simple, you can just give some dummy addresses - maybe say that every track is 1 minute long or something. It doesn't use the length information, except to pass to the Play command. You can assume that it always requests the whole track.

It detects that play of either a background or foreground track has finished by polling the drive every 4 seconds using QChannel Info, to look for the BUSY flag being clear. When that happens, if it has a background track to resume/repeat, it seeks to it, and then 4 seconds later plays it.

It can ask to stop the playback with the Stop command. This is used at end of levels, death, exiting, and it can also happen in gameplay (although I will usually seek - see below). Oddly, it appears that after a Stop command, the driver continues to report "busy" to QChannel Info, which can inhibit the background from restarting. I suggest you emulate this; I handle this behaviour

There are also checks for disk changes using Drive Status and Change Status. You can probably ignore these - just report everything as being okay.

The Seek command should be treated as a Stop. As well as its use in the automatic background resumption, I'm using it to stop a foreground cue if I know I need to resume background. It gives better performance than stopping. If you're feeling keen, you could preload the MP3 it specifies to improve responsiveness.

Is that sufficient info? That's all that TR1 requires, but obviously the better your emulation the more chance it has of working with other games where Red Book emulation could be useful. In particular, QChannel info should ideally report real time info - people could well be using this to sync cut scenes to CD audio (as TR1 spectacularly fails to do - although does have an unused routine to parse the time information from the CD).

Reply 203 of 301, by KMO

User metadata
Rank Newbie
Rank
Newbie

I've just tested with Glidos for the first time - I had had a report that it didn't work with Glidos, but it seems fine for me, after I renamed the EXE down to an 8.3 name.

But the CD performance isn't brilliant. There's a slightly longer seek delay - that's not a big deal though. But most annoyingly it appears to have 2 seconds of silence before each track - presumably that's the track pre-gap.

Is that anything to do with your Red Book emulation? Under dgVoodoo it appears to start each track immediately.

Reply 204 of 301, by ronnie_t

User metadata
Rank Newbie
Rank
Newbie

It's a shame I didn't hear from this initiative before. It is great that people are so dedicated to get the audio AS IT SUPPOSED TO BE on the PC version. It's a great discovery to find all the information in the original binary, so the texturehacks are not needed. Sorry for those who put all the work in. KMO, I have send you a PM. If you still want those audio-tracks from the official playstation 1 cd, I get them for you. I have ripped them to FLAC with PLEXTOOLS. They are now 121 MB.

Is this topic and KMO's work still alive? I would be a shame if devellopment stopped right before such a breakthrough. I want to help as far as I can, because I would love to see the results.

Reply 206 of 301, by KMO

User metadata
Rank Newbie
Rank
Newbie

Hi folks,

I've stopped work on this. 😢

But that's because it's finished! 🤣 I put version 1.00 of the patch to bed on 21 August.

I'm just waiting for the folks at Tomb Raider Chronicles to finish testing and sort out distribution.

It will need users to burn a CD, until Glidos or something can intercept CD calls.

I must agree, I do feel a little bit guilty that so many people put so much work in trying to get the texture triggers to work, when it could have been done so much more simply. And I could have done this years ago, it's just that I've just come back to TR1 for the first time in years, and the existing audio pack prompted me to investigate.

Reply 207 of 301, by Kaminari

User metadata
Rank Oldbie
Rank
Oldbie

Man, no need to be confused. Even if the texture triggers had been completed, I'd have thrown them away as soon as your patch had been released.

Nevertheless, the texture triggers are still a useful way to implement "new" incidental music in the Gold levels (which were not released on PS1/Saturn). I suppose there isn't any PS1 CD call hidden in TRUB, other than the ambient tracks 😀

Reply 210 of 301, by Zebius

User metadata
Rank Member
Rank
Member

Nice work KMO! Thanks a lot! 😁
Right now I'm testing your patch and it works OK so far.

So, no need to look for audio triggers anymore. Some guys here wasted so much time doing this and I thought it would take few more years to complete the entire game (if ever). 😦 Very impressive work.

If anybody else wants to test it, here are the links:

PATCH
AUDIO TRACKS
INSTRUCTIONS
You need to burn mixed-mode replacement CD with 60 tracks (1st - data track, 2-60 - audio). And then replace tomb.exe file in TOMBRAID folder with the one from the patch. Both Glidos and dgvoodoo work with it.

Reply 211 of 301, by Gambit37

User metadata
Rank Oldbie
Rank
Oldbie

I've burnt the mixed mode CD and made sure it's in my first drive, but I get no CD audio at all using Glidos.

I have switched off both MP3 and Redbook Audio support.

I also get nothing if RedBook audio support is enabled.

Also, how do I get the command line option to work with Glidos?

Reply 212 of 301, by Gambit37

User metadata
Rank Oldbie
Rank
Oldbie

Doh, my CD audio volume was at 0.... oops!

It seems to be working as I now get music cues at various places where I never had them before. Excellent stuff! However, the docs say that the default mode is TR2: looping ambience will restart after being interuupted. This is not happening for me: the ambience never comes back after being interrupted.

Still unsure how to pass the audio parameter to the EXE -- I edited the glidos batch file but it doesn't seem to make any difference in there.

Reply 213 of 301, by KMO

User metadata
Rank Newbie
Rank
Newbie

Odd. Make sure Red Book support is enabled in Glidos.

Does the ambience itself loop? The "resume ambience" logic is the same as the "repeat ambience" logic, and I believe my code doesn't make any assumptions that the original TOMB.EXE didn't. And I have had people testing with Glidos, and it's worked for them.

Run the game, start a new game, and wait at the start. Make sure the ambience loops after 3(?) minutes. If it doesn't, check it on the original TOMB.EXE.

As for the parameter, when I was using dgVoodoo/VDMSound, the command line was set in the VDMSound configuration, by right-clicking on the .VLP file. I don't know where the Glidos equivalent is, I'm afraid.

Reply 214 of 301, by KMO

User metadata
Rank Newbie
Rank
Newbie

Handy tip on the CD volume - Windows Media Player has a nasty habit of setting the volume to 0 after every CD playback if "digital CD audio" is disabled. God knows why. I would recomend digital CD audio playback being off for Tomb Raider though - reduces CPU load, and I (and others) get a snippet of the next track at the end with digital audio on.

Reply 215 of 301, by Gambit37

User metadata
Rank Oldbie
Rank
Oldbie

OK, I tested as you suggested and started a new game, and did nothing once entering the Caves. As I suspected:

Ambience loops perfectly with my original TOMB.EXE.

Ambience DOES NOT LOOP with your new TOMB.EXE.

What now?

Reply 216 of 301, by KMO

User metadata
Rank Newbie
Rank
Newbie

Hmm. Are you sure you're not playing in "-audio 0" mode somehow, from your fiddling with the batch file? The command line parsing is primitive, so if it was given a malformed option, such as just "-audio", it might fall back to 0.

In -audio 0, there is no looping ambience, just individual ambience triggers, including one at the start of level 1. Could be what you're seeing. You could test that by saving somewhere a little on from the start, and loading there. You wouldn't get ambience when you loaded the game if -audio 0 was set.

Otherwise this doesn't make much sense. The logic for track play is (simplified):

  • Look up track start and end addresses
  • Tell drive to play that range of the disc
  • Every 4 seconds, see if the drive reports "busy"
  • If it reports non-busy, seek to the ambient track, and set a flag for the next 4-second check.
  • On the next 4-second check, start playing the ambient track.

I've changed quite a lot in the code, but I've tried to avoid changing any of the direct CD drive manipulation, as I'm wary of different drives (and MSCDEX emulations) having different behaviour. The only new assumption I'm aware I've made is that a "Seek" command will silence playback.

But for the loop, this code is unaltered. Perhaps Glidos has binary detection and special casing somehow, and doesn't recognise the modified binary?

I'll test it myself with Glidos later. But please check you're not in "-audio 0" mode.

<edit - I've realised this post is largely nonsense - I was getting -audio 0 and 1 the wrong way round>

Last edited by KMO on 2007-09-23, 19:25. Edited 1 time in total.

Reply 217 of 301, by KMO

User metadata
Rank Newbie
Rank
Newbie

Righty ho, just checked it in Glidos myself. Glidos was misbehaving somewhat - had to keep hitting Alt-Tab to get the screen back, but I get the same audio behaviour as you. But the same binary works fine in dgVoodoo (I just checked).

So I guess it's got to be some sort of CD emulation thing rather than core logic. I'm going to have to think about what I could be doing differently in the CD accesses to upset Glidos, if the original TOMB.EXE didn't. It would be nice if Paul could confirm that there's no special binary detection.

I know Glidos has another problem, in that you get a couple of seconds silence before every track (thus rather losing the impact of some of the dramatic cues).

Just a thought - try flipping the "digital audio" option on your CD drive properties. Mine is off.

Reply 218 of 301, by Gambit37

User metadata
Rank Oldbie
Rank
Oldbie

Glidos seems to rewrite the batch file everytime it runs: I put that commandline in there and it had disappeared the next time I went to edit it -- file date and time showed they were changed when I exited Glidos, so it's definitely nothing to do with that.

I don't have an auido lead on my CD -- if I disable digital audio, I'll get nothing at all won't I?

Reply 219 of 301, by KMO

User metadata
Rank Newbie
Rank
Newbie

If you don't have a CD audio connection, then you'll have to leave digital audio on.

I can't see any way of passing command line options with Glidos. And if the CD emulation isn't working either, I'd suggest you ditch it for now and use dgVoodoo/VDMSound. That works much more smoothly for me than Glidos in general anyway.

I still haven't figured out why there should be a difference between the patched and original TOMB.EXE in Glidos, at least for the looping. And it's a bit odd none of my testers reported the problem. I guess not many people use Glidos...