VOGONS


SBEMU: Sound Blaster emulation on AC97

Topic actions

Reply 780 of 1335, by jtchip

User metadata
Rank Member
Rank
Member
clintonoddfellow wrote on 2023-06-15, 22:21:

Hardware: HP T5710 w/ VT8231

Issue: With sbemu loaded, PC speaker audio no longer is mixed into the internal speaker/line out. Driver must be unloaded in order for PC speaker audio to function correctly.

The T5710 is somewhat unusual in that it doesn't have an internal beeper, instead normally routing the PC speaker audio through the internal speaker used by the onboard audio, or out through the line out on the rear. Since it only has the one internal speaker, if the audio is not properly mixed in, there will be no pc speaker sound of any sort, system beeps, or audio from software that uses it.

Looking at the SC_VIA82.C source, at the end of via82xx_chip_init() is:

 // initial ac97 volumes (and clear mute flag)
via82xx_ac97_write(card->iobase, AC97_MASTER_VOL_STEREO, 0x0202);
via82xx_ac97_write(card->iobase, AC97_PCMOUT_VOL, 0x0202);
via82xx_ac97_write(card->iobase, AC97_HEADPHONE_VOL, 0x0202);
via82xx_ac97_write(card->iobase, AC97_EXTENDED_STATUS,AC97_EA_SPDIF);

In AC97_DEF.H is:

#define  AC97_PCBEEP_VOL          0x000a      // none

The register is the same as the one in Linux where it's called AC97_PC_BEEP and it's marked as optional.
I wonder if it's as simple as adding:

 via82xx_ac97_write(card->iobase, AC97_PCBEEP_VOL, 0x0202);

to enable it again.
I have a Jetway J7F2 with a VT8237 audio controller (which uses the same MPXPLAY driver as the VT8231 though a different PCI device) and in the mixer in Linux there is a PC Beep volume control but it does nothing, PC speaker beeps still always come through the piezoelectric beeper on the motherboard, not through the line-out.
If the mixer in Windows or Linux on the T5710 has a PC Beep volume control and it does control the PC speaker volume, perhaps it is as easy as adding the line above. I don't have the ability to build an SBEMU binary though.

Reply 781 of 1335, by clintonoddfellow

User metadata
Rank Newbie
Rank
Newbie
jtchip wrote on 2023-06-15, 23:44:

I have a Jetway J7F2 with a VT8237 audio controller (which uses the same MPXPLAY driver as the VT8231 though a different PCI device) and in the mixer in Linux there is a PC Beep volume control but it does nothing, PC speaker beeps still always come through the piezoelectric beeper on the motherboard, not through the line-out.
If the mixer in Windows or Linux on the T5710 has a PC Beep volume control and it does control the PC speaker volume, perhaps it is as easy as adding the line above. I don't have the ability to build an SBEMU binary though.

That seems like it would track. Since your Jetway board has a separate PC speaker, they didn't bother wiring it up to the input on the sound chip. Since business PCs and thin clients tend to route all PC sound through the internal speaker, it stands to reason that'd be a feature used more on machines like this thin client, or a SFF business desktop.

I do have success in altering the volume in software with VIASBCFG, so I imagine you're probably correct.

Thanks for the insight!

Reply 782 of 1335, by Kenpachi

User metadata
Rank Newbie
Rank
Newbie
clintonoddfellow wrote on 2023-06-16, 02:23:
That seems like it would track. Since your Jetway board has a separate PC speaker, they didn't bother wiring it up to the input […]
Show full quote
jtchip wrote on 2023-06-15, 23:44:

I have a Jetway J7F2 with a VT8237 audio controller (which uses the same MPXPLAY driver as the VT8231 though a different PCI device) and in the mixer in Linux there is a PC Beep volume control but it does nothing, PC speaker beeps still always come through the piezoelectric beeper on the motherboard, not through the line-out.
If the mixer in Windows or Linux on the T5710 has a PC Beep volume control and it does control the PC speaker volume, perhaps it is as easy as adding the line above. I don't have the ability to build an SBEMU binary though.

