Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to index page
Thread view  Board view
PCGamingTimeMachine

24.04.2026, 18:35
(edited by PCGamingTimeMachine, 24.04.2026, 18:51)
 

Digital CD Audio in DOS games via modified VSBHDA and SHSUCD (Announce)

Hi everyone, I've been working on adding CD audio support to the excellent VSBHDA, SHSUCDX and SHSUCDHD programs for a couple of months. Before I go ahead, I'd like to give a disclaimer + assurance:

AI help was used for bootstrap code for some functionalities, debugging and code cleanup/formatting. However I did manually verify everything and manually built on top of initial bootstrap code blocks if AI was used. I dislike AI slop but acknowledge that used correctly it's a useful tool (especially debugging).

I also acknowledge I'm nowhere nearly as good or experienced of a DOS programmer as many members here, so it would be awesome to get your feedbacks/comments.


With that said, I'm at the stage where the modified programs work and I'm comfortable releasing this as a pre-alpha.

Links:
- https://github.com/PCGamingTimeMachine/VSBHDARB/releases/tag/Pre-alpha
- https://github.com/PCGamingTimeMachine/shsucd/releases/tag/Pre-alpha

Modified SHSUCDX + VSBHDA allow you to run games with Red Book / mixed-mode CDs, and get fully working in-game and CD audio. Please go through README.txt in the modded shsucd and VSBHDARB.txt in the modded VSBHDA packages, respectively.

Quick usage guide if you have a physical CD drive:
1. Load the CD driver in config.sys. What works well for me: DEVICEHIGH=UIDE.SYS /D:MSCD001 /N1 /UX
2. Run modified SHSUCDX via: SHSUCDX /D:MSCD001 /A:1
3. Run vsbhdarb.exe via: VSBHDARB /CDA

You can also get such games working without a CD drive if you additionally use the modded SHSUCDHD program. Basically in that case you'll have to convert a .bin/.cue image set for a Red Book game to a CD metadata (.CDM) + consolidated BIN format (I've included instructions for that in the modded SHSUCD release's README.txt). Then you will need to run:
1. SHSUCDHD /F:<path to CDM file>
2. SHSUCDX /D:SHSU-CDH /A:1
3. VSBHDARB /CDA

I'll edit this post with more details and instructions later on, but I hope this is sufficient info for you to get started. Please back up your DOS partition before trying it in a bare-metal DOS machine - I've not faced any issues so far on my own PC or 86Box VMs, but it's not possible for me to test it on all possible hardware configurations. So just to be safe, please back up.

Please let me know if you have any questions and I'll try my best to answer.

Demo for physical CD + modded SHSUCDX + modded VSBHDA: https://youtu.be/QUDK3KzQmc8

Acknowledgements
Thanks to Japheth for VSBHDA and authors of all programs that VSBHDA is based on or uses - SBEMU, VSBHDASF, DosBox, MpxPlay, TinySoundFont, etc. Thanks also to Jason Hood and John McCoy for their amazing work on the shsucd suite.

