title: PJSIP Media Error
body: <p>I am working with Raspberry Pi's and PJSIP Softphone library, i have one Raspberry where everything works fine and one who always throws a error. The sound device is an usb headset which is configured correctly, means i can play sounds via <code>aplay path/to/file</code>. </p>
  
  <p>I am just starting a call via a button:</p>
  
  <pre><code>if ( button[1] ) { 
      digitalWrite( GPIO_LED_CALL3_AKTIVE, HIGH );
      while ( GPIO_Read( GPIO_BTN_CALL3 ) );
      dest_uri = pj_str( "sip:6001@" SIP_DOMAIN );
      call_init = 1;
  }   
  /* Initiate Call if call_init was set */
  if ( call_init ) { 
      call_init = 0;
      printf ( "\n=============   Call to %s   =============\n",dest_uri );
      int status = pjsua_call_make_call( acc_id, &amp;dest_uri, 0, NULL, NULL, NULL );
      delay ( 1000 );
  }
  </code></pre>
  
  <p>The error which is thrown looks like following</p>
  
  <pre><code>Expression 'SetApproximateSampleRate( pcm, hwParams, sr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1294
  Expression 'PaAlsaStreamComponent_InitialConfigure( &amp;self-&gt;capture, inParams, self-&gt;primeBuffers, hwParamsCapture, &amp;realSr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1870
  Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &amp;inputLatency, &amp;outputLatency, &amp;hostBufferSizeMode )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1994
  Expression 'SetApproximateSampleRate( pcm, hwParams, sr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1294
  Expression 'PaAlsaStreamComponent_InitialConfigure( &amp;self-&gt;capture, inParams, self-&gt;primeBuffers, hwParamsCapture, &amp;realSr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1870
  Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &amp;inputLatency, &amp;outputLatency, &amp;hostBufferSizeMode )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1994
  </code></pre>
  
  <p>I get a short audio output which stops after 1 or 2 seconds.  </p>
  
  <p>I have build PJSIP by source like following:</p>
  
  <pre><code>    sudo su
  
      apt−get install build−essential automake autoconf libtool \
         libasound2−dev libpulse−dev libssl−dev libsamplerate0−dev \
         libcommoncpp2−dev libccrtp−dev libzrtpcpp−dev libdbus−1−dev \
         libdbus−c++−dev libyaml−dev libpcre3-dev libgsm1−dev \ 
         libspeex−dev libspeexdsp−dev libcelt−dev
          cd /home/pi
          wget http://www.pjsip.org/release/2.4.5/pjproject−2.4.5.tar.bz2 
          tar xvjf pjproject −2.4.5.tar.bz2
          cd pjproject−2.4.5.tar.bz2
          ./configure &amp;&amp; make dep &amp;&amp; make
  </code></pre>
  
  <p>As far as i can say its now a programming error since the code works on one device. So is it an audio miss configuration oder  did i build pjsip wrong? Maybe i forget a package or sth? </p>
  
  <p>if you need more information about the code i can give you more. Thanks for your time.</p>
  
  <p>EDIT:</p>
  
  <p>I have playback methods which looks like following:</p>
  
  <pre><code>static void ringback_start( pjsua_call_id call_id ) {
      print_Debug_Info( "*** Starting ringback to out_call ***\n" );
      pj_str_t fname = pj_str( "Sounds/Freizeichen3.wav" );
      pjsua_player_create( &amp;fname, 0, &amp;cm.player_id );
      pjsua_conf_connect( pjsua_player_get_conf_port( cm.player_id ), 0 );
  }
  
  static void ringback_stop( pjsua_call_id call_id ) {
      print_Debug_Info( "*** Stopping ringback to out_call ***\n" );
      pjsua_conf_disconnect( pjsua_player_get_conf_port( cm.player_id ), 0 );
      pjsua_player_destroy( cm.player_id );
  }
  </code></pre>
  
  <p>I have some feeling that this could create the error since i get the error even before the call is established.</p>