[RESOLVED] Conversion between codecs (can't get it working)

Hi All,

This is probably something very stupid and simple, but I fail to find to solution, so please help…

I have (a.o.) two Android phones connected to my Asterisk server, both are on the internal lan, so no NAT issues etc. I am using the app CSipSimple on them to connect to Asterisk.

As long as I make sure they both use the same codec (either using the settings in CSipSimple or in Asterisk), I can make calles between both, no problem.

As soon as one of the two phones select a different (supported) codec, I have no sound, and Asterisk logs these four lines continuously (rather quickly, about 10 per second):

[Nov 14 20:13:38] WARNING[11158][C-00000000]: channel.c:5309 set_format: Unable to find a codec translation path from (silk24) to (speex16) [Nov 14 20:13:38] WARNING[11158][C-00000000]: chan_sip.c:7290 sip_write: Asked to transmit frame type speex16, while native formats is (silk24) read/write = silk24/silk24 [Nov 14 20:13:38] WARNING[11158][C-00000000]: chan_sip.c:7290 sip_write: Asked to transmit frame type silk24, while native formats is (speex16) read/write = silk24/silk24 [Nov 14 20:13:38] WARNING[11158][C-00000000]: channel.c:5081 ast_write: Codec mismatch on channel SIP/nexus4-00000000 setting write format to speex16 from silk24 native formats (silk24)

I was under the impression this should just work?

AFAIK I have everything required enabled and supported, what am I missing here? I am running Asterisk 11.5.1 from Fedora 18.

Thanks!

[code]Global Signalling Settings:

Codecs: (ulaw|alaw|speex|speex16|ilbc|speex32|silk8|silk16|silk24)
Codec Order: silk24:20,silk16:20,silk8:20,ilbc:30,speex:20,speex16:20,speex32:20,alaw:20,ulaw:20
[/code]

[code]gaia*CLI> core show codecs audio
Disclaimer: this command is for informational purposes only.
It does not indicate anything about your configuration.
ID TYPE NAME DESCRIPTION

100001 audio g723 (G.723.1)
100002 audio gsm (GSM)
100003 audio ulaw (G.711 u-law)
100004 audio alaw (G.711 A-law)
100011 audio g726 (G.726 RFC3551)
100006 audio adpcm (ADPCM)
100019 audio slin (16 bit Signed Linear PCM)
100007 audio lpc10 (LPC10)
100008 audio g729 (G.729A)
100009 audio speex (SpeeX)
100016 audio speex16 (SpeeX 16khz)
100010 audio ilbc (iLBC)
100005 audio g726aal2 (G.726 AAL2)
100012 audio g722 (G722)
100021 audio slin16 (16 bit Signed Linear PCM (16kHz))
100013 audio siren7 (ITU G.722.1 (Siren7, licensed from Polycom))
100014 audio siren14 (ITU G.722.1 Annex C, (Siren14, licensed from Polycom))
100017 audio testlaw (G.711 test-law)
100015 audio g719 (ITU G.719)
100028 audio speex32 (SpeeX 32khz)
100020 audio slin12 (16 bit Signed Linear PCM (12kHz))
100022 audio slin24 (16 bit Signed Linear PCM (24kHz))
100023 audio slin32 (16 bit Signed Linear PCM (32kHz))
100024 audio slin44 (16 bit Signed Linear PCM (44kHz))
100025 audio slin48 (16 bit Signed Linear PCM (48kHz))
100026 audio slin96 (16 bit Signed Linear PCM (96kHz))
100027 audio slin192 (16 bit Signed Linear PCM (192kHz))
100018 audio silk8 (SILK Custom Format 8khz)
100018 audio silk12 (SILK Custom Format 12khz)
100018 audio silk16 (SILK Custom Format 16khz)
100018 audio silk24 (SILK Custom Format 24khz)
[/code]

[code]gaia*CLI> core show translation
Translation times between formats (in microseconds) for one second of data
Source Format (Rows) Destination Format (Columns)

        gsm  ulaw  alaw  g726 adpcm  slin lpc10 speex speex16  ilbc g726aal2  g722 slin16 testlaw speex32 slin12 slin24 slin32 slin44 slin48 slin96 slin192
  gsm     - 15000 15000 15000 15000  9000 15000 15000   23000 15000    15000 17250  17000   15000   23000  17000  17000  17000  17000  17000  17000   17000
 ulaw 15000     -  9150 15000 15000  9000 15000 15000   23000 15000    15000 17250  17000   15000   23000  17000  17000  17000  17000  17000  17000   17000
 alaw 15000  9150     - 15000 15000  9000 15000 15000   23000 15000    15000 17250  17000   15000   23000  17000  17000  17000  17000  17000  17000   17000
 g726 15000 15000 15000     - 15000  9000 15000 15000   23000 15000    15000 17250  17000   15000   23000  17000  17000  17000  17000  17000  17000   17000
adpcm 15000 15000 15000 15000     -  9000 15000 15000   23000 15000    15000 17250  17000   15000   23000  17000  17000  17000  17000  17000  17000   17000
 slin  6000  6000  6000  6000  6000     -  6000  6000   14000  6000     6000  8250   8000    6000   14000   8000   8000   8000   8000   8000   8000    8000
lpc10 15000 15000 15000 15000 15000  9000     - 15000   23000 15000    15000 17250  17000   15000   23000  17000  17000  17000  17000  17000  17000   17000
speex 15000 15000 15000 15000 15000  9000 15000     -   23000 15000    15000 17250  17000   15000   23000  17000  17000  17000  17000  17000  17000   17000

speex16 23500 23500 23500 23500 23500 17500 23500 23500 - 23500 23500 15000 9000 23500 23000 17500 17000 17000 17000 17000 17000 17000
ilbc 15000 15000 15000 15000 15000 9000 15000 15000 23000 - 15000 17250 17000 15000 23000 17000 17000 17000 17000 17000 17000 17000
g726aal2 15000 15000 15000 15000 15000 9000 15000 15000 23000 15000 - 17250 17000 15000 23000 17000 17000 17000 17000 17000 17000 17000
g722 15600 15600 15600 15600 15600 9600 15600 15600 15000 15600 15600 - 9000 15600 23000 17500 17000 17000 17000 17000 17000 17000
slin16 14500 14500 14500 14500 14500 8500 14500 14500 6000 14500 14500 6000 - 14500 14000 8500 8000 8000 8000 8000 8000 8000
testlaw 15000 15000 15000 15000 15000 9000 15000 15000 23000 15000 15000 17250 17000 - 23000 17000 17000 17000 17000 17000 17000 17000
speex32 23500 23500 23500 23500 23500 17500 23500 23500 23500 23500 23500 23500 17500 23500 - 17500 17500 9000 17000 17000 17000 17000
slin12 14500 14500 14500 14500 14500 8500 14500 14500 14000 14500 14500 14000 8000 14500 14000 - 8000 8000 8000 8000 8000 8000
slin24 14500 14500 14500 14500 14500 8500 14500 14500 14500 14500 14500 14500 8500 14500 14000 8500 - 8000 8000 8000 8000 8000
slin32 14500 14500 14500 14500 14500 8500 14500 14500 14500 14500 14500 14500 8500 14500 6000 8500 8500 - 8000 8000 8000 8000
slin44 14500 14500 14500 14500 14500 8500 14500 14500 14500 14500 14500 14500 8500 14500 14500 8500 8500 8500 - 8000 8000 8000
slin48 14500 14500 14500 14500 14500 8500 14500 14500 14500 14500 14500 14500 8500 14500 14500 8500 8500 8500 8500 - 8000 8000
slin96 14500 14500 14500 14500 14500 8500 14500 14500 14500 14500 14500 14500 8500 14500 14500 8500 8500 8500 8500 8500 - 8000
slin192 14500 14500 14500 14500 14500 8500 14500 14500 14500 14500 14500 14500 8500 14500 14500 8500 8500 8500 8500 8500 8500 -
[/code]

Looks like you have format modules for silk24 but not codec ones. Are there there actually any validly licensed open source ones for that codec?

Howdy,

You could go it yourself, but Digium has already executed the agreement with Skype and can offer these :

downloads.digium.com/pub/telephony/codec_silk/

so that you don’t have to.

Cheers

It appears you were right on the money!

Apparently I misread the “slin*” for “silk”, and indeed, asterisk says there is no translation from / to silk.

So now I chose speex16 instead and it works like a charm, no problems converting from/to other codecs.

Thanks so much.

[quote=“malcolmd”]Howdy,
You could go it yourself, but Digium has already executed the agreement with Skype and can offer these :
downloads.digium.com/pub/telephony/codec_silk/
so that you don’t have to.
Cheers[/quote]
Is there a significant bonus quality-wise in using silk as opposed to speex? And otherwise opus?

My provider uses ilbc so I guess it need not be that superb :wink:

I think SILK outclasses Speex, but that’s just me.

Asterisk doesn’t transcode Opus.

Cheers