there are a couple of ways to deal with this i think
(remember i don't know whats going on but i think it's the bus getting overloaded)
also on my machine the alsa output for xmms just sucks and i have to use either oss emulation or jack to get consistent sound out of xmms. so try different outs.
first use the command
lspci -v
to see how the bus sees your components
the audio card will have some name like 02:0a.0 or something to the left of it
i will refer to this as <audiocardname>
as root try
(first thing increases bandwidth for all devices second increases bandwidth for sound device to max)
setpci -v -d '*:*' latency_timer=b0
setpci -v -s <audiocardname> latency_timer=ff
see if that fixes it -- if it does you can add it to boot scripts
the first command increases latency across the bus and some people disagree with that for sound so you decide -- if you are running a video driver with a very high setting it will reduce it also so you have to decide that as well. reduced not increased latency seems on the surface to be better for audio but it actually reduces bandwidth or burst size.. anyway enough of my ramblings.
you can also mess with buffersizes and whatnot in ~/.asoundrc here is mine because it contains left over cruft where i tweeked mine
the output buffer junk is in the plugin named dmixer
latency and buffersize are all intertwined .. alsa uses a ring buffer so if it overruns or underuns it sounds all weird.
Code:
pcm.dsp {
type plug
slave.pcm "duplex"
}
pcm.dsp0 {
type plug
slave.pcm "duplex"
}
# this makes native ALSA apps default to using dmix
pcm.!default {
type plug
slave.pcm "duplex"
}
ctl.!default {
type hw
card 0
}
pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
# period_time 0 # set to 0 lets period size and buffer size do everything
period_time 2 # this is the general standard even though often is set to 0
# period_time 84000
# period_size 512
period_size 1024 # oss period frames this is the one shown as hardware
# period_size 2048
# period_size 4096 # not great to go over this
# buffer_time 340000
# buffer_size 16384 # this is the one shown as hardware but causes huge mess
# buffer_size 8192
# buffer_size 4096
buffer_size 2052 # this is the one i use
rate 44100 # can let card decide this on it's own this one is what hardware says
# rate 48000
}
bindings {
0 0
1 1
}
}
ctl.dmixer {
type hw
card 0
}
ctl.mixin {
type hw
card 0
}
pcm.duplex{
type asym
playback.pcm "dmixer"
capture.pcm "mixin"
}
pcm.mixin {
type dsnoop
ipc_key 5978293 # must be unique for all dmix plugins!!!!
ipc_key_add_uid yes
slave {
pcm "hw:0,0"
channels 2
# period_size 1024
period_size 1026
# buffer_size 4096
buffer_size 2052
rate 44100
# periods 0
period_time 2
}
bindings {
0 0
0 1
}
}