Re: Simple 3D mixer confusion
Re: Simple 3D mixer confusion
- Subject: Re: Simple 3D mixer confusion
- From: John Stiles <email@hidden>
- Date: Wed, 5 May 2004 14:33:41 -0700
From everything I've read at this point, it looks like the Sonica
Theater can only input stereo or DTS/Dolby Digital (which is great for
DVDs, but unhelpful for CoreAudio).
I have a Revolution 7.1 at my disposal, but last I tried it, I had
terrible results--static/dropouts, system instability, and just
all-around badness. Has it improved? Will I experience problems
plugging it into my G5?
What other products could a developer use to test real surround-sound
output? Are the choices on the Mac really this limited? I know emagic
makes a $300 surround-sound box, but most end users don't want to make
that kind of investment ($300 plus speakers sold separately) to make a
$50 game sound slightly better. I'd hate to think that M-Audio
completely controlled the consumer space for surround-sound audio
hardware. What a shame that the optical out on the G5 is going to
waste.
On May 5, 2004, at 1:18 PM, Avelino Santa Ana Jr. wrote:
I've heard a lot of complaints about the Sonica Theater. I believe
Greg Gant posted a less than enthusiastic review at IMG. Can you
adjust the frequency? From what I've read, 5.1 is limited to a max of
44.1 or 48 KHz, so if you're above that it'll switch to stereo. While
in the Apple Midi Setup app were you able to configure your Sonica
Theater following these instructions?
http://opensource.creative.com/pipermail/openal/2004-April/002050.html
Do you by any chance have a Revolution 7.1 card available for testing?
UT2K*, America's Army, and to a lesser extent RotK seem to work fine
with my Revo 7.1 and 5.1 sound using the most recent version of OpenAL
rewritten by Apple (The April 21st release, earlier ones had some
issues...).
On Wednesday, May 05, 2004, at 11:19AM, John Stiles
<email@hidden> wrote:
I am trying to use the 3D mixer to make positional sounds work on real
5.1 hardware. At my disposal, I have a Sonica Theater USB box with
outputs for five speakers and a subwoofer.
I have existing code which can play a WAV positioned in 3D space using
the 3D mixer unit. This is serving me quite well. Far-away sounds are
quieter than nearby sounds, and there is a bit of stereo positioning
(not a ton, but enough).
I hooked up the Sonica Theater USB box and installed the latest
drivers
from the m-audio web site. The M-Audio setup application shows lots of
surround sound options and multi-speaker configuration; however, Audio
MIDI Setup shows it as a simple "2ch 16-bit" output device. (Even my
SoundSticks have more options--they can go 1ch or 24-bit!) I am not
100% sure but I get the feeling that the Sonica's real purpose is to
SIMULATE surround from a 2-channel input signal, which is pretty lame.
I hope I'm wrong :)
I also got some code from an Apple Game Kitchen that is supposed to
allow my mixer unit to send 5.1 sound to the output unit. (I didn't
attend the kitchen personally; this was brought back by a coworker.)
Apparently the snippet of code at the bottom of this message was able
to get 5.1 going on whatever hardware setup they were running at
Apple.
Unsurprisingly, on the Sonica it fails. A bit more surprisingly, it is
also failing testing on the machines in our testing lab, which claim
that our output unit's input format is not a writable property. I
don't
understand this, since it's writable on my machine.
So my questions are--what am I doing wrong? Should the Sonica be
showing up as something more than a 2-channel device? Is this Apple
Game Kitchen code useful? Do bugs need to get filed? :)
// CODE SNIPPET!
err = AudioUnitGetProperty( m_outputUnit,
kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &format,
&dataSize );
ASSERTN( err == noErr, err );
format.mChannelsPerFrame = (m_speakerMode == SPEAKERMODE_SURROUND)?
5:
2;
format.mBytesPerPacket = sizeof(float);
format.mBytesPerFrame = sizeof(float);
format.mFormatFlags |= kAudioFormatFlagIsNonInterleaved;
err = AudioUnitSetProperty( m_outputUnit,
kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &format,
sizeof(format) );
if( err != noErr )
{
if( m_speakerMode == SPEAKERMODE_SURROUND )
{
// THIS HAPPENS ON MY SONICA THEATER USB BOX
printf( "FAILED! Surround sound is not supported on this
hardware.\n"
);
m_speakerMode = SPEAKERMODE_STEREO;
return err;
}
// THIS HAPPENS TO THE TESTERS, BUT NO PROBLEMS FOR ME AND MY
SOUNDSTICKS OR INTERNAL OUT
printf( "FAILED! Unable to set the speaker mode (output unit: stream
input format). (%d)\n", err );
m_speakerMode = SPEAKERMODE_STEREO;
return err;
}
err = AudioUnitSetProperty( m_mixerUnit,
kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &format,
sizeof(format) );
if( err != noErr )
{
// THIS HASN'T HAPPENED TO ANYONE YET, JUST BEING PARANOID
printf( "Unable to set the speaker mode (mixer unit: stream output
format). (%d)\n", err );
m_speakerMode = SPEAKERMODE_STEREO;
return err;
}
AudioChannelLayout layout = {};
layout.mChannelLayoutTag = (m_speakerMode == SPEAKERMODE_SURROUND)?
kAudioChannelLayoutTag_AudioUnit_5_0: kAudioChannelLayoutTag_Stereo;
//
is 5_0 correct? or do I want 5_1??
err = AudioUnitSetProperty( m_outputUnit,
kAudioUnitProperty_AudioChannelLayout, kAudioUnitScope_Input, 0,
&layout, sizeof(layout) );
ASSERTN( err == noErr, err );
err = AudioUnitSetProperty( m_mixerUnit,
kAudioUnitProperty_AudioChannelLayout, kAudioUnitScope_Output, 0,
&layout, sizeof(layout) );
ASSERTN( err == noErr, err );
UInt32 spatialization = kSpatializationAlgorithm_EqualPowerPanning;
switch( m_speakerMode )
{
case SPEAKERMODE_HEADPHONES: spatialization =
kSpatializationAlgorithm_HRTF; break;
case SPEAKERMODE_SURROUND: spatialization =
kSpatializationAlgorithm_SoundField; break;
}
for( int channel=0; channel<64; channel++ )
{
err = AudioUnitSetProperty( m_mixerUnit,
kAudioUnitProperty_SpatializationAlgorithm,
kAudioUnitScope_Input,
channel,
&spatialization,
sizeof(spatialization) );
ASSERTN( err == noErr, err );
}
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.