Re: Helpful hint (was: HAL Devices and Streams (with QuickTime))
Re: Helpful hint (was: HAL Devices and Streams (with QuickTime))
- Subject: Re: Helpful hint (was: HAL Devices and Streams (with QuickTime))
- From: <email@hidden>
- Date: Wed, 23 Jan 2002 05:59:36 -0600
Jeff Galyan wrote:
>
I just read through the thread you reference, and this actually works on
>
10.1.2. I gave a test build to my client last night specifically to test
>
this feature, and the report I got back was, "This ******* ROCKS!!!".
>
>
More details:
>
Apparently, the "Mac OS X Audio HAL (System)" sdev is always the built-in
>
audio hardware.
>
>
"Mac OS X Audio HAL" is whatever is selected in System Preferences as your
>
default audio output.
Jeff, oh my, you're right! Does this work on older OS X versions? Although
I had a difficult time at first, it does indeed work on 10.1.2!
It's not consistent for me though. Several times I had to switch channels
back and forth, before it would actually split, and allow two outputs
simultaneously.
Plus, during my testing I swear it switched on me. In other words, the "HAL
(System)" was the USB, while the "HAL" was the Built-In output. Switching
USB devices (to test two brands) probably didn't help.
What drives me batty, is the names Apple used for these "Proxy sdev's"...
"Mac OS X Audio HAL" --?? That's cryptic. Why not simply "Built-In"?
And then, "Mac OS X Audio HAL (System)" --?? That's not confusing. :)
"System Output", or "System Preference" seems clearer. Still not a problem
to catch the odd names, and replace them. Or better yet, use the extra Core
Audio calls to control the "System Preference" device, AHEM, I mean the "Mac
OS X Audio HAL (System)" device.
If this works correctly, we at least have two simultaneous output options
for QuickTime on OS X... Just in a roundabout way.
>
(in my app's case, it's vital that the output from
>
both devices is synchronized; i.e., simply loading up a new Movie instance
>
with the same file won't do. One of the output devices must always be
>
active, the other one can be muted/unmuted by the user at will).
Not sure about your application, but there are buffer delays between various
outputs that will cause slight sync problem. But you should be able flip
any track or movie output to either HAL or HAL(System) at any time. But of
course it didn't work consistently in my brief tests.
-Jason
>
>
So, if you've selected your USB audio output as your output device in System
>
Preferences, then "Mac OS X Audio HAL" sends your sound to the USB device
>
(at least, that's how it looks to me based on my client's report back to
>
me). "Mac OS X Audio HAL (System)" will route the sound output to the
>
built-in audio hardware, so you might have, say, headphones plugged into the
>
output jack on the back of your box.
>
>
Now, I just have to test my theory on having a Movie play through two
>
different output devices simultaneously (I think it's a simple matter of
>
adding a new Track to the Movie by duplicating the existing Track, getting
>
the new Track's Media and using MediaSetSoundOutputComponent() to route the
>
new Track's sound to a different output device... We'll see if I'm right or
>
not). Of course, if someone on the list knows this can't work, that might
>
save me some time. :) (in my app's case, it's vital that the output from
>
both devices is synchronized; i.e., simply loading up a new Movie instance
>
with the same file won't do. One of the output devices must always be
>
active, the other one can be muted/unmuted by the user at will).
>
>
--Jeff
>
>
>
>
On 1/22/02 6:43 PM, "email@hidden" <email@hidden> wrote:
>
>
> Hi Jeff, that's the way it should work. But note that under OS X, QuickTime
>
> can no longer use to the Component Manager to access an output device. For
>
> example, a second USB audio output (like the P900 from Telex or iMic from
>
> Griffin). However You can use a CoreAudio call to change the default sdev
>
> to a new device: siHALAudioDeviceID
>
>
>
> A quote from Jeff Moore (Core Audio, Apple):
>
>
>
>> The HAL sdev does have an Get/SetInfo selector to change what
>
>> AudioDeviceID it is using. It is, unsurprisingly, siHALAudioDeviceID.
>
>>
>
>> But, and this goes back to what I was trying to get at when I talked about
>
>> the Sound Manager's architecture getting in the way, the Sound Manager will
>
>> use the same sdev for all the tracks in a QTMovie without being pointed at a
>
>> wholly different sdev Component using MediaSetSoundOutputComponent.
>
>
>
> See the recent thread "HAL Devices and Streams (with QuickTime)" for more
>
> gory details.
>
>
>
> If all you want to do is control the main output under OS X, then you'll be
>
> OK. But if you want to have various QT movies playing on multiple outputs,
>
> you're currently out of luck... Unless you want to try a hack workaround by
>
> making a new sdev that points to a HAL device yourself.
>
>
>
> That's where I am right now. Getting the nerve up to try the sdev hack,
>
> that Jeff thinks will cover you 90% of the time... Problems (crashes) may
>
> arise if a HAL device is unplugged, causing the Sound Manager to freak.
>
>
>
> -Jason
>
>
>
>
>
>
>
>> Hi all,
>
>>
>
>> I just thought I'd pass this along for others who may be new to QuickTime or
>
>> might need to do this same thing, but only have one sound output device
>
>> actually connected.
>
>>
>
>> I have an application I'm working on for a client that needs to allow the
>
>> user to set the sound output device. Searching through the archives, I found
>
>> the answer to that, but I had no idea how I would test it since I only have
>
>> the built-in audio on my machine.
>
>>
>
>> The answer to testing turned out to be very simple. This works on Mac OS X,
>
>> I don't know about earlier versions.
>
>>
>
>> On Mac OS X, when you get the 'sdev's, you'll get "FireWire DV", "Mac OS X
>
>> Audio HAL", and "Mac OS X Audio HAL (System)" (this is what I get on my box,
>
>> you may get more). Set the Media's sound output device to "FireWire DV"
>
>> using MediaSetSoundOutputComponent() (you can do this while the movie is
>
>> stopped or while it's playing, it doesn't matter). If you have a DV recorder
>
>> set up to record from its FireWire input, you should be able to record the
>
>> audio from the movie you're playing. In either case, you won't hear any
>
>> sound from the built-in sound output - if you do, something's wrong. In my
>
>> case, I don't have a DV recorder, so I have to assume this works as I want
>
>> it to. If someone knows differently, I'd love to hear about it, and why it
>
>> doesn't work as I expect.
>
>>
>
>> Incidentally, this is the first time I've done anything with QuickTime, and
>
>> I have to say that the team at Apple have done a great job of making it easy
>
>> (once you've read through the nearly 4000 pages of the API reference,
>
>> anyway). :)
>
>>
>
>> --Jeff