VOGONS


SBEMU: Sound Blaster emulation on AC97

Topic actions

Reply 140 of 1632, by MBH

User metadata
Rank Newbie
Rank
Newbie

Hey, my name is Marcus and I just created an account here on vogons for two reasons:

1. I want to thank you @crazii for making this dream real!
2. I think no one tested SBEMU on VIA VT8237R yet? At least, I haven't read about it.

I have an IGEL Thin Client, 4210LX Winestra, with VIA C7 (1 GHz), CN700 and VT8237R. It has 256 MB of RAM and a 512 MB CF Card. MPXPlay166G plays nice on this one, so should SBEMU? Sadly I didn't manage it to get it work. Probably just my fault, who knows. I have tried alot of things, will try to list everything. In Duke3d I got no sound. Setup complains about wrong or used DMA. No matter if I try 8 or 16 Bit. DESCENT1 Setup crash and freeze everytime I try to set soundcard or test my settings.

In my CONFIG.SYS I have following line:

DEVICE C:\SOUND\SBEMU\JEMMEX.EXE NOEMS I=B000-B7FF

I tried with and without NOEMS, with and without VCPI. Also tried with HIMEM and EMM386 instead.

In my AUTOEXEC.BAT:

SET BLASTER=A220 I5 D1 H5 T6
LH C:\SOUND\SBEMU\JLOAD.EXE C:\SOUND\SBEMU\QPIEMU.DLL
LH C:\SOUND\SBEMU\HDPMI32I.EXE -r -x
LH C:\SOUND\SBEMU\SBEMU.EXE /k44100

I tried every BLASTER combination, A220/240, I5/7, D0/1/3, H5/6/7, T4/5/6
I tried SBEMU with and without /k44100

I deactivated everything in BIOS other than sound, to free up reccources. Network Controller, COM1/2, LPT1. Also deactivated IRQ for USB and VGA.

In any case, SBEMU detects the VT82xx successful, but I always end with the errors I wrote above. Never I got any sound out of the IGEL. Interesting fact, if SBEMU is loaded, MPXPlay used the emulated SB device instead of the native VIA. And also failed to play any sound. Or to make things more clear, there is some very disorted "noise" with a lot of breaks in between.

Have I'm done anything wrong? If you need some more information, please let me know.

Reply 141 of 1632, by keenmaster486

User metadata
Rank l33t
Rank
l33t

I'd like to drop in here that I'm detecting some small latency in the Adlib emulation (not sure about SB) compared to DOSBox and real hardware. Maybe as much as 200-300ms. Edit: stopwatch says 100-200ms.

Last edited by keenmaster486 on 2023-03-14, 04:39. Edited 1 time in total.

World's foremost 486 enjoyer.

Reply 142 of 1632, by old_pc_f@n

User metadata
Rank Newbie
Rank
Newbie
keenmaster486 wrote on 2023-03-13, 17:49:

I'd like to drop in here that I'm detecting some small latency in the Adlib emulation (not sure about SB) compared to DOSBox and real hardware. Maybe as much as 200-300ms.

Shouldn't the latency be much smaller according to this? -- https://github.com/crazii/SBEMU/issues/2

Reply 143 of 1632, by keenmaster486

User metadata
Rank l33t
Rank
l33t
old_pc_f@n wrote on 2023-03-13, 20:02:

Shouldn't the latency be much smaller according to this? -- https://github.com/crazii/SBEMU/issues/2

Well, it isn't. It's noticeable. Not quite enough to ruin your gameplay experience, but enough to get on your nerves.

World's foremost 486 enjoyer.

Reply 144 of 1632, by Thermalwrong

User metadata
Rank Oldbie
Rank
Oldbie

The latency might depend on the game? With Duke Nukem 2 on a P3 I'm seeing maybe 50-100ms latency but less than I can properly notice for sound effects.

Also - wow what an excellent development. I have a Toshiba Portege 3490CT (running win98 SE that boots straight to DOS now) that has great display scaling and USB mouse support but is limited with Yamaha's AC97 audio. This has sound working quite well in real-mode DOS! - though so far I've noticed that Descent's setup with sb-pro mode seems to give double speed audio? It works with SB-16 mode though on the standard IRQ 7 & DMA1.
Just noticed another oddity with Duke Nukem 2, after about a minute of play on here, the PCM audio stopped working and now there's only OPL3 emulation and adlib sounds.
The OPL3 emulation is great too 😀

edit: haha this is so odd, I have it set up to start with sbem in sb-pro mode now again, but with in sb-pro mode, the descent setup test sounds play at normal speed with sb-16 (i7 d1) selected. If I set it to sb-pro (i7 d1) with the sbemu in sb-pro mode then it goes right back to double speed.

