VOGONS


Reply 80 of 406, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
Baron von Riedesel wrote on 2023-02-04, 11:15:

That's true. Btw. what software synthesizer is included in your SBEMU binary?

I used the dbopl.cpp from DOSBOX. I didn't show much details in the /? information, only mentioned that code of DOSBOX is used.

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 81 of 406, by crazii

User metadata
Rank Oldbie
Rank
Oldbie

DBOPL is less precise than Nuked-OPL, but I guess it's enough for PC emulation, maybe I can add more options to use Nuked-OPL .

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 82 of 406, by Baron von Riedesel

User metadata
Rank Member
Rank
Member
crazii wrote on 2023-02-04, 10:09:

I think I need a real machine to debug, they're quite different from the virtualbox emulation.

I just tried VirtualBox ( v7.0 ). The results so far are not very promising:

MPXPLAY works ok if audio controller is set to "SoundBlaster 16". Setting it to "ICH AC97" also emits "some sound", but it's pretty strange and "alien". Audio controller "Intel HD Audio" remains silent.

I know and did just verify again thet MPXPLAY works well on my Ryzen with HDA.

Might be an OS related problem, I'm running VBox in Linux...

Reply 83 of 406, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
Baron von Riedesel wrote on 2023-02-04, 15:44:
I just tried VirtualBox ( v7.0 ). The results so far are not very promising: […]
Show full quote
crazii wrote on 2023-02-04, 10:09:

I think I need a real machine to debug, they're quite different from the virtualbox emulation.

I just tried VirtualBox ( v7.0 ). The results so far are not very promising:

MPXPLAY works ok if audio controller is set to "SoundBlaster 16". Setting it to "ICH AC97" also emits "some sound", but it's pretty strange and "alien". Audio controller "Intel HD Audio" remains silent.

I know and did just verify again thet MPXPLAY works well on my Ryzen with HDA.

Might be an OS related problem, I'm running VBox in Linux...

Yeah. I fixed some bugs in MPXPlay too. It did have no sound in Virtualbox with HDA, it uses PIO for immediate commands while Virtualbox only support MMIO, I read the HDA spec and found the PIO are optional only.
the ICH driver also have tiny bugs and I fixed them. 🤣

Here's a list that contains my bugfix commits, you may want to take a look: https://github.com/crazii/SBEMU/commits/main/ … PXPLAY/AU_CARDS

Also, I've tested virtualbox on three different machines, one desktop with i9 CPU and works good, one laptop with i7 4700 also working but may have noises, another i9 also sounds a little bit "alien" but I think its something related to the host environment.
2 real machines, with VT82C686 and ICH4, both works good, the sounds have no major problem.

Last edited by crazii on 2023-02-04, 16:19. 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 84 of 406, by crazii

User metadata
Rank Oldbie
Rank
Oldbie

You can test SBEMU in virutalbox to see whether it have sounds for doom2, as I tested it have for both ICH & HDA, although doom2 is too slow in virtualbox and not playable.

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 85 of 406, by Bondi

User metadata
Rank Oldbie
Rank
Oldbie

Did some quick testing and the results are impressing.
Wolf3D, Rott, Prince of Persia - work fine both FM and PCM. Duke3D works amazingly!
GTA1 - works mostly fine, just very slight stuttering sometimes.
DOOM I/II - Music is fine. Digital works, but very distorted. Recording attached.

Filename
New Recording.m4a
File size
240.94 KiB
Downloads
38 downloads
File license
Public domain

MDK - hangs in the menu.
LBA - setup won't start.
Chasm the rift - game didn't start.

Tested on Thinkpad x60s with Intel HD Audio AD1981HD.

IMG_0624.jpg
Filename
IMG_0624.jpg
File size
59.76 KiB
Views
1243 views
File license
Public domain

Will try more games later on.

PCMCIA Sound Cards chart
archive.org: PCMCIA software, manuals, drivers

Reply 86 of 406, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
Bondi wrote on 2023-02-04, 16:19:
Did some quick testing and the results are impressing. Wolf3D, Rott, Prince of Persia - work fine both FM and PCM. Duke3D works […]
Show full quote

Did some quick testing and the results are impressing.
Wolf3D, Rott, Prince of Persia - work fine both FM and PCM. Duke3D works amazingly!
GTA1 - works mostly fine, just very slight stuttering sometimes.
DOOM I/II - Music is fine. Digital works, but very distorted. Recording attached.
New Recording.m4a
MDK - hangs in the menu.
LBA - setup won't start.
Chasm the rift - game didn't start.

Tested on Thinkpad x60s with Intel HD Audio AD1981HD.
IMG_0624.jpg

Will try more games later on.

