VOGONS


First post, by SaxxonPike

User metadata
Rank Member
Rank
Member

In doing some research on the VT82* south bridges, it looks like FM NMI is a feature that can be enabled so that you can hook into something like INT 2h to process messages sent to an FM synthesizer. I suspect that VIAFMTSR sends its own emulated audio to the AC97 interface (I haven't reverse engineered anything to confirm this.) But what if we used a better core? Something based off what there is in Dosbox or NukeYKT's OPL core? SB support built into the VIA southbridge is actually not too bad and I think this will be a very useful way to accomplish the same task with better quality output, while also working in a realmode only environment when needed.

I have a guess as to how I might have to write the TSR, but has anyone else tried this technique before, and what other gotchas have you found? I'm tempted to dig into VIAFMTSR itself, but I don't know how appropriate of a template that would be. The challenge of doing it fresh is better, anyhow.

Sound device guides:
Sound Blaster
Aztech
OPL3-SA

Reply 1 of 11, by mkarcher

User metadata
Rank l33t
Rank
l33t
SaxxonPike wrote on 2023-08-20, 16:55:

In doing some research on the VT82* south bridges, it looks like FM NMI is a feature that can be enabled so that you can hook into something like INT 2h to process messages sent to an FM synthesizer. I suspect that VIAFMTSR sends its own emulated audio to the AC97 interface (I haven't reverse engineered anything to confirm this.)

I did reverse that thing. The VT82* south bridge has multiple digital audio channels and mixes them in hardware. In legacy emulation mode, one of the audio channels is used by the SB Pro engine, and a different channel is used for FM playback.

The FM emulation in fact uses the NMI (int 02). It is enabled using bit 0 in PCI config space register 48h. In the NMI handler, you can read back the data written to the OPL data port (that caused the NMI). The read back in the NMI is performed on the second I/O range declared in the PCI config space. The first port indicates whether the write was to 389 or 38b; the second port in that range indicates the current index and the third port indicates the data just written. All the relevant registers are documented in the VIA data sheets (for example in the VT82C686B data sheet).

SaxxonPike wrote on 2023-08-20, 16:55:

I'm tempted to dig into VIAFMTSR itself, but I don't know how appropriate of a template that would be. The challenge of doing it fresh is better, anyhow.

Take a look at the TSR if you need inspiration. The OPL emulator core isn't that great, but digging into that TSR might help you getting the stuff around the emulator core running.

Reply 2 of 11, by ishadow

User metadata
Rank Newbie
Rank
Newbie

OPL emulation isn't ideal, but it isn't the worst. The biggest issue for me is that VIAFMTSR takes too much conventional memory and I wasn't able to load it high.
However it is possible to load only DAC support for games that don't use FM and require a lot of conventional memory like SilverBall. By using DAC + FM, DAC only or SBEMU we're getting higher compatibility and higher FM quality with games that work using SBEMU.

Better VIAFM that don't use a lot of conventional memory and has better OPL3 emulator would be really great, especially with near 100% compatibility this solution has.

I wonder if it is possible to do General MIDI this way also.

Reply 3 of 11, by mkarcher

User metadata
Rank l33t
Rank
l33t
ishadow wrote on 2023-08-22, 11:07:

The biggest issue for me is that VIAFMTSR takes too much conventional memory and I wasn't able to load it high.

That's interesting. The version of VIAFMTSR I have at hand (38.417 bytes) is supposed to use VDS ("Virtual-mode DMA Specification") if present, which should allow loading it high. I can try troubleshooting next time I have a VIAFMTSR-compatible system at hand, but that will be some weeks from now. Just to ensure a common baseline: Are you using Windows 95 or Windows 98 EMM386.EXE to provide UMBs?

Reply 4 of 11, by DoutorHouse

User metadata
Rank Member
Rank
Member
mkarcher wrote on 2023-08-22, 14:34:
ishadow wrote on 2023-08-22, 11:07:

The biggest issue for me is that VIAFMTSR takes too much conventional memory and I wasn't able to load it high.

That's interesting. The version of VIAFMTSR I have at hand (38.417 bytes) is supposed to use VDS ("Virtual-mode DMA Specification") if present, which should allow loading it high. I can try troubleshooting next time I have a VIAFMTSR-compatible system at hand, but that will be some weeks from now. Just to ensure a common baseline: Are you using Windows 95 or Windows 98 EMM386.EXE to provide UMBs?

Was wondering if you found a way of loading VIAFMTSR high? Been trying it lately with my t5710 Thin Client and it really uses a lot of memory... That, along with VIASBCFG really makes DOS memory fall to around 569kB only... 🙁

Reply 5 of 11, by Demolition-Man

User metadata
Rank Member
Rank
Member

@DoutorHouse
Hi again. Just use SBEMU. Not perfect either, but better and smaller than viafmtsr.

Reply 6 of 11, by DoutorHouse

User metadata
Rank Member
Rank
Member
Demolition-Man wrote on 2024-06-19, 14:28:

@DoutorHouse
Hi again. Just use SBEMU. Not perfect either, but better and smaller than viafmtsr.

SBEMU doesn't seem to work on my t5710... It only works on my t5530 because it has one of the sound chipsets it supports. For the t5710 I have to use VIASBCFG with VIAFMTSR and they both need lots of memory... Only solution I found so far was disabling the Network Adapter on BIOS to free up some RAM...

Nevermind, you are right!!!! SBEMU also works with this chipset and it actually sounds better than the combination of VIASBCFG and VIAFMTSR. VIAFMTSR produces a lot of crackling noises on most games... I probably tried an old version of it before but I have just tried the latest beta and it's working great for most games!!! The only problem is that it mutes the PC Speaker for the games that use it (for example PCMAN...)... Do you know if there's a way to solve this? Thanks again for your suggestion!!!

I also came across a different (not sure if it's older) VIAFMTSR.COM file. I'm attaching it here, maybe it's useful to the VIASBCFG developers...

Reply 7 of 11, by Demolition-Man

User metadata
Rank Member
Rank
Member

Good to know that I'm not the only one with the problem, thanks, I thought my PC Speaker was defective. 😁
But I'll check it again soon.
Edit:
Confirmed, SBEMU mutes the speaker sound...

Reply 8 of 11, by DoutorHouse

User metadata
Rank Member
Rank
Member
Demolition-Man wrote on 2024-06-19, 16:55:
Good to know that I'm not the only one with the problem, thanks, I thought my PC Speaker was defective. :D But I'll check it aga […]
Show full quote

Good to know that I'm not the only one with the problem, thanks, I thought my PC Speaker was defective. 😁
But I'll check it again soon.
Edit:
Confirmed, SBEMU mutes the speaker sound...

Thanks for checking!!! I was browsing this long thread and just noticed a list of systems compatible with SBEMU. Now I kinda have lots of different sound options for the t5710, using either the VIASBCFG and VIAFMTSR on DOS and Windows98SE (allowing the vxd drivers to be installed) or the SBEMU solution. Since each solution works for some games but not for others, I'm making different sets of AUTOEXEC.BAT and CONFIG.SYS files to use. For example, on plain DOS, Warcraft II sound is better with the VIASBCFG and VIAFMTSR. With SBEMU the volume goes up and down all the time. On Windows98SE, using the VIASBCFG and the VXD drivers, the sound is perfect. Also, each set of AUTOEXEC.BAT and CONFIG.SYS takes in account what should be changed in BIOS for allowing either IRQ5 or IRQ7 and/or disabling the network adapter for more memory...

The Vinyl_AudioCode_v600a.zip drivers can be used in Windows98SE but only if VIASBCFG is loaded beforehand!

Reply 9 of 11, by Demolition-Man

User metadata
Rank Member
Rank
Member

Thanks, I'll test the other drivers again when I get the chance.

Reply 10 of 11, by DoutorHouse

User metadata
Rank Member
Rank
Member
Demolition-Man wrote on 2024-06-19, 20:38:

Thanks, I'll test the other drivers again when I get the chance.

Forgot to add that these VXD drivers apparently aren't very compatible with games using DirectX. Tried Diablo II and got no sound. Using the WDM drivers makes it work but it breaks sound compatibility for the other "DOS" sound games, like Warcraft II, if run from Windows98SE...

It's kind of a choice between using VIASBCFG and VIAFMTSR for pure DOS and the VXD drivers for games inside Windows98SE or using SBEMU for pure DOS and the WDM drivers for DirectX games inside Windows98SE... 😀

Reply 11 of 11, by Demolition-Man

User metadata
Rank Member
Rank
Member

We can talk there about the thin client t5710 in general:
Any t5710 Thin Client experts?