Beaglebone Black Rev-C with C-Media USB audio, no sound

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

 



Hi

I had the same problem on Raspberry PI. It solved  by doing the following steps:

Edit the config_site.h file at "../pjlib/include/pj/" and write these lines in it:

#define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO          0

#define PJMEDIA_AUDIO_DEV_HAS_ALSA                         1

#include <pj/config_site_sample.h>

 

./configure

make clean

make dep

make

 

I hope this maybe helpfull

From: pjsip [mailto:pjsip-bounces@xxxxxxxxxxxxxxx] On Behalf Of Tanny
Sent: Monday, January 04, 2016 1:15 AM
To: pjsip at lists.pjsip.org
Subject: Beaglebone Black Rev-C with C-Media USB audio, no sound

 

The audio problem - a total lack of sound - occurs when attempting to use pjsip to connect two Beaglebone Black Rev-C boxes on a LAN, running Debian from microSD cards.  There is no NAT issue since both are inside the same LAN.

Orange Box:
===========
Linux cargo-42-4 3.8.13-bone50 #1 SMP Tue May 13 13:24:52 UTC 2014 armv7l GNU/Linux
Debian GNU/Linux 7
The IP Address for eth0 is: 192.168.1.32
C-Media USB audio (nameless cheapo)

Transparent Box:
================
Linux cargo-159 3.8.13-bone79 #1 SMP Tue Oct 13 20:44:55 UTC 2015 armv7l GNU/Linux
BeagleBoard.org Debian 7.9 Image 2015-11-12
The IP Address for eth0 is: 192.168.1.15
C-Media USB audio (Syba)

Both boxes can record ('arecord') and play ('aplay') audio properly over the USB dongle, which is the default audio device (.asoundrc == 'pcm.!default sysdefault:Device').  HDMI audio is fully disabled via uEnv.txt.

The problem is that when connected via pjsip 2.4.5, no sound is communicated, and no port 4000 UDP packets are transferred.  A pjsua recording test yields an empty wav file.

