[pulseaudio-tickets] [PulseAudio] #839: Pulseaudio tries to rewind on ioplug devices
PulseAudio
trac-noreply at tango.0pointer.de
Tue Jul 13 02:45:50 PDT 2010
#839: Pulseaudio tries to rewind on ioplug devices
----------------------+-----------------------------------------------------
Reporter: mcarans | Owner: lennart
Type: defect | Status: reopened
Milestone: | Component: module-alsa-*
Resolution: | Keywords:
----------------------+-----------------------------------------------------
Comment(by mcarans):
Colin, pl bossart in Pulseaudio email list discussion came up with
improvements:
{{{
NAK. This does not work for me. You need to rewind also in the thread
context:
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 2995c3c..4059a9b 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -953,7 +953,12 @@ static int update_sw_params(struct userdata *u) {
}
pa_sink_set_max_request_within_thread(u->sink, u->hwbuf_size -
u->hwbuf_unused);
- pa_sink_set_max_rewind_within_thread(u->sink, u->hwbuf_size);
+ if (pa_alsa_pcm_is_hw(u->pcm_handle))
+ pa_sink_set_max_rewind_within_thread(u->sink, u->hwbuf_size);
+ else {
+ pa_log("Disabling rewind_within_thread for device %s", u->device_name);
+ pa_sink_set_max_rewind_within_thread(u->sink, 0);
+ }
return 0;
}
@@ -1906,7 +1911,12 @@ pa_sink *pa_alsa_sink_new(pa_module *m,
pa_modargs *ma, const char*driver, pa_ca
(double) pa_bytes_to_usec(u->hwbuf_size, &ss) /
PA_USEC_PER_MSEC);
pa_sink_set_max_request(u->sink, u->hwbuf_size);
- pa_sink_set_max_rewind(u->sink, u->hwbuf_size);
+ if (pa_alsa_pcm_is_hw(u->pcm_handle))
+ pa_sink_set_max_rewind(u->sink, u->hwbuf_size);
+ else {
+ pa_log("Disabling rewind for device %s", u->device_name);
+ pa_sink_set_max_rewind(u->sink, 0);
+ }
if (u->use_tsched) {
u->tsched_watermark =
pa_usec_to_bytes_round_up(pa_bytes_to_usec_round_up(tsched_watermark,
&requested_ss), &u->sink->sample_spec);
pa_pcm_is_hw detects a52 but allows rewind for iec958. Looks like a
better fix than a hard-coded string compare.
"
I didn't have a line with pa_sink_set_max_rewind_within_thread but I added
it anyway with no ill effect. Probably my Pulseaudio is older.
}}}
He also came up with a great way to avoid editing
/usr/local/share/pulseaudio/alsa-mixer/profile-sets/default.conf
{{{
# Rate Converter to 48kHz, needed for some applications
pcm.a52 {
@args.0 {
type integer
}
type rate
slave {
pcm "Filter_A52Encode"
rate 48000
}
}
The args.0 will then allow a52:%f to match a52:0.
}}}
Now all we need is a way to avoid specifying "card NVidia"? "card 0" would
work for the majority of users including me, but it would be nice to have
something that will work if the card is not 0.
--
Ticket URL: <http://pulseaudio.org/ticket/839#comment:14>
PulseAudio <http://pulseaudio.org/>
The PulseAudio Sound Server
More information about the pulseaudio-bugs
mailing list