That seems like it would track. Since your Jetway board has a separate PC speaker, they didn't bother wiring it up to the input on the sound chip. Since business PCs and thin clients tend to route all PC sound through the internal speaker, it stands to reason that'd be a feature used more on machines like this thin client, or a SFF business desktop.

I do have success in altering the volume in software with VIASBCFG, so I imagine you're probably correct.

Thanks for the insight!

From memory my STAC HDA datasheet describes the provision for the capture of the pc speaker beep and sending it to the audio codec line/spkr out, though its possible it could just be generating a beep separately on the line/spkr rather than directly routing (eg. pc speaker game fx/music) straight through the mixer matrix.
There's a fair few config verbs in there for configuring all sorts of routing and enabling different functions. I recall poking around in sound drivers on different windows platforms and finding lots of these (on-plug pin-detect per jack and assign to mixer matrix), and i think it's probably beyond the scope of any dos program to keep a database of all the specific verbs for all the chip variants, but there are also likely many standard verbs defined in the specification, so I have thought it would be interesting to have some sort of AC97/HDA config program that could send through various config verbs with an audio player test, when the right combination is found, it could save the init and config and be loaded at startup.
Without looking at SBemu and the MPXplay code, i figure they have already sourced plenty of standard init sequences from available linux drivers.
In any case, i would imagine pc beep capture/gen/route config verbs should be pretty standard and in both AC97 and HDA specs.
There are definitely smarter people around here than me who might know.

Reply 783 of 1335, by clintonoddfellow

User metadata
Rank Newbie
Rank
Newbie
Kenpachi wrote on 2023-06-20, 14:49:

From memory my STAC HDA datasheet describes the provision for the capture of the pc speaker beep and sending it to the audio codec line/spkr out, though its possible it could just be generating a beep separately on the line/spkr rather than directly routing (eg. pc speaker game fx/music) straight through the mixer matrix.

Yeah, although the metaphor is that it's a separate mixer channel, it could be doing odd stuff behind the scenes.

It's not a stretch to imagine that since the pc speaker is just a square wave generator that the signal is being digitally read, and then the guts of the sound chip are just using that data to beep at the right tone. Logic tells me this would be a cleaner and simpler way of doing it rather than having a separate analogue circuit to mix in.

This is just spitballing here though, and I'm certainly not very smart either. I'm hoping that this could be an easy fix, looking at the above post by jtchip, but I could be opening a can of worms here too.

I do hope it'll be able to be worked out though! I'm pretty rubbish when it comes to software, but I am more than happy to test any potential solution 😀

-C

Reply 784 of 1335, by urbanus

User metadata
Rank Newbie
Rank
Newbie

DOS + Dual Booting

Using Windows 98SE DOS might make sense for many with SBEMU since more modern hardware will often be used!
This will be a guide for how I set DOS up, so I could install Windows XP alongside DOS.

Reasoning
The advantage with Windows 98SE is that many other OSes detect it and dual boots it.
MS-DOS 6.22 however is often not detected and is more difficult to dual boot.
Dual booting even works if you only "install DOS" with the "format c: /s" from say a Windows 98SE CD.

Since the SBEMU driver works on newer hardware, it makes sense to also install a newer OS alongside DOS for the more modern games those machines support.

Files needed
1. Windows 98SE Bootable CD
2. SBEMU naturally
3. CuteMouse
4. FreeDOS gcdrom driver

Prepare C drive content
1. Create a temporary folder named "C"

2. Copy the content below in into Notepad and save it as a file named "AUTOEXEC.BAT" into the C folder.

@ECHO OFF

rem CuteMouse driver
C:\CTMOUSE\CTMOUSE
echo.

rem Windows 98SE CD-Rom Driver & GCDRom Driver
LH C:\CDROM\MSCDEX.EXE /D:oemcd001 /D:GCDROM /L:D
set CDROM=FOO23
C:\CDROM\FINDCD.EXE
echo.

rem SBEMU Audio driver
C:\SBEMU\jload C:\SBEMU\qpiemu.dll
C:\SBEMU\hdpmi32i -r -x
C:\SBEMU\sbemu

rem Populate PATHS
path=C:\DOS\;C:\CDROM\;C:\CTMOUSE\;C:\SBEMU\

rem Add CD-ROM to PATH if detectable
if NOT "%CDROM%"=="FOO23" path=%path%;%CDROM%\

rem SMARTDRV
rem LH /L:0;2 /S C:\DOS\SMARTDRV 2048 16 /V
LH /L:0;2 /S C:\DOS\SMARTDRV 2048 16

3. Copy the content below in into Notepad and save it as a file named "CONFIG.SYS" into the C folder.

rem SBEMU Audio driver
DEVICE=C:\SBEMU\jemmex.exe

dos=high,umb
files=60
buffers=20
stacks=9,256

rem Windows 98SE CD-ROM Driver (IDE)
device=C:\CDROM\oakcdrom.sys /D:oemcd001
device=C:\CDROM\btdosm.sys
device=C:\CDROM\flashpt.sys
device=C:\CDROM\btcdrom.sys /D:oemcd001
device=C:\CDROM\aspi2dos.sys
device=C:\CDROM\aspi8dos.sys
device=C:\CDROM\aspi4dos.sys
device=C:\CDROM\aspi8u2.sys
device=C:\CDROM\aspicd.sys /D:oemcd001

rem GCDRom Driver (SATA)
DEVICE=C:\CDROM\GCDROM.SYS /D:GCDROM

4. Create a folder named "SBEMU" in the C folder. Extract the "SBEMU.XXXX.zip" file, and copy all its files into the "SBEMU" folder.

5. Create a folder named "CTMOUSE" in the C folder. Extract the cutemouseXXXX.zip file, and copy all the files in the "bin" folder into the "CTMOUSE" folder.

6. Create a folder named "CDROM" in the C folder. Extract the file named "gcdrom.sys" from the file "gcdrom24.zip", and put the extracted file into the folder "CDROM".

7. Extract the "Windows 98SE CD.iso" with say 7Zip to a temporary folder.
- Open the extracted CD folder.
- Open the folder "[BOOT]"
- Extract the file "Boot-1.44M.img"
- Open the folder "Boot-1.44M"
- Extract the file "EBD.CAB"

You should now have extracted the CD itself and two other files from within it.
8. Copy the following files into the "CDROM" folder from the folder "Extracted CD folder\[BOOT]\Boot-1.44M\".
- ASPI2DOS.SYS
- ASPI4DOS.SYS
- ASPI8DOS.SYS
- ASPI8U2.SYS
- ASPICD.SYS
- BTCDROM.SYS
- BTDOSM.SYS
- FINDCD.EXE
- FLASHPT.SYS
- MSCDEX.EXE
- OAKCDROM.SYS

9. Create a folder named "DOS" in the C folder. Copy the file "smartdrv.exe" from the folder "Extracted CD folder\WIN98\" and put it in the "DOS" folder.

10. Copy other files/programs if you want to the "DOS" folder, like EDIT, SCANDISK, FORMAT, XCOPY etc.

11. Partition the HDD you want to use.
- Create a primary partition
- Set it to be active

You can use fdisk from the Windows 98SE CD, and with the switch "/actok" you can also set any disk as active.

fdisk /actok

12. Format the HDD/primary partition, and make it bootable (Install minimal DOS)

This example command formats the drive C: and "installs a minimal DOS" to it using the switch "/s".

format c: /s

Change "c:" to be the drive letter you need to use for your HDD.

12. Copy all the content from the C folder we created in the beginning, and paste/put it into the C: drive (or whatever drive letter you used).

Finished
You should now have a bootable HDD with a minimal DOS (Windows 98SE based) installation with:
- Sound driver (SBEMU)
- Mouse driver (CuteMouse)
- CD-ROM driver (Windows boot floppy files for IDE, and "gcdrom" for SATA CD drives)
- smartdrv for faster disk access.

If you now install say Windows XP on another partition or HDD, it should detect this DOS installation and add it to the Boot Menu automatically (calls it "Microsoft Windows" if I remember correctly). Just edit the "boot.ini" file on the C: drive to change the name in the boot menu to say "DOS" or something.

Last edited by urbanus on 2023-07-01, 09:22. Edited 1 time in total.

Reply 785 of 1335, by ishadow

User metadata
Rank Newbie
Rank
Newbie

I've recently made dual booting MS-DOS 6.22 and Windows 98 on my HP T5710 thin client.

Things that I've used:
- SD2IDE for SD cards, although it's not necessary.
- Partition Magic for MS-DOS to handle partitioning from bootable MS-DOS 6.22 USB drive (FreeDOS should work too)
- PLOP boot manager to boot into each OS after.

1. I've cloned Windows 98 HDD image to SD card I've once made using WinImage on modern PC.
2. Using partition magic I've created new FAT16 partition (1280 MB, but it could be 2 GB) at the beginning of HDD, moved Win98 partition after and resized Win98 partition to fill rest of the SD card. Both partitions need to be set as Primary and Active, although Partition Magic will hide one, which is irrelevant since PLOP will handle this.
3. Installed PLOP.
4. Configuring PLOP was a long trial and error, but I've found working solution:

Windows 98 Boot entry:
*80A HDA1
HDA 2
CLEAR
CLEAR

MS-DOS Boot Entry:
*80A HDA2
CLEAR
CLEAR
CLEAR

It was necessary to set partition ID in EDIT partition menu:
HDA1 had to be set as "0CH WIN95 FAT32 LBA"
HDA2 should be "06H FAT16 (BIG DOS)"

With such setup I was finally able to boot to both systems.
MS-DOS has access only to it's own FAT16 partition, so it won't damage Win98 one.
Windows 98 sees both partitions. Its own is a C drive and MS-DOS is D.

HP T5710 thin client has hardware SB Pro support that can be enabled by VIASBCFG.COM. It works in real-mode so I has (probably) 100% compatibility.
It uses no RAM for DAC support only. FM is done by VIAFMTSR.COM which uses quite a lot of conventional memory, making some 16-bit games quitting with "not enough memory" error.
FM emulation is kinda mediocre though.

SBEMU also can be used which gives SB16 emulation and much better OPL3 emulation, however with limited compatibility with games.

Third option is to run DOS games from Windows 98. SB emulation is good and while there's no FM in Windows 98, there is Windows's MIDI synth.

Overall I like this setup. With quite good sound options for MS-DOS. Small case, totally silent. USB 2.0 and modern 2005 BIOS. There's also Radeon 7000 mobility on board with decent 3D performance for early 3D games. Unreal Tournament will run at highest settings in 640x480 at playable frame rate.

Reply 786 of 1335, by RayeR

User metadata
Rank Oldbie
Rank
Oldbie

The only thing needed for NTOS dual booting is to save existing bootrecord from partition (DOS bootrecord, not MBR) to a file (there are various tools to do this), e.g. bootsect.w98 and then, after installing WinNT/2k/XP add one line to boot.ini:
C:\bootsect.w98="Your old DOS name"
if it was not done automatically by installer.

Gigabyte GA-P67-DS3-B3, Core i7-2600K @4,5GHz, 8GB DDR3, 128GB SSD, GTX970(GF7900GT), SB Audigy + YMF724F + DreamBlaster combo + LPC2ISA

Reply 787 of 1335, by urbanus

User metadata
Rank Newbie
Rank
Newbie
RayeR wrote on 2023-07-01, 13:31:

The only thing needed for NTOS dual booting is to save existing bootrecord from partition (DOS bootrecord, not MBR) to a file (there are various tools to do this), e.g. bootsect.w98 and then, after installing WinNT/2k/XP add one line to boot.ini:
C:\bootsect.w98="Your old DOS name"
if it was not done automatically by installer.

Whenever I googled how to get DOS 6.22 working, the explanations have always been confusing.

I have seen your way mentioned before, but not easily/properly described so that I understood how to actually do it.

Your description is the best one I've seen so far 😜

Reply 788 of 1335, by urbanus

User metadata
Rank Newbie
Rank
Newbie
RayeR wrote on 2023-07-01, 13:31:

The only thing needed for NTOS dual booting is to save existing bootrecord from partition (DOS bootrecord, not MBR) to a file (there are various tools to do this), e.g. bootsect.w98 and then, after installing WinNT/2k/XP add one line to boot.ini:
C:\bootsect.w98="Your old DOS name"
if it was not done automatically by installer.

