Sound Blaster Emulator for Dos?

Announcements, advice, random banter, unrelated discussion, et cetera.

Sound Blaster Emulator for Dos?

Postby Malik » 2011-4-02 @ 05:00

Is it even remotely possible, even theoritically, that a Sound Blaster/Pro/16 emulator be made for users of ANY sound card to be used in actual Dos?

For that matter, is it possible to create a Dosbox for Dos? A program which can emulate sound cards floppy drives emulation etc. for Dos? Does this sound crazy or is it possible?

Why?

1. Because Dos can be installed on any x86/amd64 architecture.

2. A fully functional FreeDOS is now available for those who don't have Dos software.

3. A Dosbox-in-Dos emulation can make use of current super fast and multi-core processors.

4. Ability to boot into Dos, at fast speeds with current processors (maybe the fastest booting OS in a modern system), forget about registry mess-ups and maintain multi-configs in dos and have the luxury of emulating of a Sound Blaster using any PCI Sound Cards or built-in audio codecs.

5. It'll be fun (maybe not for the developers, but for us users! :happyhappy:)

6. Ability to run resource -hungry dos games in modern systems at full speed. (In fact, these games might be crying asking to slow down the superfast speed! :happyhappy:)

Sometimes, on a free weekend, when you're tired and bored to even play some games, you might be thinking like what I have just written above. Please ignore this idea (read boredom blabbers or day dreaming ideas) if it sounds like plain nonsense! At least you guys can understand that I'm bored. Other sites may be offended that there's a crazy guy on the loose! :lol:

