VOGONS


First post, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

Hello 😀
I've been trying for quite a while now to get Eric the Unready's digitized sound working under DosBox to no avail. The sound card is detected, yet when digitized sound is meant to play, all I get is a sound drop and some crackles. Just like this video:
https://youtu.be/c2Dt7PtV1E0?t=3m29s
I've tried setting the music to Sound Blaster instead of MT32, no difference.
I've tested the game using the official DosBox 0.74 and my own build that's usually up to date with SVN (except for the latest PC speaker patches that break another patch that fixes PC speaker sound in Commander Keen and games that use similar PC speaker interface).
Eric's sound works properly in PCEM...but no MT32 there. SoftMPU can, indeed, make MUNT work...but when the digitized sample plays, the sound is not correct and the MIDI note hangs (probably due to it using the same IRQ as the emulated Sound Blaster 16 😖).
Has anybody actually managed to get digitzed sound working in that game? If so...how? Am I stuck with PCEM and adlib sound? If anyone has a suggestion or fix, thanks in advance 😀.

Reply 1 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The sound effects are loud and clear for me with default settings in 0.74 and SVN when I run the game with: ERIC BLASTER

This is with the version in "The Lost Adventures of Legend" collection, maybe you have a different version.

Reply 2 of 16, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

Same version actually. I just tried it with plain BLASTER (no IRQ or address like install sets legend.bat to start and no MT-32) and while the beginning of the sample now plays, by the end it's all garbled, easily tested with the very first "pigs" sample, also with the cows in the barn. Tested both 0.74 and my SVN build.

Edit: I just reinstalled the game from the CD, since I made a new install under PCem and there it works right...same result.

Reply 3 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Well, this seems like progress over "a sound drop and some crackles". For me there are pops at the start and end of sounds, but nothing I would refer to as "garbled". I've already mentioned default settings, so I hope you aren't overlooking that part.

Reply 4 of 16, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

Nope, started DosBox 0.74 "out of the box" (except, obviously, for mounts) and yep, pops at beginning and end as well as sound garbling.
I've uploaded 2 files, one from PCem and one from DosBox...the DosBox one's rather useless, the pigs aren't even there...but recording them did show something interesting...they seem to be some sort of inverted rectified waves, that could account for the pops, for reference I also recorded a small Sam and Max clip with digitized voices only and I include a graph: the top is the Sam and Max clip (i.e how a sample should look); the middle is the PCem one (no clipping distortion) and the bottom is DosBox (probably the reason for the sound being garbled: clipping distortion, most likely and the reason no sample was recorded). When editing audio it is ideal to cut it when the wave's going negative (and even then you'll likely have to crossfade it), the game most likely doesn't know when that's happening (even today it usually takes a human to do that) so if we combine that along with their odd way of presenting samples...that could explain both problems, the distortion's likely to be corrected by lowering the volume (but not the popping). I'll experiment and report my findings 😉.

Attachments

  • waves.png
    Filename
    waves.png
    File size
    33.63 KiB
    Views
    2056 views
    File license
    Fair use/fair dealing exception
  • Filename
    samnmax.ogg
    File size
    90.05 KiB
    Downloads
    71 downloads
    File license
    Fair use/fair dealing exception
  • Filename
    dosbox.ogg
    File size
    18.33 KiB
    Downloads
    71 downloads
    File license
    Fair use/fair dealing exception
  • Filename
    pcem.ogg
    File size
    49.35 KiB
    Downloads
    93 downloads
    File license
    Fair use/fair dealing exception

Reply 5 of 16, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

Indeed, lowering the volume using the sb pro mixer fixes the issue, the popping's still there but, obviously, not as noticeable.
Thanks for all your help and I hope this thread serves someone, somewhere in the future solve the issue as well.

Reply 6 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

What I hear is in the attached audio file captured with DOSBox and compressed with oggenc to make it smaller. How your result is so different is a mystery to me.

When you make statements like "lowering the volume using the sb pro mixer fixes the issue" I have to wonder what you aren't explaining about what you're doing. What does an "sb pro mixer" have to do with this issue? DOSBox emulates an SB16 with default settings. Are you not using DOSBox's mixer? Shouldn't need to fiddle with any kind of mixer, anyway, as the attached audio file was made in 0.74 with everything at default.

Attachments

  • Filename
    eric_000.ogg
    File size
    104.22 KiB
    Downloads
    72 downloads
    File license
    Fair use/fair dealing exception

Reply 7 of 16, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

The important issue to understand is is to look at the graph.
Essentially, for example, what a distortion pedal does to a guitar signal is chop the peaks off the sine waveform, to make it a square, with that in mind, when an audio signal clips, among other things, it causes the distortion I was experiencing (true enough, if you look at the graphs, the DosBox signal is, effectively, a square...), the rest is compounded by the inverse rectified wave (a rectified wave usually goes "up" not "down", a speaker "pumps" on the "ups" [or positives]). If you have access to one, lots of mixing consoles have a "polarity invert" switch, play some audio you like before and after activating the feature and hear the difference. It has several uses, equal waves, after all, cancel each other out, so you could use it to, say, record a drum kit in some instances. Thing with the game is...there's no "equal" wave playing in front and at the same time...so it really is a mystery to me why the game plays audio that way.
Hearing your recording, there's a rather clear the distortion at the end, along with the pops (we knew already they're there, but I explained why they are there in my previous post), why the result is different could be attributed to a number of things, I'm thinking "built in internal audio": you're probably using it (I'm not), in my experience some built in audio chips do funny things to a signal, for instance...it compresses it at times, effectively (usually) negating the clipping effect. Want clipping audio to stop it? Just lower the gain (or volume) until it is no longer a square.
Can this be negated by DosBox? Yep, just adjust the mixer
Can this be negated by DosBox out of the box? Of course, just set the mixer to start at lower levels at compile time (and this could probably fix some clipping in other games, out of the box).
Why is the sb pro mixer inserted in the err...mix? Well I wanted a solution that I could use from the command line within DosBox. From the DosBox wiki "MIXER is an utility that makes DOSBox display its current volume settings." just now I realize that despite the wiki being err...unclear, to say the least, the DosBox mixer can probably be a perfect substitute for the SB Pro Mixer, perhaps the wiki should be made clearer, for example, "MIXER is an utility that can display and adjust DOSBox's volume settings"
The Sound Blaster Pro mixer has nothing to do with the cause of the issue, but its solution I deemed useful to me that point in time. (As explained above there are several paths for fixing it, actually).
I hope this makes it clear.

Reply 8 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I'm thinking "built in internal audio"

My audio attachment was made with the wave capture function in DOSBox (Ctrl-F6), and how the host renders audio is irrelevant for that. Are you recording some other way?

The pops in the audio are the result of Legend's "RealSound Technology" writing samples with a DC offset and DOSBox's tendency to move back towards the center to help avoid clipping when all of its various emulated sound devices are mixed into a *single* waveform. Any game that writes samples with a DC offset may have pops to some extent.

Reply 9 of 16, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Just to make sure, and I couldn't see it in the wall of text, are you using SVN of Dosbox? And if so, straight SVN or some other flavor (e.g. Yhkwong's built)?

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 10 of 16, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