Ok, so here is how I understand how it should be done (will have to test it later, vacation etc):

1. Install DOS 6.22 to a primary partition
2. Download https://www.winimage.com/bootpart.htm, extract and copy the files to a folder on the DOS 6.22 drive
3. Run the following command from DOS 6.22 and where you copied the files above to: BOOTPART DOS622 C:\BOOTSECT.622 "MS-Dos 6.22"
4. Install Windows XP (or maybe something else) to a secondary partition/drive
5. Edit C:\boot.ini (Windows XP will place it on the DOS 6.22 drive, which will also be C:, XP will be installed to D: usually)
6. Add the following line at the bottom of "C:\boot.ini": C:\BOOTSECT.622="MS-Dos 6.22"
7. Reboot and it should appear in the boot menu.

Reply 789 of 1335, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie

I wonder could be C:\bootsect.w98 transferred to new disk with different geometry?

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 790 of 1335, by RayeR

User metadata
Rank Oldbie
Rank
Oldbie

No, it cannot be moved to different partition size without changing specific values in bootsector image, you would have to boot DOS from other media, run sys command to create new bootsector on your new partition and then save it to file. Then repair NT bootsector from install media or via bootprep utility from DOS (it is similar utility to sys for NT systems, part of XP embedded deploy tools). Btw this is a bit offtopic from SBEMU, should be moved to other thread...

Gigabyte GA-P67-DS3-B3, Core i7-2600K @4,5GHz, 8GB DDR3, 128GB SSD, GTX970(GF7900GT), SB Audigy + YMF724F + DreamBlaster combo + LPC2ISA

Reply 791 of 1335, by mrfusion92

User metadata
Rank Member
Rank
Member

40 pages are a lot, a FAQ or wiki is really necessary. I have a question that I'm sure it was already asked but I can't find the answer.

Is there any hope to make it work under Windows 98? Not DOS mode, Windows itself.
I have a Asus EEE netbook with SiS chipset and HDA sound. In DOS mode SBEMU works okay but have it working sound also under Windows would be terrific.

Reply 792 of 1335, by urbanus

User metadata
Rank Newbie
Rank
Newbie
mrfusion92 wrote on 2023-07-04, 10:56:

40 pages are a lot, a FAQ or wiki is really necessary. I have a question that I'm sure it was already asked but I can't find the answer.

Is there any hope to make it work under Windows 98? Not DOS mode, Windows itself.
I have a Asus EEE netbook with SiS chipset and HDA sound. In DOS mode SBEMU works okay but have it working sound also under Windows would be terrific.

1. Don't disagree with the wiki thing. "README.MD" files on the original github repo might be the way to go. Maybe a "wiki" subfolder with .MD files linked together via the main README.MD file, where each subfolder .MD file might handle different subjects (one .MD file for DOS 6.22, another FreeDos etc)

2. The problem with Windows vs DOS is that it is an entirely different driver architecture. So as always, anything is possible I assume, but it's not a simple adapt what we have job from what I have read. You would probably have to write much of the hardware part of the driver from scratch. Maybe the OPL3 emulation could be reused, but the cards would have to be initialized the Windows way. Do we have someone here in the thread with Windows 9x driver development knowledge?

Reply 793 of 1335, by trojan2179

User metadata
Rank Newbie
Rank
Newbie

Hello Crazii,
I just tested SBEMU with my Dell OptiPlex FX160 BIOS Rev 13 running DOS 6.22
Detects Intel HD and happy to report Doom sounds great!
Thank you for your time and everyone who contributed to this cool little tool.
Have a great day.

Reply 794 of 1335, by retrofan011

User metadata
Rank Newbie
Rank
Newbie
mrfusion92 wrote on 2023-07-04, 10:56:

40 pages are a lot, a FAQ or wiki is really necessary. I have a question that I'm sure it was already asked but I can't find the answer.

Is there any hope to make it work under Windows 98? Not DOS mode, Windows itself.
I have a Asus EEE netbook with SiS chipset and HDA sound. In DOS mode SBEMU works okay but have it working sound also under Windows would be terrific.

