VOGONS


Wobbly sound in latest CVS build?

Topic actions

First post, by jez

User metadata
Rank Member
Rank
Member

Hi, I just downloaded the CVS build from 2006-02-18 from CVS-Compile and tried running Colonization in it. Oh dear.

Seems there's been a sound regression; all I can describe the Adlib music as is 'wobbly'. Very very strange sounding. When I change from dynamic core to normal, all that happens is that the 'wobbly' music is a few keys lower. Maybe this is a timing problem?

== Jez ==

Reply 1 of 21, by jez

User metadata
Rank Member
Rank
Member

Another thing I just realised (another apparent regression from 0.63) is that when I'm using MIDI, in Tyrian setup, the music plays at the right speed on the 'jukebox' screen with the moving stars, but go back to the menu and it starts playing too slowly.

I dunno if these are regressions or just something to do with the way these unofficial builds are compiled, compared to the last official release.

== Jez ==

Reply 3 of 21, by jez

User metadata
Rank Member
Rank
Member

How weird.

Well, is there a way I can get it back to skipping again? I don't like wobbly sound.

Also, if that's the case, the sound should be OK again if I take DOSbox way down to 500 cycles, right? Because there's much more CPU time for the sound mixer. Yet, even with Colonization running at 500 cycles, I get wobbly sound.

== Jez ==

Reply 4 of 21, by Jiri

User metadata
Rank Member
Rank
Member
gulikoza wrote:

The "wobbly sound regression" is actually an intended modification of the sound mixer. Instead of sound skipping, it slows down...

Problem is that it doesn´t work well with some games. I attached a sample from the game The Dark Half in CVS (sound slows down if I change a location) but I have perfect sound in 0.63 with the same settings (core, cycles etc.). Could this new mixer feature be at least optional?
BTW: I could not capture wobbling sound with DOSBox (I used external tool) because sound was good without any slowdowns after capturing.

Attachments

  • Filename
    Dark Half.mp3
    File size
    87.33 KiB
    Downloads
    271 downloads
    File license
    Fair use/fair dealing exception

Reply 5 of 21, by ChaosFish

User metadata
Rank Member
Rank
Member

jez - I opened this same thread in the beta testers forum a few days ago...
For me this only happens when I set cycles=auto (both in Normal and Dynamic).

Reply 8 of 21, by Alkarion

User metadata
Rank Member
Rank
Member

Hmm, handling the sound so it stays synchronized seems to be quite a problem. I'm not entirely against the new method, since short slowdowns may not be as annoying as skips. However, the sample from Colonization shows that perhaps the solution is not yet optimal. Though Colonization seems to be quite demanding considering it's still 320x200.

Reply 9 of 21, by jez

User metadata
Rank Member
Rank
Member

Not optimal? Give me skipping over that tripe *anyday*. Whatsmore, it is screwed up no matter what you do. In 0.63, I get perfect sound (no skipping) at the same rate as that sample was taken from on the latest CVS.

== Jez ==

Reply 10 of 21, by Lofty

User metadata
Rank Member
Rank
Member

Heh. When this "feature" was added, I thought it was a bug 'till I noticed it only happened when dosbox couldn't keep up, and I realised it was probably intentional. It's an interesting solution to sound-skipping - I've never seen any other emulator with this feature! Definitely needs to be optional though, cos it sure makes things sound strange! Maybe it could be improved so as to stretch the sound, without changing the pitch, though I think that would be more CPU intensive.

Reply 11 of 21, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

well you didn't get perfect sound in 0.63 you got sound which was played at different speeds.
which you probably didn't notice (especially dma sound effects).

I must say that your sample of colonization sounds particulary weird. You don't have some program running in the backround which occasionally becomes active ?

Dosbox doesn't correct anymore for losses in the soundplayback. (it used to do that by speeding it up(the interval at which dosbox generated the sound got smaller). So if you have very irregular sound at this moment. Then the sound generating code is called at very irregular moments.

