Page 1 of 2

Audio routing in Virtualbox.

Posted: 25. Feb 2012, 22:23
by xmusicmatt
Audio routing in Virtualbox.

I have multiple audio devices in my computer.. What I want to do is to send virtual box audio to a specific sound card instead of the default sound card on the windows host machine.. Is this possible? Right now Virtualbox routes its audio out of the default audio card in windows. I can't seem to find a way to route VBox to another audio card within it's application (other apps such as Skype, etc have this ability)

Re: Audio routing in Virtualbox.

Posted: 25. Feb 2012, 22:29
by michaln
Audio output goes to the default device. VirtualBox isn't Skype.

Re: Audio routing in Virtualbox.

Posted: 26. Feb 2012, 04:02
by xmusicmatt
michaln wrote:Audio output goes to the default device. VirtualBox isn't Skype.
I guess "ye get what ye pay for"

Even winamp can route to a different audio output... oh well...

Re: Audio routing in Virtualbox.

Posted: 26. Feb 2012, 04:24
by Perryg
But not from a different PC.
You must look at this as you having two separate PCs. The only thing that I can think of that would do anything like what you are wanting is an audio server, but then the sound is degraded because it is actually sent over a net connection.
While skype, winamp, Etc. can work because it is actually on the same PC

Re: Audio routing in Virtualbox.

Posted: 26. Feb 2012, 12:12
by michaln
xmusicmatt wrote:Even winamp can route to a different audio output... oh well...
Did it ever cross your mind that Skype and Winamp are 100% audio-oriented applications and therefore rather likely to have extensive audio settings? On the other hand, in VirtualBox audio functionality is way down on the list of important features.

Just out of curiosity, where are the settings you want in Microsoft's RDP client or Virtual PC? Those are products comparable to VirtualBox, unlike Skype or WinAmp.

Re: Audio routing in Virtualbox.

Posted: 2. Mar 2012, 13:45
by mpack
Mod note: irrelevent trolling messages deleted.

Re: Audio routing in Virtualbox.

Posted: 14. Nov 2012, 23:47
by Beppe
So there's really no way you can change the audio routing? I'm using Ubuntu as host and I like to route the sound of the VM to the HDMI audio output, which is playback device 3.

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC887-VD Analog [ALC887-VD Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC887-VD Digital [ALC887-VD Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 0/1
Subdevice #0: subdevice #0

/B

Re: Audio routing in Virtualbox.

Posted: 15. Nov 2012, 08:39
by jorgensen
The only way I can think of, is a program called AirFoil that can route through a network.
But - there is a significant latency, and Linux is not supported.

Re: Audio routing in Virtualbox.

Posted: 23. Dec 2012, 20:22
by vid
wow, grumpy unimaginative people. Of course it's possible to route audio to a different device on modern Linux. I used pavucontrol. I hope this helps someone!

Re: Audio routing in Virtualbox.

Posted: 23. Dec 2012, 21:01
by Perryg
vid wrote:wow, grumpy unimaginative people. Of course it's possible to route audio to a different device on modern Linux. I used pavucontrol. I hope this helps someone!
Great but this is a windows host question and not Linux. Still Pulse audio (has audio server capability) could be installed on Windows but it is not default. Not to mention that the question was how to do this with VirtualBox not various hosts.

Re: Audio routing in Virtualbox.

Posted: 24. Dec 2012, 10:51
by jorgensen
Actually it could be solved by having more than one sound card in VirtualBox, like networking, and include routing like Virtual Audio Cable at the host.

Looking forward to this feature, which would improve VirtualBox considerable.

Re: Audio routing in Virtualbox.

Posted: 24. Dec 2012, 20:19
by Perryg
jorgensen wrote:Actually it could be solved by having more than one sound card in VirtualBox, like networking, and include routing like Virtual Audio Cable at the host.

Looking forward to this feature, which would improve VirtualBox considerable.
For best results you would need to actually post an enhancement ticket at bugtracker

Re: Audio routing in Virtualbox.

Posted: 3. May 2013, 23:58
by reaglejr
I've been using "audio routing" (i.e., selecting the audio device )for years via the VBOX_ALSA_DAC_DEV and VBOX_ALSA_ADC_DEV env variables with the VBox 4.1.* series. However, this doesn't seem to work with the 4.2 series. Now that Ubuntu 13.04 is out I'd like to upgrade, but I don't see a 4.1 for 13.04? Does/will 4.2 support this feature, or will you continue to provide 4.1 builds? Thanks!

Re: Audio routing in Virtualbox.

Posted: 25. Jul 2013, 18:57
by reaglejr
I posted a bug about the failure of VBOX_ALSA_ADC_DEV and VBOX_ALSA_DAC_DEV here: https://www.virtualbox.org/ticket/11985

Re: Audio routing in Virtualbox.

Posted: 12. Dec 2017, 13:44
by emusic
Perryg wrote:You must look at this as you having two separate PCs.
No, it is incorrect point of view. Separate PCs can communicate only via external, special channels (network, USB, FireWire etc.) while VirtualBox emulates a guest VM on host machine resources, having a direct access to them all. To emulate guest audio hardware, VirtualBox intercepts specific register access, determines which operation is performed (playback, recording, volume control etc.) and translates these operations to the host. To access host audio hardware, VirtualBox acts as a plain user-mode application using DirectSound API. This API allows either to use default playback/recording devices (endpoints) or specify a particular endpoint. Playback and recording streams are fully independent from each other so playback and recording streams may use different hardware adapters at the same time.

Specifying particular audio endpoints instead of using default ones is very simple thing (20-30 lines of C/C++ code for enumeration procedure implementation). Moreover, there is no design problems to emulate more than a single audio adapter in a VM; it is easy to support several virtual audio adapters of different types.

So the only reason why VirtualBox always uses default endpoints is the intentional artificial limitation chosen by the developers. All other explanations given here are not suitable.

BTW, VMware Workstation allows to specify host audio endpoint but has artificial limitations too: only a playback endpoint can be specified. Corresponding recording endpoint is determined by the code automatically. This is all the more strange, because a code determining a corresponding endpoint of the same audio adapter is obviously more complex than a code that selects an endpoint directly by its name or number. So VMware uses more code to implement less functionality.