Sound and Windows Vista

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Sound and Windows Vista

Post by Paul Stevens »

Mike Covey wrote that he could not get
CSBWin to make any sound when running
under Windows Vista Home Premium.

Anyone else have any experience with this?
User avatar
ChristopheF
Encyclopedist
Posts: 1540
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Post by ChristopheF »

I just tried version 10.0 (the one on my web site) and indeed there is no sound, by default. However, if you enable the "Attempt Using DirectX" option in the Volume menu, then sound works fine.

If you want to troubleshoot this, and if you have a powerful enough PC, you can download Virtual PC 2007 from here (this software is completely free):
http://www.microsoft.com/downloads/deta ... laylang=en

and a preinstalled VHD image of Windows Vista that you can freely use for evaluation for 30 days:
http://www.microsoft.com/technet/try/vhd/default.mspx

Or you can also buy and install Windows Vista :)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

The DirectX route seems the better
choice in any case. It seems to work
well enough that I might make it the
default. Initially, I shied away from
DirectX because I had zero experience
with it.
User avatar
mikeman
Neophyte
Posts: 3
Joined: Fri Aug 17, 2007 4:27 am
Location: U.S.

Post by mikeman »

I looked for this "Attempt Using DirectX" option in control panel (hardware and sound), in the volume icon on lower right, within the DM files, etc. Couldn't find it. WHERE did you find this option?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

While running CSBwin (playing the game)
the Volume Menu contains this option along
with a few other options.
User avatar
mikeman
Neophyte
Posts: 3
Joined: Fri Aug 17, 2007 4:27 am
Location: U.S.

Post by mikeman »

I tried again while playing -- was unable to find the volume menu. My CSB/DM version is 9.6, is that my problem? And while playing, should I find "volume menu" within the CSB/DM menus, or is it within Windows Vista menus?

Hey Paul, this is an awesome website you've created.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

The current stable version is 10.something, which is now downloadable from the enclyclopaedia
User avatar
mikeman
Neophyte
Posts: 3
Joined: Fri Aug 17, 2007 4:27 am
Location: U.S.

Post by mikeman »

OK, my old version 9.6 was the problem. I downloaded 10 something and now see the volume menu. Thanks to all for your help -- looking forward to returning to the dungeons!!!
If we knew what we were doing, it wouldn't be called research.
User avatar
megar
Journeyman
Posts: 65
Joined: Thu Dec 29, 2005 10:15 am
Location: France

Post by megar »

I was just going to suggest Paul to make 'directx' the default !

Another one would be to default the "eight volume", because otherwise, sound is too loud and saturating. I used CSBwin on a dozen computer the last few years and everytime the sound was not playing correctly until I tick 'directx' and too loud until I tick 'eight volume'.

Another suggestion to Paul: Please would it be possible not to open the csbwin window at (0,0), but ask the OS the coordinates of the main window ? as example (0,32,1024,688), and then open the csbwin window at (0,32). Because everytime I launch CSBwin, it open right behind my start menu (switched to top of the screen).
Thank you Paul...
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Can't you create a 'Shortcut' with the
command-line parameters that you want
to set? All except the sound volume and
I will add that shortly. If I remember.
User avatar
megar
Journeyman
Posts: 65
Joined: Thu Dec 29, 2005 10:15 am
Location: France

Post by megar »

Well the only thing I can pass with the command line is "directx". Maybe there is a command line parameter to tell where to put the window ?

Anyway, asking Windows the coordinates of the upper-left corner may be useful to you, for your future applications...
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Here is how my copy of config.txt starts:

Code: Select all

************************ Documentation *************************
;**************** COMMAND LINE OPTIONS and PARAMETERS ***********
;
; directory="directory name"
;    This is the directory where we start looking for files.
;    We also search the parent directory if necessary.
;
; repeat
;    When do a playback this causes the playback to be repeated.
;
; height=nnnn
;    Sets the window height in pixels.
;
; quick=nnnn
;    In playback mode this causes quick playback for the
;    specified number of 'clock ticks'.
;
; vblmultiplier=nnnn
;    In playback mode this causes faster playback.  Specified
;    value between 1 and 99.  Values 1 through 98 cause the 
;    graphics routines to be skipped sot that the screen is 
;    updated less often.  The value 99 is special in that all
;    normal screen updates are performed.
;
; dungeon="dungeon name"
;
; width=nnnn
;    Sets the window width in pixels.
;
; x=nnnn
;    Sets the horizontal postion of the left edge of window.
;
; y=nnnn
;    Sets the vertical position of top edge of window.
;
; size=FULL,EXTRALARGE,VERYLARGE,LARGE, or SMALL
;    Sets size of graphics (not the window!)
;
; speed=GLACIAL,MOLASSES,VERYSLOW,SLOW,NORMAL<FAST or QUICK
;    Sets the speed of the internal clock.
;
; play="filename"
;    Plays a previously recorded game.
;
; record
;    Automatically sets the program to record the player's moves.
;
; norecord
;    Overrides any automatic recording initiated by the game's designer.
;
;  *********** END OF COMMAND LINE OPTIONS and PARAMETERS ******************
;    
;