I'm not very sure what is going on your pc.
Those spikes in the sound I can explain. (I found that "bug")
Although I don't exactly understand what is going on your pc.
Could you post a long sample of colonization (while in game ? not the intro) with cpu cycles set to 5000 (if you can't handle that 3000)

Water flows down the stream
How to ask questions the smart way!

Reply 12 of 21, by jez

User metadata
Rank Member
Rank
Member

Yep, attached is another colonization sample. The dodgyness at around 2:20 is me dragging the dosbox window, dont mind that. But it sounds very wrong. During the sample I took it down to 5000 cycles, and then ramped it back up to 25000 cycles. I doubt you can tell when I did that, because there was no change to the sound at all; as I said, it does this wobbliness regardless.

I've also attached a sample of Transport Tycoon to show that it seems to be happening for all games using Adlib sound (and I've noticed it with SoundBlaster digitized sound too). The second Tycoon sample is how it sounds with 0.63; it appears to be 'perfect' once I'm ingame. I know there's a bit of skipping but actually there's usually none; perhaps CoolEdit being open was causing it, I dunno. Anyhow it certainly sounds better than with wobbly sound.

By the way, in the latest DVS examples, my CPU isn't at all maxed out; it's around 60%.

Qbix:attachments removed

== Jez ==

Reply 15 of 21, by Lofty

User metadata
Rank Member
Rank
Member

Qbix: I'm curious - How does digital sound generation in dosbox work?
I assume dosbox does X cycles, then handles all the interrupts, including generation of sound. If cycles is set too high, not enough sound data is generated for that time period which is the cause of the skipping (old method) or pitch/speed drop (new method). Don't understand why the same thing happens with adlib though, because isn't adlib command-driven like general midi? (which would cause the music to slow down like for GM, but not the actual sample speed/pitch).

Reply 16 of 21, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Lofty:
Sound generation in DOSBox is quite bit more complicated.
Technically:
Dosbox calculates on a high resolution timer every now and then a few sound samples.
(I recall around 20-40).
Aside from this there is a call from SDL that requests sound data every now and then (for 2048 samples).
At that moment DOSBox uses the precalculated data. If there isn't enough.

OLD CASE:
It used to skip AND increase the speed of the high resolution timer. So that the next time more data is available. The skipping increases the amount of data as well! (as the allready generated data stays)

New Case:
If there isn't enough:
It stretches the available data (which is a tiny bit bugged (algorithm wise)).
And continues. (well technically it sometimes stretches the data itself in order to create a small prebuffer). As there are no skips anymore the data will not be restored with it.
And there is no increase in the generation speed of the new data.

The increase of the generation speed could resulted in DMA sounds being played at the wrong speed.

I think I will send Jez a debug version of dosbox with some log messages in it.
If he plays colonization with it I'm quite sure I can see in the logs the exact moments of the sounddistortion. Perharps I can figure out why happends so often at his place.

Water flows down the stream
How to ask questions the smart way!

Reply 17 of 21, by Jiri

User metadata
Rank Member
Rank
Member

I noticed in some games that it is possible to have higher cycles without a sound problem with the old mixer. For example in intro of Colonization I have good sound in DOSBox 0.63 at 2500 cycles (normal core, Adlib) while in CVS with changed mixer I must go only to 800 cycles.
Also some games need to be little overcycled to the point where sound is not perfect so they are playable at decent speed. I don't mind much if sound skips occasionally in them, but wobbling is simply terrible.
I can build DOSBox with the old mixer but I still think that an option in config would be useful for those who don't like wobbling sound and don't know how to build DOSBox.

Reply 18 of 21, by jez

User metadata
Rank Member
Rank
Member

Another thing I'm noticing is that the MIDI in Tyrian's setup.exe is going noticeably slower on the menu bit than it is on the 'jukebox' bit, in the latest CVS. However, in 0.63, it stays at the same speed in both screens. When I take the CPU cycles right down in the latest CVS, it does speed up again, but at the same number of cycles and frameskip as I use in 0.63 (25000, 0) the MIDI is a lot slower on the menu screen.

Is anyone else getting this?

== Jez ==