1)
The code for SHSUCDX is available for free. Instead of trying to monkey in the middle against it, we can just have it respond to the game's Play, Stop, and Resume messages by sending a private API message, such as writing on a bit of mutually-agreed scratchpad memory with some flags, and sending IO port messages.
Sourcecode can be found (at least a fork of it anyway) here: https://github.com/adoxa/shsucd
This means we dont need to trap any IO writes to catch this message from the game. SHSUCDX is already trapping for these messages. Since SHSUCDX is able to play redbook audio, it is already listening for, and responding to these messages. Instead, we need a way to instruct SHSUCDX that it should not attempt to tell the downstream interface driver to do redbook playback, as a command line option on load. This would deactivate that codepath, and activate the digital playback codepath instead. This new codepath looks for VSBHDA to be loaded first, by scanning for its device driver identifier name, then creating the scratchpad, allocating XMS buffers, then signalling to VSBHDA that it has loaded, and is ready to coordinate digital audio extraction for playback. If it does not find VSBHDA, it should alert this error condition to the console output, then default to normal redbook audio behavior.
2)
Since SHSUCDX is the primary handler for accessing cdrom drives in this scenario, any request for data of any kind from a program that involves a CDROM will go through it first. This makes it the ideal candidate to leverage. When a game issues the Play, Stop or Resume commands, SHSUCDX handles this request. If the "Do Digital Extraction method" codepath is activated from its load arguments, then it will inspect the play command for track number and position, read the cd's TOC to find that track, allocate both playback buffers from XMS, populate both playback buffers at this time, then communicate to VSBHDA by creating the shared communication scratch pad, and writing the needed information in it, then communicating the location of this scratchpad to VSBHDA with an IOport write. It will then set up a polled timer interrupt to read this pad, and make actions accordingly, or write on this pad to communicate with VSBHDA, accordingly.
Things in the scratch pad:
A bitfield, containing:
Currently active buffer [1/0] [Which XMS playback buffer is currently being read by VSBHDA? 0, or 1?]
Playback requested [1/0] [Has SHSUCDX requested that redbook audio should be getting played from the buffer? Yes/No]
currently playing [1/0] [Is VSBHDA currently playing redbook audio? Yes/No]
Restart at top of next buffer [1/0] [This is used to tell VSBHDA that it should stop playing this buffer, and immediately switch to the next buffer, then resume playing. VSBHDA sets this to 0 after completion. It's used when say, a game switches the redbook audio play location suddenly. This allows SHSUCDX to load the new play location data into the inactive buffer, then trigger VSBHDA to stop what its doing on the active buffer, and switch.]
SHSUCDX has topped up buffer [1/0] [When VSBHDA switches the buffer, it sets this to 0. SHSUCDX monitors for this bit, and then knows it needs to populate the now inactive buffer while VSBHDA is playing the active one. Once it is populated, it sets this to 1. This lets VSBHDA know it is OK to switch to the inactive buffer when it runs out.]
VSBHDA ready/error status [1/0] [VSBHDA sets this to 1 after it has received the initial IO port message containing this table, and configured itself for redbook playback, and is read to get messages from SHSUCDX. If any kind of error condition happens, it lets SHSUCDX know that things are amiss by setting this to 0]
SHSUCDX ready/error status [1/0] [SHSUCDX sets this to 1 when it starts its monitoring loop for this scratchpad. If something odd happens, like an unrecoverable media error, it sets this to 0, to let VSBHDA know that it cannot service the buffer.]
Write on scratchpad OK [1/0] [Writes on the scratch pads are OK to do if this value is 1, and forbidden/"presumed to be locked by the other process" when this is set to 0]
Long values containing the XMS handles of Buffer 0, and Buffer 1.
to initiate communication with VSBHDA, an IOport is written to that is monitored by VSBHDA. This IOwrite contains a message stating where the scratchpad is located in low memory. (memory owned by SHSUCDX, but which is OK to be written on/checked, by VSBHDA.)
2a)
VSBHDA monitors for this message, and when it gets it, it knows it needs to service digital CD audio. It locates the scratchpad from the message, then reads or writes on it using a polled interrupt, or after so many samples of PCM are played, to make sure it should continue. It reads the XMS handles for both buffers, and configures itself for playback, then waits.
SHSUCDX then is in charge of telling VSBHDA to start, stop, or resume playback, loading data into the buffers, setting bitflags when it has loaded data into a buffer, or when it has encountered an error.
VSBHDA is in charge of designating the currently active buffer, playing the buffered audio, requesting that the inactive buffer be filled, reporting its current playback status, and reporting its error condition.
They coordinate to avoid race condition by the use of the Write On Scratchpad bit. If this bit is 0, it means the other process is doing something with the scratch pad.
3) and 4) are wholly the job of VSBHDA
I am CERTAIN I have missed something, because I have not fully flowcharted out the logic for this. That should give a very basic skeleton to hang meat on though.