The window size/position parameters USED to work.
Give them a try.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Sound and Windows Vista

Post by Paul Stevens »

Myself wrote:Mike Covey wrote that he could not get
CSBWin to make any sound when running
under Windows Vista Home Premium.
I got a copy of Vista. Spent four days
getting to where I could edit/compile
CSBwin. What a painful experience :-(

I fixed this sound problem but probably
nobody cares because they could use the
DirectX option. But. . . if anyone does care,
let me know and I will point you to a new
version of CSBwin.
User avatar
ChristopheF
Encyclopedist
Posts: 1540
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: Sound and Windows Vista

Post by ChristopheF »

Now I can test it on Windows 7 beta if you want ;)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Sound and Windows Vista

Post by Paul Stevens »

Go for it. CSBwin10_102.7z
User avatar
ChristopheF
Encyclopedist
Posts: 1540
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: Sound and Windows Vista

Post by ChristopheF »

I have tested CSBwin10_102 both on my laptop running Windows Vista and my desktop running Windows 7 beta 1.
It works on both systems, but with the following issues:
- When you open a door, the same sound sample is played several times. When using the DirectX mode, it is played 4 times (which I think is normal), but when using the default, non DirectX mode, it is only played 3 times, there is more delay between the 3 samples, as if the program was lagging and unable to keep up to speed.
- There are 'pops' and 'clicks' when playing sounds (particularly the door sound, but with others too), just like when you play an old LP :)

This is not really important because both issues disappear when using the DirectX mode, which is an easy workaround.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Sound and Windows Vista

Post by Paul Stevens »

The delay and missing sounds are quite
understandable. DirextX allows several
sounds at once. The standard windows
calls allow only one so I have to put them
in a queue and play them when I get a
chance. The queue only holds a couple of
sounds because otherwise you would
be hearing things that happened long ago.
So the delay and missing sound are
accounted for.

No idea about the clicks and pops.
Does it happen only wiith Windows7
or what?
User avatar
ChristopheF
Encyclopedist
Posts: 1540
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: Sound and Windows Vista

Post by ChristopheF »

I thought the original atari code only allowed a single sound to be played at once. So why would there be multiple sounds to play at once when you open a door? Did the original code try to play multiple sounds, the last one automatically stopping the previous one?

Clicks and pops do happen both on Windows Vista and Windows 7 on my systems. If you don't experience this issue, maybe it depends on the sound card drivers...
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Sound and Windows Vista

Post by Paul Stevens »

Certainly, the Atari only allowed one sound.

Now ... as to how it worked? Don't really
know. One BIG BIG difference is that the
Atari program operated in a kind of DOS
mode. That is, the program sat around and
waited for things like keyboard events and
sound completions. CSBwin was twisted
around (rather ruthlessly and sorta ugly) to
operate as a true Windows program. It
returns to the operating system instead of
doing things like "wait for sound to finish".
I used the very simplest Windows sound interface.
I made no attempt to request a Windows
message when a sound finished. In fact, I
am not sure it is possible. And there is no
way to ask if a sound has finished. You have
to attempt to start a new sound (with an option
to NOT stop an old sound) and see if it worked.
So every now and then I check the sound queue
and try to start any pending sound.

In the case of the opening door, there is also
a 'wait' involved so that the door does not open
instantaneously. Again, the Atari program simply
sat and waited for a given number of vertical
retraces. CSBwin relies on Windows to provide
time messages that are rather crude. (There
are other ways to deal with time in smaller
increments - for multimedia applications. But
CSBwin did not take advantage of them.)

All-in-all, after twisting CSBwin from its first
form as a DOS-like program to its final form as
a Windows-like program, I no longer knew
exactly how my own program worked! I don't
know to this day. It is a god-awful combination
of the two modes with the Atari-like sound and
video thrown in for good measure. The program
still has a 'WaitForVerticalRetrace' function and
windows message handlers to make it somehow
work. That there are timing problems between
audio and video is not surprising.
User avatar
ChristopheF
Encyclopedist
Posts: 1540
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: Sound and Windows Vista

Post by ChristopheF »

I better understand the challenge you faced while porting the game. What a nightmare!
I guess I'll keep using directx mode as it sounds better.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Sound and Windows Vista

Post by Paul Stevens »

Christophe wrote:I'll keep using directx mode
And for that you can thank someone other than me.
I resisted for a long time before I finally let someone
provide code. After it sorta worked, I broke down
and did it myself. I'm more happy with it now that
DirectX has become an integral part of the OS. Probably
should make it the default on the next release.
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”