<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:Courier New,courier,monaco,monospace,sans-serif;font-size:8pt"><font size="2"><span style="font-family: arial,helvetica,sans-serif;">Cool - I'm glad you got rid of the a52 string check hack</span></font>.<br><br><font size="2"><span style="font-family: arial,helvetica,sans-serif;">I didn't have the line</span></font> pa_sink_set_max_rewind_within_thread(u->sink, u->hwbuf_size);<br><font size="2"><span style="font-family: arial,helvetica,sans-serif;">I guess the version of Pulseaudio </span><span style="font-family: arial,helvetica,sans-serif;">source code in Lucid is much older than yours?</span></font><br><font size="2"><span style="font-family: arial,helvetica,sans-serif;"><br>Anyway I did have the line with </span></font>pa_sink_set_max_request_within_thread <font size="2"><span style="font-family: arial,helvetica,sans-serif;">so I added
your lines below and didn't get any compile errors, so the function exists in my version, just wasn't used.<br><br>It still all works for me.<br><br>Cheers,<br>Mike<br></span></font><div><br></div><div style="font-family: Courier New,courier,monaco,monospace,sans-serif; font-size: 8pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> pl bossart <bossart.nospam@gmail.com><br><b><span style="font-weight: bold;">To:</span></b> General PulseAudio Discussion <pulseaudio-discuss@mail.0pointer.de><br><b><span style="font-weight: bold;">Sent:</span></b> Mon, 12 July, 2010 22:08:44<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support<br></font><br>> 2. Replace: pa_sink_set_max_rewind(u->sink, u->hwbuf_size); with:<br>>
if(strcmp(u->device_name, "a52") == 0) {<br>> pa_sink_set_max_rewind(u->sink, 0);<br>> } else {<br>> pa_sink_set_max_rewind(u->sink, u->hwbuf_size);<br>> }<br><br><br>NAK. This does not work for me. You need to rewind also in the thread context:<br><br>diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c<br>index 2995c3c..4059a9b 100644<br>--- a/src/modules/alsa/alsa-sink.c<br>+++ b/src/modules/alsa/alsa-sink.c<br>@@ -953,7 +953,12 @@ static int update_sw_params(struct userdata *u) {<br> }<br><br> pa_sink_set_max_request_within_thread(u->sink, u->hwbuf_size -<br>u->hwbuf_unused);<br>- pa_sink_set_max_rewind_within_thread(u->sink, u->hwbuf_size);<br>+ if (pa_alsa_pcm_is_hw(u->pcm_handle))<br>+
pa_sink_set_max_rewind_within_thread(u->sink, u->hwbuf_size);<br>+ else {<br>+ pa_log("Disabling rewind_within_thread for device %s", u->device_name);<br>+ pa_sink_set_max_rewind_within_thread(u->sink, 0);<br>+ }<br><br> return 0;<br> }<br>@@ -1906,7 +1911,12 @@ pa_sink *pa_alsa_sink_new(pa_module *m,<br>pa_modargs *ma, const char*driver, pa_ca<br> (double) pa_bytes_to_usec(u->hwbuf_size, &ss) /<br>PA_USEC_PER_MSEC);<br><br> pa_sink_set_max_request(u->sink, u->hwbuf_size);<br>- pa_sink_set_max_rewind(u->sink, u->hwbuf_size);<br>+ if (pa_alsa_pcm_is_hw(u->pcm_handle))<br>+ pa_sink_set_max_rewind(u->sink, u->hwbuf_size);<br>+ else {<br>+
pa_log("Disabling rewind for device %s", u->device_name);<br>+ pa_sink_set_max_rewind(u->sink, 0);<br>+ }<br><br> if (u->use_tsched) {<br> u->tsched_watermark =<br>pa_usec_to_bytes_round_up(pa_bytes_to_usec_round_up(tsched_watermark,<br>&requested_ss), &u->sink->sample_spec);<br><br>pa_pcm_is_hw detects a52 but allows rewind for iec958. Looks like a<br>better fix than a hard-coded string compare.<br>Even with this fix, the sink doesn't seem to do anything:<br><br>D: alsa-sink.c: Requested to rewind 0 bytes.<br>D: alsa-sink.c: Mhmm, actually there is nothing to rewind.<br>D: protocol-native.c: Requesting rewind due to rewrite.<br>D: sink-input.c: Requesting rewind due to corking<br>D: alsa-sink.c: Requested to rewind 0 bytes.<br>D: alsa-sink.c: Mhmm, actually there is nothing to rewind.<br>D: module-suspend-on-idle.c:
Sink<br>alsa_output.pci-0000_00_1b.0.iec958-ac3-surround-51 becomes idle,<br>timeout in 5 seconds.<br>D: alsa-sink.c: Requested to rewind 0 bytes.<br>D: module-suspend-on-idle.c: Sink<br>alsa_output.pci-0000_00_1b.0.iec958-ac3-surround-51 becomes idle,<br>timeout in 5 seconds.<br>D: alsa-sink.c: Mhmm, actually there is nothing to rewind.<br>D: protocol-dbus.c: Interface org.PulseAudio.Core1.Stream removed from<br>object /org/pulseaudio/core1/playback_stream0<br>I: sink-input.c: Freeing input 0 "Playback Stream"<br>I: client.c: Freed 5 "gst-launch-0.10"<br>I: protocol-native.c: Connection died.<br><br>You'll find my diffs against git master below:<br>- Pierre<br></div></div>
</div><br>
</body></html>