Page 1 of 1

Switch Default Audio Device

Posted: 04 Mar 2007 02:28
by toddtmw
I've searched the Mac forum and cannot find anything on this. I found something on the Windows Forum and from what that said, it seems like what I tried should work, but it doesn't.

What I want to do is default VLC to a different Audio device. I have a griffin iMic and have my iMac hooked to my TV. I have VLC playing movies full-screen on the TV by default when I open the movie, but I cannot get it to play sound though the iMic (When my system sound is set to internal speakers.)

I tried changing the setting in preferences -> Audio -> Output Modules -> auhal -> Audio Device to different numbers (The default is 0) but it always plays sound through the built-in speakers. Once the movie starts, I can manually switch it to the iMic via Audio -> Audio Device -> iMic... But I don't want to have to do that all the time.

I've tried setting the auhal -> Audio Device to 0, -1, 1, 2 and 3 and in all cases when I save it, quit VLC and then launch it with a movie file, it plays using the internal speakers.

From what I've read here, at one point the preference for video device was not getting read correctly, is it possible we have the same problem with the Audio Device preference?

I'm so close to being able to use my Mac to watch a movie, while still having full functionality of the main computer. This is the last hurdle I have to cross.

Thank you in advance for any help anyone can provide!

-Todd

Posted: 07 Mar 2007 18:52
by toddtmw
Bump to see if I can get someone to look at what appears to be a bug in this otherwise fine application.

Thanks.

Re: Switch Default Audio Device

Posted: 05 Nov 2007 08:42
by maguirer
This has been bothering me for ages, as well. I finally figured it out, and it sorta makes sense, but it's not at all intuitive. I also figured it'd be a number like 0, 1, 2, or 3, etc..., but it is in fact the AudioDeviceID of your device. The next question is how do you find that number. After doing some googling, there's some example coreaudio source code included with Xcode, to build an app called HALLab. Once compiled and run, it will display a list of connected audio devices and their AudioDeviceIDs (in hexadecimal). Find the corresponding ID for the device you want to be the default (if you have two entries for your device, like I did with my iMic, pick the one that has a non-zero value in the "Out" column), convert the value to decimal, and that's what you enter in VLC's default audio device id prefs, click Save and quit, and everything now works great!

Just thought that might be handy, as I haven't seen an answer for this anywhere, and my old workaround of using Detour no longer seems to work in 10.5/Leopard.

Re: Switch Default Audio Device

Posted: 09 Nov 2007 16:02
by toddtmw
Yeah, I was using Detour too, but it stopped working for me when I went to Intel.

I'll never understand why they dropped that (or why no one else created a similar product). It was terribly useful.

Anyway, I'll give this a try. Thanks for the info.

-Todd

Re: Switch Default Audio Device

Posted: 04 Dec 2007 15:27
by derHindemith
Thank you so much. It seems like such a horribly convulted solution to a seemingly simple problem.

Re: Switch Default Audio Device

Posted: 09 Feb 2011 01:26
by Tozzi
Sorry for bringing up this necro thread again.
It was, however, the only useful hint I found on the net regarding this problem and it finally pointed me towards the proper solution.

I am using the Creative Soundblaster X-Fi Surround Pro USB card and want all sounds (system, Skype etc.) to play via the internal speakers, but I want VLC to use the X-Fi SPDIF in passthrough mode by default.

HALLab works (btw, you don't have to compile it, it sits in /Developer/Applications/Audio if XCode is installed), but it gave me only the ID for stereo output (0x104, 260 in decimal).
It wouldn't tell me, however, which AudioDeviceID to use for "Encoded Output"...

Now here's the simple solution to the problem:
Open the VLC "Messages" Window, either from the Menu or by pressing Shift Option M.
Now change the Audio Device from the Audio Menu.
Pause the video and look in the messages window for the line:
auhal debug: Set Device: (some hexadecimal number)

In my case this was 0xf00104, so I had to set the device id to 15728900.

Jeez, that sure took a while to figure out. But I am happy now.