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

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

 



Thanks, Farzan Shojaee.

Sadly, even after rebuilding pjsip on both Beaglebone Black boxes per 
your instructions (my config_site.h was originally empty), the behavior 
remains unchanged.  pjsua still exhibits the same (apparently 
recoverable) errors when opening the audio port, no RTP packets are sent 
or received, and no sound is heard.  Hanging up the call still freezes 
pjsua while attempting to close the audio port.

Additional detail: the USB audio dongle blinks its LED during the call, 
so it is somehow active.  The blinking starts when the call starts, but 
does not stop until pjsua is terminated with a ctrl-C (probably because 
the software is unable to politely close the audio port upon call hangup).

Is anyone able to use pjsip with a standard C-Media audio card?


On 01/04/2016 09:00 AM, pjsip-request at lists.pjsip.org wrote:
> Send pjsip mailing list submissions to
> 	pjsip at lists.pjsip.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> or, via email, send a message with subject or body 'help' to
> 	pjsip-request at lists.pjsip.org
>
> You can reach the person managing the list at
> 	pjsip-owner at lists.pjsip.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of pjsip digest..."
>
>
> Today's Topics:
>
>     1. PJSIP Library compiling error on Mac OS X (Prasad De zoysa)
>     2. Beaglebone Black Rev-C with C-Media USB audio, no sound (Tanny)
>     3. Re: Beaglebone Black Rev-C with C-Media USB audio, no sound
>        (Farzan Shojaee)
>     4. libpjnath potential SEGV and suggested fix (Steve Davies)
>     5. Obscure deadlock in libpjnath (Steve Davies)
>     6. two usb sound cards and pjsip (Farzan Shojaee)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 4 Jan 2016 01:08:06 +0530
> From: Prasad De zoysa <tozoysa@xxxxxxxxx>
> To: pjsip at lists.pjsip.org
> Subject: PJSIP Library compiling error on Mac OS X
> Message-ID:
> 	<CAAMrgT+svE+M3gKowPXCAQ_uFv9FjuE0DYzvx7-4Q_eCyh-riQ at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hello All,
>
> I'm trying to compile PJSIP library on my mac and i'm getting below error.
> Could anyone tell me if i'm doing something wrong please?
>
> Commands,
>
> ./configure --host=arm-elf-linux;
>
> $ make dep
>
> $ make
>
> *../src/pj/os_core_unix.c:1128:40: **error: *
>> *use of undeclared identifier 'PTHREAD_MUTEX_FAST_NP'*        rc =
>> pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_FAST_NP);
>>
>> *                                              ^**../src/pj/os_core_unix.c:1138:40:
>> **error: *
>> *use of undeclared identifier 'PTHREAD_MUTEX_RECURSIVE_NP'*        rc =
>> pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
>>
>> *                                              ^**../src/pj/os_core_unix.c:1588:9:
>> **warning: *
>> *'sem_init' is deprecated [-Wdeprecated-declarations]*    if (sem_init(
>> sem->sem, 0, initial) != 0)
>>
>> *        ^**/usr/include/sys/semaphore.h:55:5: note: *'sem_init' has been
>> explicitly marked deprecated here
>> int sem_init(sem_t *, int, unsigned int) __deprecated;
>>
>> *    ^**../src/pj/os_core_unix.c:1711:14: **warning: *
>> *'sem_destroy' is deprecated [-Wdeprecated-declarations]*    result =
>> sem_destroy( sem->sem );
>>
>> *             ^**/usr/include/sys/semaphore.h:53:5: note: *'sem_destroy'
>> has been explicitly marked deprecated here
>> int sem_destroy(sem_t *) __deprecated;
>>
>> *    ^*2 warnings and 2 errors generated.
>> make[2]: *** [output/pjlib-arm-unknown-linux-uclibcgnueabi/os_core_unix.o]
>> Error 1
>> make[1]: *** [libpj-arm-unknown-linux-uclibcgnueabi.a] Error 2
>> make: *** [all] Error 1
>
> Best Regards,
> Prasad.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20160104/712763ac/attachment-0001.html>
>
> ------------------------------
>
> Message: 2
> Date: Sun, 3 Jan 2016 13:44:40 -0800
> From: Tanny <pjsip@xxxxxxxxxx>
> To: pjsip at lists.pjsip.org
> Subject: Beaglebone Black Rev-C with C-Media USB audio, no
> 	sound
> Message-ID: <56899648.4060604 at blog22.com>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>
> 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/20160103/4d726344/attachment-0001.html>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 4 Jan 2016 10:18:14 +0330
> From: "Farzan Shojaee" <Shojaee@xxxxxxxxxxxxxx>
> To: "'pjsip list'" <pjsip at lists.pjsip.org>
> Subject: Re: Beaglebone Black Rev-C with C-Media USB audio, no
> 	sound
> Message-ID: <000601d146bc$034a4510$09decf30$@PartoDadeh.com>
> Content-Type: text/plain; charset="utf-8"
>
> 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-0001.html>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 04 Jan 2016 12:09:38 +0000
> From: Steve Davies <davies147@xxxxxxxxx>
> To: pjsip list <pjsip at lists.pjsip.org>
> Subject: libpjnath potential SEGV and suggested fix
> Message-ID:
> 	<CAFLM+hsGFtuc-wXr9PL2v=z+_54SKBxt3OeXpYoVsuzh3UR_qQ at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi,
>
> First time posting to this list, and I've not lurked for long, so hopefully
> no faux-pas below :)
>
> The following references are from:
>      pjnath/src/pjnath/stun_session.c
> this SEGV can be seen when using Asterisk 11+ with JsSIP or similar clients
> in a very small number of calls (1 in 10,000?) and can also be seen as a
> 100% CPU utilisation in some cases. It seems to have started due to an
> optimisation in Chrome 47+ which triggers this timing-related problem.
>
> In the STUN engine, a retransmit cache is maintained in
>      sess->cached_response_list
> When this linked-list of data is modified, the relevant lock
>      sess->grp_lock
> is held in all places except one.
>
> A cache expiry timer is set on the above list, which fires
>      on_cache_timeout()
> to clean the cache after 10 (?) seconds. This function does not get the
> group lock before trying to empty the list. I propose that the locks are
> added as per the attached patch against 2.4.5.
>
> Feedback obviously welcome. I have load- tested this patch here with great
> success.
>
> Regards,
> Steve
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20160104/0c600c5b/attachment-0001.html>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: lock_stun_sess_on_pkt_timeout
> Type: application/octet-stream
> Size: 877 bytes
> Desc: not available
> URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20160104/0c600c5b/attachment-0001.obj>
>
> ------------------------------
>
> Message: 5
> Date: Mon, 04 Jan 2016 12:55:12 +0000
> From: Steve Davies <davies147@xxxxxxxxx>
> To: pjsip list <pjsip at lists.pjsip.org>
> Subject: Obscure deadlock in libpjnath
> Message-ID:
> 	<CAFLM+hun4LKZjc4uEs=zUbhXSZ6tEva8uNzWefROJEQBF8FBAA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> This deadlock is almost impossible to fix, so can be considered theoretical
> if you'd like, but I have a test rig which can cause what I am describing.
>
> I combined Asterisk-11 latest branch with pjproject-2.4.5 to cause this,
> and my current workaround is to revert to locking behaviour similar to
> pjproject-2.1 just to get me going again.
>
> Attached it a fairly nasty patch that does this. The reasoning is hard to
> explain, but in the file:
>      pjnath/src/pjnath/ice_session.c
> in
>      on_timer()
> The 'ice->grp_lock' is acquired at the start and released at the end, such
> that if the 'ice->cb.on_ice_complete' callback is called, then the lock is
> held while this call completes. This makes perfect sense because the 'ice'
> data is being passed into that callback, but...
>
> What can happen though is in a threaded application (Asterisk), this can
> result in a reversed locking order, and a deadlock - The following is a
> horribly simplified demonstration of 2 threads deadlocking:
>
> Thread1:
> - Call into ice_session.c:on_timer()
> - Locks ice->grp_lock
> - Callback to ice->cb.on_ice_complete()
> - application tries to lock it's own APP_LOCK
>
> Thread2:
> - non PJ application code...
> - Locks it's own APP_LOCK
> - Call into ice_session.c:pj_ice_sess_send_data()
> - Tries to lock ice->grp_lock
>
> As I mentioned, this is VERY hard to demonstrate, but can be made to
> happen. I am sure that the attached patch is not the best solution, but is
> relatively harmless AFAIK to keep me going.
>
> As always, feedback and comments requested.
>
> Regards,
> Steve
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20160104/4d5b0a37/attachment-0001.html>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: unlock_ice_before_callback
> Type: application/octet-stream
> Size: 477 bytes
> Desc: not available
> URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20160104/4d5b0a37/attachment-0001.obj>
>
> ------------------------------
>
> Message: 6
> Date: Mon, 4 Jan 2016 17:20:44 +0330
> From: "Farzan Shojaee" <Shojaee@xxxxxxxxxxxxxx>
> To: "'pjsip list'" <pjsip at lists.pjsip.org>
> Subject: two usb sound cards and pjsip
> Message-ID: <001201d146f6$edc16a30$c9443e90$@PartoDadeh.com>
> Content-Type: text/plain; charset="us-ascii"
>
> I'm using pjsip on Raspberry Pi 1. I compiled and tested it successfully.
> I've used an external USB sound, everything is true. I've attached two
> external USB sound card now. and I want to use two simultaneous pjsua apps
> so that each one work with one of this USB sound cards.
>
> I have edited /etc/modprobe.d/alsa-base.conf as following:
>
>                  options   snd-usb-audio  index=0,1
>
>                  options   snd_bcm2835  index=2
>
> I can see two usb sound card by using "aplay -l" with index of 0 and 1.
>
> I can also see it in "cat    /proc/asound/cards". It shows my two USB sound
> cards.
>
>   
>
> But when I run pjsua (./pjsua-armv61-unknown-linux-gnueabihf   --capture-dev
> 1   --playback-dev   1) it runs successfully and shows that usb sound card 1
> is selected:
>
>   
>
> pjsua_aud.c       Set sound device: capture=1, playback=1
>
> pjsua_app.c       .Turning sound device ON
>
> pjsua_aud.c       .Opening sound device PCM at 8000/1/20ms
>
>   
>
> but USB sound card 0 is active yet and audio heard in it, and USB sound card
> 0 doesn't work anyway.
>
>   
>
> Has anyone any idea??
>
> Help me plz
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20160104/61e00787/attachment-0001.html>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
> ------------------------------
>
> End of pjsip Digest, Vol 101, Issue 2
> *************************************
>




[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