edit 2: just observed latency for myself, it's particularly obvious in the menus of doom but far less apparent in actual gameplay

Reply 145 of 1632, by keenmaster486

User metadata
Rank l33t
Rank
l33t
Thermalwrong wrote on 2023-03-14, 01:18:

The latency might depend on the game? With Duke Nukem 2 on a P3 I'm seeing maybe 50-100ms latency but less than I can properly notice for sound effects.
...
edit 2: just observed latency for myself, it's particularly obvious in the menus of doom but far less apparent in actual gameplay

The latency for me is much more noticeable in Commander Keen, which uses Adlib sound effects. It's still present in DOOM with SB sound effects, but may be less, or it may just be my imagination.

A ballpark estimate with the stopwatch on my phone puts me at 100-200 ms.

World's foremost 486 enjoyer.

Reply 146 of 1632, by stamasd

User metadata
Rank l33t
Rank
l33t
MBH wrote on 2023-03-13, 12:18:

Hey, my name is Marcus and I just created an account here on vogons for two reasons:

1. I want to thank you @crazii for making this dream real!
2. I think no one tested SBEMU on VIA VT8237R yet? At least, I haven't read about it.

It will not work. The 8237 is a completely different architecture from 8233 etc. It is not an AC97 codec but a HD codec. It is not supported by MPXPlay (which is used with SBEMU). It would need VIA Vinyl support added to MPXPlay, which isn't likely to happen (VIA never released drivers for the Vinyl series for any architecture earlier than WDM, never supported it in DOS etc). I have a system with 8237 (HP thin client 5512t), I tried it and it didn't work either. I didn't expect it to.

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 147 of 1632, by MBH

User metadata
Rank Newbie
Rank
Newbie

@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.

Reply 148 of 1632, by Stainlesscat

User metadata
Rank Newbie
Rank
Newbie

i have an vt8237r plus southbridge based computer on an Biostar p4m890-m7. i'm also having simliar problems in which SBEMU successfully inits but no sound blaster audio actually works in games. the SETBLAST.exe tool detects an IRQ conflict of some sort but i don't rely on this tool often.

Reply 149 of 1632, by sparky4

User metadata
Rank Newbie
Rank
Newbie

no sound on my thinkpad p53 it has a

00:1f.3 Audio device: Intel Corporation Cannon Lake PCH cAVS (rev 10)

let me test again after my upgrade

wwww

Reply 151 of 1632, by sergio_prado

User metadata
Rank Newbie
Rank
Newbie
Kamerat wrote on 2023-03-14, 21:56:

Working on Intel X58/ICH10R (Asus SABERTOOTH X58 with a Realtek ALC892 codec). For some reason the system is dog slow in DOS, but that's even before SBEMU is loaded.

Already tryed MTRRLFBE? It can help games run faster.

Reply 152 of 1632, by wbahnassi

User metadata
Rank Oldbie
Rank
Oldbie

Intel X58 chipset with Integrated Intel/Realtek HD ALC262 Audio (HP Z400 workstation). Only FM music works. SBEmu says IRQ conflict. I switch to IRQ 5 and the conflict is gone and SBEmu loads successfully, but any game hangs when it wants to output digital sound. MPXPlay works fine.

Reply 153 of 1632, by zyzzle

User metadata
Rank Member
Rank
Member
sergio_prado wrote on 2023-03-11, 19:32:

Were i can find Jason Brooks DOS utilities? I searched the web and find nothing. Can you please share the link?

I'm very sorry. I misremembered. The author I was thinking about is Jason Hood.

He has a very good, small CD-ROM DOS driver here:
http://adoxa.altervista.org/shsucdx/index.html

and other utilities, such as an excellent RAM DRIVE for DOS:

http://adoxa.altervista.org/shsufdrv/index.html

This, along with MSCDEX.EXE will enable you to get CD-ROM drives recognized in DOS.

Reply 154 of 1632, by zyzzle

User metadata
Rank Member
Rank
Member
Thermalwrong wrote on 2023-03-14, 01:18:

Just noticed another oddity with Duke Nukem 2, after about a minute of play on here, the PCM audio stopped working and now there's only OPL3 emulation and adlib sounds.