Test:
=====
I run pjsua on both boxes, then initiate a call from Orange Box to Transparent Box.  Some errors occur when opening the sound device (but maybe they're legitimate codec-match failures).  The next console snippet shows all the errors that occur (captured from Orange Box, but both boxes behave the same).
=====
11:06:39.410    pjsua_aud.c  .Set sound device: capture=-1, playback=-2
11:06:39.411    pjsua_app.c  ..Turning sound device ON
11:06:39.412    pjsua_aud.c  ..Opening sound device PCM at 16000/1/20ms
Expression 'SetApproximateSampleRate( pcm, hwParams, sr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1294
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self->primeBuffers, hwParamsCapture, &realSr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1870
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &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( &self->capture, inParams, self->primeBuffers, hwParamsCapture, &realSr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1870
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1994
11:06:39.430    pjsua_app.c  ..Turning sound device ON
11:06:39.432    pjsua_aud.c  ..Opening sound device PCM at 44100/1/20ms
11:06:39.489     ec0x236770  ...AEC created, clock_rate=44100, channel=1, samples per frame=882, tail length=200 ms, latency=0 ms
=====
Some INVITES later, the media negotiation looks good:
=====
11:06:45.382   pjsua_core.c  .RX 885 bytes Response msg 200/INVITE/cseq=22258 (rdata0x24cebc) from UDP 192.168.1.15:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.32:5060;rport=5060;received=192.168.1.32;branch=z9hG4bKPjl0nsfaVcpIDXP9f9jS1bzxPnA.zg2QjS
Call-ID: Odd58LgI.B2F2WUfW.RmbTox2CXzpAK7
From: <sip:192.168.1.32>;tag=-HgPab8XCkf0D3cnQxggXsmhX-IJaFur
To: <sip:192.168.1.15>;tag=BV9GhxaJGo5ihz.yt5SbQHkX3cbMmCJV
CSeq: 22258 INVITE
Contact: <sip:192.168.1.15:5060>
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800;refresher=uac
Require: timer
Content-Type: application/sdp
Content-Length:   275

v=0
o=- 3660836799 3660836800 IN IP4 192.168.1.15
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4000 RTP/AVP 98 96
c=IN IP4 192.168.1.15
b=TIAS:64000
a=rtcp:4001 IN IP4 192.168.1.15
a=sendrecv
a=rtpmap:98 speex/16000
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-16

--end msg--
11:06:45.407    pjsua_app.c  .....Call 0 state changed to CONNECTING
11:06:45.410  pjsua_media.c  .....Call 0: updating media..
11:06:45.411    pjsua_aud.c  ......Audio channel update..
11:06:45.414   strm0x2d6034  .......VAD temporarily disabled
11:06:45.419   strm0x2d6034  .......Encoder stream started
11:06:45.420   strm0x2d6034  .......Decoder stream started
11:06:45.424  pjsua_media.c  ......Audio updated, stream #0: speex (sendrecv)
11:06:45.426    pjsua_app.c  .....Call 0 media 0 [type=audio], status is Active
11:06:45.428    pjsua_aud.c  .....Conf connect: 4 --> 0
11:06:45.429   conference.c  ......Port 4 (sip:192.168.1.15) transmitting to port 0 (USB PnP Sound Device: USB Audio (hw:0,0) (44KHz))
11:06:45.431    pjsua_aud.c  .....Conf connect: 0 --> 4
11:06:45.432   conference.c  ......Port 0 (USB PnP Sound Device: USB Audio (hw:0,0) (44KHz)) transmitting to port 4 (sip:192.168.1.15)
=====
The boxes are connected but no sound can be heard at either end.  Having started pjsua with '--rec-file mic2.wav', we now connect the microphone input to the wav file output.
=====
>>> cl
Conference ports:
Port #00[16KHz/20ms/1] USB PnP Sound Device: USB Audio (hw:0,0) (44KHz)  transmitting to: #4 
Port #01[16KHz/20ms/1]             mic2.wav  transmitting to: 
Port #02[16KHz/20ms/1]             ringback  transmitting to: 
Port #03[16KHz/20ms/1]                 ring  transmitting to: 
Port #04[16KHz/20ms/1]     sip:192.168.1.15  transmitting to: #0 

>>> cc 0 1
11:07:26.206    pjsua_aud.c !Conf connect: 0 --> 1
11:07:26.207   conference.c  .Port 0 (USB PnP Sound Device: USB Audio (hw:0,0) (44KHz)) transmitting to port 1 (mic2.wav)
Success
=====
We say a few words, then end the recording using 'cd'.  
=====
>>> cd
[...]
Disconnect src port # (empty to cancel): 1
>From dst port # (empty to cancel): 
>>> cd
Conference ports:
[...]
Disconnect src port # (empty to cancel): 0
>From dst port # (empty to cancel): 1
11:08:06.483    pjsua_aud.c  Conf disconnect: 0 -x- 1
11:08:06.484   conference.c  .Port 0 (USB PnP Sound Device: USB Audio (hw:0,0) (44KHz)) stop transmitting to port 1 (mic2.wav)
Success
=====
The freshly recorded wav file is unexpectedly empty.
=====
-rw-r--r-- 1 bear bear     0 Jan  3 11:06 mic2.wav

A possibly related issue: Subsequently, when attempting to hang up the call, pjsua hangs (freezes) when closing the USB sound device, so ctrl-C must be used to terminate it.  This also happens when pjsua is run with no recording option.  Note as well that no RTP packets were ever sent.
=====
11:08:30.165    pjsua_app.c  ......Call 0 is DISCONNECTED [reason=200 (Normal call clearing)]
11:08:30.167 pjsua_app_comm  ......
  [DISCONNCTD] To: sip:192.168.1.15;tag=BV9GhxaJGo5ihz.yt5SbQHkX3cbMmCJV
    Call time: 00h:01m:44s, 1st res in 5912 ms, conn in 5952ms
    #0 audio speex @16kHz, sendrecv, peer=-
       SRTP status: Not active Crypto-suite: 
       RX pt=98, last update:00h:01m:44.744s ago
          total 0pkt 0B (0B +IP hdr) @avg=0bps/0bps
          pkt loss=0 (0.0%), discrd=0 (0.0%), dup=0 (0.0%), reord=0 (0.0%)
                (msec)    min     avg     max     last    dev
          loss period:   0.000   0.000   0.000   0.000   0.000
          jitter     :   0.000   0.000   0.000   0.000   0.000
       TX pt=98, ptime=20, last update:never
          total 0pkt 0B (0B +IP hdr) @avg=0bps/0bps
          pkt loss=0 (0.0%), dup=0 (0.0%), reorder=0 (0.0%)
                (msec)    min     avg     max     last    dev 
          loss period:   0.000   0.000   0.000   0.000   0.000
          jitter     :   0.000   0.000   0.000   0.000   0.000
       RTT msec      :   0.000   0.000   0.000   0.000   0.000
11:08:30.173  pjsua_media.c  ......Call 0: deinitializing media..
11:08:30.179  pjsua_media.c  ........Media stream call00:0 is destroyed
11:08:31.176    pjsua_aud.c  Closing sound device after idle for 1 second(s)
11:08:31.178    pjsua_app.c  .Turning sound device OFF
11:08:31.180    pjsua_aud.c  .Closing USB PnP Sound Device: USB Audio (hw:0,0) sound playback device and USB PnP Sound Device: USB Audio (hw:0,0) sound capture device

>>>>

^C
=====
The empty  recording appears to indicate that audio is not being received, or not being processed, by pjsip.  But normal alsa aplay and arecord work fine on both boxes.

Any suggestions on how to resolve or further troubleshoot this would be appreciated.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20160104/54657a42/attachment.html>


[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