(No, this is NOT an (delayed) April Fool crap. It's just an ordinary crap! :happyhappy:)


7. And oh, also the ability to introduce an actual software based slowdown on fast systems, with more scalability than ICD.EXE alone would be nice, too!

In the end, just a Sound Blaster or Pro emulator with built-in good slow down utility and a VESA compatible driver is all that I need in a modern system.
User avatar
Malik
l33t
 
Posts: 2483
Joined: 2004-4-10 @ 14:37
Location: Malaysia

Re: Sound Blaster Emulator for Dos?

Postby Sune Salminen » 2011-4-02 @ 05:33

The main problem with your idea is that you'd still need a driver for the hardware that plays back the output from your emulated Sound Blaster.

...someone would have to write DOS drivers for every modern on-board sound or X-fi card in existence in order for your emulator to play any sound.

I don't see that happening.
User avatar
Sune Salminen
Member
 
Posts: 193
Joined: 2002-7-28 @ 17:40
Location: BH, Brasil

Re: Sound Blaster Emulator for Dos?

Postby Malik » 2011-4-02 @ 08:39

I don't know anything about hardware programming, but here's something which is more of science-fiction than facts :

1. How about just invoking the ports 388h, 330h, 300h, I/O 220-260, and the interrupts 2, 9, 5 and 7 to send signals to the sound cards that a program want the sound card to let out the sounds requested by the SB emulator? Or something like that. (Something like how Dosbox emulates all these ports and interupts in Windows, Linux and Mac?)

I guess the PCI architecture will prevent this? But if an ALS4000 or Vortex2 can boast of SB/Pro compatibility, hmmm....

2. I'm trying to see a sound card as nothing but a....say.. a MT32 or SC55; i.e. Send the signals via the "doorway" 330 (388 for fm requests) to let the sound cards serve back the requests by playing the required waveforms.

3. Something like the paper-fold example of explaining time travel or warping in space theory - bypass the driver requirement by directly communicating with the sound cards by "contacting directly" the sound cards, via the usual common audio hardware ports and interrupts on the pc.

Then, it'll be like the SB emulator itself is like a universal driver, where it'll be using the pc's ports as a bridge to access the sound cards' functions directly, rather than depending on a driver.

4. Maybe it'll be easier to emulate a wavetable sample - more like requesting the stored instruments in a SC-55 for eg., than emulating a FM synthesis? I dunno.



I think I'm REALLY free this weekend. :lol:
User avatar
Malik
l33t
 
Posts: 2483
Joined: 2004-4-10 @ 14:37
Location: Malaysia

Re: Sound Blaster Emulator for Dos?

Postby Mau1wurf1977 » 2011-4-02 @ 08:41

Well, even Creative struggled doing that. They ended up buying Ensoniq, because they found a better solution.

It certainly doesn't appear to be a trivial matter...
User avatar
Mau1wurf1977
l33t++
 
Posts: 7652
Joined: 2010-8-27 @ 04:15
Location: Western Australia

Re: Sound Blaster Emulator for Dos?

Postby Zup » 2011-4-02 @ 09:30

...and even a "better solution" was not a "good solution".

Also, you'll have the same limitations as SB DOS drivers (conflicts in protected mode and those things).

The good news is that (in Linux) most onboard audio cards are supported via AC97 and Intel HDA drivers, so it may be factible to create a "stack" of drivers for those cards.
I have traveled across the universe and through the years to find Her.
Sometimes going all the way is just a start...

I'm selling some stuff!
User avatar
Zup
Oldbie
 
Posts: 1137
Joined: 2003-10-04 @ 12:16

Re: Sound Blaster Emulator for Dos?

Postby Dominus » 2011-4-02 @ 10:01

There was a.ready a discussion on this not too long ago (couple of months).
I doubt you manage to do this over the weekend. I wonder why people think it is so trivial to do this...
User avatar
Dominus
DOSBox Moderator
 
Posts: 7618
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Sound Blaster Emulator for Dos?

Postby tikbalang » 2011-4-02 @ 10:26

there was "Virtual Sound Blaster" and "Tandy Emulator" by Andrew Zabolotny.

final versions and source code:
http://cs.ozerki.net/zap/pub/vsb/


Code: Select all

Virtual Sound Blaster v2.02
 
This is a program written by Andrew Zabolotny a long time ago when few people owned Sound Blaster's but many had Covoxes and similar things. It will emulate a real Sound Blaster (1.x) on PC-Speaker or on a Covox. The emulation is relatively accurate, but FM synthesizer is not supported, thus it will play only digital sound. It was tested on a number of DOS games.

Tandy Emulator v3.03

TEMU stands for "Tandy Emulator". I wrote it even before I wrote VSB, and it will emulate a "Tandy 3-voice synthesizer" on a PC-Speaker or on a Covox and similar. There was once a IBM PC clone called "Tandy"; it had a built-in 3-voice synthesizer (similar to those found in early game consoles). It supports three melodic channels and one noise channel. I never heard how a real Tandy sounds (deduced how to program it by reverse-engineering some drivers for Tandy synthesizer :), but it sounds well to me.
 
download (deadlinks, use wayback):
http://zap.eltrast.ru/
http://zap.eltrast.ru/en/dldos.html
http://zap.eltrast.ru/data/vsb202.zip
http://zap.eltrast.ru/data/temu303.zip
 
homepage:
http://zap.eltrast.ru/en/frames.html

Andrew Zabolotny
anpaza@mail.ru


ESS PCI DOS Drivers
_________________
User avatar
tikbalang
Newbie
 
Posts: 88
Joined: 2006-7-07 @ 06:16

Re: Sound Blaster Emulator for Dos?

Postby Malik » 2011-4-02 @ 11:35

Interesting, tikbalang! I guess they're more useful in a covox card. But the tandy implementation will come in handy in a pc speaker output, connected to a sb's pc speaker pins. :happy:
User avatar
Malik
l33t
 
Posts: 2483
Joined: 2004-4-10 @ 14:37
Location: Malaysia

Re: Sound Blaster Emulator for Dos?

Postby Jorpho » 2011-4-02 @ 14:20

The last time the subject came up not so long ago, I found this rather nifty thread at the MPXPlay Sourceforge forums:
http://sourceforge.net/projects/mpxplay ... ic/3079341

Also, it is well-established that HX DOS Extender can indeed run DOSBox in DOS, but of course there is no sound support:
http://www.japheth.de/HX.html
User avatar
Jorpho
l33t++
 
Posts: 7043
Joined: 2003-2-14 @ 19:50
Location: Canada

Re: Sound Blaster Emulator for Dos?

Postby WolverineDK » 2011-4-03 @ 00:53

I also mentioned the subject , but took a different route, and asked. What about a wrapper instead of an emulator.
User avatar
WolverineDK
Oldbie
 
Posts: 1096
Joined: 2006-7-16 @ 21:00
Location: Denmark

Re: Sound Blaster Emulator for Dos?

Postby Malik » 2011-4-03 @ 01:17

Thanks for the links! I'll see what I can do in my current laptop with all these goodies.
User avatar
Malik
l33t
 
Posts: 2483
Joined: 2004-4-10 @ 14:37
Location: Malaysia

Re: Sound Blaster Emulator for Dos?

Postby retro98 » 2011-11-01 @ 18:25

Well, I am looking for a sound blaster emulator for DOS which can make use of generic AC97 compliant hardware as the underlying sound card.

Is there still generic interest for such an item?


Assuming such drivers do not exist, I will seriously considering developing it, but there are questions regarding feasibility, and any development tips would be helpful. If feasible, I believe the effort is non trivial and requires at least a few months.

Here's what I have found so far on researching this subject.


The only true sound blaster hardware are the cards that plug into legacy ISA slots. The later sound blaster cards, and equivalents, for PCI bus all require DOS drivers to achieve legacy sound blaster compatibility.

As far as I can determine, the SB DOS drivers are really sound blaster emulators, but still require hardware support from the sound card. In particular, a SB PCI card has to intercept access to legacy sound blaster I/O ports (eg 0x220) and produce interrupts. The interrupt handler is code in the DOS emulator, which then determines what I/O port operation the game has requested, and then controls the actual sound hardware accordingly.

BIOS settings for legacy sound enable/disable the hardware trapping of legacy sound blaster I/O ports; where the hardware trap produces interrupts. In modern processors, I think interrupt latency could be a issue. The processor may execute too many instructions after I/O port operation, before interrupt processing occurs. Maybe that's why this BIOS setting no longer seems to exist with modern PCs. Does legacy sound blaster emulation in DOS with sound blaster PCI cards still work reliably?

DOS driver files I have seen for Sound Blaster card have names such as SBINIT.COM, SBEINIT.COM, SBLOAD.EXE, SBPCI.BIN. These files are a mix of 16-bit real mode, and 32-bit protected mode code. So they require EMM386, or equilvalent, to load and run in DOS environment. The driver makes use of VCPI for protected mode operations.

These DOS drivers apparently manipulate the GDT and IDT tables of the virtual 8086 environment of EMM386. They also setup interception of numerous interrupt vectors in both real and protected mode context. In particular, int 67h intercept of VCPI calls get set up too.

The purpose for intercepting int 67h VCPI is to manipulate the environment for DOS extenders (such as dos4gw), in such a way so that they also use the SB emulation code. Manipulating the EMM386's v86 environment is apparently for SB emulation support with 16-bit real mode applications.


Some issues for making SB emulation work with generic AC97 sound:

The will be no sound card suppport for the trapping of SB I/O ports. However, the processor can do the trapping instead using TSS (task state segments). I believe these traps produce protection fault exceptions, which a handler can then perform I/O port emulation.

In v86 mode, there are int xxh calls that can arrange I/O port trapping and emulation which should help with 16-bit real mode games and applications. Unclear on my part is how to make this work with DOS extenders. Using TSS I/O maps requires code to run unprivileged, but VCPI runs protected mode code in ring-0. Maybe modify VCPI to launch protected mode apps in ring-3? Has anyone achieved this with examples?

Also unclear on my part is the relationship between DMA with PCI, and legacy DMA.


Thanks for listening ...retro98
retro98
Newbie
 
Posts: 2
Joined: 2011-11-01 @ 15:45

Re: Sound Blaster Emulator for Dos?

Postby Jorpho » 2011-11-01 @ 19:10

Looks like you've done some intriguing work so far.
retro98 wrote:BIOS settings for legacy sound enable/disable the hardware trapping of legacy sound blaster I/O ports; where the hardware trap produces interrupts. In modern processors, I think interrupt latency could be a issue. The processor may execute too many instructions after I/O port operation, before interrupt processing occurs. Maybe that's why this BIOS setting no longer seems to exist with modern PCs. Does legacy sound blaster emulation in DOS with sound blaster PCI cards still work reliably?
http://www.vogons.org/viewtopic.php?t=24769 includes discussion regarding the necessary chipset support for the PCI sound blaster cards to work. Perhaps speed does not yet become an issue with the fastest boards that still have such support.
User avatar
Jorpho
l33t++
 
Posts: 7043
Joined: 2003-2-14 @ 19:50
Location: Canada

Re: Sound Blaster Emulator for Dos?

Postby retro98 » 2011-11-02 @ 02:11

Here's some additional information to add to my previous posting.

The sound blaster PCI cards produce PCI SERR or IRQ to support legacy SB emulation with DOS drivers. In the case of SERR, it routes to processor NMI, but modern motherboards no longer route PCI SERR to processor NMI. There will be no way for SB DOS drivers to function properly in configurations requiring SERR/NMI, even with working sound card hardware. If card uses IRQ for legacy support instead, then emulation should still work in theory. Interrupt latency may not be a problem after all, assuming the processor recognizes interrupts before the hardware completes (fake SB) I/O port accesses.

But my information on I/O port traps with hardware interrupts doesn't matter with SB emulation on generic AC97 sound chip. That's because there will be no hardware support to do I/O port traps. I/O port emulation will need to be done with the processor's help instead.

In v86 mode, int 2fh with AX=4A15h is the "INSTALL I/O VIRTUALIZATION HANDLER" API. I believe this should work for real mode games and apps. The more significant issue would be how to get this to also work with DOS extenders.

On sound blasters or equivalent, I think some cards use the ES1371 chip. According to the datasheet circulating on the internet, the chip has an AC97 codec. That implies the SB DOS drivers for cards with ES1371 already emulate SB using an underlying AC97 codec. So the solution may be to find a way to get this emulation to work by substituting with software, the hardware I/O port trapping feature of the card.
retro98
Newbie
 
Posts: 2
Joined: 2011-11-01 @ 15:45

Re: Sound Blaster Emulator for Dos?

Postby Cyberdyne » 2011-11-02 @ 05:38

But there is DOSBOX in DOS possible, with HXDOS.
I am aroused about any X86 stuff that has full functional ISA stuff. I think i have problem.
User avatar
Cyberdyne
Member
 
Posts: 291
Joined: 2011-9-18 @ 18:45
Location: Estonia, Tallinn

Re: Sound Blaster Emulator for Dos?

Postby Dominus » 2011-11-02 @ 06:55

And? Dosbox relies on existing and working sound drivers of the host. The host being Dos and no sound drivers for Dos means no sound in Dosbox. Dosbox can't produce sound out of thin air ;)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7618
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Sound Blaster Emulator for Dos?

Postby laxdragon » 2011-11-02 @ 18:04

You would be better served taking a minimal Linux install and running DOSbox on that. Let the Linux kernel handle your modern hardware, and DOSbox for your DOS needs.

It is pretty simple to configure Linux to boot straight into a fullscreen DOSbox session.
User avatar
laxdragon
Member
 
Posts: 387
Joined: 2004-10-22 @ 18:42
Location: Minneapolis, MN

Re: Sound Blaster Emulator for Dos?

Postby alic3woodstock » 2017-4-28 @ 17:21

I have found this thread searching for a SB emulator for generic onboard cards. Imagining if it's possible to make somthing like this with already existing linux sound drivers (ALSA for DOS maybe?).

I have tested DosBobx on a laptop, not too old to have compatibility on dos but not as new to run dosbox flawless. Only runs linux since the O.S. on it was not a legal version of windows. Dosbox was slower than my old 486 I had to turn on frameskip and try to optimize, but the game have more slowdowns than my android phone runing dosbox (well I will try to run only X and dosbox to see if there is any improvement). Dosemu only shows segmentation fault when I try to run any game.

I tried FreeDos two things didn't work, so the game in quetion (Pro Pinbal - Timeshock!) wont run:
First: sound - not even a possibility to install a PCI card since it's a laptop, SB emulation would be the only solution for the sound
Second: cd image emulation - The game version from GOG was packed with a cd image that I only could mount properly with imgmount (dosbox) I have the original CD but it was too damaged to even try to play the games music.

Working properly with DOS would be great to play games on such machines that aren't old enough to run DOS or Windows 9x but not new enough to run dosbox or even windows 7 properly.
alic3woodstock
Newbie
 
Posts: 1
Joined: 2017-4-28 @ 17:03

Re: Sound Blaster Emulator for Dos?

Postby Jorpho » 2017-4-28 @ 17:48

Since the last post in this thread, builds of HX DOS Extender with sound support have emerged.
viewtopic.php?f=7&t=53061&p=572075

I for one have no idea if they are a reasonable alternative to a Linux install on a low-powered machine, but I doubt it. Do other applications run adequately on your Linux install? Perhaps you are lacking proper drivers, or have swap disabled or something.

machines that aren't old enough to run DOS or Windows 9x but not new enough to run dosbox or even windows 7 properly.
It seems to me that must be a very narrow range of machines.
User avatar
Jorpho
l33t++
 
Posts: 7043
Joined: 2003-2-14 @ 19:50
Location: Canada

Re: Sound Blaster Emulator for Dos?

Postby gdjacobs » 2017-4-28 @ 18:01

Hmm... that only works for Win32 calls, no? Maybe something could be done via port trapping, but I understand there are limitations on that.
http://www.bttr-software.de/forum/mix_e ... p?id=11947

Three immediate options I see:
1) Build a native DOS machine with ISA or compatible PCI sound capability
2) See if any other virtual platforms deliver better performance
3) Use a faster computer running DOSBox

Anybody have any other options?
User avatar
gdjacobs
l33t++
 
Posts: 5489
Joined: 2015-11-03 @ 05:51
Location: The Great White North

Next

Return to Milliways

Who is online

Users browsing this forum: No registered users and 2 guests