I'm trying to understand what's wrong with CDA in this game. I believe we fixed the CDA in some past release, but now I can't get it working, and honestly weird things are happening.
Let's start from the beginning:
The game is on 2 disks, the CD1 is an installer disk and CD2 is a mixed audio disk with some mission data and 16 audio tracks that you can easily rip with freac.
The game patched with the gold patch for accelerated cards can work with DxWnd, but only if CDA emulation is off (DxWnd option "No emulation"). Of course, in this way you can hear no CD audio tracks.
I tried then to run the game with the CD mounted on Win11, again it works but because the mci system doesn't support CDA and again no audio can be heard. Here the log that shows what happens:
The curious thing happens if I try to enable the DxWnd CDA emulation: the game stops and tells to insert the CD2, no matter if I use a real or fake CD drive. It seems that the CDA emulation triggers some error condition and blocks the game. So, in short, no CD = game working, CDA emulation = game stops!
Here someone could help: probably on a WinXP or Win98 it should be possible to run the game with the CD mounted and the Audio tracks working. Could you run the game for me with no CDA emulation, log flags for "Sound" + "Debug" and capture a log session that would indicate what the game is expecting to see?
@Huh @Dippy dipper: maybe you remember better than me this game situation? In case, I can provide a private copy of my RIP ...
Last edit: gho 2023-09-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Damn, 4share put size limitations on the files. Can you download the CD images (2 files, about 600 MB) directly from old-games.ru? I'll try to pack the necessary updates.
Update: it will be sufficient the only CD2 file, 400 MB in .mds/.mdf format
Last edit: gho 2023-09-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@Huh:
instructions:
Unpack the archive on a game folder (link sent through PM)
create there a cd folder
copy the content of the whole CD2 to cd (if you want to use fake CD) or keep the CD mounted on drive E:
Use the attached profile. The CDA emulation is disabled, the audio should come from the CD2.
BEWARE: the game saves the CD drive letter somewhere and my wiles only work with CD2 mounted on drive E:\ !!!
Unfortunately, file cannot be downloaded without logging into a social network account.
I have CD2.
Can you save it on ulozto.net?
Or anywhere else where I don't have to log in/register.
Last edit: huh 2023-09-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
the game closes the MCI session with MCI_CLOSE and the next statement gets the answer. This perhaps does not happen on Win11, after you close you should re-open the MCI session, or not?...
Where did you got the log? I'm not sure that Win10/11 behave this way, or maybe we got it wrong, the mci system is supposed to answer to MCI_SYSINFO also when the mci session is closed!
Sounds quite interesting, there's some refinement needed into our CDA emulator!!!
Last edit: gho 2023-09-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I installed the game in WinXP, but I didn't give any patches, the game hangs in the menu. Interesting that I saw some links to 4share that didn't need any login, maybe this can be set up? I still don't have your files.
Be careful about running commands after "close cdaudio". Some commands can be run after "close cdaudio", but running others is illegal and leads to unexpected behavior.
I once posted a post on this topic here, I'll find it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, I have your files, .... I'll try tomorrow to see if I have the same log as @BEEN_Nath_58.
Here is my old post. https://sourceforge.net/p/dxwnd/discussion/general/thread/0d852410/?limit=25&page=60#1866
That time I tried some commands after "close cdaudio". As you can see the results were unexpected. Of course, this doesn't mean that any command won't work, I'm just urging caution.
Update:
Interesting, now I found out, that I've tried this game before in Win7 and according to what I can see, some FakeCD audio changes had to be made in version 2.05.87 for this game.
Update2:
If I look in my log (with mounted CD2), the game detects the number and position of all the tracks, maybe it needs a mcihack. I think I saw also the status mode for track 0 here (stop), but I must have been mistaken, the log has already been overwritten with a newer one.
Last edit: huh 2023-09-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
v2.05.99: when MCI session is closed, you can still send MCI_OPEN and MCI_SYSINFO
For sure you can also send MCI_STATUS and MCI_INFO without opening the device.
edit:
I don't have my PCem setup to verify this on Win9x and I am currently stuck with a Linux system so I can not verify with Win10 either. But I seem to remember that MCI_SET and MCI_SEEK for cdaudio will also succeed without throwing an error even if the device was not opened. In addition you should also be able to auto open a device with a simple MCI_PLAY command. It might be that the only MCI command that will throw an error is if you call MCI_CLOSE on a device that is already closed.
edit2:
Well maybe not so sure. Could be a difference between the mciSendString and mciSendCommand behaviour.
Last edit: dippy dipper 2023-09-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To make tests, you can use this .rc3 release that has in practice only this tiny fix to the mci logic, but is enough to bypass one check and fail (maybe) a little later.
In effect, I double-checked all mci messages and apparently this .rc3 release is behaving very well until it stops for the CD check. But I wonder if the reason now is some mci oddity or perhaps some other event that we didn't notice yet. Or maybe it will just work on your machines?
If I look in my log (with mounted CD2), the game detects the number and position of all the tracks, maybe it needs a mcihack.
This part is puzzling. Maybe you are right, but the thing is not so obvious. The game sets TMSF format, a format for which the beginning of track n is .... n (that is, 00 frames + 00 seconds + 00 minutes after track n) . So, you can see a funny loop where the game does this:
question: where does the track 1 start?
answer: it starts at position 1
question: where does the track 2 start?
answer: it starts at position 2
question: where does the track 3 start?
answer: it starts at position 3
...
And if you look at BEEN_Nath_58 log file, you can see that this is exactly what the game expects, no tricks it seems.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To make tests, you can use this .rc3 release that has in practice only this tiny fix to the mci logic, but is enough to bypass one check and fail (maybe) a little later.
There is only one difference: the CDaudio doesn't work at all now. It gets bypassed completely
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@gho
I tried it this morning and the music played for me with rc3 in Win7. However, CD2 was required later. I see 3 errors in spystudio, is it possible that there is a problem with FakeCD (F:)?
I doubt that there could be so many mci commands working after MCI_CLOSE because this message releases the mci session handle, so any further command wouldn't know on what device it would work. MC_OPEN must work by definition (it initialized the device handle) and MCI_SYSINFO refers to the system as a whole, so it can be ok. MCI_STATUS could perhaps work in all cases where it queries a global status condition, but that would depend on the status item. If you have two CD devices, both closed, how could an mci command know to which it should refer?
Anyway, we know that mci is full of surprises, so if you can find any other command that works somehow after the MCI_CLOSE operation, I would fix the emulation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't know if I expressed myself correctly with spystudio, I meant FakeCD not CD Audio emualation . And yes, as you can see in my link to my old post above, some commands aftrer close cdaudio still work but give unexpected behavior, so I wouldn't change anything else yet (except MCI_SYSINFO).
Last edit: huh 2023-09-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I doubt that there could be so many mci commands working after MCI_CLOSE because this message releases the mci session handle, so any further command wouldn't know on what device it would work. MC_OPEN must work by definition (it initialized the device handle) and MCI_SYSINFO refers to the system as a whole, so it can be ok.
You maybe right. I remember that mciSendString takes surprisingly many strings without actually requiring the use of "open cdaudio" first and does not throw an error. So you could for example use "set cdaudio time format tmsf" and it would succeed without giving an error message. (Not that it's useful as it does not remember the "tmsf" format if you then open the device with "open cdaudio".) BUT this may not be directly comparable to using the mciSendCommand fucntion.
For mciSendCommand the MS Docs say: The MCI_SYSINFO command retrieves information about MCI devices. MCI supports this command directly rather than passing it to the device. https://learn.microsoft.com/en-us/windows/win32/multimedia/mci-sysinfo
So it may be the only special case when mciSendCommand function is used where the device does not need to be opened first.
If you have two CD devices, both closed, how could an mci command know to which it should refer?
Again if I remember correctly MCI is quite stupid in this regard and always picks the first optical drive letter. So you could never use cdaudio from anything but the first drive in the drive letter order.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to understand what's wrong with CDA in this game. I believe we fixed the CDA in some past release, but now I can't get it working, and honestly weird things are happening.
Let's start from the beginning:
The game is on 2 disks, the CD1 is an installer disk and CD2 is a mixed audio disk with some mission data and 16 audio tracks that you can easily rip with freac.
The game patched with the gold patch for accelerated cards can work with DxWnd, but only if CDA emulation is off (DxWnd option "No emulation"). Of course, in this way you can hear no CD audio tracks.
I tried then to run the game with the CD mounted on Win11, again it works but because the mci system doesn't support CDA and again no audio can be heard. Here the log that shows what happens:
The curious thing happens if I try to enable the DxWnd CDA emulation: the game stops and tells to insert the CD2, no matter if I use a real or fake CD drive. It seems that the CDA emulation triggers some error condition and blocks the game. So, in short, no CD = game working, CDA emulation = game stops!
Here someone could help: probably on a WinXP or Win98 it should be possible to run the game with the CD mounted and the Audio tracks working. Could you run the game for me with no CDA emulation, log flags for "Sound" + "Debug" and capture a log session that would indicate what the game is expecting to see?
@Huh @Dippy dipper: maybe you remember better than me this game situation? In case, I can provide a private copy of my RIP ...
Last edit: gho 2023-09-18
I can make a log in XP if you send me a PM with the necessary files.
Damn, 4share put size limitations on the files. Can you download the CD images (2 files, about 600 MB) directly from old-games.ru? I'll try to pack the necessary updates.
Update: it will be sufficient the only CD2 file, 400 MB in .mds/.mdf format
Last edit: gho 2023-09-18
Maybe I remember better too... let me see
2.90 it was. I got from my notes
Anyways heres the file requested
@Huh:
instructions:
Unpack the archive on a game folder (link sent through PM)
create there a cd folder
copy the content of the whole CD2 to cd (if you want to use fake CD) or keep the CD mounted on drive E:
Use the attached profile. The CDA emulation is disabled, the audio should come from the CD2.
BEWARE: the game saves the CD drive letter somewhere and my wiles only work with CD2 mounted on drive E:\ !!!
Last edit: gho 2023-09-18
Unfortunately, file cannot be downloaded without logging into a social network account.
I have CD2.
Can you save it on ulozto.net?
Or anywhere else where I don't have to log in/register.
Last edit: huh 2023-09-18
Later, this evening ...
@ghotik didn't my log work for. you?
I'm about to move and drive for a while, but I got BEEN_Nath_58 logs and I see I spotted the clue, here:
the game closes the MCI session with MCI_CLOSE and the next statement gets the answer. This perhaps does not happen on Win11, after you close you should re-open the MCI session, or not?...
Where did you got the log? I'm not sure that Win10/11 behave this way, or maybe we got it wrong, the mci system is supposed to answer to MCI_SYSINFO also when the mci session is closed!
Sounds quite interesting, there's some refinement needed into our CDA emulator!!!
Last edit: gho 2023-09-18
Windows XP as you asked. Without enabling CD emulation.
Game worked fine upto 2.05.89
The only change in Dxwnd 2.05.90 mciwrapper.cpp is this one:
Unless you mean that 2.05.88 is the last one that worked?
Certainly there are mci commands that can be run without opening the device.
Last edit: dippy dipper 2023-09-18
I fixed it now this way (see the MCI_SYSINFO in the if condition):
The game likes it, it goes much further ahead, but still complain about a missing CD2. There must be something else, but the fix seems correct.
Last edit: gho 2023-09-18
I installed the game in WinXP, but I didn't give any patches, the game hangs in the menu. Interesting that I saw some links to 4share that didn't need any login, maybe this can be set up? I still don't have your files.
Be careful about running commands after "close cdaudio". Some commands can be run after "close cdaudio", but running others is illegal and leads to unexpected behavior.
I once posted a post on this topic here, I'll find it.
OK, I have your files, .... I'll try tomorrow to see if I have the same log as @BEEN_Nath_58.
Here is my old post.
https://sourceforge.net/p/dxwnd/discussion/general/thread/0d852410/?limit=25&page=60#1866
That time I tried some commands after "close cdaudio". As you can see the results were unexpected. Of course, this doesn't mean that any command won't work, I'm just urging caution.
Update:
Interesting, now I found out, that I've tried this game before in Win7 and according to what I can see, some FakeCD audio changes had to be made in version 2.05.87 for this game.
Update2:
If I look in my log (with mounted CD2), the game detects the number and position of all the tracks, maybe it needs a mcihack. I think I saw also the status mode for track 0 here (stop), but I must have been mistaken, the log has already been overwritten with a newer one.
Last edit: huh 2023-09-18
For sure you can also send MCI_STATUS and MCI_INFO without opening the device.
edit:
I don't have my PCem setup to verify this on Win9x and I am currently stuck with a Linux system so I can not verify with Win10 either. But I seem to remember that MCI_SET and MCI_SEEK for cdaudio will also succeed without throwing an error even if the device was not opened. In addition you should also be able to auto open a device with a simple MCI_PLAY command. It might be that the only MCI command that will throw an error is if you call MCI_CLOSE on a device that is already closed.
edit2:
Well maybe not so sure. Could be a difference between the mciSendString and mciSendCommand behaviour.
Last edit: dippy dipper 2023-09-19
To make tests, you can use this .rc3 release that has in practice only this tiny fix to the mci logic, but is enough to bypass one check and fail (maybe) a little later.
In effect, I double-checked all mci messages and apparently this .rc3 release is behaving very well until it stops for the CD check. But I wonder if the reason now is some mci oddity or perhaps some other event that we didn't notice yet. Or maybe it will just work on your machines?
@Huh
This part is puzzling. Maybe you are right, but the thing is not so obvious. The game sets TMSF format, a format for which the beginning of track n is .... n (that is, 00 frames + 00 seconds + 00 minutes after track n) . So, you can see a funny loop where the game does this:
question: where does the track 1 start?
answer: it starts at position 1
question: where does the track 2 start?
answer: it starts at position 2
question: where does the track 3 start?
answer: it starts at position 3
...
And if you look at BEEN_Nath_58 log file, you can see that this is exactly what the game expects, no tricks it seems.
There is only one difference: the CDaudio doesn't work at all now. It gets bypassed completely
@gho
I tried it this morning and the music played for me with rc3 in Win7. However, CD2 was required later. I see 3 errors in spystudio, is it possible that there is a problem with FakeCD (F:)?
I doubt that there could be so many mci commands working after MCI_CLOSE because this message releases the mci session handle, so any further command wouldn't know on what device it would work. MC_OPEN must work by definition (it initialized the device handle) and MCI_SYSINFO refers to the system as a whole, so it can be ok. MCI_STATUS could perhaps work in all cases where it queries a global status condition, but that would depend on the status item. If you have two CD devices, both closed, how could an mci command know to which it should refer?
Anyway, we know that mci is full of surprises, so if you can find any other command that works somehow after the MCI_CLOSE operation, I would fix the emulation.
I don't know if I expressed myself correctly with spystudio, I meant FakeCD not CD Audio emualation . And yes, as you can see in my link to my old post above, some commands aftrer close cdaudio still work but give unexpected behavior, so I wouldn't change anything else yet (except MCI_SYSINFO).
Last edit: huh 2023-09-19
yes, I was commenting the post above ...
You maybe right. I remember that
mciSendString
takes surprisingly many strings without actually requiring the use of "open cdaudio" first and does not throw an error. So you could for example use "set cdaudio time format tmsf" and it would succeed without giving an error message. (Not that it's useful as it does not remember the "tmsf" format if you then open the device with "open cdaudio".) BUT this may not be directly comparable to using themciSendCommand
fucntion.For mciSendCommand the MS Docs say:
The MCI_SYSINFO command retrieves information about MCI devices. MCI supports this command directly rather than passing it to the device.
https://learn.microsoft.com/en-us/windows/win32/multimedia/mci-sysinfo
So it may be the only special case when mciSendCommand function is used where the device does not need to be opened first.
Again if I remember correctly MCI is quite stupid in this regard and always picks the first optical drive letter. So you could never use cdaudio from anything but the first drive in the drive letter order.