Current version of the stand alone CDAudio proxy is based on Dxwnd v2_05_08 (including dwplay.dll). Below is a list of improvements in Dxwnd CD audio emulation since then.
Here an archive with the dll & sources aligned to last release v2.04.54 (actually, this release od DxWnd isn't released yet ...).
Would someone help me to test it? I'm running without a good testbed.
Again, mostly untested but working with "Imperialism" and "Corum III", in attach a new release that is even ahead of the last published in DxWnd.
winmm2.rar: proxy winmm.dll + sample configuration file winmm.ini. The file is empty, but the comments hopefully work as documentation.
cdaudioproxy2.rar: full sources
These are the news:
1) added the ReserveMCIId trick. It can be enabled with reservemciid=1 and requires the file dxwnd.wav to lock a mci id.
2) added the magicid trick. Since in so many cases we regret the old 0xBEEF falue that made things working, setting magicid=1 enables this old trick. (do not set reservemciid in this case)
3) added the log flag to enable logging. BEWARE: it's "log", not "logging".
4) fixed some incongruencies about MCI_INFO default values. Now, unless specified differently, they all return the default string "fakecd".
5) added a (c)copyright line in the log with version string. Mostly useful to be sure what release produced the logs.
I'm also going to bring some minor fix back to DxWnd.
Seems to work fine. A couple of small suggestions:
I would put "magicid" on by default. I think there are way more games that need it than those that do not like it.
winmm.ini could be autogenerated if not found (code for example in winmm.cpp):
FILE*fh;errno_terr;err=fopen_s(&fh, "winmm.ini", "r");if(err==0){
fclose(fh);
}
else{
err=fopen_s(&fh, "winmm.ini", "w+");
}
if(err==0){
fprintf(fh,
"[winmm]\n""\n""#log, 0-1, 1: enables logging, default:0\n""#log=0\n""\n""#volume, range 0-100, default 100\n""#volume=100\n""\n""#repeat, 0-1, 1:enable AUTO-REPEAT, default:0\n""#repeat=0\n""\n""#pause, 0-1, 1:enable PAUSE capability, default:0\n""#pause=0\n""\n""#cdrompresent: 0-1, 1: forces CD detection in the CD caddy also when there are no audio tracks\n""#default: 0\n""#cdrompresent=0\n""\n""#hack: 0-1, 1: enables ./Music/mcihack.txt configuration file\n""#for mcihack.txt see dxwnd help pages\n""#hack=0\n""\n""#magicid: 0-1, 1:forces using the 'impossible' value 0xBEEF, default:1\n""#magicid=1\n""\n""#reservemciid: 0-1, 1:enables reservation of a genuine mci id got by opening dxwnd.wav\n""#default=0. beware: if enabled, requires a dxwnd.wav file in the program folder\n""#reservemciid=0\n");fclose(fh);
}
else{
fclose(fh);
}
Last edit: dippy dipper 2020-08-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
About the MciId set to 0, you were awfully right: I forgot one essential part of code that is within dxhook.cpp in the procedre HookInit():
if(dxw.dwFlags8&VIRTUALCDAUDIO) {
//auxGetNumDevsishot-hooked, sopauxGetNumDevsshouldbesethere.
//thereturnofpauxGetNumDevscouldbezero!//thedeviceidsstartfrom0, soVirtualCDAudioDeviceIdmustben-1+1=n.
if(pauxGetNumDevs)dxw.VirtualCDAudioDeviceId=(*pauxGetNumDevs)();//v2.05.36: pretendthere's ALWAYS a first device id = 0 for the audio mixerif(dxw.VirtualCDAudioDeviceId==0)dxw.VirtualCDAudioDeviceId=1;OutTraceDW("Fake CDAudio DevId=%d\n", dxw.VirtualCDAudioDeviceId);//ghogho
}
In here DxWnd initializes the CDaudio MciId to a value depending on the number of available aux devices, skipping the value 0 in any case. Probably also this piece of code is wrong, but at least it ensures that there's no overlapping on the MciId value 0.
I think I'll take your suggestion to set MscId to 0xBEEF by default and use the "reservemciid" flag to make a real device MCI_OPEN on the wav file, this at least on the winmm wrpper. I start to doubt if such a thing should be made also on the full DxWnd tool.
About the auto-builded winmm.ini, I don't think it's a good idea, at least at this stage: any change to the wrapper should be made twice. Also, the usage of GetPrivateProfice calls to read the file will require that only the non-default values should be written in winmm.ini, so writing that file would be a very easy operation. A maybe better idea, instead, would be to auto-generate the dxwnd.wav file to be sure that the "reservemciid" would always work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here's the patched version. Fixes:
1) no more MciId = 0. the default is now 0xBEEF
2) in case you set "reservemciid = 1" the file winmm.wav is created automatically
The archive has all within, sources & winmm.dll + sample winmm.ini
I uploaded the new stuff (source & libs) in the download area, naming the release 2.05.56 because of the derivation from DxWnd v2.05.55, plus a few enhancements.
In particular, this release auto-generates the file winmm.wav (used as dxwnd.wav to reserve a MciId value) in case it doesn't exists.
Please, let me know if anything went wrong because my testing capability is currently rather low....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I uploaded the new stuff (source & libs) in the download area, naming the release 2.05.56 because of the derivation from DxWnd v2.05.55, plus a few enhancements.
In particular, this release auto-generates the file winmm.wav (used as dxwnd.wav to reserve a MciId value) in case it doesn't exists.
Please, let me know if anything went wrong because my testing capability is currently rather low....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Maybe I got it: the culprit could be the "renderer" field. If you run the game in fullscreen mode, the "DirectX / renderer" selector should be moved to "none". If it stays on the default value "primary surface" the problem happens.
You can fix your configuration this way, while I'm trying to figure out why the "primary surface" renderer is not working as it should in any case.
New leaked release that should fix the "Asghan" sound emulation. Still some alignment should be done, but soon enough it will be moved to download area.
Sure. Is there anything that would interest you in particular? I think the most notable change is the CD audio volume mapped to the mixer channels, but maybe you meant something else?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here it is. I'm having some trouble testing it on my copy of TM2, would you mind to try it yourself and report?
Please, remember that the proxy should work exactly as before unless you add this line to the winmm.ini file:
emulatecdmixer=1
if things are not fully satisfactory, better add also this one and post here the winmm.log file that you will find on the game folder after the experiment:
Current version of the stand alone CDAudio proxy is based on Dxwnd v2_05_08 (including dwplay.dll). Below is a list of improvements in Dxwnd CD audio emulation since then.
Here an archive with the dll & sources aligned to last release v2.04.54 (actually, this release od DxWnd isn't released yet ...).
Would someone help me to test it? I'm running without a good testbed.
This new version is missing the logic to make sure VirtualCDAudioDeviceId is never zero. So several games will be mute.
Testing with "Civ2 Test of Time" I tried forcing "VirtualCDAudioDeviceId = 1" but it did not work.
Then I noticed there is still "#define MAGIC_DEVICEID 0xBEEF" in mciplayer.h so I edited line 1309 in mciwrapper.cpp to this:
//parms->wDeviceID = VirtualCDAudioDeviceId;
parms->wDeviceID = MAGIC_DEVICEID;
That worked but is probably not the ideal solution.
Also someone was asking for an option to disable winmm.log creation.
OutTrace.cpp with logging toggle:
Plus a new "logging = 1" option in winmm.ini...
Again, mostly untested but working with "Imperialism" and "Corum III", in attach a new release that is even ahead of the last published in DxWnd.
winmm2.rar: proxy winmm.dll + sample configuration file winmm.ini. The file is empty, but the comments hopefully work as documentation.
cdaudioproxy2.rar: full sources
These are the news:
1) added the ReserveMCIId trick. It can be enabled with reservemciid=1 and requires the file dxwnd.wav to lock a mci id.
2) added the magicid trick. Since in so many cases we regret the old 0xBEEF falue that made things working, setting magicid=1 enables this old trick. (do not set reservemciid in this case)
3) added the log flag to enable logging. BEWARE: it's "log", not "logging".
4) fixed some incongruencies about MCI_INFO default values. Now, unless specified differently, they all return the default string "fakecd".
5) added a (c)copyright line in the log with version string. Mostly useful to be sure what release produced the logs.
I'm also going to bring some minor fix back to DxWnd.
Last edit: gho 2020-08-17
Seems to work fine. A couple of small suggestions:
I would put "magicid" on by default. I think there are way more games that need it than those that do not like it.
winmm.ini could be autogenerated if not found (code for example in winmm.cpp):
Last edit: dippy dipper 2020-08-17
About the MciId set to 0, you were awfully right: I forgot one essential part of code that is within dxhook.cpp in the procedre HookInit():
In here DxWnd initializes the CDaudio MciId to a value depending on the number of available aux devices, skipping the value 0 in any case. Probably also this piece of code is wrong, but at least it ensures that there's no overlapping on the MciId value 0.
I think I'll take your suggestion to set MscId to 0xBEEF by default and use the "reservemciid" flag to make a real device MCI_OPEN on the wav file, this at least on the winmm wrpper. I start to doubt if such a thing should be made also on the full DxWnd tool.
About the auto-builded winmm.ini, I don't think it's a good idea, at least at this stage: any change to the wrapper should be made twice. Also, the usage of GetPrivateProfice calls to read the file will require that only the non-default values should be written in winmm.ini, so writing that file would be a very easy operation. A maybe better idea, instead, would be to auto-generate the dxwnd.wav file to be sure that the "reservemciid" would always work.
Here's the patched version. Fixes:
1) no more MciId = 0. the default is now 0xBEEF
2) in case you set "reservemciid = 1" the file winmm.wav is created automatically
The archive has all within, sources & winmm.dll + sample winmm.ini
I uploaded the new stuff (source & libs) in the download area, naming the release 2.05.56 because of the derivation from DxWnd v2.05.55, plus a few enhancements.
In particular, this release auto-generates the file winmm.wav (used as dxwnd.wav to reserve a MciId value) in case it doesn't exists.
Please, let me know if anything went wrong because my testing capability is currently rather low....
I uploaded the new stuff (source & libs) in the download area, naming the release 2.05.56 because of the derivation from DxWnd v2.05.55, plus a few enhancements.
In particular, this release auto-generates the file winmm.wav (used as dxwnd.wav to reserve a MciId value) in case it doesn't exists.
Please, let me know if anything went wrong because my testing capability is currently rather low....
Maybe I got it: the culprit could be the "renderer" field. If you run the game in fullscreen mode, the "DirectX / renderer" selector should be moved to "none". If it stays on the default value "primary surface" the problem happens.
You can fix your configuration this way, while I'm trying to figure out why the "primary surface" renderer is not working as it should in any case.
Last edit: gho 2020-08-22
New leaked release that should fix the "Asghan" sound emulation. Still some alignment should be done, but soon enough it will be moved to download area.
Would an update be possible with the new audio fixes/changes of the new dxwnd version ? That would be great, thanks in advance
Sure. Is there anything that would interest you in particular? I think the most notable change is the CD audio volume mapped to the mixer channels, but maybe you meant something else?
Yes, exactly that. Hopefully the CD volume control will work for Twisted Metal 2 in the options.
Here it is. I'm having some trouble testing it on my copy of TM2, would you mind to try it yourself and report?
Please, remember that the proxy should work exactly as before unless you add this line to the winmm.ini file:
if things are not fully satisfactory, better add also this one and post here the winmm.log file that you will find on the game folder after the experiment:
Mixer control (CD Volume) doesn't working
For reference until a full release is posted a link to cdaudio proxy fixed mixer/aux volume controls winmm.dll (2.05.58d dev release):
https://sourceforge.net/p/dxwnd/discussion/general/thread/255e0ff888/96fc/attachment/winmm.2.05.58d.rar
winmm.ini new fields:
emulatecdmixer=0
emulatecdaux=1