Game Development Community

TGB - No sound in OS X

by Justin Allen · in Technical Issues · 02/03/2010 (12:27 pm) · 6 replies

Crosspost since I didn't get anything back in the other forum.

I can't play sound. I have things defined in audiodatablocks.cs. That part is fine. alxPlay() doesn't do anything. It doesn't throw any errors. It doesn't play any sound. I grabbed one of the sounds from the breakout tutorial to see if it was a problem with the sound files I was using. No luck there either.

OpenAL inits as 1.2. I tried taking the framework out of the TGB Game package to get it to use the system's framework. OpenAL then inits as 1.1. No sound there either.

OS X 10.6.2
TGB 1.7.4

#1
02/04/2010 (8:07 am)

Unfortunately, swapping out the pre-supplied OpenAL for the system one won't work without code changes to TGB.

However, since in your case there is no audio at all, the problem is clearly somewhere else.

Are there errors in the console.log? What does the OpenAL init section there say?
#2
02/04/2010 (9:52 am)
I was just out of other ideas at the time. I didn't actually expect it to.

Quote:OpenAL Driver Init:
Vendor: Any
Version: OpenAL 1.2
Renderer: Software
Extensions:

I can get and change channel volume, not that it does anything. I don't know if there are supposed to be extensions actually listed there, but it does show some when taking the framework out of the tgbgame.

Quote:OpenAL Driver Init:
Vendor: Apple Computer Inc.
Version: 1.1
Renderer: Software
Extensions: AL_EXT_OFFSET AL_EXT_LINEAR_DISTANCE AL_EXT_EXPONENT_DISTANCE AL_EXT_float32 AL_EXT_STATIC_BUFFER

I do also have some error messages going to the console that don't really appear to be very helpful.

2/4/10 07:50:31 	TGBGame[59668]	unknown error code: invalid enumeration
2/4/10 07:50:31 	TGBGame[59668]	kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
2/4/10 07:50:31 	[0x0-0x622622].com.garagegames.torqueGameBuilder[59552]	Thu Feb  4 07:50:31 Soulblade.local TGBGame[59668] <Error>: unknown error code: invalid enumeration
2/4/10 07:50:31 	[0x0-0x622622].com.garagegames.torqueGameBuilder[59552]	Thu Feb  4 07:50:31 Soulblade.local TGBGame[59668] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
2/4/10 07:50:31 	TGBGame[59668]	unknown error code: invalid enumeration
2/4/10 07:50:31 	[0x0-0x622622].com.garagegames.torqueGameBuilder[59552]	Thu Feb  4 07:50:31 Soulblade.local TGBGame[59668] <Error>: unknown error code: invalid enumeration
#3
02/04/2010 (12:42 pm)

Hmm, not sure I can really help you here. Best thing would be I could debug this here and see what happens, but I'm still on 10.5.

I will post updates to my Theora fixes for Macs shortly that will do away with the old OpenAL library used by TGB and make use of the system-installed one, but this will require a TGB Pro license to merge the changes. Also, I'm of course absolutely not sure the changes would actually affect this. Being able to drop this into a debugger would definitely help, though.
#4
02/04/2010 (3:14 pm)
It didn't work on my old G5 either. But it doesn't throw that error to the console.

I got an ogg file from the breakout tutorial, so I'm assuming it's formatted in a readable fashion. I can get the length of the file, so my path works. My audiodatablocks.cs is a copy/paste. I tried setting the sound to be a loop, $somevarhere = alxPlay(someprofile); the variable reads as 0, so doing an alxIsPlaying check returns 0 as well.

So, do I just have a faulty build or something? Should there be extensions listed in the OpenAL Driver Init? I don't get any extensions listed on the G5 either.
#5
02/04/2010 (3:35 pm)

A faulty build? Since I can see no license on your account, I'm assuming you are running the TGB Demo.

The extensions being blank should be okay. IIRC the OpenAL that shipped with TGB indeed had none. 1.1 has a few mandatory ones.

Do you get sound with the examples that come with TGB and/or other TGB games on the Mac?
#6
02/04/2010 (4:50 pm)
As a matter of fact, they do produce sound!

And I figured out the problem. In the old audio tutorial, it specifies the filename as "./game/data/audio/soundfile.ext" which won't work. "~/data/audio/soundfile.ext" does. However, to complicate that, alxGetWaveLen() won't return a size using the relative path, but will with the absolute.

So, thanks for stopping by and thanks for breaking my cow lamp.