OS/2, eCS & ArcaOS - Technical > Multimedia

PC Speaker output to sound card?

<< < (3/6) > >>

Martin Iturbide:
That is awesome Lars.

How goes it has to be installed?  run the cmd and reboot? or I need to copy the DLL into /DLL ?
Did you tried it with some specific tool that make the speakers sound?

Regards

Lars:
Hi Martin,
get this:
http://www.edm2.com/common/snippets/newc2.zip
and read the readme that it contains. That explains what it is all about. In general, you need to patch any EXE or DLL where you want to have the default API implentation of DosBeep replaced by an "MMPM" version.
You need a rename tool to patch the binary. VAC has one but there is also one on Hobbes I think.

Martin Iturbide:
Hi Lars

For what I can read the instructions it says to:
1) Backup PMMERGE.DLL
2) Copy Newcalls.dll to the OS2/DLL
3) Modify PMMERGE.DLL  with "dllrname pmmerge.dll doscalls=NewCalls /q"

Does it means that all PM applications that uses DosBeep (and PC Speaker) will play on the sound device ? or also the command line applications (non PM Applications) that uses DosBeep are going to change too?

Or, if understand you right, you can only patch the program that uses DosBeep, instead of patching OS/2's DLLs ?

Regards

Lars:
My newcalls is based on the idea of the original newcalls package by Peter Fitzsimmons but it is not the very same.

Effectively it works like this:
1) ANY application (that is, either an EXE or a DLL that this EXE binds to) that uses DosBeep can be modified to instead use the DosBeep that is implemented in NEWCALLS.DLL. That also includes any DLLs delivered with OS/2.
2) what you need to do to this EXE or DLL is to overwrite the import references that import from DOSCALLS (where ordinal 286 points to the genuine DosBeep function as implemented in the kernel: it uses the PIT to create a sound via an attached PC built-in LOW-FI speaker) and instead tell the EXE or DLL to import from NEWCALLS (which uses your soundcard to play a generated PCM sine wave stream).
3) because there is a good chance that a number of DOSCALLS routines are bound to the exe and not only DosBeep, what NEWCALLS does is to forward all unchanged functions directly from DOSCALLS to the EXE or DLL. With the one exception of "DosBeep" which NEWCALLS replaces with its own implementation (and it binds to the genuine implementation and calls that where necessary).

Let's say you have an EXE called MyApp.exe that links to a couple of functions implemented in the kernel, say, DosOpen, DosClose, DosRead, DosWrite and also DosBeep.

You then run:
dllrname.exe /Q /N MyApp.exe DOSCALLS=NEWCALLS

After doing so, MyApp.exe will invoke the genuine kernel functions DosOpen,DosClose, DosRead,DosWrite in DOSCALLS (because those are forwarded) but it will call the implementation of DosBeep in NEWCALLS as that has been replaced.

You will have to do the "dllrname" action on every EXE and DLL where you want to have a DosBeep call replaced by the implementation in NEWCALLS.DLL. "dllrname.exe" is a tool that comes with VAC but:
https://hobbes.nmsu.edu/download/pub/os2/dev/util/dllrname.zip
https://hobbes.nmsu.edu/download/pub/os2/util/system/renmodul2_0_0.zip
are free tools and serve the very same purpose.

NEWCALLS.DLL has to go somewhere in your LIBPATH or BEGINLIBPATH or ENDLIBPATH, just like for any other DLL.

Just a hint: you can only do this module renaming (DOSCALLS=NEWCALLS) if the modules have the very same name length (DOSCALLS and NEWCALLS have the same number of letters). That is a design limitation. Additionally, under OS/2, DLL names are limited to 8 characters (excluding file extension).

Additional note: I have implemented DosBeep so that PM and also VIO applications can use it without any restrictions. I even went through some hoola hoops so that error message boxes can be displayed even from a VIO app.


Lars

Martin Iturbide:
Thanks for the explanation Lars. Now I get what to do.

Sadly I was not able to get results. I tested two programs on an ArcaOS VM (with Uniaud working) from hobbes: rhythm.zip and os2sn2.zip.
os2sn2.zip comes with the source code, and it seems it does not use DosBeep. rhythm did not also produced any sound.

Did you tried it on some other program (executable) just to test it is working?

Regards

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version