VOGONS


SBEMU: Sound Blaster emulation on AC97

Topic actions

Reply 200 of 1245, by commander_spuds

User metadata
Rank Newbie
Rank
Newbie

Incredible work. Talk about saving the day. Absolutely fantastic stuff.
Thought I'd make an account to share my experiences so far.

Hardware:
MSI MS5182
K6-2 475
512 MB RAM
IDE-CF adapter
IDE CD-ROM drive
Sound Blaster Live

Only tested on FreeDOS so far.

I've noticed that the OPL is very quiet compared to the sound effects. Is it possible to tweak the volumes of the two independently? Also it's a bit quiet in general even with /VOL9. This also happens on other hardware I've briefly tested.
CD audio isn't playing. The CD light is blinking, but no sound.

Doom runs great
SimCity 2000 crashes. "HDPMI: fatal exit 0007" This actually crashes without loading sbemu, just loading HDPMI32I is enough to cause the crash.
Warcraft 1 music plays in slight slow motion.

Are others having these problems? Maybe we should make a compatibility database like emulators do.

Reply 202 of 1245, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
MBH wrote on 2023-03-14, 16:14:

@stamasd: Please read my post again. I already wrote, MPXPlay plays nice on this one. But SBEMU not. So something is wrong (either with me or with SBEMU). And no, its not a HD codec, its oldstyle AC97.

EDIT: Just saw on Wikipedia, there is a 8237"A" variant which indeed has HD-Audio instead of AC97. Probably you have this one. But mine is 8237 or later named 8237R PLUS, which is basically a 8233 with SATA, RAID and USB2.

I cannot find datasheet of VT8233 on the web. Just checked the source code and found I only modified the source code of VT82C686 to enable interrupt according to its datasheet. Not sure they use the same registers But I tried to build a test binary that operates the same register, hope it will work.

Filename
SBEMU_VT8233Fix.zip
File size
201.77 KiB
Downloads
188 downloads
File license
CC-BY-4.0
Last edited by crazii on 2023-03-26, 15:38. Edited 5 times in total.

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 203 of 1245, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
Kamerat wrote on 2023-03-18, 11:53:
As I wrote in a later post I actually got it working by running and exiting HDAplay before launching SBEMU. […]
Show full quote
crazii wrote on 2023-03-16, 06:43:
Kamerat wrote on 2023-03-08, 20:49:
Still no sound with /VOL9. […]
Show full quote

Still no sound with /VOL9.

I also get no sound with MPXPLAY even that it detects IHD. Maybe the driver from MPXPLAY is the problem?

This is the device:

 Bus 0 (PCI Express), Device Number 20, Device Function 2
Vendor 1002h Advanced Micro Devices, Inc. [AMD/ATI]
Device 4383h SBx00 Azalia (Intel HDA)
Subsystem ID FF1E1179h Unknown
Subsystem Vendor 1179h Toshiba Corporation
System IRQ 7, INT# A

There was problem on MPXPlay and I did some fix, tested working by folk here, when MPXPlay doesn't work but SBEMU does. There might be more problems that are not fixed.
It uses IRQ7, so you need to use IRQ5 for SBEMU, I saw you've already done that. So what's the BLASTER env after running SBEMU?

As I wrote in a later post I actually got it working by running and exiting HDAplay before launching SBEMU.

I don't think the driver from Mpxplay sets up the codec correctly on that system, here are the main differences I discovered by running the HDAstat utility:

Cold boot        0/ 16/0F05/0  - power state control=0x433
SBEMU only 0/ 16/0F05/0 - power state control=0x33
HDAplay + SBEMU 0/ 16/0F05/0 - power state control=0x0

Cold boot 0/ 16/0F06/0 - link stream/channel: 0x0 (stream=0, channel=0)
SBEMU only 0/ 16/0F06/0 - link stream/channel: 0x0 (stream=0, channel=0)
HDAplay + SBEMU 0/ 16/0F06/0 - link stream/channel: 0x10 (stream=1, channel=0)

I don't know if both are needed for the codec to work correctly as I dont't know how to manually modify it's registers.

Based on the symptom that SBEMU can work with HDAplay without any modification, I think MPXPlay may miss some compatibility setup steps for some chipsets.
Just checked the MPXPlay's source code, the link stream register is written by MPXPlay already, but involves parsing HDA DAC nodes, not just a simple write to register with a raw value. I'm not sure I can handle it right now.
The power state is not touched by MPXPlay, I can try to set it, but not sure if it works.

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 204 of 1245, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
sergio_prado wrote on 2023-03-18, 14:49:
crazii wrote on 2023-03-05, 06:13:
Hi, I'm happy to announce that SBEMU is ready for more tests. :D […]
Show full quote

