Audiopack revival

General information and assistance with GliDOS.

Re: Audiopack revival

Postby Glidos » 2007-8-16 @ 07:25

Oh amazing! What did you do on the Acorn platform?
User avatar
Glidos
l33t
 
Posts: 3114
Joined: 2002-8-08 @ 02:55

Re: Audiopack revival

Postby Glidos » 2007-8-16 @ 07:33

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.
User avatar
Glidos
l33t
 
Posts: 3114
Joined: 2002-8-08 @ 02:55

Re: Audiopack revival

Postby KMO » 2007-8-16 @ 11:37

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).
KMO
Newbie
 
Posts: 46
Joined: 2007-7-30 @ 14:11

Re: Audiopack revival

Postby KMO » 2007-8-18 @ 16:03

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.
KMO
Newbie
 
Posts: 46
Joined: 2007-7-30 @ 14:11

Re: Audiopack revival

Postby ronnie_t » 2007-8-31 @ 22:42

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.
ronnie_t
Newbie
 
Posts: 1
Joined: 2007-8-31 @ 22:17

Re: Audiopack revival

Postby Antonijadis » 2007-9-01 @ 20:10

Great! This work always need some new enthusiasts to help. :happy:
User avatar
Antonijadis
Member
 
Posts: 128
Joined: 2005-7-05 @ 23:34
Location: Peru

Re: Audiopack revival

Postby KMO » 2007-9-02 @ 10:51

Hi folks,

I've stopped work on this. :depressed:

But that's because it's finished! :lol: 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.
KMO
Newbie
 
Posts: 46
Joined: 2007-7-30 @ 14:11

Re: Audiopack revival

Postby Kaminari » 2007-9-02 @ 15:37

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 :)
User avatar
Kaminari
Oldbie
 
Posts: 768
Joined: 2002-12-06 @ 01:54

Re: Audiopack revival

Postby KMO » 2007-9-02 @ 16:28

There aren't any music cues in the TRUB level files, no. There are just the ambient tracks, hardcoded in TOMBUB.EXE.
KMO
Newbie
 
Posts: 46
Joined: 2007-7-30 @ 14:11

Re: Audiopack revival

Postby z9d10 » 2007-9-06 @ 13:57

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




any time table on release?

need more testors? :)
User avatar
z9d10
Member
 
Posts: 105
Joined: 2006-3-03 @ 00:49

Re: Audiopack revival

Postby Zebius » 2007-9-19 @ 09:14

Nice work KMO! Thanks a lot! :happyhappy:
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). :oops: 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.
User avatar
Zebius
Member
 
Posts: 166
Joined: 2004-10-05 @ 07:46
Location: Poland

Re: Audiopack revival

Postby Gambit37 » 2007-9-21 @ 17:16

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?
User avatar
Gambit37
Oldbie
 
Posts: 613
Joined: 2003-10-19 @ 02:29
Location: London, England

Re: Audiopack revival

Postby Gambit37 » 2007-9-21 @ 17:50

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.
User avatar
Gambit37
Oldbie
 
Posts: 613
Joined: 2003-10-19 @ 02:29
Location: London, England

Re: Audiopack revival

Postby KMO » 2007-9-21 @ 19:51

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.
KMO
Newbie
 
Posts: 46
Joined: 2007-7-30 @ 14:11

Re: Audiopack revival

Postby KMO » 2007-9-21 @ 19:53

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.
KMO
Newbie
 
Posts: 46
Joined: 2007-7-30 @ 14:11

Re: Audiopack revival

Postby Gambit37 » 2007-9-21 @ 22:59

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?
User avatar
Gambit37
Oldbie
 
Posts: 613
Joined: 2003-10-19 @ 02:29
Location: London, England

Re: Audiopack revival

Postby KMO » 2007-9-22 @ 08:41

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-9-23 @ 19:25, edited 1 time in total.
KMO
Newbie
 
Posts: 46
Joined: 2007-7-30 @ 14:11

Re: Audiopack revival

Postby KMO » 2007-9-22 @ 09:09

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.
KMO
Newbie
 
Posts: 46
Joined: 2007-7-30 @ 14:11

Re: Audiopack revival

Postby Gambit37 » 2007-9-22 @ 12:12

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?
User avatar
Gambit37
Oldbie
 
Posts: 613
Joined: 2003-10-19 @ 02:29
Location: London, England

Re: Audiopack revival

Postby KMO » 2007-9-22 @ 13:02

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...
KMO
Newbie
 
Posts: 46
Joined: 2007-7-30 @ 14:11

PreviousNext

Return to GliDOS General

Who is online

Users browsing this forum: No registered users and 1 guest