<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-&gt;sink, u-&gt;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 &lt;bossart.nospam@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> General PulseAudio Discussion &lt;pulseaudio-discuss@mail.0pointer.de&gt;<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>&gt; 2. Replace: pa_sink_set_max_rewind(u-&gt;sink, u-&gt;hwbuf_size); &nbsp; &nbsp;&nbsp; with:<br>&gt;
 &nbsp;&nbsp;&nbsp; if(strcmp(u-&gt;device_name, "a52") == 0) {<br>&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pa_sink_set_max_rewind(u-&gt;sink, 0);<br>&gt; &nbsp;&nbsp;&nbsp; } else {<br>&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pa_sink_set_max_rewind(u-&gt;sink, u-&gt;hwbuf_size);<br>&gt; &nbsp;&nbsp;&nbsp; }<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>&nbsp; &nbsp;  }<br><br>&nbsp; &nbsp;  pa_sink_set_max_request_within_thread(u-&gt;sink, u-&gt;hwbuf_size -<br>u-&gt;hwbuf_unused);<br>-&nbsp; &nbsp; pa_sink_set_max_rewind_within_thread(u-&gt;sink, u-&gt;hwbuf_size);<br>+&nbsp; &nbsp;  if (pa_alsa_pcm_is_hw(u-&gt;pcm_handle))<br>+&nbsp; &nbsp;
 &nbsp; &nbsp;  pa_sink_set_max_rewind_within_thread(u-&gt;sink, u-&gt;hwbuf_size);<br>+&nbsp; &nbsp; else {<br>+&nbsp; &nbsp; &nbsp; &nbsp; pa_log("Disabling rewind_within_thread for device %s", u-&gt;device_name);<br>+&nbsp; &nbsp; &nbsp; &nbsp; pa_sink_set_max_rewind_within_thread(u-&gt;sink, 0);<br>+&nbsp; &nbsp; }<br><br>&nbsp; &nbsp;  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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (double) pa_bytes_to_usec(u-&gt;hwbuf_size, &amp;ss) /<br>PA_USEC_PER_MSEC);<br><br>&nbsp; &nbsp;  pa_sink_set_max_request(u-&gt;sink, u-&gt;hwbuf_size);<br>-&nbsp; &nbsp; pa_sink_set_max_rewind(u-&gt;sink, u-&gt;hwbuf_size);<br>+&nbsp; &nbsp; if (pa_alsa_pcm_is_hw(u-&gt;pcm_handle))<br>+&nbsp; &nbsp; &nbsp; &nbsp; pa_sink_set_max_rewind(u-&gt;sink, u-&gt;hwbuf_size);<br>+&nbsp; &nbsp; else {<br>+&nbsp; &nbsp; &nbsp; &nbsp;
 pa_log("Disabling rewind for device %s", u-&gt;device_name);<br>+&nbsp; &nbsp; &nbsp; &nbsp; pa_sink_set_max_rewind(u-&gt;sink, 0);<br>+&nbsp; &nbsp; }<br><br>&nbsp; &nbsp;  if (u-&gt;use_tsched) {<br>&nbsp; &nbsp; &nbsp; &nbsp;  u-&gt;tsched_watermark =<br>pa_usec_to_bytes_round_up(pa_bytes_to_usec_round_up(tsched_watermark,<br>&amp;requested_ss), &amp;u-&gt;sink-&gt;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>