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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux