VOGONS


SBEMU: Sound Blaster emulation on AC97

Topic actions

Reply 1360 of 1643, by analog_programmer

User metadata
Rank Oldbie
Rank
Oldbie

Just for the experiment today I dug up my old ISA SB16 semi-P&P card (it is set trough jumpers, but needs DOS initializer/"driver"). Default settings through jumpers for this soundcard are IRQ 5, LowDMA 1, HighDMA 5, I/O address 220 and MPU-401 I/O address 330. Surprisingly to me the original SB16 card sound quality is almost indistinguishable from the emulated SB16 on CMI8738 card with the latest beta4 build of SBEMU.

from СМ630 to Ryzen gen. 3
engineer's five pennies: this world goes south since everything's run by financiers and economists
this isn't voice chat, yet some people, overusing online communications, "talk" and "hear voices"

Reply 1361 of 1643, by wierd_w

User metadata
Rank Oldbie
Rank
Oldbie

Not surprising at all. the OPL chips are very well documented (and dont have super secret sauce inside them like a SID chip), and the secret sauce that soundblasters DID have for their DSP chips, got successfully dumped using side channel exploits over the years. There is even a thread here on Vogons about that.

EVERYTHING about a soundblaster, and how it processes data, is known. 😜

Reply 1362 of 1643, by analog_programmer

User metadata
Rank Oldbie
Rank
Oldbie

Yeah, but I'm not surprised that SB16 is very well emulated, I just thought that CMI8738 SB16 emulated sound quality is worse than one of the original SB16 card because of the hardware. And it turned out that it is not 😀

I also wanted to check what the original hardware settings were on the SB16, and as I suspected, interrupt 7 is not default setting for this soundcard.

from СМ630 to Ryzen gen. 3
engineer's five pennies: this world goes south since everything's run by financiers and economists
this isn't voice chat, yet some people, overusing online communications, "talk" and "hear voices"

Reply 1363 of 1643, by georgel

User metadata
Rank Member
Rank
Member
wierd_w wrote on 2024-05-01, 10:29:

Not surprising at all. the OPL chips are very well documented (and dont have super secret sauce inside them like a SID chip), and the secret sauce that soundblasters DID have for their DSP chips, got successfully dumped using side channel exploits over the years. There is even a thread here on Vogons about that.

EVERYTHING about a soundblaster, and how it processes data, is known. 😜

Then why some sound blasters are experiencing DMA cracking bug, others are not 😉 ?

Reply 1364 of 1643, by analog_programmer

User metadata
Rank Oldbie
Rank
Oldbie
georgel wrote on 2024-05-01, 14:30:

Then why some sound blasters are experiencing DMA cracking bug, others are not 😉 ?

There are different versions of the DSP. Some of them have this bug, but other don't.

from СМ630 to Ryzen gen. 3
engineer's five pennies: this world goes south since everything's run by financiers and economists
this isn't voice chat, yet some people, overusing online communications, "talk" and "hear voices"

Reply 1365 of 1643, by DarthSun

User metadata
Rank Member
Rank
Member

For SB, all codes/registers are documented, eg a small volume:

procedure SetMixer(RegNum,Value:byte); assembler;
asm
mov dx,Base
add dx,$0004
mov al,RegNum
out dx,al
inc dx
mov al,Value
out dx,al
end;

procedure SetMasterVolume(Left,Right:byte);
begin
SetMixer($30,Left);
SetMixer($31,Right);
end;

The 3 body problems cannot be solved, neither for future quantum computers, even for the remainder of the universe. The Proton 2D is circling a planet and stepping back to the quantum size in 11 dimensions.

Reply 1366 of 1643, by rasz_pl

User metadata
Rank l33t
Rank
l33t
georgel wrote on 2024-05-01, 14:30:

Then why some sound blasters are experiencing DMA cracking bug, others are not 😉 ?

😀
Wasnt the conclusion after disassembly of different fw versions that DMA crackling is due to something inside ISA bus interfacing chip? So we dont really know

