VOGONS


First post, by fruktsoda

User metadata
Rank Newbie
Rank
Newbie

Basically, every time I start certain games like Xargon it maxes all my mixer volumes making it really obnoxious if you forget to adjust the volume beforehand. I read somewhere here that temporary changing your SET SOUND setting to some bogus directory could prevent this, but that didn’t work for me. Also tried different versions of sb16set and mixerset, but no difference there either.

Anyone got any other suggestions, or are you stuck with this when gaming in pure DOS?

EDIT: This is using a SB16 model CT2290.

Reply 1 of 12, by Tiido

User metadata
Rank l33t
Rank
l33t

There isn't anything that can prevent games from messing with the mixer on existing cards unfortunately. In theory EMM386 based solution could be made that traps writes to the mixer and makes them ineffective but someone will have to make such a thing first. Hardware based solution is also possible, but it needs to be a middleman type card that sits between ISA slot and the card in question or an actual modification to some sound card. I intend to have mixer locking on the next version of my YMF71x based sound card.

T-04YBSC, a new YMF71x based sound card & Official VOGONS thread about it
Newly made 4MB 60ns 30pin SIMMs ~
mida sa loed ? nagunii aru ei saa 😜

Reply 2 of 12, by georgel

User metadata
Rank Member
Rank
Member

Much simpler approach that will work even on XT machines is to periodically overwrite persistent mixer settings 😀 I am not much of a game player but how exactly do the games disrupt the mixer settings?

By the way from all EMMs EMM386 sucks and its IO trapping API won't do any good with protected mode software that uses DOS extenders.

Reply 3 of 12, by Tiido

User metadata
Rank l33t
Rank
l33t

Games just write the mixer registers directly as part of their initialization.

Timer interrupt could be used to restore mixer settings periodically but it comes with its own problems such as loss of performance and games themselves hijacking the interrupt for their own purposes and not necessarily calling the original handler. I am not sure what effects will periodic poking of these registers mid-playback will do either.

T-04YBSC, a new YMF71x based sound card & Official VOGONS thread about it
Newly made 4MB 60ns 30pin SIMMs ~
mida sa loed ? nagunii aru ei saa 😜

Reply 4 of 12, by georgel

User metadata
Rank Member
Rank
Member

Performance loss is practically absolute zero unless you decide to refresh the values thousand of times per second which is meaningless. Especially considering the CPUs speed difference in the PC world mentioning the performance loss is simply a theoretical chewing gum . Plenty of interrupt sources to use, not only the timer one. Which games do not reflect the interrupt handler's chain (and of what interrupt number)? And which of the latter overwite the mixer regs in the way that makes you unhappy? And what happens when the games set up the mixer regs with their own values that was my question, not how the games do it.

Reply 5 of 12, by aitotat

User metadata
Rank Member
Rank
Member
Tiido wrote on 2021-10-23, 04:48:

In theory EMM386 based solution could be made that traps writes to the mixer and makes them ineffective but someone will have to make such a thing first.

I was already planning to add such option to MIDIto along with few other Sound Blaster related stuff that require messing with mixer settings. But the locking would have to be only for master volume and inputs since games can use the mixer for effects. Like that is how Wolf3D creates stereo effects. But all the other mixer volumes could be restored when game exits.

But the biggest problem of course is that the port trapping won't work with protected mode games.

Reply 6 of 12, by Tiido

User metadata
Rank l33t
Rank
l33t

There is only one interrupt that just happens periodically which is the timer one, and it is usually repurposed to game's own tasks. It doesn't matter what games don't call the original handler (Pinball Fantasies is one such, which also maxes out the mixer), only that there are games that don't making it not an universal solution. Some games also mask out all interrupts they don't need such as Tyrian 2000, which for example breaks SW20PC sound card's MIDI emulation as the emulation IRQ is no longer seen by the TSR. Sonud card's own IRQ is always fully hijacked and games assume there is no original handler that could be called so it isn't an option either. Keyboard interrupt is often hijacked without original being called, i.e games where CTRL+ALT+DEL or other global shortcuts not functioning.

The effect of the hijacked mixer results in stuff such as music (FM, MIDI) being too loud or too quiet in relation to other sounds, or stuff like excess noise as line in and/or microphone inputs got enabled and maxed.

Performance concern applies especially to the XT example, where every cycle does matter. It is also unknown what effects will the periodic mixer access do, I wouldn't be surprised that it will upset the DSP when timer fires between DSP accesses etc.

T-04YBSC, a new YMF71x based sound card & Official VOGONS thread about it
Newly made 4MB 60ns 30pin SIMMs ~
mida sa loed ? nagunii aru ei saa 😜

Reply 8 of 12, by retardware

User metadata
Rank Oldbie
Rank
Oldbie

This makes me think of my DOS screensaver I wrote in 1990.
Iirc the MS mouse driver always fought to get the mouse interrupt, so I had to add functionality to check that the mouse interrupt still pointed to the screensaver.
If the screensaver found at the timer interrupt routine that the mouse driver had "stolen" the interrupt handler, the screensaver had to take it back again.

So maybe such a mixer reset TSR could work if it does multiple interrupt handlers (eg timer, kbd, mouse) and always make sure it does not get "pushed out of control".

Q: Are the mixer registers readable, so that they can be polled to only reset them if they have actually been changed (to avoid potential playback distortion problems)?

Reply 9 of 12, by Tiido

User metadata
Rank l33t
Rank
l33t

Yes, the registers are readable.

T-04YBSC, a new YMF71x based sound card & Official VOGONS thread about it
Newly made 4MB 60ns 30pin SIMMs ~
mida sa loed ? nagunii aru ei saa 😜

Reply 10 of 12, by georgel

User metadata
Rank Member
Rank
Member
retardware wrote on 2021-10-28, 15:00:

So maybe such a mixer reset TSR could work

Of course it will work. But I have consulted a friend of mine who is a retro gamer and a sound maniac having original Roland synths, plus having contemporary dream blaster module(s) (100 % useless stuff to me), etc. and he informed me the issue was too insignificant and not worth the effort. Most games don't suffer that problem at all.

Reply 11 of 12, by digistorm

User metadata
Rank Member
Rank
Member

It is only problematic if you own a SB revision that has a crappy mixer chip that will clip in the analogue domain when you maximize the volume of the DAC.