Limitations (as far as I'm aware of)
- The CPU does quite a bit of heavy-lifting in not just running the game and emulating digital audio, but also doing raw reads from the game CD and mixing that into the regular audio stream, so this probably won't work well on older computers with period-accurate processors
- Raw read speed also depends on the CD drive's speed, so performance may vary from one CD drive to another. e.g. in my case a SATA CD/DVD drive performed better than an IDE CD drive
- Modified SHSUCDX works with UIDE, UIDEJR and GCDROM drivers, but may not necessarily give CD audio functionality (even if invoked via appropriate flag during SHSUCDX initialization) with some other CD drivers. I'm not sure why that is but I'll try to figure it out eventually

Laaca

Homepage

Czech republic,
25.04.2026, 07:42

@ PCGamingTimeMachine
 

Digital CD Audio in DOS games via modified VSBHDA and SHSUCD

Does it work with CD/DVD images or it needs a physical disc and CD/DVD drive?

---
DOS-u-akbar!

Japheth

Homepage

Germany (South),
25.04.2026, 08:21

@ Laaca
 

Digital CD Audio in DOS games via modified VSBHDA and SHSUCD

> Does it work with CD/DVD images or it needs a physical disc and CD/DVD
> drive?

If you bother to read the readme you'll get the answer... :-D

---
MS-DOS forever!

PCGamingTimeMachine

25.04.2026, 10:53

@ Laaca
 

Digital CD Audio in DOS games via modified VSBHDA and SHSUCD

> Does it work with CD/DVD images or it needs a physical disc and CD/DVD
> drive?

Thanks for checking this out! It does work with images if you have more than 768 MB RAM. But not directly with .BIN/.CUE image sets - you'll have to convert them using a utility I included in the modified shsucd package.

As Japheth mentioned above, the instructions are in the readme file. Please et me know if you get around to trying it and how it goes

Japheth

Homepage

Germany (South),
25.04.2026, 08:20

@ PCGamingTimeMachine
 

Digital CD Audio in DOS games via modified VSBHDA and SHSUCD

Thanks!

Did a quick test of this variant with Quake Mission Pack 1 on a real machine with a real CD. It works, AFAICS.

I used newest JLM AHCICD; the SATA controller on the MB is "AHCI only", and supports memory-mapped access only - so no UIDEJR or GCDROM will probably work there.

---
MS-DOS forever!

PCGamingTimeMachine

25.04.2026, 10:57

@ Japheth
 

Digital CD Audio in DOS games via modified VSBHDA and SHSUCD

> Thanks!
>
> Did a quick test of this variant with Quake Mission Pack 1 on a real
> machine with a real CD. It works, AFAICS.
>
> I used newest JLM AHCICD; the SATA controller on the MB is "AHCI only", and
> supports memory-mapped access only - so no UIDEJR or GCDROM will probably
> work there.

Awesome! Thanks Japheth for testing this. I'm taking a temporary weekend breather and will be back to testing this with a few more releases next week. Let me know as and when you get the chance to review modified VSBHDA code, and maybe some time next month I can open a PR to merge with your main VSBHDA branch.

Also if you're testing this with more games, then please let me know if it's all good

Japheth

Homepage

Germany (South),
26.04.2026, 21:52

@ Japheth
 

Digital CD Audio in DOS games via modified VSBHDA and SHSUCD

> Did a quick test of this variant with Quake Mission Pack 1 on a real
> machine with a real CD. It works, AFAICS.

Now I tested the very same game on this same machine, but this time with an image file. It worked as well.

I also tried to test this on a P3 machine with 512 MB. With a real CD the game crashed immediately; the image variant won't work because the image driver wants to allocate 780 MB XMS memory. Perhaps this can be improved a bit, because the image is 320 MB only, so in theory it might be possible to run on that machine. It's of minor importance, of course, since on such machines you can usually just connect the CD drive with the sound card and so avoid all this extra work.

---
MS-DOS forever!

PCGamingTimeMachine

26.04.2026, 23:02

@ Japheth
 

Digital CD Audio in DOS games via modified VSBHDA and SHSUCD

> > Did a quick test of this variant with Quake Mission Pack 1 on a real
> > machine with a real CD. It works, AFAICS.
>
> Now I tested the very same game on this same machine, but this time with an
> image file. It worked as well.
>
> I also tried to test this on a P3 machine with 512 MB. With a real CD the
> game crashed immediately; the image variant won't work because the image
> driver wants to allocate 780 MB XMS memory. Perhaps this can be improved a
> bit, because the image is 320 MB only, so in theory it might be possible to
> run on that machine. It's of minor importance, of course, since on such
> machines you can usually just connect the CD drive with the sound card and
> so avoid all this extra work.

Absolutely, I'll add memory to be allocated as a command line flag so maybe that'll help. But I'm more interested in the real CD crash. What game is this? Another thing I should mention is that performance (even stability) depends quite a bit on 3 parameters I have defined in CDAUDIO.H - SHARED_SLOT_SECTORS, AUDIO_BUFFER_SIZE and AUDIO_BUFFER_PREFILL_BYTES. I should also probably add them as cmd flags but for now I've hardcoded them.

That's a possible culprit off the top of my head but if you can let me know which game it was, I'll test it out on my end and see if it works for me

Zyzzle

27.04.2026, 05:28

@ PCGamingTimeMachine
 

Digital CD Audio in DOS games via modified VSBHDA and SHSUCD

> Absolutely, I'll add memory to be allocated as a command line flag so maybe
> that'll help.
You could also implement a kind of round-robin "dual" buffer of a few MB where you'd be filling up the buffer a 5-10 seconds at a time in a revolving fashion with .PCM audio. This way you wouldn't need to pre-allocate any extra XMS beyond, say 4 MB maximum.

Most modern systems with gobs of memory can of course allocated a full CD at a time, but vintage systems certainly can't. You're limited to as little as 4 or 8 mb total system memory on some of them. Indeed, the game itself will need to allocate its memory in addition. So, we're likely looking as 8mb total extended memory as the minimum where your program will even run with a CD image with redbook audio.

Then SBEMU / VSBHDA has its memory requirements and CPU overhead also.

PCGamingTimeMachine

27.04.2026, 09:46

@ Zyzzle
 

Digital CD Audio in DOS games via modified VSBHDA and SHSUCD

> > Absolutely, I'll add memory to be allocated as a command line flag so
> maybe
> > that'll help.
> You could also implement a kind of round-robin "dual" buffer of a few MB
> where you'd be filling up the buffer a 5-10 seconds at a time in a
> revolving fashion with .PCM audio. This way you wouldn't need to
> pre-allocate any extra XMS beyond, say 4 MB maximum.
>
> Most modern systems with gobs of memory can of course allocated a full CD
> at a time, but vintage systems certainly can't. You're limited to as little
> as 4 or 8 mb total system memory on some of them. Indeed, the game itself
> will need to allocate its memory in addition. So, we're likely looking as
> 8mb total extended memory as the minimum where your program will even run
> with a CD image with redbook audio.
>
> Then SBEMU / VSBHDA has its memory requirements and CPU overhead also.

Thank you! I'll have a look at this approach after I've tested the current version a bit more extensively (in terms of multiple games).

But here was my rationale: generally vintage systems would anyways have the capability to run DOS games with full analog audio. My idea was to make this targetted to more modern systems since PCI cards generally don't have native DOS drivers, so even with an analog connection between CD drive and sound card, it's still not possible to get CD audio on the modern systems. Vintage systems (generally) would have, say, an ISA slot into which one could put a sound card sith native DOS support and connect it to CD drive. On the other hand, even more modern systems may not even have PCI slots, but if they have onboard audio with VSBHDA support, then this set of modified programs would be useful to get that full DOS audio.

Not saying that I won't try to implement the dual buffer approach you suggested, but just wanted to explain why (at least for the first pre-alpha) I decided to just assume that target modern systems would have sufficient memory. Hope it makes sense :-D

Zyzzle

28.04.2026, 02:25

@ PCGamingTimeMachine
 

Digital CD Audio in DOS games via modified VSBHDA and SHSUCD

My idea was to make
> this targetted to more modern systems since PCI cards generally don't have
> native DOS drivers, so even with an analog connection between CD drive and
> sound card, it's still not possible to get CD audio on the modern systems.
> Vintage systems generally) would have, say, an ISA slot into which one
> could put a sound card sith native DOS support and connect it to CD drive.
> On the other hand, even more modern systems may not even have PCI slots,
> but if they have onboard audio with VSBHDA support, then this set of
> modified programs would be useful to get that full DOS audio.
>
> Not saying that I won't try to implement the dual buffer approach you
> suggested, but just wanted to explain why (at least for the first
> pre-alpha) I decided to just assume that target modern systems would have
> sufficient memory. Hope it makes sense :-D
Yes, your rational makes complete sense. Personally, my only use will be on "modern" systems with no PCI slots, no audio cables, no CD-ROM or DVD physical drives. Therefore, your program adds great functionality to these modern 'castrated' systems. It's now possible to have the full vintage DOS experience with 30-year-old DOS CD games on modern systems - bare metal - with VSBHDA / SBEMU, SHSUCD and your wrapper. Outstanding, a miracle, really. I like staying baremetal as much as possible, and abhor emulators such as DOSBOX, etc. For raw speed and elimination of additional abstraction layers and long loads, etc.