I've fixed doom/doom2's digital sounds like a few minutes ago 🤣, and tested on real machine. I'll update a new binary later.

EDIT: I forgot that I uploaded the new binary here already: https://github.com/crazii/SBEMU/releases/tag/1.0beta1 you can try this one.
EDIT2: the fix might not work on HDA, its a buffering/timing issue and I adjusted it for ICH & VT82C686 but not for HDA yet.
EDIT3: updated new binary for HDA too.

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 87 of 406, by Bondi

User metadata
Rank Oldbie
Rank
Oldbie

DOOM works perfectly now. Which means a bunch of games that use same engine.
Also tried Tomb Raider and HOMM2 - all woks.
Quake - no sound with the first version, and doesn't start at all with the later.

EDIT: Darkforces and Tertis Classic work fine.

PCMCIA Sound Cards chart
archive.org: PCMCIA software, manuals, drivers

Reply 88 of 406, by Baron von Riedesel

User metadata
Rank Member
Rank
Member

Now it works for me as well on a real machine ( Ryzen ) - I had forgotten that I have set environment variable "HDPMI=32", which virtually deactivates SBEMU.

The original DOOM/DOOM2 still doesn't run ( "transfer stack overflow" ), but the "MBF" port works, both sound and music. Quake crashes, though

Reply 89 of 406, by crazii

User metadata
Rank Oldbie
Rank
Oldbie

Glad to hear that DOOM works on your machine, unfortunately I doesn't on mine, but Doom2 works. the CLI/STI hack of HDPMI is not bulletproof. somehow on a fast machine it runs fast to skip the bug I guess.
Found some bugs which causes Quake to fail, after them being fixed, it works (still noisy, probably due to PCM resampling using linear interpolation).

I think for now the priority might be: to make a client with POPF/IRET work for HDPMI just like in win9x, for DOOM to work stable on all machines.

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 90 of 406, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
Baron von Riedesel wrote on 2023-02-05, 05:17:

Now it works for me as well on a real machine ( Ryzen ) - I had forgotten that I have set environment variable "HDPMI=32", which virtually deactivates SBEMU.

The original DOOM/DOOM2 still doesn't run ( "transfer stack overflow" ), but the "MBF" port works, both sound and music. Quake crashes, though

That's really good news! Now we have 2 machines with HDA working. 😁, BTW the bug for Quake is fixed but binary not yet updated.

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 91 of 406, by Baron von Riedesel

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

BTW the bug for Quake is fixed but binary not yet updated.

Can't wait to test...

In the meantime, I played a bit with the SBEMU source - and made a JLM ( Jemm Loadable Module ), QPIEMU, that emulates the Qemm API ( well, just the few functions that are used by SBEMU ). It works flawless, so far ... I just tested Commander Keen 4, though. A tiny adjustment to the SBEMU source was also necessary, because the method to get the API entry point has to be different.

Reply 92 of 406, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
Baron von Riedesel wrote on 2023-02-05, 23:06:
crazii wrote on 2023-02-05, 05:50:

BTW the bug for Quake is fixed but binary not yet updated.

Can't wait to test...

In the meantime, I played a bit with the SBEMU source - and made a JLM ( Jemm Loadable Module ), QPIEMU, that emulates the Qemm API ( well, just the few functions that are used by SBEMU ). It works flawless, so far ... I just tested Commander Keen 4, though. A tiny adjustment to the SBEMU source was also necessary, because the method to get the API entry point has to be different.

That's cool! is it possible detect & switch to the module at runtime (support QEMM & the module both)? I was thinking about support different EMMs but not yet starting that. Sine this module almost have the same API like QEMM so I guess only tiny portion need to be adjusted, like detection/entry point and such.
BTW The new binary of SBEMU was uploaded at https://github.com/crazii/SBEMU/releases/tag/1.0beta1

I was thinking about how to make the POPF working with IOPL0, 2 methods came to my mind:
1. after CLI, force further exception (#AC, #SS or something) happens on each stack operations, and emulate all stack instructions(PUSH/POP PUSHA(D)/POPA(D) , CALL/RET/RETF) until there's a STI or IRET/POPF that set the IF.
2.use PVI & VIF, but still, POPF won't reset VIF. but now HW interrupts never disabled for real and can come to the DPMI host, just check VIF to decide whether to route the interrupt to the client, if the client's VIF keeps off for too long, enable it. this could detect the freeze, but might be a bad timing since it is not instantly set on POPF.
I think the 2nd is more doable and have less performance risk. Is it even possible to do that?

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 93 of 406, by Bondi

User metadata
Rank Oldbie
Rank
Oldbie
crazii wrote on 2023-02-05, 05:48:

Glad to hear that DOOM works on your machine, unfortunately I doesn't on mine, but Doom2 works. the CLI/STI hack of HDPMI is not bulletproof. somehow on a fast machine it runs fast to skip the bug I guess.
Found some bugs which causes Quake to fail, after them being fixed, it works (still noisy, probably due to PCM resampling using linear interpolation).

I think for now the priority might be: to make a client with POPF/IRET work for HDPMI just like in win9x, for DOOM to work stable on all machines.

Sound in Quake works flawlessly now 👍

PCMCIA Sound Cards chart
archive.org: PCMCIA software, manuals, drivers

Reply 94 of 406, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
Bondi wrote on 2023-02-06, 06:19:

Sound in Quake works flawlessly now 👍

Good! I tested MDK just now, it seems it doesn't freeze but the keyboard is not working, I can use the mouse to check the sound config and found it detected the emulated SB as an SB16/AWE, I fixed some SB16 related bug now it has sounds (fortunately it only uses 8bit DMA), but the keyboard problem remains unfixed. I have no clue at all. 🤣

BTW I personally always prefer win9x versions over dos versions, like MDK, KKND, Theme Hospital, Dungeon Keepers etc. 😁

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 95 of 406, by crazii

User metadata
Rank Oldbie
Rank
Oldbie

Tested LBA, and found that it will work with the original HDPMI, the STI/CLI hack won't work, this lead to the previous question again.

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 96 of 406, by Bondi

User metadata
Rank Oldbie
Rank
Oldbie
crazii wrote on 2023-02-06, 13:39:
Bondi wrote on 2023-02-06, 06:19:

Sound in Quake works flawlessly now 👍

Good! I tested MDK just now, it seems it doesn't freeze but the keyboard is not working, I can use the mouse to check the sound config and found it detected the emulated SB as an SB16/AWE, I fixed some SB16 related bug now it has sounds (fortunately it only uses 8bit DMA), but the keyboard problem remains unfixed. I have no clue at all. 🤣

BTW I personally always prefer win9x versions over dos versions, like MDK, KKND, Theme Hospital, Dungeon Keepers etc. 😁

Now that you wrote, I tried MDK with mouse and yes, same here, keyboard blocked. It autodetects SB16 and I cannot change it without keyboard. 😁

I also faced that some games don't run on tihs newer laptop no matter if the sbemu is loaded or not, due to other incompatibilities.
For instance setup.exe of Abuse won't run at all. I poked in setup.cfg and got digtal sound, but no music.
Overall my impression is that protected mode games are more compatible with sbemu+fast CPU setup.

PCMCIA Sound Cards chart
archive.org: PCMCIA software, manuals, drivers

Reply 97 of 406, by digger

User metadata
Rank Oldbie
Rank
Oldbie
crazii wrote on 2023-02-04, 12:22:

DBOPL is less precise than Nuked-OPL, but I guess it's enough for PC emulation, maybe I can add more options to use Nuked-OPL .

Perhaps ymfm would be a reasonable compromise between accuracy and performance?

Polpo, the guy who's developing the PicoGUS card, is considering it for adding AdLib and possibly OPL3 compatibility to his project.

By the way, @crazii, may I compliment you on the amazing work you've been doing on this? Legacy DOS sound card emulation has been something that I've been wanting to work on in my spare time for years. And except for taking a few beginners' steps into retro DOS sound and emulation programming, I never really got very far. And here you are, finally solving the notorious and persistent problem of getting sound card emulators to work with protected mode DOS games on modern hardware! 🦸🏻 Kudos.

Slso big thanks to Baron von Riedesel and everyone else who provided crucial support along the way.

Reply 98 of 406, by digger

User metadata
Rank Oldbie
Rank
Oldbie
crazii wrote on 2023-02-04, 15:59:

Yeah. I fixed some bugs in MPXPlay too. It did have no sound in Virtualbox with HDA, it uses PIO for immediate commands while Virtualbox only support MMIO, I read the HDA spec and found the PIO are optional only.

That makes a lot of sense, actually. As I understand it, MMIO is much more virtualization-friendly than PIO, which would require port trapping at the hypervisor level, which is costly in terms of performance.

It seems not unlike the NVMe specification (modern-day disk interface optimized for SSDs), which introduced an extension called the Doorbell Buffer Config command in version 1.3 of the spec. This extension allows the hardware to be accessed through memory-mapped I/O, with the explicit goal to make the standard more emulation/virtualization-friendly.

It's interesting how MMIO is actually the mandatory default in the HDA spec, with PIO being optional, while the opposite is true for NVMe.

It makes one wonder why not all new hardware interface standards are memory-mapped these days. Especially since port-mapped I/O isn't even supported in most non-x86 architectures. Or am I confusing things here?