Skip to contentSkip to conversation

App database, libsynth

DISCUSSION Stas Sergeev 2 participants 2 messages Jul 17, 2003

lore
Share & tools
lore
#0 lore raw

Hello.

Quoted 1 line · Ryan Underwood

The design is simple to me. The programmer of the application need do nothing but SynthOpen the correct devices, and then SynthWrite the data to them.

Sounds good. It would probably be a good idea to provide an optional way to query user's time and request the timer events from user. It may be that the user's time is different than the real time. dosemu uses the real time, but AFAIK dosbox uses the emulated time (CPU-emu relative).
It may also be possible that the real card's sampling rate is not very precise (the pcsp driver rounds the sampling rate rather cruely), in which case you'll have one more timing source with which you also have to keep in sync. Last time I dealt with all that mess, it wasn't very simple (see linux_sound.c :)

Quoted 1 line

Plan to support the following synths in the library, all can be either hardware or emulated:

How are you accessing the hardware btw? ioperm() ?

Quoted 1 line

or DMA and such are not candidates.

Yes, DMA is out of question, that's for sure.

Quoted 2 lines

The OPL-chip has an internal IRQ but it can be triggered or cleared by simply writing to the OPL's port.

AFAIK it is not even connected to any of the PIC wires, but why can't you provide an optional way to notify the user about an IRQ? Simply calling the user's registered call-back function might just do the trick, so why not?

#1 lore raw

Hi Stas,

Quoted 6 lines · Stas Sergeev

Hello.

Quoted 3 lines · Ryan Underwood

The design is simple to me. The programmer of the application need do nothing but SynthOpen the correct devices, and then SynthWrite the data to them.

Quoted 14 lines

Sounds good. It would probably be a good idea to provide an optional way to query user's time and request the timer events from user. It may be that the user's time is different than the real time. dosemu uses the real time, but AFAIK dosbox uses the emulated time (CPU-emu relative).
It may also be possible that the real card's sampling rate is not very precise (the pcsp driver rounds the sampling rate rather cruely), in which case you'll have one more timing source with which you also have to keep in sync. Last time I dealt with all that mess, it wasn't very simple (see linux_sound.c :)

Ok, I will look into this.

Quoted 4 lines
Quoted 2 lines

Plan to support the following synths in the library, all can be either hardware or emulated:

How are you accessing the hardware btw? ioperm() ?

For the OPL chips, I use the direct-FM API of OSS/ALSA. (This is not implemented yet because I do not have a working OPL-chip on my soundcard. I will swap out my card with SB16 to test it or else hack the vortex driver to get FM access).

For any other chips, it will have to use iopl(3). I can create ALSA hwdep driver to handle all the other chips, but I might wait until people wiht the actual hardware request the capability. :)

But the design of the library does not exclude it.

Quoted 7 lines
Quoted 2 lines

The OPL-chip has an internal IRQ but it can be triggered or cleared by simply writing to the OPL's port.

AFAIK it is not even connected to any of the PIC wires, but why can't you provide an optional way to notify the user about an IRQ? Simply calling the user's registered call-back function might just do the trick, so why not?

You have a good point, I will look into this.

I rewrote the library last few days, now having trouble with some "chainsaw" noise in wolf3d music. :) Hopefully won't be hard too fix.

Thanks,

Signature · 1 line
Ryan Underwood, <nemesis at icequake.net>, icq=10317253