Yes, its possible.
Check this thread and follow the instructions.
https://msfn.org/board/topic/178295-audio-dri … testing-thread/
I tried it and it works perfectly, although I thought it was an impossible mission.
Now my Realtek HDA onboard card, provides sound in Win 98 too.
Together with SBEMU for DOS, we have now complete solution.
Amazing stuff.

Reply 795 of 1335, by mrfusion92

User metadata
Rank Member
Rank
Member
retrofan011 wrote on 2023-07-06, 20:40:
Yes, its possible. Check this thread and follow the instructions. https://msfn.org/board/topic/178295-audio-dri … testing-thread […]
Show full quote

Yes, its possible.
Check this thread and follow the instructions.
https://msfn.org/board/topic/178295-audio-dri … testing-thread/
I tried it and it works perfectly, although I thought it was an impossible mission.
Now my Realtek HDA onboard card, provides sound in Win 98 too.
Together with SBEMU for DOS, we have now complete solution.
Amazing stuff.

I already tried that hack\driver\thing but saldy didn't worked with my specific HDA sound card.

Reply 796 of 1335, by retrofan011

User metadata
Rank Newbie
Rank
Newbie
mrfusion92 wrote on 2023-07-06, 20:45:
retrofan011 wrote on 2023-07-06, 20:40:
Yes, its possible. Check this thread and follow the instructions. https://msfn.org/board/topic/178295-audio-dri … testing-thread […]
Show full quote

Yes, its possible.
Check this thread and follow the instructions.
https://msfn.org/board/topic/178295-audio-dri … testing-thread/
I tried it and it works perfectly, although I thought it was an impossible mission.
Now my Realtek HDA onboard card, provides sound in Win 98 too.
Together with SBEMU for DOS, we have now complete solution.
Amazing stuff.

I already tried that hack\driver\thing but saldy didn't worked with my specific HDA sound card.

You could ask user deomsh for help, who is an expert in this topic and willing to help.
With a precise analysis of your hardware, a custom setup can be made, as it has been done before.

Reply 797 of 1335, by veelstekel

User metadata
Rank Newbie
Rank
Newbie

I couldn't get the original SBEMUb3 to work on my Acer A0751h; however VSHDA runs and I am able to run Epic Pinball with sound!
Also Quake 1 is running fine at 800x600 (1024x768 works; but too slow)

However two interesting observations:
- It only works if I ENABLE my Network Boot in my BIOS (whereas MPXPLAY was working); the reason for this (as found out by Baron) is that the Intel HDA is not assigned an IRQ by my bios if Network boot is disabled (Details: https://github.com/Baron-von-Riedesel/VSBHDA/issues/1)
- All tables of Epic Pinball work with sound EXCEPT Android (unsure why)

Now I am trying to get this also working on my Asus C60M1-I, unfortunately JEMMEX crashes; and with QHIMEM2.SYS VSBHDA loads and recognizes the HDA (VIA VT1708S) but crashes when starting Epic Pinball.

Now I was wondering how easy it is to get the EXTERNAL midi device working on the Sb Live 5.1! (this is something which could absolutely not be done with the original DOS drivers). If this would be working I think it would be possible put the mt32-pi directly to the header and have mt32 / General Midi sound working (https://github.com/dwhinham/mt32-pi/discussio … comment-4296879)

Any thoughts?

Reply 798 of 1335, by RayeR

User metadata
Rank Oldbie
Rank
Oldbie
veelstekel wrote on 2023-07-08, 08:46:

Now I was wondering how easy it is to get the EXTERNAL midi device working on the Sb Live 5.1!

I'd be happy too if I could connect my dreamblaster MIDI to my SB Audigy, via gameport header or other herader. But it would probably need some extra programming to setup the MPU UART. I don't know if it is documented and/or included in Linux Alsa drivers. Once it woul be setup then SBEMU could just trap access to port 330h and redirect it to another port of real MPU UART device on SBA/SBL card...

Gigabyte GA-P67-DS3-B3, Core i7-2600K @4,5GHz, 8GB DDR3, 128GB SSD, GTX970(GF7900GT), SB Audigy + YMF724F + DreamBlaster combo + LPC2ISA