Hi, I'm happy to announce that SBEMU is ready for more tests. 😁

Purpose: for PCs with AC97/Intel High Definition Audio sound cards that doesn't have Sound Blaster support (vintage PCs after 2000 era, or modern PCs with HDA).
Supported PCI soundcards:

  • Intel ICH
  • nForce (nForce2 tested working)
  • Intel High Definition Audio
  • VIA VT8233 & VT82C686
  • SB Live/Audigy (thanks to Baron von Riedesel for debugging)

Emulated cards: SB 1.0, 2.0, Pro, 16, 8 bit DMA & 16 bit DMA.
Notes: All on chip AC97 mother boards including Intel ICH and nForce both will reported as ICH. And it doesn't report the actual codec (e.g. realtek), but only the board (ICH). For HDA codec its the same.

Supported both real mode and protected mode games. Requirements:
HDPMI32i is needed for protected mode support, which is included in the zip file.
QEMM or JEMM is needed for real mode support. JEMMEX is included in the zip. It's optional, SBEMU can run without it and so without real mode support.

For more information, read the readme.txt in the zip and use /? in the command line.

Thanks to:

  • MPXPlay's: sound card drivers
  • DOSBox: DBOPL emulation
  • HDPMI & JEMM: Port traps
  • Folks in the forum that helped guiding & testing & improving the emulation

The original discussion can be found here: Possibility to write OPL3 sound driver for protected mode games, which initially intended for RetroWave OPL3 but then led to a pure soft emulation of SB & OPL.
The source code of SBEMU can be found here: https://github.com/crazii/SBEMU

Known issues: some games might not work properly, need more tests & improvement. 16 bit protected mode games are not supported - this remains a challenge so far.
Some games prefer VCPI over DPMI, need use "JEMMEX NOVCPI" AFTER loading HDPMI, or remove QEMM/JEMM and run the system without VCPI (also no real mode support).
Use /t6 to enable SB16 emulation.
Use /i5 to change the virtual IRQ if you get an IRQ conflict error, or adjust IRQ assignment in the BIOS.
Any suggestion and bug report are welcomed.

1.0Beta2b:
Fix SB Live/Audigy interrupt.
Add option "/SCL" to list sound cards, use "/SC[n]" to select sound card.
Experimental: adjust sound buffer to reduce latency. (1/8 to original).
This is a single binary of SBEMU.
SBEMU1.0beta2b.zip

1.0 Beta2:
SBEMU.zip

Thanks for this amazing software. This is something that many people was wanting for many years.

On my libretto U100 with ICH4 AC97, i noticed that the music have a lower volume compared to the sound effects. I already tryed /VOL9. There's any other way to increase the music volume?

You can try the SB mixer utility to set volumes. the /VOL is the overall volume for the real sound cards.
The initial SB volume of music & sound are already set to maximum, I don't know why this happens, there're probably some bugs on this.

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 205 of 1245, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
stanwebber wrote on 2023-03-18, 23:56:

my compaq armada e500 laptop has a 440bx chipset and the system architecture block diagram in the user manual clearly indicates the ac97 codec. does this mean sbemu should work?

the audio chip is an ess es1978 and it's working under pure dos using ddma; however, the opl3 midi is a wavetable hybrid mess. i've tried sbemu with and without the ddma drivers, but it always reports no soundcard found.

is there some trick to get sbemu working with my laptop or is it a hopeless case?

MPXPlay has ESS drivers but only for ISA cards (ESS18xx), and I didn't include the code in SBEMU because the ISA cards already have SB support.

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 206 of 1245, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
commander_spuds wrote on 2023-03-19, 00:35:
Incredible work. Talk about saving the day. Absolutely fantastic stuff. Thought I'd make an account to share my experiences so f […]
Show full quote

Incredible work. Talk about saving the day. Absolutely fantastic stuff.
Thought I'd make an account to share my experiences so far.

Hardware:
MSI MS5182
K6-2 475
512 MB RAM
IDE-CF adapter
IDE CD-ROM drive
Sound Blaster Live

Only tested on FreeDOS so far.

