Some research and I seem to have solved my own problem. ALSA is
apparently stupid-powerful but convoluted. Evidently you can do all
kinds of voodoo with its plugins, but if I didn't already have
experience writing apps with ALSA I'm not sure if I could figure out its
format...
With some research I managed to contrive the I created the below
~/.asoundrc. The audio still skips, but much more rarely, and the
latency's acceptable. I basically manually specified the processing
chain for ALSA:
- from the application, audio goes to a "plug" plugin for conversion to
8-channel 44khz, then out to the "playback_stream_mixer" for mixing
with audio from other applications, which is configured to set a higher
buffer size and count, and finally out to the device itself
- we use a separate device for capture, which is simply a conversion
plugin directly to the hardware
I can't seem to record from the host while the guest is running. Perhaps
if VirtualBox closes the capture device when not in use?
I might be able to make that work but don't care to right now...
VBox: It should be testament to the quality of your application that,
while running a game and VOIP software on a guest system, my biggest
complaint is audio skipping. Keep up the good work!
pcm_slave.intel {
pcm "hw:0"
channels 8
format S16
rate 44100
buffer_size 32768
periods 4
}
pcm.playback_stream_mixer {
type dmix
ipc_key 53723451
ipc_key_add_uid true
slave intel
bindings {
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
}
}
pcm.main_playback {
type plug
slave {
pcm "playback_stream_mixer"
channels 8
rate 44100
}
route_policy duplicate
}
pcm.main {
type asym
playback.pcm "main_playback"
capture.pcm "plughw:0"
}
ctl.main {
type hw
card 0
}
ctl.!default "main"
pcm.!default "main"
pcm.pulse { type pulse }
ctl.pulse { type pulse }
Greg Knight wrote:
I was wondering if there is any way to adjust the buffer settings
using the ALSA or Pulse sound plugins for a VirtualBox host running on
Linux.
There are two problems I'm having, using my Windows XP SP3 guest, both
using the ALSA plugin:
- The main problem is that the audio tends to skip lightly during
playback (very brief ticks.) This is annoying, since I'm trying to
play music back from the Zune software on Windows.
- The second problem I noticed while playing Starcraft and using
Ventrilo on the VM. Everything works fine for quite some time, but
then, all of a sudden, the sound will cut out entirely. SC started
exhibiting some very severe lag at this point, too, so I suspect
whatever's happening is being compounded by bugs in the guest apps.
I can't use the Pulse plugin b/c it records at 1/4 speed and skips
severely. (Test: Open sndrec32, record for 4 seconds. sndrec32 says it
recorded 1 second of audio, and playing it back plays back 1 second of
a recording that skips severely.)
In both cases, I suspect some kind of underrun issue (the former is
obvious, the latter likely a mishandling of a severe underrun) but I
can't be sure.
So I'd like to try longer fragment sizes or more fragments to see if
the performance improves.
Thanks!
Greg
_______________________________________________
vbox-users mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-users