<div dir="ltr"><a class="gmail_plusreply" id="plusReplyChip-0" href="mailto:georg@chini.tk" tabindex="-1">+Georg Chini</a> <br></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 31, 2018 at 10:40 AM Harish Gaddameedi <<a href="mailto:harish.gaddameedi@smartron.com">harish.gaddameedi@smartron.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Georg,<div><br></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">As i told module-loopback is giving overall latency around 300ms from the time when i started the sequence, and<span> </span></span><b style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">latency of module-loopback doesn't grow at any point of time</b><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">. On saturday and sunday, we have kept a continuous streaming for 2 days, expecting that the delay will be further increased, but the delay is constant with 4-5 secs, and <b>there are no errors in the logs</b>. Are there any chances like alsa-sink is filling somewhere and blocking the source to send the audio chunks into the memblockq? </span><br><div><br></div><div><i><b>module-loopback output is like this:</b></i></div><div><div><i>Tue Jul 31 10:15:37 2018 user.debug pulseaudio[4370]: (47917.422| 0.020) [alsa-sink-I2S cx2072x-dsp-0] alsa-sink.c: Wakeup from ALSA!</i></div><div><i>Tue Jul 31 10:15:37 2018 user.debug pulseaudio[4370]: (47917.443| 0.020) [pulseaudio] module-loopback.c: Loopback overall latency is 0.02 ms + 244.43 ms + 54.55 ms = 298.89 ms</i></div><div><i>Tue Jul 31 10:15:37 2018 user.debug pulseaudio[4370]: (47917.443| 0.000) [pulseaudio] module-loopback.c: Loopback latency at base rate is 298.42 ms</i></div><div><i>Tue Jul 31 10:15:37 2018 user.debug pulseaudio[4370]: (47917.443| 0.000) [pulseaudio] module-loopback.c: [alsa_output.0] Updated sampling rate to 44053 Hz.</i></div></div><div><i><br></i></div><div><i><b>pactl list sources:</b></i></div><div><div><i>Source #1</i></div><div><i><span style="white-space:pre-wrap"> </span>State: RUNNING</i></div><div><i><span style="white-space:pre-wrap"> </span>Name: bluez_source</i></div><div><i><span style="white-space:pre-wrap"> </span>Description: AP 🙏</i></div><div><i><span style="white-space:pre-wrap"> </span>Driver: module-bluez5-device.c</i></div><div><i><span style="white-space:pre-wrap"> </span>Sample Specification: s16le 2ch 44100Hz</i></div><div><i><span style="white-space:pre-wrap"> </span>Channel Map: front-left,front-right</i></div><div><i><span style="white-space:pre-wrap"> </span>Owner Module: 17</i></div><div><i><span style="white-space:pre-wrap"> </span>Mute: no</i></div><div><i><span style="white-space:pre-wrap"> </span>Volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB</i></div><div><i><span style="white-space:pre-wrap"> </span> balance 0.00</i></div><div><i><span style="white-space:pre-wrap"> </span>Base Volume: 65536 / 100% / 0.00 dB</i></div><div><i><span style="white-space:pre-wrap"> </span>Monitor of Sink: n/a</i></div><div><i><span style="white-space:pre-wrap"> </span>Latency: 45876 usec, configured 39512 usec</i></div><div><i><span style="white-space:pre-wrap"> </span>Flags: HARDWARE DECIBEL_VOLUME LATENCY </i></div><div><i><span style="white-space:pre-wrap"> </span>Properties:</i></div><div><i><span style="white-space:pre-wrap"> </span>bluetooth.protocol = "a2dp_source"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.description = "AP 🙏"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.string = "AC:C1:EE:69:A6:02"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.api = "bluez"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.class = "sound"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.bus = "bluetooth"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.form_factor = "phone"</i></div><div><i><span style="white-space:pre-wrap"> </span>bluez.path = "/org/bluez/hci0/dev_AC_C1_EE_69_A6_02"</i></div><div><i><span style="white-space:pre-wrap"> </span>bluez.class = "0x5a020c"</i></div><div><i><span style="white-space:pre-wrap"> </span>bluez.alias = "AP 🙏"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.icon_name = "audio-card-bluetooth"</i></div><div><i><span style="white-space:pre-wrap"> </span>Ports:</i></div><div><i><span style="white-space:pre-wrap"> </span>phone-input: Phone (priority: 0, available)</i></div><div><i><span style="white-space:pre-wrap"> </span>Active Port: phone-input</i></div><div><i><span style="white-space:pre-wrap"> </span>Formats:</i></div><div><i><span style="white-space:pre-wrap"> </span>pcm</i></div><div style="font-weight:bold"><br></div></div><div style="font-weight:bold"><i>pactl list sinks:</i></div><div><div><i>Sink #0</i></div><div><i><span style="white-space:pre-wrap"> </span>State: RUNNING</i></div><div><i><span style="white-space:pre-wrap"> </span>Name: alsa_output.0</i></div><div><i><span style="white-space:pre-wrap"> </span>Description: ipq4019_snd_card</i></div><div><i><span style="white-space:pre-wrap"> </span>Driver: module-alsa-sink.c</i></div><div><i><span style="white-space:pre-wrap"> </span>Sample Specification: s16le 2ch 48000Hz</i></div><div><i><span style="white-space:pre-wrap"> </span>Channel Map: front-left,front-right</i></div><div><i><span style="white-space:pre-wrap"> </span>Owner Module: 5</i></div><div><i><span style="white-space:pre-wrap"> </span>Mute: no</i></div><div><i><span style="white-space:pre-wrap"> </span>Volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB</i></div><div><i><span style="white-space:pre-wrap"> </span> balance 0.00</i></div><div><i><span style="white-space:pre-wrap"> </span>Base Volume: 65536 / 100% / 0.00 dB</i></div><div><i><span style="white-space:pre-wrap"> </span>Monitor Source: alsa_output.0.monitor</i></div><div><i><span style="white-space:pre-wrap"> </span>Latency: 0 usec, configured 26000 usec</i></div><div><i><span style="white-space:pre-wrap"> </span>Flags: HARDWARE DECIBEL_VOLUME LATENCY </i></div><div><i><span style="white-space:pre-wrap"> </span>Properties:</i></div><div><i><span style="white-space:pre-wrap"> </span>alsa.resolution_bits = "16"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.api = "alsa"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.class = "sound"</i></div><div><i><span style="white-space:pre-wrap"> </span>alsa.class = "generic"</i></div><div><i><span style="white-space:pre-wrap"> </span>alsa.subclass = "generic-mix"</i></div><div><i><span style="white-space:pre-wrap"> </span><a href="http://alsa.name" target="_blank">alsa.name</a> = ""</i></div><div><i><span style="white-space:pre-wrap"> </span><a href="http://alsa.id" target="_blank">alsa.id</a> = "I2S cx2072x-dsp-0"</i></div><div><i><span style="white-space:pre-wrap"> </span>alsa.subdevice = "0"</i></div><div><i><span style="white-space:pre-wrap"> </span>alsa.subdevice_name = "subdevice #0"</i></div><div><i><span style="white-space:pre-wrap"> </span>alsa.device = "0"</i></div><div><i><span style="white-space:pre-wrap"> </span>alsa.card = "0"</i></div><div><i><span style="white-space:pre-wrap"> </span>alsa.card_name = "snd_card"</i></div><div><i><span style="white-space:pre-wrap"> </span>alsa.long_card_name = "snd_card"</i></div><div><i><span style="white-space:pre-wrap"> </span>alsa.driver_name = "<i style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">snd_card</i>"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.string = "dmixer"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.buffering.buffer_size = "383040"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.buffering.fragment_size = "4032"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.access_mode = "mmap+timer"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.description = "snd_card"</i></div><div><i><span style="white-space:pre-wrap"> </span>device.icon_name = "audio-card"</i></div><div><i><span style="white-space:pre-wrap"> </span>Formats:</i></div><div><i><span style="white-space:pre-wrap"> </span>pcm</i></div><div style="font-weight:bold"><br></div></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Jul 29, 2018 at 9:37 PM Georg Chini <<a href="mailto:georg@chini.tk" target="_blank">georg@chini.tk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div class="m_4540190555070405963m_9083762336076987211moz-cite-prefix">On 29.07.2018 18:03, Georg Chini wrote:<br>
</div>
<blockquote type="cite">
<div class="m_4540190555070405963m_9083762336076987211moz-cite-prefix">On 29.07.2018 12:44, Harish
Gaddameedi wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr"> <span style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Hi
Georg,</span>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br>
</div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">I
was working on simple Openwrt Platform, and Source device is
Android phone Bluetooth with Youtube app 24 hrs live
streaming video and alsa device is speaker, which is
hardwired</div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br>
</div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">The
12 hrs testing which i did on pulseaudio-11.1 are without my
modification. The basic modification which i made in the
previous pulseaudio-8.0 is with the idle state of
bluez_source card (i.e., card is vanishing when the song is
in the pause state) and did some changes to buffers of
pulseaudio to reduce the latency. But in pulseaudio-11.1 i
didn't do all the changes as i didn't find any initial
latency. but periodic latency after 12hrs still exists. The
issue is reproducible with Gstreamer also. </div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br>
</div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">I
haven't worked on microphone scenarios, I'm just working on
music player and speaker.</div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br>
</div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Let
me clear you some test scenarios for better understanding,</div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Case
1: Android phone as source (bluez_source) and device with
internal speaker (alsa-sink as sink for pulseaudio)
-------> delay after 12hrs exists.</div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Case
2: Device with Gstreamer as source and same device with
internal speaker (pulsesink with <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">alsa
card as sink for pulseaudio</span>) ----------> delay
after 12 hrs exists.</div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Case
3: Device with Gstreamer as source and External Bluetooth
speaker (pulsesink with bluez_sink card) -----------> No
delay after 12 hrs.</div>
<br class="m_4540190555070405963m_9083762336076987211gmail-Apple-interchange-newline">
</div>
</blockquote>
What output does module-loopback give when you run with debugging?<br>
Do you see the growing latency there? Does it show up with pactl
list sinks<br>
or pactl list sources? Any error messages in the PA log?<br>
<br>
Regards<br>
Georg<br>
</blockquote>
One more comment: It may well be worth trying 12.2 because the
bluetooth thread<br>
function has changed.<br>
</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_4540190555070405963gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Regards,</div><div>Harish Gaddameedi</div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Regards,</div><div>Harish Gaddameedi</div><div>Software Engineer<br></div><div>Mobile: +91- 9246040475<br></div><div><img src="https://docs.google.com/uc?export=download&id=1179THzPaIyEiFgbLrcPWmCyheA5rAXcv&revid=0B1BS28AhWdviTDdRRGY3bzFIZ1FTaXd0d0o1cHJRYms4ejIwPQ" height="54" width="96"><br></div></div></div></div></div></div></div>