I've noticed that the OPL is very quiet compared to the sound effects. Is it possible to tweak the volumes of the two independently? Also it's a bit quiet in general even with /VOL9. This also happens on other hardware I've briefly tested.
CD audio isn't playing. The CD light is blinking, but no sound.

Doom runs great
SimCity 2000 crashes. "HDPMI: fatal exit 0007" This actually crashes without loading sbemu, just loading HDPMI32I is enough to cause the crash.
Warcraft 1 music plays in slight slow motion.

Are others having these problems? Maybe we should make a compatibility database like emulators do.

Yes CD audio is previously reported not working on SB live. It needs special handling for CD audio registers of SB - not implemented yet, and I'm not sure whether SB Live's CD audio register commands are identical to SBPro/16 (whether they need remap), it's quite possible that they are the same, in that case the only thing to do is to forward the register commands to real SB live without translation.

commander_spuds wrote on 2023-03-19, 00:49:

How do you build the source?

You need DOSLFN + DJGPP (better with RHIDE) which can be downloaded on the web. run RHIDE in the root folder of the source code and it will open the project.

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 207 of 1245, by georgel

User metadata
Rank Member
Rank
Member
crazii wrote on 2023-03-19, 07:04:

MPXPlay has ESS drivers but only for ISA cards (ESS18xx), and I didn't include the code in SBEMU because the ISA cards already have SB support.

But they do not support SB16.

Reply 208 of 1245, by stanwebber

User metadata
Rank Member
Rank
Member
crazii wrote on 2023-03-19, 07:04:

MPXPlay has ESS drivers but only for ISA cards (ESS18xx), and I didn't include the code in SBEMU because the ISA cards already have SB support.

the es1978 is the ess maestro 2e which is a pci chipset. it is sbpro compatible using ddma, but has no hardware opl3 and emulates it rather badly in software. the soundcard absolutely ruins an otherwise very serviceable retro laptop.

the es1978 is not that great of win9x/xp soundcard either since running dos games in dosbox is preferable to a msdos prompt in every circumstance (vxd or wdm).

i was hoping to salvage something with sbemu.

Reply 209 of 1245, by Stainlesscat

User metadata
Rank Newbie
Rank
Newbie
crazii wrote on 2023-03-19, 06:41:
MBH wrote on 2023-03-14, 16:14:

@stamasd: Please read my post again. I already wrote, MPXPlay plays nice on this one. But SBEMU not. So something is wrong (either with me or with SBEMU). And no, its not a HD codec, its oldstyle AC97.

EDIT: Just saw on Wikipedia, there is a 8237"A" variant which indeed has HD-Audio instead of AC97. Probably you have this one. But mine is 8237 or later named 8237R PLUS, which is basically a 8233 with SATA, RAID and USB2.

I cannot find datasheet of VT8233 on the web. Just checked the source code and found I only modified the source code of VT82C686 to enable interrupt according to its datasheet. Not sure they use the same registers But I tried to build a test binary that operates the same register, hope it will work.

I'm not sure if this will help but here's the data sheet for the VIA vt8235 & vt8237r+ southbridges. as far as i'm aware these chipsets all carry some form of AC'97 codec, in which MPXplay play's fine in "VIA" mode on my build with a VIA chipset. it's an p4m890 with vt8237r+ chipset.

sbemu inits correctly with no issues. but all dos games i've tested detect an sound blaster IRQ & DMA conflict and nor even OPL fm seems to work. i'm using the sbemu vt8233fix build you just recently compiled.

Attachments

Reply 210 of 1245, by L4MD4

User metadata
Rank Newbie
Rank
Newbie

I'm not sure if this will help but here's the data sheet for the VIA vt8235 & vt8237r+ southbridges. as far as i'm aware these chipsets all carry some form of AC'97 codec, in which MPXplay play's fine in "VIA" mode on my build with a VIA chipset. it's an p4m890 with vt8237r+ chipset.

sbemu inits correctly with no issues. but all dos games i've tested detect an sound blaster IRQ & DMA conflict and nor even OPL fm seems to work. i'm using the sbemu vt8233fix build you just recently compiled.

Could issues like this, and ICH6, be sourced in HDPMI32I.EXE? Not even directly, HDPMI32I. Perhaps the required resource are somehow tied up. Maybe not even already assigned, just not accessible using normal methods.

Could there also be issues, depending on the Dos you use? As and example (only): Using the same machine, Jemmex can free UMB memory on FreeDos; but it does not on MsDos7.1..

Also, I apologize for not "yet" building SBEMU, and debugging on non-working devices.