>EVERYTHING about a soundblaster, and how it processes data

yet, but we might after someone puts a logic analyzer on ISA bus and tests access patterns of different Sound Blasters.

https://github.com/raszpl/FIC-486-GAC-2-Cache-Module for AT&T Globalyst
https://github.com/raszpl/386RC-16 memory board
https://github.com/raszpl/440BX Reference Design adapted to Kicad
https://github.com/raszpl/Zenith_ZBIOS MFM-300 Monitor

Reply 1367 of 1643, by crazii

User metadata
Rank Oldbie
Rank
Oldbie

1.0 beta4 released, information updated in the original post.
Changes:

Build: add CI/CD pipeline, build FreedDOS image and zip file, by volkertb (Volkert de Buisonjé).
Build: Add Makefile (RHIDE project files deprecated), by thp (Thomas Perl).
Drivers: AC97: Add support for SIS7012, by thp (Thomas Perl).
Drivers: Add support for ICH5/AD1980 sound output, by thp (Thomas Perl).
CD-Audio mixer support, by thp (Thomas Perl).
Runtime debugging over serial port, by thp (Thomas Perl).
Text-mode UI: Nice display of sound card name, and highlight important messsge with color, by thp (Thomas Perl).
move "fix time constant for exact 11/22/44 kHz" to the option, by wbcbz7
improve SB direct mode audio quality, by wbcbz7
Drivers: Add PIO support to Intel HDA, by jiyunomegami.
Drivers: Ensoniq ES1371 supported.
MPU-401 UART emulation with serial MIDI output, by jiyunomegami.
Drivers: C-Media CMI 8338/8738 supported, by crazii & jiyunomegami.
Expermimental: IRQ assignment if PCI sound card IRQ is invalid or above 15.
Drivers: YAMAHA YMF supported, by jiyunomegami.
PCM resampling improvements and fix low-frequency interpolation (Skyroads SFX).
HDPMI: PCI IRQ client bypass, send to SBEMU/BIOS directly and hide from games - fix freeze for DOOM. Thanks to veelstekel for testing.
Build: enable -O2 and -flto optimizations.
Command line: /I9 supported for IRQ9 if IRQ5/7 not working due to IRQ conflicts, by jiyunomegami.
Command line: options support decimals, i.e. /K22050 and other arbitrary values, by jiyunomegami.
Add /SCFM and /SCMPU for cards that have builtin FM and MPU (not enabled by default, need specify in command line), by jiyunomegami.
Drivers: /SCFM /SCMPU for CMI cards, by jiyunomegami.
Drivers: MMIO fix for ICH4 boards, by jiyunomegami.
Drivers: new set of Linux sound card drivers ported, by jiyunomegami. New dirvers:

  • ALS4000
  • EMU10K1X (Dell SB0200)
  • X-Fi (both EMU20K1 and EMU20K2)
  • OXYGEN(CMI8788) (Only tested with Asus Xonar DG)
  • ESS Allegro-1 (ES1988S/ES1989S)
  • Trident 4D Wave

IRQ guard to prevent the virtual SB IRQ sending to BIOS.
Bugfix: crash on calling HDPMI functions, and crash on error exiting.
Bugfix: DMA address mapping using DPMI_MapMemory/DPMI_UnmapMemory that doesn't work properly and cause leaks.
Bugfix: SB16: IRQ/DMA mixer registers not initialized properly, seen in TOMBRAIDER's SETUP.
Add high DMA check, force /Hx=/Dx when /Hx uses low DMA for 16 bit PCM.
Bugfix: prevent compiler optimization on MMIO reads/writes.
Bugfix: fix for some Intel HDA chips that mutes the sound for unkown reason.
Add README.txt & CHANGLOG.txt, shipped with binaries in zip file.
Compatibility: make /H option working if /T6 not set.
Some trivial bugfixes and improvements.

Special Thanks to veelstekel for the testing.

