[pjsip] No sound from capture device when communication via Ethernet - Works properly with Wifi.

Mysoft Systems info at mysoftsystems.com
Wed Jan 11 21:43:59 EST 2017


Hi Guys!

 

We deployed this build to a raspberry pie 3
https://trac.pjsip.org/repos/wiki/Getting-Started/Windows-Phone.

 

The Raspberry Pi is running Windows IOT. Since Raspberry has no microphone,
we are using a standard Generic USB Audio device (we have a lot of  them and
we found some that work very well).

 

It is important to note that the raspberry pi has a single LAN/USB chip on
board - here is some info from the specification:

"The Raspberry Pi 3 shares the same SMSC LAN9514 chip as its predecessor,
the Raspberry Pi 2, adding 10/100 Ethernet connectivity and four USB
channels to the board. As before, the SMSC chip connects to the SoC via a
single USB channel, acting as a USB-to-Ethernet adaptor and USB hub."

 

Now about the problem... When I make a voip call from through the
raspberry's wifi module - everything works just perfect. Wasapi raises an
event and this portion of code in wasapi_dev.cpp works fine:

 

hr = strm->cap_client->GetNextPacketSize(&packet_size);

     if (FAILED(hr)) {

  PJ_LOG(4, (THIS_FILE, "Error getting next packet size"));

  continue;

     }

     

     while (packet_size) {

 

  unsigned next_frame_size = 0;

  DWORD cap_flag;

  pj_int16_t *cap_buf = NULL;

  unsigned nsamples = 0;

 

  hr = strm->cap_client->GetBuffer((BYTE**)&cap_buf,

       &next_frame_size,

       &cap_flag,

       NULL,

       NULL);

 

But when I use the same code on the same raspberry connected to the network
through the Pi's Ethernet connection, event in thread is raised, but we get
packet_size == 0 all the time. One time per 5-10 seconds we get some data,
which sounds like a short blip on the other side. As a result, the log
constantly contains  "speex  warning: discarded first playback frame" - not
just for the first frame but for almost all frames.  (it seems that this is
an outcome from the lack of data in the packets) 

 

I did one more test - I Took a portion of code that is provided in the
samples that records sound to file. It uses the same Wasapi device, and gets
audio when the Ethernet is connected (but not used). After that I tried to
record the sound while having a load the LAN, (by copying large files while
recording) and I got the same result, the sound is recorded perfectly.

 

So the problem appears to be only when Ethernet is used for pjsip
communication (before sending the stream).

 

Another interesting factor is, that I tried using a webcam as the capture
device, and in this instance, it works perfectly.

 

Any suggestions for what may cause this, and how to rectify this issue? Are
there perhaps any values I can change that may affect this?

 

The problem was reproduced on different pies with different USB audio
devices.

 

Any assistance would be greatly appreciated

Thanks in advance!

Yanky

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20170111/b3d5f6ae/attachment-0002.html>


More information about the pjsip mailing list