Reply 211 of 1245, by Stainlesscat

User metadata
Rank Newbie
Rank
Newbie
L4MD4 wrote on 2023-03-19, 19:54:
Could issues like this, and ICH6, be sourced in HDPMI32I.EXE? Not even directly, HDPMI32I. Perhaps the required resource are so […]
Show full quote

I'm not sure if this will help but here's the data sheet for the VIA vt8235 & vt8237r+ southbridges. as far as i'm aware these chipsets all carry some form of AC'97 codec, in which MPXplay play's fine in "VIA" mode on my build with a VIA chipset. it's an p4m890 with vt8237r+ chipset.

sbemu inits correctly with no issues. but all dos games i've tested detect an sound blaster IRQ & DMA conflict and nor even OPL fm seems to work. i'm using the sbemu vt8233fix build you just recently compiled.

Could issues like this, and ICH6, be sourced in HDPMI32I.EXE? Not even directly, HDPMI32I. Perhaps the required resource are somehow tied up. Maybe not even already assigned, just not accessible using normal methods.

Could there also be issues, depending on the Dos you use? As and example (only): Using the same machine, Jemmex can free UMB memory on FreeDos; but it does not on MsDos7.1..

Also, I apologize for not "yet" building SBEMU, and debugging on non-working devices.

i'm using the lastest version of freedos with jemmex provided with the sbemu binary, i believe version freedos 1.3? i would suppose both freedos and ms-dos would behave the same. the former latter haven't tried yet, would dos 6.22 make any difference compared to dos 7.1?

Reply 212 of 1245, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
Stainlesscat wrote on 2023-03-19, 18:49:
crazii wrote on 2023-03-19, 06:41:
MBH wrote on 2023-03-14, 16:14:

@stamasd: Please read my post again. I already wrote, MPXPlay plays nice on this one. But SBEMU not. So something is wrong (either with me or with SBEMU). And no, its not a HD codec, its oldstyle AC97.

EDIT: Just saw on Wikipedia, there is a 8237"A" variant which indeed has HD-Audio instead of AC97. Probably you have this one. But mine is 8237 or later named 8237R PLUS, which is basically a 8233 with SATA, RAID and USB2.

I cannot find datasheet of VT8233 on the web. Just checked the source code and found I only modified the source code of VT82C686 to enable interrupt according to its datasheet. Not sure they use the same registers But I tried to build a test binary that operates the same register, hope it will work.

I'm not sure if this will help but here's the data sheet for the VIA vt8235 & vt8237r+ southbridges. as far as i'm aware these chipsets all carry some form of AC'97 codec, in which MPXplay play's fine in "VIA" mode on my build with a VIA chipset. it's an p4m890 with vt8237r+ chipset.

sbemu inits correctly with no issues. but all dos games i've tested detect an sound blaster IRQ & DMA conflict and nor even OPL fm seems to work. i'm using the sbemu vt8233fix build you just recently compiled.

Yes, the datasheet is very helpful!
I've made a new build according to the datasheet. zip updated here: Re: SBEMU: Sound Blaster emulation on AC97

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 213 of 1245, by L4MD4

User metadata
Rank Newbie
Rank
Newbie
Stainlesscat wrote on 2023-03-19, 20:09:

i'm using the lastest version of freedos with jemmex provided with the sbemu binary, i believe version freedos 1.3? i would suppose both freedos and ms-dos would behave the same. the former latter haven't tried yet, would dos 6.22 make any difference compared to dos 7.1?

I would not have thought there was a difference, between FreeDos and MsDos7.1, in this respect. It was my guess, that it doesn't happen on all machines. Otherwise, it would have been noticed. I haven't tested MsDos6.22. MsDos6.22 may preform more like FreeDos, since 7.1 was designed to be used with Win9x.

If it was only a MsDos7.1 issue, then it would suggest it has nothing to do with the hardware. That would reduce the relevance towards SBEMU/HDPMI32I; at least with the exampled I provided.

I only brought this up, in relation to SBEMU/HDPMI32I. Jemex is only mentioned as an example.

Reply 214 of 1245, by Kenpachi

User metadata
Rank Newbie
Rank
Newbie