However, there are many others who will want to try and get this working with vintage systems. I was thinking of those traditional DOS users.

PCGamingTimeMachine

28.04.2026, 12:40

@ Zyzzle
 

Digital CD Audio in DOS games via modified VSBHDA and SHSUCD

> Yes, your rational makes complete sense. Personally, my only use will be on
> "modern" systems with no PCI slots, no audio cables, no CD-ROM or DVD
> physical drives. Therefore, your program adds great functionality to these
> modern 'castrated' systems. It's now possible to have the full vintage DOS
> experience with 30-year-old DOS CD games on modern systems - bare metal -
> with VSBHDA / SBEMU, SHSUCD and your wrapper. Outstanding, a miracle,
> really. I like staying baremetal as much as possible, and abhor emulators
> such as DOSBOX, etc. For raw speed and elimination of additional
> abstraction layers and long loads, etc.
>
> However, there are many others who will want to try and get this working
> with vintage systems. I was thinking of those traditional DOS users.

I see what you mean. Btw the round robin dual buffer approach - earlier I thought you were talking about using it for enabling CD audio from images. A double buffer approach is already implemented in the current version for physical CD path (just that these buffers aren't in XMS). So if you use physical CD + modded shsucdx + vsbhda, then that scenario does use two buffers - one in conventional memory and the other in DPMI protected mode memory.

But if you indeed meant using a dual buffer approach for the CD image path, I guess that would involve doing file (i.e. image file) reads from shsucdhd while the game is running, and then putting that in XMS on the fly. I will keep this in mind..

My concern is that when I run my current version of shsucdhd + shsucdx + vsbhda in an 86box VM (allotted 2 gb RAM), even then it runs slowly, which may be a problem. Certainly the dual buffer approach would be a bit heavier on the CPU since it's using less memory. What do you think?

Zyzzle

29.04.2026, 01:30

@ PCGamingTimeMachine
 

Digital CD Audio in DOS games via modified VSBHDA and SHSUCD

>
> But if you indeed meant using a dual buffer approach for the CD image path,
> I guess that would involve doing file (i.e. image file) reads from shsucdhd
> while the game is running, and then putting that in XMS on the fly. I will
> keep this in mind..
>
This is what I meant. Doing reads from shsuchd on the fly while game is running, as opposed to loading the entire image into memory at once and allocating the full 768 mb of XMS

> My concern is that when I run my current version of shsucdhd + shsucdx +
> vsbhda in an 86box VM (allotted 2 gb RAM), even then it runs slowly, which
> may be a problem. Certainly the dual buffer approach would be a bit heavier
> on the CPU since it's using less memory. What do you think?
There may be some slight additional CPU usage, but the read rate is constant: 176 kb per sec as 16 bit / 44.1 Khz PCM audio. The memory allocated, whether it's 2-4 MB XMS or 768 XMS will not change the constant read rate of the .wav track. But, you'll just be reading several "chunks" of the audio via a revolving "endless tape" XMS buffer instead of reading it all at once. I think the extra CPU load wouldn't be more than about 5% extra, at the most, even on a slower system.

Japheth

Homepage

Germany (South),
27.04.2026, 16:55

@ PCGamingTimeMachine
 

Digital CD Audio in DOS games via modified VSBHDA and SHSUCD

> What game is this?

It's Quake Mission Pack 1 "Scourge of Armagon", the same game that I tested successfully on a newer system.

But I don't think the actual game really matters - it's probably more important whether the optical drive can read the CD without retrys/errors. On that P3 machine there's just an old Sony CRX220A attached, which apparently has problems with that quake cd.

It's strange, because that Quake CD is in very good shape (virtually unused ) and OTOH the drive has no problems at all with 40 year old audio CDs...

---
MS-DOS forever!

Back to index page
Thread view  Board view
23342 Postings in 2199 Threads, 406 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum