Opened 16 years ago

Closed 16 years ago

Last modified 10 months ago

#1087 closed defect (fixed)

SIMON1/2: Sound problems

Reported by: Kirben Owned by: fingolfin
Priority: normal Component: Engine: AGOS
Keywords: Cc:
Game: Simon the Sorcerer 1

Description

Using ScummVM 0.5.3cvs.
English versions of Simon the Sorcerer 1 and 2.
Compiled under mingw with GCC 3.2.3 and running under
Windows XP.

simon1talkie sound effects/speech and
simon1win sound effects/speech
cause the following error:
Assertion failed: input.isStereo() == stereo, file
sound/rate.h, line 81

simon2talkie sound effects/speech and
simon2win sound effects/speech
are been played back too fast.

The problems don't occur when using mp3s for sound
effects/speech.
The problems don't occur in 0.5.0cvs branch.

Ticket imported from: #780167. Ticket imported from: bugs/1087.

Change History (26)

comment:1 Changed 16 years ago by eriktorbjorn

I've committed a partial fix that seems to stop it from
crashing, but I think the sounds play at the wrong rate.

comment:2 Changed 16 years ago by fingolfin

Status: newclosed

comment:3 Changed 16 years ago by fingolfin

Resolution: fixed

comment:4 Changed 16 years ago by fingolfin

Fixed. And let me point out, it wasn't my fault this time <g>

comment:5 Changed 16 years ago by Kirben

Status: closednew

comment:6 Changed 16 years ago by Kirben

I no longer get crashes in simon1 and sound is playing at
correct speed but there is a lot of cracking in the sound now.

comment:7 Changed 16 years ago by fingolfin

Priority: highnormal

comment:8 Changed 16 years ago by fingolfin

Can't reproduce this right now since my voice data is MP3
compressed, and that isn't rate changed at all.
What sampling rate does the original sound data use?

Still this is hardly priority 7.

comment:9 Changed 16 years ago by Kirben

All Simon the Sorcerer 1 verisons use PCM 22kHz, 8 bit, mono
All Simon the Sorcerer 2 versions use PCM 11kHz, 8 bit, mono

The priority 7 was for when simon1 was crashing, forgot to
lower it with last post.

comment:10 Changed 16 years ago by Kirben

I should have been more exact in that last post:
All Simon the Sorcerer 1 verisons use PCM 22050kHz, 8 bit,
mono
All Simon the Sorcerer 2 versions use PCM 11025kHz, 8 bit,
mono

Check
http://members.optusnet.com.au/wormmon/simon_formats.htm
l if you need more details

comment:11 Changed 16 years ago by fingolfin

That's very odd. Because ScummVM does its sound playback by
default with 22050Hz, and if Simon 1 uses exactly this sampling
rate, then there is no rate conversion involved at all! So I don't
see how the new code could introduce any problems... hum

BTW, I find it odd that they decreased the quality in the newer
version... any idea why that is so?

comment:12 Changed 16 years ago by Kirben

I don't understand why Adventure Soft lowered the sample
rate in their second game but I'm sure the rates I posted are
correct. I ripped out all the sound effects and voices files out
of each PC version to compare.

I just noticed that ambient sounds no longer loop in Simon the
Sorcerer 2 now either.

comment:13 Changed 16 years ago by Kirben

A good example of the crackling is after the typewriter sound
in the Loan Office in simon2win. Sound effects are stored in
game file so should be able to easily reproduce this one.
Just go north from start of game, choose Loan Office and
enter building. It helps if you turn off music too.

comment:14 Changed 16 years ago by fingolfin

Yes, looping wasn't implemented. I just checked in some code that
should work, but it's not tested.

Still it's beyondy me why the Simon1 sound shows problems. The
Dig uses 22050hz data, too, and I noticed no cracking. There is no
rate conversion involved at all. Hrm :-/

comment:15 Changed 16 years ago by fingolfin

Just for comparision, all voices in The Dig are 8 bit unsigned
22050 Hz, too. In particular it prints for me:

makeRateConverter: inrate 22050, outrate 22050, mono
data has 8 bits and is unsigned

If you have The Dig, could you try this out (you just have to start
the game, skip the intro, and let the actors talk)... Do they sound
normal (the sound quality of course isn't perfect to start with). You
could maybe compare once with the old and once with the new
mixing code, for comparision.

When you play simon1, where you get the cracking noises, what
does the "makeRateConverter" debug output say?

comment:16 Changed 16 years ago by Kirben

The crackling in speech doesn't occuring when using mp3 files
either, which makes it more difficult to give examples for you.

I don't know of a good place to find the crackle in the Simon
the Sorcerer 1, since there isn't much use of frequent sounds
in that game.
Have you tried the place I mentioned earlier in simon2win ?

The ambient sound effects lopping now causes a brief bit a
silence between each loop. Start simon2 (any version), go
north, choose fountain and go to the right. The fountain is an
ambient looping sound.

comment:17 Changed 16 years ago by Kirben

The debug from the simon2win example I gave earlier is
always this line:
makeRateConverter: inrate 11025, outrate 22050, mono
data has 8 bits and is unsigned

comment:18 Changed 16 years ago by Kirben

I just compared The Dig, the speech sounds the same under
both 0.5.0cvs and 0.5.3cvs. I noticed no extra sound
problems.

comment:19 Changed 16 years ago by fingolfin

MP3 files go thru different code than "normal" sound data, so if
they work, that doesn't mean much.

comment:20 Changed 16 years ago by fingolfin

Just to clarify this: when you remove this line from sound/
mixer.cpp:
#define SOX_HACK
(or comment it out), then the crackling vanishes? I am asking
because in the past couple days I also made some changes in the
simon code which invokes the mixer, and I want to know if that
broke it, or not.

comment:21 Changed 16 years ago by eriktorbjorn

This should be fixed in the latest CVS.

The problem was that at the end of st_rate_flow()
rate->ilast and rate->cur would have the same values, which
led to some samples being duplicated at the beginning of the
next conversion.

I changed it to fill rate->icur from the input stream. I
hope I didn't break anything.

comment:22 Changed 16 years ago by Kirben

Status: newclosed

comment:23 Changed 16 years ago by fingolfin

Status: closednew

comment:24 Changed 16 years ago by fingolfin

The fix is incorrect. You read from the input stream without
update ipos, for one thing. It might cure the symptom, but causes
new issues.

comment:25 Changed 16 years ago by Kirben

Status: newclosed

comment:26 Changed 10 months ago by digitall

Component: Engine: AGOS
Game: Simon the Sorcerer 1
Note: See TracTickets for help on using tickets.