<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yiv5327315241"><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;" id="yui_3_16_0_1_1421127289387_2552"><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr">All,</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr"><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr">I've been trying to pin down the cause of an audio issue with pulseaudio and an application called Quisk. This is a software defined radio application that uses I&Q sampling (L&R channels) via a sound card. The SDR radio has both audio in and out going to a Wolfson pi audio card attached to a raspberry pi. My Ubuntu laptop runs the Quisk application and the Pi only runs pulseaudio. Both are using version 5.0 of PA.</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr"><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr">The issue is, after some time of small network buffer underruns or a short time of large network underruns, the incoming IQ audio stream suddenly becomes white noise. Occasionally, the IQ samples appear to be offset by a sample or more, as the SDR application suddenly looses its ability to reject mirror images. When either of these phenomenon occur I usually have to restart the application to recover, however occasionally a subsequent network underrun will "fix" the issue. When either the mirroring problem or the white noise problem occurs, I can start a second instance of the application which will act normally. This makes me think it's not a soundcard issue, but something to do with pulseaudio and either it's alsa device buffer or the network buffer. One other observation is that this problem only seems to happen when i have both read and play streams going at the same time... just one read stream seems to be robust.</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr"><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr">This application uses the simple API. I have tried every combination of buffering attribute I can think of, and have not been able to prevent this issue (except by using Ethernet vs WiFi). I can deal with occasional stream stuttering, but this noise/stream corruption is a show stopper. Has this been encountered before?</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr"><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr">Info below. Thanks in advance.</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr"><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr">Eric</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style="">Here are the basic parameters passed when opening both local and remote sound streams.</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> ss.format = PA_SAMPLE_S16LE;</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> ss.rate = dev->sample_rate;</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> ss.channels = dev->num_channels;</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""><br class="yiv5327315241" style=""></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> if ( strcmp(stream_description, "IQ Input") == 0) {</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> server = "192.168.0.6"; //remote sound server</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> ba.maxlength = (uint32_t) 48000; </div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> ba.fragsize = (uint32_t) -1;</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> s = pa_simple_new(server, "Quisk", direction, dev_name, stream_description, &ss, NULL, &ba, &error);</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> }</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> else if ( strcmp(stream_description, "IQ Output") == 0) {</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> server = "192.168.0.6"; //remote sound server<br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> ba.maxlength = (uint32_t) 96000;</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> ba.prebuf = (uint32_t) -1;</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> ba.tlength = (uint32_t) -1;</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> ba.minreq = (uint32_t)-1;</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> s = pa_simple_new(server, "Quisk", direction, dev_name, stream_description, &ss, NULL, &ba, &error);</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> }</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> else </div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> server = NULL; //use local sound server<br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> s = pa_simple_new(server, "Quisk", direction, dev_name, stream_description, &ss, NULL, NULL, &error);</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""> </div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style="">Here is a trimmed down version of my daemon.conf file on the remote rpi. All other values are either default or not relevant to this issue.</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style="">high-priority = yes</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style="">nice-level = -11</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""><br class="yiv5327315241" style=""></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style="">realtime-scheduling = yes</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style="">realtime-priority = 5</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""><br class="yiv5327315241" style=""></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style="">resample-method = trivial</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style="">; default-sample-format = s16le</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style="">default-sample-rate = 96000</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style="">alternate-sample-rate = 48000</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style="">default-fragments = 4</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style="">default-fragment-size-msec = 40</div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""><br class="yiv5327315241" style=""></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr" class="yiv5327315241" style=""><br></div><div class="yiv5327315241" style="" id="yiv5327315241yui_3_16_0_1_1421125221453_2668"><br class="yiv5327315241" style=""></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr"><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr"><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr"><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr"><br></div><div id="yiv5327315241yui_3_16_0_1_1421125221453_2337" dir="ltr"><br></div></div></div></div></body></html>