4. After line: if (PA_UNLIKELY((sframes = snd_pcm_mmap_commit(u->pcm_handle, offset, frames)) < 0)) { add:
if (!after_avail && (int) sframes == -EAGAIN)
break;
5. Compile and install Pulseaudio with udev support
6. Copy /etc/pulse/daemon.conf to ~/.pulse/daemon.conf and ensure it has uncommented: default-sample-rate = 48000
7. Edit ~/.asoundrc and put in it:
pcm.a52 {
@args [CARD]
@args.CARD {
type string
}
type rate
slave {
pcm {
type a52
bitrate 448
channels 6
card $CARD
}
rate 48000 #required somehow, otherwise nothing happens in PulseAudio
}
8. sudo alsa reload
9. Make sure you do not have a ~/.pulse/default.pa or if you do, that it is using load-module module-udev-detect to load Alsa sinks not load-module module-alsa-sink ...
New versions of Pulseaudio will be patched, but in the meantime, here are the revised steps for Ubuntu Lucid 10.04 LTS:
1. Open from Pulse source code: src/modules/ alsa/alsa- sink.c
2. Replace: pa_sink_ set_max_ rewind( u->sink, u->hwbuf_size); with: pcm_is_ hw(u->pcm_ handle) ) { sink_set_ max_rewind( u->sink, u->hwbuf_size); log("Disabling rewind for device %s", u->device_name); sink_set_ max_rewind( u->sink, 0);
if (pa_alsa_
pa_
} else {
pa_
pa_
}
3. Replace: pa_sink_ set_max_ rewind_ within_ thread( u->sink, u->hwbuf_size); with: pcm_is_ hw(u->pcm_ handle) ) { sink_set_ max_rewind_ within_ thread( u->sink, u->hwbuf_size); log("Disabling rewind_ within_ thread for device %s", u->device_name); sink_set_ max_rewind_ within_ thread( u->sink, 0);
if (pa_alsa_
pa_
} else {
pa_
pa_
}
4. After line: if (PA_UNLIKELY( (sframes = snd_pcm_ mmap_commit( u->pcm_ handle, offset, frames)) < 0)) { add:
if (!after_avail && (int) sframes == -EAGAIN)
break;
5. Compile and install Pulseaudio with udev support
6. Copy /etc/pulse/ daemon. conf to ~/.pulse/ daemon. conf and ensure it has uncommented: default-sample-rate = 48000
7. Edit ~/.asoundrc and put in it:
pcm.a52 {
@args [CARD]
@args.CARD {
type string
}
type rate
slave {
pcm {
type a52
bitrate 448
channels 6
card $CARD
}
rate 48000 #required somehow, otherwise nothing happens in PulseAudio
}
8. sudo alsa reload
9. Make sure you do not have a ~/.pulse/default.pa or if you do, that it is using load-module module-udev-detect to load Alsa sinks not load-module module-alsa-sink ...
10. pulseaudio -k and pulseaudio -D