This happened for me also. I think it has to do with Duke 2 using ADPCM sound (compressed) samples. I found this post on VOGONS offering some uncompressed (8-bit VOCs) of those compressed (2.6 bit VOCs) used in Duke 2:
Re: Duke Nukem 2 ADPCM fix?
I downloaded the DUKEVOC.ZIP file posted in that thread, imported the files in that ZIP manually into the NUKEM2.CMP file (the 5.3 meg file with all of Duke 2's graphics and sound) using Camoto (a GREAT web-based game viewer / modifier), downloaded the re-injected NUKEM2.CMP file, and the game played perfectly with this modified file with both OPL3 and digital effect enabled.

crazii addressed the ADPCM audio issue with his latest SBEMU version posted in this thread. However, it worked for me imperfectly in Duke Nukem 2 until I applied the patch detailed above. The other ADPCM games I know of are:

Monster Bash (Apogee): Get only scratchy clicks with crazii's ADPCM fix. before that, nothing at all. OPL works perfectly.
Major Stryker (Apogee): Works perfectly with digital and OPL *after* the ADMPCI fix for SBEMU
Last Eichoff: Works perfectly with SBEMU after the ADPCM audio fix
Duke Numem 2 (Apogee): works with SB digital audio fix method above with SBEMU, otherwise dig. audio cuts after ~1 min.

I noticed the same thing happens with me using Wolfenstein 3D. The digital sounds work fine for about a minute, then stop working with SBEMU. I don't think Wolf3D uses ADPCM audio, however. This is with the latest version of SBEMU.

Reply 155 of 1632, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
keenmaster486 wrote on 2023-03-14, 04:38:
Thermalwrong wrote on 2023-03-14, 01:18:

The latency might depend on the game? With Duke Nukem 2 on a P3 I'm seeing maybe 50-100ms latency but less than I can properly notice for sound effects.
...
edit 2: just observed latency for myself, it's particularly obvious in the menus of doom but far less apparent in actual gameplay

The latency for me is much more noticeable in Commander Keen, which uses Adlib sound effects. It's still present in DOOM with SB sound effects, but may be less, or it may just be my imagination.

A ballpark estimate with the stopwatch on my phone puts me at 100-200 ms.

By default the PCI buffer size is 16384 bytes, and 16 bit stereo 22050Hz PCM format will be used, and so the total delay of the buffer is about 185ms, you may use "/k44100" to use higher sample rate, which will halve the delay.

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 156 of 1632, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
Baron von Riedesel wrote on 2023-03-10, 07:44:

Well, yes, of course. I had problems with those SB PCI cards on a second machine that I tried. Turned out that it's not a good idea to enable interrupts for the sound card before the sbemu IRQ handler is installed. So I modified sbemu a bit and it worked ...

I remember the IRQ is unmasked after IRQ handler being installed. Or is it that on some system's startup the IRQ is enabled by default, by the BIOS? So need to mask the IRQ first?

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 157 of 1632, by georgel

User metadata
Rank Member
Rank
Member
crazii wrote on 2023-03-15, 07:47:
keenmaster486 wrote on 2023-03-14, 04:38:
Thermalwrong wrote on 2023-03-14, 01:18:

The latency might depend on the game? With Duke Nukem 2 on a P3 I'm seeing maybe 50-100ms latency but less than I can properly notice for sound effects.
...
edit 2: just observed latency for myself, it's particularly obvious in the menus of doom but far less apparent in actual gameplay

The latency for me is much more noticeable in Commander Keen, which uses Adlib sound effects. It's still present in DOOM with SB sound effects, but may be less, or it may just be my imagination.

A ballpark estimate with the stopwatch on my phone puts me at 100-200 ms.

By default the PCI buffer size is 16384 bytes, and 16 bit stereo 22050Hz PCM format will be used, and so the total delay of the buffer is about 185ms, you may use "/k44100" to use higher sample rate, which will halve the delay.

https://www.mindshare.com/files/resources/min … ffer_sizing.pdf

Reply 158 of 1632, by sledge

User metadata
Rank Member
Rank
Member

Can someone try Cubic Player / Open Cubic Player, please?

In my case (Asus EEE netbook) playback works, but the screen is erratically jumping up&down and text is outputed ("trapcli pushf pop ax 0246 0246")

doshaven.eu / high-voltage.cz

Reply 159 of 1632, by Baron von Riedesel

User metadata
Rank Member
Rank
Member
crazii wrote on 2023-03-15, 07:59:

I remember the IRQ is unmasked after IRQ handler being installed. Or is it that on some system's startup the IRQ is enabled by default, by the BIOS? So need to mask the IRQ first?

the problem is with the SB Live - interrupts are/were enabled in AU_setrate(). That's too early, the ISR isn't installed yet, if there are pending interrupts, they won't be acknowledged.

It was fixed by moving the code that enabled the interrupt into AU_start().