EDIT: IMPORTANT: please use all the files in the zip, or at least SBEMU+HDPMI32i, both updated.

Last edited by crazii on 2024-05-02, 21:36. Edited 1 time 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 1368 of 1643, by megatog615

User metadata
Rank Newbie
Rank
Newbie
crazii wrote on 2024-04-26, 18:17:
Then it's worth a try with MMX enabled. BTW I remember some flags in control register needs to be set to enable it - maybe that' […]
Show full quote
megatog615 wrote on 2024-04-26, 16:06:

Yeah, it struggles on Pentium MMX 233 with my SBLive, last time I tried it. It was almost there in terms of performance.

Then it's worth a try with MMX enabled. BTW I remember some flags in control register needs to be set to enable it - maybe that's already done by HDPMI. otherwise the CPU will generate an exception. Also, if SBEMU is planned to work in win9x, it has to save the MMX context too.
and, if the newly written DPMI is used, I'm concerned that it won't perform as good as HDPMI for your Pentium MMX. 😁 It's written in C and for ease of development, some codes are not well optimized, especially the most frequently used - mode switching and interrupt handling.

BTW have you try the recent builds? it enables LTO and use O2 optimization, which might perform a little better than before.

Cool! I will try soon.

Reply 1369 of 1643, by analog_programmer

User metadata
Rank Oldbie
Rank
Oldbie

Is there any differences between the latest official "1.0-beta4" build and "UserBuild_2024.04.29_09-29" which is also dubbed "beta4" in the CHANGELOG.TXT?

from СМ630 to Ryzen gen. 3
engineer's five pennies: this world goes south since everything's run by financiers and economists
this isn't voice chat, yet some people, overusing online communications, "talk" and "hear voices"

Reply 1370 of 1643, by crazii

User metadata
Rank Oldbie
Rank
Oldbie

There's no big changes but some tiny ones:
* skip software FM emulation if HW FM is used.
* HDA: potential bugfix
* compatibility fix on high DMA.

BTW the release is originally tagged with "UserBuild_2024.05.02_04_31" and I renamed it to beta4, because my VPN is again f**ked up by the GFW (still trying to fix it with the help of another VPN of a friend of mine), I just rename the release without uploading another identical one.

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 1372 of 1643, by Nikita Lita

User metadata
Rank Newbie
Rank
Newbie
zyzzle wrote on 2024-03-25, 23:02:
There is a new version of VSBHDA out which now supports 16-bit protected mode games. I successfully tested it on Jazz Jackrabbit […]
Show full quote

There is a new version of VSBHDA out which now supports 16-bit protected mode games. I successfully tested it on Jazz Jackrabbit and Tyrian 2k on an i5 8th gen Dell laptop with Intel HDA . Thanks to Baron von Riedesel's spectacular efforts, the sound is working and we have another hurdle overcome on getting DOS sound working baremetal on "modern" HDA cards. This is the link:
https://github.com/Baron-von-Riedesel/VSBHDA/ … e1/vsbhda14.zip

crossposted from DOS Aint dead forum.

Test some 16-bit protected mode games and report here if they're working. Most of the Webfoot DOS games also used 16-bit protected mode.

I'm curious as to why these changes aren't being upstreamed; seems like the feature-sets of these forks are diverging significantly.

Reply 1373 of 1643, by digger

User metadata
Rank Oldbie
Rank
Oldbie

Great news. Thanks for the feature-packed new release and for continuing your work on this amazing project, crazii! ☺️

Reply 1374 of 1643, by zyzzle

User metadata
Rank Member
Rank
Member
Nikita Lita wrote on 2024-05-03, 00:21:

I'm curious as to why these changes aren't being upstreamed; seems like the feature-sets of these forks are diverging significantly.

The existence of a fork of SBEMU, namely VSBHDA is a great thing. Having two experts working on emulating SB on "modern" systems is just fantastic. Accordingly, VSBHDA is more targeted to HDA PCI systems, and is more lean because of it, while SBEMU is more feature-rich in support of assessory PCI chipsets.