Both 0.74 official and my own build, the samples were recorded with the official one.
Edit: For the sake of completeness, here's how it looks when recorded with the internal thingie. Zooming in the graph, indeed, shows a number of clipped parts.

Attachments

  • Clipboard-1.jpg
    Filename
    Clipboard-1.jpg
    File size
    18.36 KiB
    Views
    2004 views
    File license
    Fair use/fair dealing exception
Last edited by bloodbat on 2016-03-04, 15:58. Edited 2 times in total.

Reply 11 of 16, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie
ripsaw8080 wrote:

I'm thinking "built in internal audio"

My audio attachment was made with the wave capture function in DOSBox (Ctrl-F6), and how the host renders audio is irrelevant for that. Are you recording some other way?

It's, definitely, not irrelevant at all and I recorded using the sound card's stereo loopback, not DosBox's internal thingie. Why? Because the loopback is what I'm actually hearing (or not) not what's being renderered.

Reply 12 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Yes, that's the DC offset you see in your graph, although more exaggerated than what's in my capture.

This is what the waveform in my capture looks like -- that horrible offset, no wonder it pops.

dc_offset.png
Filename
dc_offset.png
File size
931 Bytes
Views
1999 views
File license
Fair use/fair dealing exception
bloodbat wrote:

It's, definitely, not irrelevant at all and I recorded using the sound card's stereo loopback, not DosBox's internal thingie. Why? Because the loopback is what I'm actually hearing (or not) not what's being renderered.

ripsaw8080 wrote:

My audio attachment was made with the wave capture function in DOSBox (Ctrl-F6), and how the host renders audio is irrelevant for that.

Do you see the "for that" on the end of my sentence? It's irrelevant for the wave capture in DOSBox. I never said it was irrelevant to anything else.

On my system what DOSBox captures into a wave file sounds about the same as what comes out of my speakers. It seems your system is adding something... extra, and unwanted.

Reply 13 of 16, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

I didn't record the video in my original post, actually I found it when trying to figure out if it happened to someone else. The video exhibits basically the same symptoms...the odds of the guy having the exact same setup as me are rather low. In any case, at least for me, the problem's solved.

Reply 14 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Heh, but that's just it, I can hear the sound effects in that video with no problem (other than the pops) on my system. There is something about that kind of waveform and your sound hardware/drivers. But, if lowering the volume helps in your case then it might help others.

Reply 15 of 16, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

Just for the sake of completeness, I captured the output of the internal audio card. Indeed, sound plays fine using that one.

Attachments

  • internal.jpg
    Filename
    internal.jpg
    File size
    162.86 KiB
    Views
    1890 views
    File license
    Fair use/fair dealing exception

Reply 16 of 16, by realnc

User metadata
Rank Oldbie
Rank
Oldbie

That waveform makes mixing and/or resampling (or applying EQ) difficult for the driver. I would be surprised if you actually didn't get glitches when playing it on a system that doesn't give exclusive audio access to the game. Lowering the volume gives the driver more headroom to convert/mix the audio, which is why the glitches go away at lower volumes.