Incredible stuff crazii, this is so cool.
I tested on a 2nd gen i7 laptop and it worked perfectly with Doom and Duke3D.
I was hoping to get it working on my Dell M6400 though (IDT 92HDxxx) as my main retro rig. Initially got through some hurdles as duke3d was reporting DMA conflicts, but i sorted those by disabling NIC, COM and parallel ports in BIOS.
Now Doom and Duke3d happily stream the audio but there's no audio output. MPXplay has the same behaviour though, talking directly to the IDT.
Tried the beta to list soundcards in case it was streaming to HDMI audio or similar, but both SBemu and MPXplay both only report the 1 IDT interface.
I'm guessing it's gonna be a mixer/routing config issue.
I'm strapped for time but in future I'll do some datasheet digging, but if anyone else has had any success with the IDT I'd love to know!
Cheers again, SBemu is awesome!

Reply 216 of 1245, by Baron von Riedesel

User metadata
Rank Member
Rank
Member
L4MD4 wrote on 2023-03-19, 19:54:

Could there also be issues, depending on the Dos you use? As and example (only): Using the same machine, Jemmex can free UMB memory on FreeDos; but it does not on MsDos7.1..

There is - at least - one difference: while MS-DOS accepts multiple UMB providers ( it checks for - new - UMBs each time a device driver has been loaded ), FreeDOS stops checking once a driver has supplied UMBs.

Reply 217 of 1245, by MBH

User metadata
Rank Newbie
Rank
Newbie
crazii wrote on 2023-03-19, 21:49:
Stainlesscat wrote on 2023-03-19, 18:49:
crazii wrote on 2023-03-19, 06:41:

I cannot find datasheet of VT8233 on the web. Just checked the source code and found I only modified the source code of VT82C686 to enable interrupt according to its datasheet. Not sure they use the same registers But I tried to build a test binary that operates the same register, hope it will work.

I'm not sure if this will help but here's the data sheet for the VIA vt8235 & vt8237r+ southbridges. as far as i'm aware these chipsets all carry some form of AC'97 codec, in which MPXplay play's fine in "VIA" mode on my build with a VIA chipset. it's an p4m890 with vt8237r+ chipset.

sbemu inits correctly with no issues. but all dos games i've tested detect an sound blaster IRQ & DMA conflict and nor even OPL fm seems to work. i'm using the sbemu vt8233fix build you just recently compiled.

Yes, the datasheet is very helpful!
I've made a new build according to the datasheet. zip updated here: Re: SBEMU: Sound Blaster emulation on AC97

Thanks crazii, but it´s still not working. There is a progress, FM music is playing in Duke3d setup. It´s very disorted and way too slow, but at least a sign of live. For the soundeffects, there´s still the error with the wrong DMA channel. But I belive that´s a standard message if something is wrong and it is not for sure DMA related.

Reply 218 of 1245, by L4MD4

User metadata
Rank Newbie
Rank
Newbie
Baron von Riedesel wrote on 2023-03-20, 15:21:

There is - at least - one difference: while MS-DOS accepts multiple UMB providers ( it checks for - new - UMBs each time a device driver has been loaded ), FreeDOS stops checking once a driver has supplied UMBs.

So, there "may" be something there. Interesting stuff.

Reply 219 of 1245, by Stainlesscat

User metadata
Rank Newbie
Rank
Newbie
MBH wrote on 2023-03-20, 15:41:
crazii wrote on 2023-03-19, 21:49:
Stainlesscat wrote on 2023-03-19, 18:49:

I'm not sure if this will help but here's the data sheet for the VIA vt8235 & vt8237r+ southbridges. as far as i'm aware these chipsets all carry some form of AC'97 codec, in which MPXplay play's fine in "VIA" mode on my build with a VIA chipset. it's an p4m890 with vt8237r+ chipset.

sbemu inits correctly with no issues. but all dos games i've tested detect an sound blaster IRQ & DMA conflict and nor even OPL fm seems to work. i'm using the sbemu vt8233fix build you just recently compiled.

Yes, the datasheet is very helpful!
I've made a new build according to the datasheet. zip updated here: Re: SBEMU: Sound Blaster emulation on AC97

Thanks crazii, but it´s still not working. There is a progress, FM music is playing in Duke3d setup. It´s very disorted and way too slow, but at least a sign of live. For the soundeffects, there´s still the error with the wrong DMA channel. But I belive that´s a standard message if something is wrong and it is not for sure DMA related.

Same here... i'm having the same behaviour with most games reporting DMA conflicts. on my system; games that use FM music or sfx ouput harsh garbled glitched noise. i nearly blew my eardrums out when i was testing commander keen 4. i blame my own stupidity for leaving the volume too high on my earbuds. 😂