crazii has mentioned getting 16-bit DOS extender sound working is on the agenda. For all I know, he may already have it working. But, it's been working in VSBHDA for over a month now, with its seperate 16-bit-extender binary, which is a work of genius by Baron von Riedesel.

I say, it's great to have options, and I'm truly thankful. Let the forks continue.

Reply 1375 of 1643, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
digger wrote on 2024-05-03, 15:18:

Great news. Thanks for the feature-packed new release and for continuing your work on this amazing project, crazii! ☺️

Thanks to the contributors! 😁

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 1376 of 1643, by crazii

User metadata
Rank Oldbie
Rank
Oldbie

Here's early test edition of SBEMU with new DPMI (let's call it 1.1-alpha1 release candidate 1 for now),
which includes the new DPMI I'm working intensively on for more than 2 months.
It's been tested by veelstekel for couple of days but now he is temporarily unavailable, so I post the zip here for an early testing.

works on my T540p, with a tiny set of previous game tested, with this new version, there're some changes:

  • JEMMEX & QPIEMU is now essentially needed, even for PM games, the dependency of JEMMEX will be made optional by adding extra simplified v86 module later.
  • warcraft2 works without crash on modern laptop
  • Mortal Kombat II works
  • Jazz jackrabbit (GOG edition) and Tyrian 2000 (GOG edition works)
  • DOS4G exceptions passed to games as expected, and games terminate themselves 'normally'
The attachment sbemu-1.1apha1-rc1.zip is no longer available

and the latest features of SBEMU 1.0 beta4 are not merged yet, including the new linux drivers.
and also the source of the dpmi is not opened yet, but is guaranteed to open when it is more stable & complete. Currently there're some temporary codes that needs to be refactored, even the name is not determined. (initially named super386 which means a supervisor, and also vm386/vmm386 considered, which means a virtual machine or vm manager, later changed to vdpmi which indicates the planned 'vxd' and 'v86' feature).

Last edited by crazii on 2024-05-04, 03:42. Edited 3 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 1377 of 1643, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
Bruno128 wrote on 2024-05-02, 21:43:

Fantastic!
Crystal CS4624/CS4630 support in plans?

I think it'll for sure be added when the compatibility reaches a more desired level.
ESS Solo-1 & CS4624 will be tested that I have both laptops of the cards. Please wait. 😁

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 1378 of 1643, by krotan

User metadata
Rank Newbie
Rank
Newbie

Testing 10b4.
1. Fast Tracker v2.12
It works, but the soundblaster is not recognized.
2. Scream Tracker v3.21
Doesn’t work, it says “initialization...” and hangs.
3. Impulse Tracker v2.15
Works great.
4. CHASM - The Rift
Doesn't start.
But if you first run the command hdpmi32i.exe -d, it starts and works well, but without sound.
Reports an error initializing sound.
5. DooM LEGACY v1.30
Same as chasm.

Reply 1379 of 1643, by zyzzle

User metadata
Rank Member
Rank
Member
crazii wrote on 2024-05-04, 02:50:

Here's early test edition of SBEMU with new DPMI (let's call it 1.1-alpha1 release candidate 1 for now),
which includes the new DPMI I'm working intensively on for more than 2 months.
It's been tested by veelstekel for couple of days but now he is temporarily unavailable, so I post the zip here for an early testing.

Thanks for this beta version of your new DPMI!

I got it working with Tyrian and Jazz Jackrabbit on the same laptop (Kaby Lake, Realtec ALC259 HDA PCI sound). However, the initial load process was a bit unstable (I got a freeze on one of three attempts). The batch file I created loads Jemmex, then QPIEMU, then your VDPMI.EXE (with no commandline options), then SBEMU (-F44100 -VOL9 -A220 -I5 -D1 -T6), then sets BLASTER=A220 I5 D1 H5 T6 environment variable.