Sound Blaster 16 Emulation Failure

Discussions about using non Windows and Linux guests such as FreeBSD, DOS, OS/2, OpenBSD, etc.

Re: Sound Blaster 16 Emulation Failure

Postby Martin » 1. Dec 2015, 20:20

The biggest hurdle for this problem is that there don't seem to be many paying customers who need this feature in old real mode / 16bit operating systems.
Martin
Volunteer
 
Posts: 1822
Joined: 30. May 2007, 18:05
Primary OS: Fedora 18
VBox Version: PUEL
Guest OSses: XP, Win7, Linux, OS/2

Re: Sound Blaster 16 Emulation Failure

Postby over_clox » 1. Dec 2015, 21:56

I've done a little further testing with different formats of PCM audio, and it now seems to regard something to do with buffer size calculations in DevSB16.cpp - sb16WriteAudio:

Counter Stuck At:
16-bit Stereo 44.1KHz - 0x1fff
16-bit Mono 44KHz - 0x1fff
8-bit Stereo 44KHz - 0x3fff

I've also noticed that in lines 1519-1520, sb16WriteAudio doesn't even seem to have any values being passed to it to indicate whether the data passed to it is supposed to be 8 or 16 bit!

Line 1519: static int sb16WriteAudio(PSB16STATE pThis, int nchan, uint32_t dma_pos, uint32_t dma_len, int len)

So I speculate the problem is probably in combination between an improper buffer size (should support 64KB for the 8237A DMA controller) and a complete oversight in bit depth.
This is a little beyond me to provide a complete fix for, but maybe this can be a starting point for someone more oriented in VBox code internals than myself.

Please refer back to page 2, last post of this thread for links to official documentation regarding both SB16 and DMA standards. I hope this helps shine a light on the issue.
over_clox
Volunteer
 
Posts: 167
Joined: 5. Apr 2008, 22:43
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows XP, Ubuntu 10.04, Legacy Testing

Re: Sound Blaster 16 Emulation Failure

Postby over_clox » 1. Dec 2015, 22:20

I have filed a bug ticket with my findings here:
Sound Blaster 16 Issues Located
over_clox
Volunteer
 
Posts: 167
Joined: 5. Apr 2008, 22:43
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows XP, Ubuntu 10.04, Legacy Testing

Re: Sound Blaster 16 Emulation Failure

Postby tauro » 22. Nov 2016, 13:34

I was experiencing the same problem both in VBox and qemu when I used my original SB16 drivers.

The solution is to use the drivers contained in the file sbbasic.exe, easily found on Google.

I hope this will help people in the future!
tauro
 
Posts: 4
Joined: 26. Jul 2011, 11:56
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: Sound Blaster 16 Emulation Failure

Postby over_clox » 22. Nov 2016, 14:04

This problem is much more an issue for old DOS games and similar software which directly drove the SB16, regardless if ANY drivers were installed. At that time in sound systems, it was much more common for games and programs to have their own "drivers" compiled right into their programs. The DOS "drivers" that came with the card were mostly to provide volume mixing controls, a music and CD player, ability to configure the BLASTER environment variable intuitively, and offer better MIDI support. The driver itself wasn't even necessary under DOS, drivers only became necessary under Windows due to their developing hardware abstraction layer. The SB16 would work just fine on real hardware in DOS even without any drivers installed, as long as the BLASTER environment variable was set correctly in AUTOEXEC.BAT. The fact that it doesn't work right in VBox but does on real hardware proves that VBox is not faithfully emulating the card to specifications.

To prove this point, I offer a simple challenge.. get 3 old school DOS games working under SB16 emulation, any choice of driver. It won't work. You'll be lucky if you find even one game that does work, and if so, it isn't using the SB16 chips in the way the engineers intended in regards to figuring out when a sound buffer has finished playing.

The proper solution isn't to change the driver, that's simply not possible as every old DOS game would have to be recompiled around this bug somehow. The proper fix is to address the issues in VBox emulation.
over_clox
Volunteer
 
Posts: 167
Joined: 5. Apr 2008, 22:43
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows XP, Ubuntu 10.04, Legacy Testing

Previous

Return to Other Guests

Who is online

Users browsing this forum: Bing [Bot] and 5 guests