directsound driver test for freeaudio

BlitzMax Forums/BlitzMax Programming/directsound driver test for freeaudio

skidracer(Posted 2007) [#1]
Could windows users please test the following and report any hiccups in audio, it's the tempest sample with a new freeaudio dsound device driver set to a rather low latency:

http://www.gameartnow.com/nitrologic/dsoundtest1.zip

single file exe so seems to run from inside the zip...


Grey Alien(Posted 2007) [#2]
Fine here.

XP Home, 1GB, P4 3.2Gz HT, Radeon 9800XT, SB Audigy 2.

Not sure how good the test is as the sound effects are pretty primative.

Could this possibly improve BMax sound in Win98?


GfK(Posted 2007) [#3]
Works here.

Toshiba Satellite 1800-814 laptop
P3 1.1GHz
512mb RAM
Trident Cyberblade XP Ai1 (16mb)
ALi onboard sound
WinXP Home/SP2


SebHoll(Posted 2007) [#4]
Yep that fixes the sound delay on my Vista Ultimate PC. Thanks Skid!


Knotz(Posted 2007) [#5]
No sound delays.

I tested it on (from my head):

1) XP Home sp2, 2.4Ghz P4, with a onboard realtek chip
2) Vista Ultimate, 3.8Ghz AMD2, with a onboard SoundMax chip.

Subjectively, the XP machine the sounded better than the Vista machine. The soundeffects used in the game are not the best to test crackling, so i can not say clearly if Vista is distorting the sound.


JazzieB(Posted 2007) [#6]
Great work! Works on my Vista set-up without the horrible delay I reported in the bugs section.


skidracer(Posted 2007) [#7]
Cool. If people want to test with their own apps replace your pub.mod/freeaudio.mod with this beta:

http://gamecodenow.com/nitrologic/freeaudio.zip


JazzieB(Posted 2007) [#8]
Mmmm, slight problem. It doesn't work in my own apps! It seems to be playing a lot slower and is very crackly/echoey as well.

Don't know if this helps, but the way I play sounds is controlled by the following Type (or very similar).
Type TFX
	Field channel:TChannel
	Field sound:TSound
	
	Global fxList:TList
	
	Function Play(fx:TSound,volume:Float=1,pan:Float=0,kill:Int=False)
		If fxList=Null Then fxList=CreateList()
		' check if same sound needs to be killed if playing already
		If fxVolume>0 Then
			If kill Then
				For Local s:TFX=EachIn fxList
					If s.sound=fx Then
						s.channel.Stop
						fxList.Remove(s)
						s=Null
					EndIf
				Next
			EndIf
			' play sound
			Local sfx:TFX=New TFX
			fxList.AddLast(sfx)
			sfx.sound=fx
			sfx.channel=CueSound(fx)
			sfx.channel.SetVolume(fxVolume*volume)
			sfx.channel.SetPan(pan)
			sfx.channel.SetPaused(False)
		EndIf
	EndFunction
	
	Function Check()
		If fxList Then
			For Local sfx:TFX=EachIn fxList
				If Not(sfx.channel.Playing()) Then
					sfx.channel.Stop
					fxList.Remove(sfx)
					sfx=Null
				EndIf
			Next
		EndIf
	EndFunction
EndType

The Check() method gets called every logic loop (which is 200 times a second), however, I got the same result when I took it out, just to see if this could be causing the problem.

Fairly simple, but maybe you can see if there is a better way for me to do what I am currently doing. I notice that you pre-allocate sound channels in the Tempest program, whereas I do it on the fly.

Hope we manage to sort this soon.


Mark Tiffany(Posted 2007) [#9]
the exe seems fine here too...


Grey Alien(Posted 2007) [#10]
Skidracer: any ideas if this will help with previously reported win98 issues like sound drop out, stuttering etc. (particularly with ogg playback)?


JazzieB(Posted 2007) [#11]
Just been playing around a bit to see if I can get a sound playing without any problems, and even the following produces crackling and slow playback.
' quick sound test

Graphics 640,480

Global sound:TSound=LoadSound("sfx/fire.wav")
Global channel:TChannel=Null

While Not KeyHit(key_escape)
	Cls
	DrawText "Press space to fire, or Esc to quit",10,10
	Flip
	
	If KeyHit(key_space) Then
		PlaySound(sound,channel)
	EndIf
Wend
End

Not really sure what the Tempest program is doing any differently.


skidracer(Posted 2007) [#12]
Try changing dsounddevice.cpp[12] to:

#define DSOUNDFRAG 2048

and build modules, you did build modules ya?


JazzieB(Posted 2007) [#13]
Well, that's much better. Still a little bit of crackle, but absolutely nowhere near as much as before.

Increasing it to 3072 yielded better results, although I thought I could see a very slight delay at this setting - could just be me seeing something that's not there!


skidracer(Posted 2007) [#14]
Is your game DX or GL?

The lag becomes unacceptable at 8192, so I was hoping 2048 would be fine as the tempest fire button certainly feels nice and responsive at this setting.

<edit>
ok, this version of dsounddevice.cpp shouldn't overrun the buffer, if you still have problems please try uncommenting the logging on lines 178-179 and post the results




JazzieB(Posted 2007) [#15]
Both! Although, I've been doing all this testing under DX.

EDIT - Same result with OpenGL.


marksibly(Posted 2007) [#16]
Hi,

Under Vista, I'm getting the 1 second audio delay with standard FreeAudio.

With the Tempest test above, I get minimal delay, but a wacky 'echoey' effect.

OpenAL also appears to be semi-hosed under Vista - the default driver does not work (no audio) but forcing OpenAL to use DirectSound driver does.

Audio under Vista is *munted*! Nice GUI but...


GfK(Posted 2007) [#17]
Munted?

Is that good or bad?


Perturbatio(Posted 2007) [#18]
Munted


GfK(Posted 2007) [#19]
Munted
"completely tw*tted of your face & gurning like a water buffalo."

Oh. Er.... I see.... :/

[edit] Ah! You meant "Broken, not workable for its origanal purpose."

:)


Grey Alien(Posted 2007) [#20]
wow so does this mean that any Bmax games will sound awful on Vista?


TartanTangerine (was Indiepath)(Posted 2007) [#21]
Most games sound *shite* under Vista.


JazzieB(Posted 2007) [#22]
wow so does this mean that any Bmax games will sound awful on Vista?

For the most part, yes. But it's mostly down to the state of the drivers for your soundcard. Mine, for example, are still in beta, but I get the impression that they're simply waiting for certification from MicroSoft.

The new driver from Skidracer goes a long way towards fixing the current issues. There's no longer a delay, but we do now get the crackle. Increasing the DSOUNDFRAG value of the driver does improve on this, but at the expense of greater latency, but nowhere near the second we are currently getting.

Most games sound *shite* under Vista

Actually, the games I tested sounded just fine, although a little flat when EAX options were not available.


I'm actually taking another look at FMOD and going to convert one of my freeware games to use it to see how it works. If all goes fine then I'll consider it for my shareware games, but then there's a licence fee to consider as well. Ideally, I'd like the sound driver with BMax to be fixed to a usable state.


Grey Alien(Posted 2007) [#23]
wow that's horrible news.


GfK(Posted 2007) [#24]
I need a change of career. This programming lark is one headache after another. :/


JazzieB(Posted 2007) [#25]
Things are lookig up. Check here.. http://www.blitzbasic.com/Community/posts.php?topic=67463

This whole issue seems pretty high up on the list of priorities at the moment, and it's come a long way in just a week.

To be fair, it's hardly unexpected when you consider when XP was released on to a 98 using public.


Grey Alien(Posted 2007) [#26]
Thanks for the link. This is one I'm gonna have to sit out on for a bit as I'm battling with the Mac. Anyway, seems there's plenty of Cooks ...


popcade(Posted 2007) [#27]
The sound sounds very cracking after today's syncmods, you can test on Digesteroids...

It requires a fix definitely... :|

SPEC: XP SP2, OnBoard AC97, Geforce FX5200


JazzieB(Posted 2007) [#28]
Check the link in my post above. You can now choose an audio driver, including the original FreeAudio and some OpenAL ones (provided you have OpenAL installed).


popcade(Posted 2007) [#29]
I have reported in that post.. the problem i actually the new freeaudio, I'm waiting for fix.