<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 25.08.2015 13:58, Eytan Naim wrote:<br>
    </div>
    <blockquote
      cite="mid:1a68760681c44202a08b293394d8d313@IL-EXCH02.marvell.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I’m trying to enable HFP on pulseaudio 6.0
          using oFono and bluez 5 on a new embedded platform which
          doesn’t support alsa yet.<o:p></o:p></p>
        <p class="MsoNormal">In order to confirm that audio is ‘played’
          I record it using parecord tool. – This method worked just
          fine when enabled a2dp a short time ago.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">After executing oFono & pulseaudio, a
          call is answered on the remote device- It is seemed that the
          relevant profile is chosen on pulseaudio, and parecord fails
          to record.</p>
      </div>
    </blockquote>
    <br>
    What is the source you are recording from?<br>
    <br>
    <blockquote
      cite="mid:1a68760681c44202a08b293394d8d313@IL-EXCH02.marvell.com"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">When executing ‘pacmd stat’ it seems that <o:p></o:p></p>
        <p class="MsoNormal"><span
            style="background:yellow;mso-highlight:yellow">Memory blocks
            allocated during the whole lifetime: 192, size: 699.9 KiB.</span><o:p></o:p></p>
        <p class="MsoNormal">Is constant while pulseaudio prints to
          terminal the following message along the call with relatively
          fixed intervals:<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">( 482.106|   0.013) D:
          [pulseaudio][modules/module-loopback.c:201 adjust_rates()]
          Should buffer 96 bytes, buffered at minimum 128 bytes<o:p></o:p></p>
        <p class="MsoNormal">( 482.118|   0.012) D:
          [pulseaudio][modules/module-loopback.c:226 adjust_rates()]
          [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate to 8000
          Hz.<o:p></o:p></p>
        <p class="MsoNormal">( 482.132|   0.013) D:
          [pulseaudio][modules/module-loopback.c:197 adjust_rates()]
          Loopback overall latency is 610.13 ms + 0.00 ms + 25.00 ms =
          635.13 ms<o:p></o:p></p>
        <p class="MsoNormal">( 482.146|   0.014) D:
          [pulseaudio][modules/module-loopback.c:201 adjust_rates()]
          Should buffer 96 bytes, buffered at minimum 0 bytes<o:p></o:p></p>
        <p class="MsoNormal">( 482.159|   0.012) D:
          [pulseaudio][modules/module-loopback.c:226 adjust_rates()]
          [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate to 8000
          Hz.<o:p></o:p></p>
        <p class="MsoNormal">( 492.134|   9.975) D:
          [pulseaudio][modules/module-loopback.c:197 adjust_rates()]
          Loopback overall latency is 610.13 ms + 8.00 ms + 0.00 ms =
          618.13 ms<o:p></o:p></p>
        <p class="MsoNormal">( 492.148|   0.013) D:
          [pulseaudio][modules/module-loopback.c:201 adjust_rates()]
          Should buffer 96 bytes, buffered at minimum 128 bytes<o:p></o:p></p>
        <p class="MsoNormal">( 492.161|   0.012) D:
          [pulseaudio][modules/module-loopback.c:226 adjust_rates()]
          [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate to 8000
          Hz.<o:p></o:p></p>
        <p class="MsoNormal">( 492.175|   0.013) D:
          [pulseaudio][modules/module-loopback.c:197 adjust_rates()]
          Loopback overall latency is 610.13 ms + 0.00 ms + 25.00 ms =
          635.13 ms<o:p></o:p></p>
        <p class="MsoNormal">( 492.189|   0.014) D:
          [pulseaudio][modules/module-loopback.c:201 adjust_rates()]
          Should buffer 96 bytes, buffered at minimum 0 bytes<o:p></o:p></p>
        <p class="MsoNormal">( 492.201|   0.012) D:
          [pulseaudio][modules/module-loopback.c:226 adjust_rates()]
          [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate to 8000
          Hz.<o:p></o:p></p>
        <p class="MsoNormal">( 502.176|   9.975) D:
          [pulseaudio][modules/module-loopback.c:197 adjust_rates()]
          Loopback overall latency is 610.13 ms + 8.00 ms + 0.00 ms =
          618.13 ms<o:p></o:p></p>
        <p class="MsoNormal">( 502.190|   0.013) D:
          [pulseaudio][modules/module-loopback.c:201 adjust_rates()]
          Should buffer 96 bytes, buffered at minimum 128 bytes<o:p></o:p></p>
        <p class="MsoNormal">( 502.202|   0.012) D:
          [pulseaudio][modules/module-loopback.c:226 adjust_rates()]
          [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate to 8000
          Hz.<o:p></o:p></p>
        <p class="MsoNormal">( 502.216|   0.013) D:
          [pulseaudio][modules/module-loopback.c:197 adjust_rates()]
          Loopback overall latency is 610.13 ms + 0.00 ms + 25.00 ms =
          635.13 ms<o:p></o:p></p>
        <p class="MsoNormal"><o:p><br>
          </o:p></p>
      </div>
    </blockquote>
    <br>
    This looks fine, the messages are from two module-loopback which are
    loaded to play back<br>
    the audio coming from the phone and to transmit audio from your
    computer to the phone.<br>
    But this is also where it is getting strange because you have no
    other sound device.<br>
    The only sink available to play back audio to is the phone and the
    only source to record from<br>
    (except the phone source) is the monitor source of the phone sink
    (See below for explanation<br>
    of the monitor source).<br>
    <br>
    To avoid that situation you should add a null sink and a null source
    to your system using<br>
    module-null-sink and module-null-source and make them the default
    sink and source.<br>
    Then audio coming from the phone will be played back to the null
    sink (and you can record<br>
    from null.monitor) while silence coming from the null-source is sent
    to the phone. <br>
    <br>
    <blockquote
      cite="mid:1a68760681c44202a08b293394d8d313@IL-EXCH02.marvell.com"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal">Please note:<o:p></o:p></p>
        <p class="MsoNormal" style="text-indent:.5in">I’m now familer
          with oFono at all – I simply run it as ofonod -d<o:p></o:p></p>
        <p class="MsoNormal" style="text-indent:.5in">Pacmd list output
          is attached while call is still ongoing. – there are 2 sources
          loaded and one sink.<o:p></o:p></p>
        <p class="MsoNormal">                <o:p></o:p></p>
        <p class="MsoNormal">Also, could someone explain why are there
          two source available? Nexus 4 and Nexus 4 monitor?</p>
      </div>
    </blockquote>
    <br>
    The monitor source is created for each sink so that you have a
    source from where you<br>
    can record what is played back to the sink.<br>
    <br>
    <blockquote
      cite="mid:1a68760681c44202a08b293394d8d313@IL-EXCH02.marvell.com"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><o:p></o:p></p>
        <p class="MsoNormal">How can I confirm that the audio arrives at
          pulseaudio? By the log I would assume that the answer is
          positive, but according to ‘pacmd stat’ the value it seems
          not.</p>
      </div>
    </blockquote>
    <br>
    In general it looks like your setup is working.<br>
    <br>
    <blockquote
      cite="mid:1a68760681c44202a08b293394d8d313@IL-EXCH02.marvell.com"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Thanks for your help,<o:p></o:p></p>
        <p class="MsoNormal">Eytan.<o:p></o:p></p>
      </div>
      <br>
    </blockquote>
    <br>
  </body>
</html>