<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">Tazari, Saied wrote on 21-Aug-20 03:37:<br>
    </div>
    <blockquote type="cite"
      cite="mid:a0246a22-5d68-5da6-2825-d32ceafd7987@gmail.com">
      <ol start="6">
        <li>
          <meta http-equiv="Content-Type" content="text/html;
            charset=UTF-8">
          <tt><tt><font color="#009959"><font color="#003300"><tt><tt><font
                        color="#009959"><font color="#003300"><font
                            face="Calibri">Created a new file by </font></font></font></tt></tt></font></font></tt></tt><tt><tt><font
                color="#009959"><font color="#003300"><tt><tt><font
                        color="#009959"><font color="#003300"><font
                            face="Calibri"><u><tt><b><font size="+1"><tt>sudo
                                      vi /etc/asound.conf</tt></font></b></tt></u>
                            and added the following as its sole content
                            (if you know the MAC address of your
                            Bluetooth device, substitute it already now;
                            otherwise you can change it also later in
                            step 9):</font></font></font></tt></tt></font></font></tt></tt></li>
      </ol>
    </blockquote>
    <br>
    <p><tt><font face="Calibri">This was a very important reason why "pa
          rescan " had failed for me previously: I had defined the
          devices in the .asoundrc of the user pi, but freeswitch was
          running with the user "freeswitch" who has no login shell and
          hence cannot have any .asoundrc --> device configuration
          had to go to a user-independent level.</font></tt></p>
    <p><tt><font face="Calibri">The suggested content for this file
          tried to get a better output quality by making use of the
          "a2dp" profile whereas for the mic you have to use the "sco"
          profile. However, in this combination pa is eventually working
          in a pretty unstable way. Therefore, we can simplify the
          content the following way:</font></tt></p>
    <blockquote>
      <p><tt>pcm.btAudioIO {<br>
                  type plug<br>
                  slave.pcm {<br>
                          type bluealsa<br>
                          service "org.bluealsa"<br>
                          device "00:11:09:94:14:3D"<br>
                          profile "sco"<br>
                          delay 10000<br>
                  }<br>
                  hint {<br>
                          show on<br>
                          description "Bluetooth Audio Input/Output
          Dvice"<br>
                  }<br>
          }<br>
          <br>
          ctl.btAudioIO {<br>
                  type bluealsa<br>
                  service "org.bluealsa"<br>
                  battery yes<br>
          }<br>
          <font face="Calibri"></font></tt></p>
    </blockquote>
    <blockquote type="cite"
      cite="mid:a0246a22-5d68-5da6-2825-d32ceafd7987@gmail.com">
      <ol start="10">
        <li><tt><tt><font color="#009959"><font color="#003300"><tt><tt><font
                        color="#009959"><font color="#003300"><font
                            face="Calibri">Test your device with the
                            following two commands (five seconds
                            recording):<br>
                          </font></font></font></tt></tt></font></font><font
                color="#009959"><font color="#003300"><tt><tt><font
                        color="#009959"><font color="#003300"><b><font
                              size="+1">arecord -D btAudioIO -d 5
                              test.wav<br>
                              aplay </font></b></font></font></tt></tt></font></font></tt></tt><tt><tt><font
                color="#009959"><font color="#003300"><tt><tt><font
                        color="#009959"><font color="#003300"><b><font
                              size="+1"><tt><tt><font color="#009959"><font
                                      color="#003300"><tt><tt><font
                                            color="#009959"><font
                                              color="#003300"><b><font
                                                  size="+1">-D btAudioIO
                                                  test.wav<br>
                                                </font></b></font></font></tt></tt></font></font></tt></tt></font></b></font></font></tt></tt></font></font></tt></tt></li>
      </ol>
    </blockquote>
    <p><font face="Calibri"><tt><font size="+1"><br>
            You may also perform a loop test:</font></tt></font></p>
    <blockquote>
      <p><tt><font size="+1"><b>arecord -D btAudioIO | aplay -D
              btAudioIO</b></font></tt><br>
      </p>
    </blockquote>
    <blockquote type="cite"
      cite="mid:a0246a22-5d68-5da6-2825-d32ceafd7987@gmail.com">
      <ol start="10">
      </ol>
      <p>After a reboot, after which also FreeSwitch and my application
        start, everything was working for me just fine :-)<br>
      </p>
    </blockquote>
    <br>
    <p>I forgot to say that you can test the working of the setup in
      fs_cli the following way:</p>
    <ol>
      <li>"<b><font size="+1"><tt>pa devlist</tt></font></b>" should
        generate an output like "<b><font size="+1"><tt>0;btAudioIO(ALSA);128;128;r,i,o</tt></font></b>"</li>
      <li>Like the test at the level of shell, the actual test can be
        the loop test: "<b><font size="+1"><tt>pa looptest</tt></font></b>"</li>
    </ol>
    <p><br>
      KR,</p>
    <p><br>
      -- Saied</p>
    <p><br>
    </p>
  </body>
</html>