[fpc-pascal]OS/2 DART/MMPM information?

Balogh, Karoly (Charlie/iNQ) charlie at scenergy.dfmk.hu
Fri Mar 30 11:46:42 CEST 2001


Hi,

On Fri, 30 Mar 2001 09:20:35 +0300 (EET DST), Matti Hamalainen wrote:

>Are there any programmers with knowledge of OS/2's
>sound APIs? (DART/MMPM if I remember right)

Yepp, i have some very basic knowledge...
But, FPC/2 still not has (at least not official) any 
kind of MMOS2 interface. So you need to write your own,
or port it from VP/2 (like i did). 

>I need such info, but can't find it from IBM's site
>or such. Yes, I could look into various GPLd programs,
>but understanding the workings is not easy just by
>looking complex code.

First, you need the IBM OS/2 Warp Programmers Toolkit.
It's free for owners of VisualAge C/C++ and/or other
IBM Development products. I just bought a VAC/C++ 
at Mensys.nl for only 4,5 euro...

>Additionally, I need info on realtime timing possibilities
>(callback timers/events) under OS/2.

You can use the TIMER0 device, or such things, but that's
a pretty big hack, and not recommended. You should time your
events to the position of your sound stream.

>Specifications and simple programming examples (C/C++/Pascal)
>would be very helpful.

There is a pascal example code about DART programming in
Virtual Pascal/2 on hobbes.nmsu.edu. 
http://hobbes.nmsu.edu/pub/os2/dev/pascal/vpdart01.zip

As you will see in the example source, using DART needs 
the followings:

1., Init MMOS2
2., Init the AMP mixer
3., Allocate stream buffers
4., Generate your stream using the callback procedure set 
    at step 2.
5., When stopping playback, wait until buffers empty,
    then deinit AMP mixer, and MMOS2

The MMOS2 programming is mostly done via sending messages
to the multimedia subsystem, and filling some structures with
the necessary data. Pretty easy, i think. 

Also, there is a very good DART example code in the sources 
of MPG123. It's in C, but very simple and clean code.

>(I need the info for writing OS/2 support into my free
>software sound system project JSS, which is being developed
>for use with FPC. http://jss.sourceforge.net)

I just got my own player (ISS) to work with OS/2 some days 
ago, using FPC, with the ported version of MMOS2 part from 
Virtual Pascal RTL. (The port is incompletted, but it has
the necessary things.)

The sources will be available soon, i hope.

To Tomas and/or the core team: it is possible to include these 
ported sources into the official FPC RTL, or it needs a 
complette rewriting to be legal?

Bye,
Charlie^iNQ






More information about the fpc-pascal mailing list