• Please review our updated Terms and Rules here

Full duplex play/record on an old school Sound Blaster.

Mike Chambers

Veteran Member
Joined
Sep 2, 2006
Messages
2,655
Hi all,

Am I correct in believing that the only way to get full duplex audio on an old school SB/SBPro type card is to use programmed IO on a timer interrupt? I can't see any way to get around that with a single DMA channel, but I know we have some code wizards on this forum that may have some tricks up their sleeves.

I've been building a SIP+RTP softphone for DOS with MTCP, and the timer interrupting at 8 KHz doesn't leave a lot of head room on an XT! If PIO is the only way, the ISR is going to have to be extremely tight and I will probably have to cut the sample rate down to 4 or even 2 KHz for slower machines.

Not that the world needs an XT compatible softphone. Just having a bit of fun while learning the guts of SIP and RTP.
 
Last edited:
Are you using UDP?

If so, turn off the checksumming on the packets. That will buy back some time. (Assuming you haven't done that already.)
 
Are you using UDP?

If so, turn off the checksumming on the packets. That will buy back some time. (Assuming you haven't done that already.)

Thanks Mike, yeah UDP is always used for the RTP. I'll turn checksums off and see how much it helps.

As it stands now, running on a 9.55 MHz V20, I only get smooth RTP audio streaming at a 2 KHz sample rate on a phone call... which sounds awful.

Aside from disabling checksums, I need to focus my attention on the timer ISR and see how efficient I can make it. I'll probably have to re-write it in assembly, but I'll see how far I can get with Open Watcom's C compiler first.

I'm able to get a full 8 KHz on a slow 286 though, which is pretty cool!
 
Last edited:
After some optimization, I'm now able to do a 4 KHz sample rate on a 10 MHz 8088.

I'm not sure how much better I can do than that yet. Unfortunately, there's no standard RTP audio codec for the Asterisk PBX server that's simple linear uncompressed 8-bit PCM audio.

The most lightweight codec I can work with is uLaw/aLaw, so for every byte in the audio payload, it needs to reference a decode table, which converts it to a 16-bit value that I then need to convert to 8-bit. Just discarding the low byte instead of dividing and clipping would save some time, but then I can't have volume control directly on the data, which is a nice thing to have.
 
What about having an 8-bit -> 8-bit translation table (allowing you to use XLAT for translating), recomputing that table when changing volume?
 
Would there be any sense in implementing this using two sound cards?
Putting two Sound Blaster compatibles into a PC/XT class system puts a serious strain on system resources. There simply aren't many spare IRQs or DMA channels to go around, and not all cards are particularly flexible in their I/O configuration.

Bus bandwidth could also be an issue, but it probably doesn't matter whether you are handling full duplex audio through one or two cards.
 
Back
Top