[help] slin16 codec translation wrong behaviour

Hello,

When I call slin16 (L16/1) device via non native bridges I hear loud constant noise instead of voice. I made some experiments with different clients, the results are:
(all peers are SIP)
[ol]
[li] peer A (ulaw) peer B (slin16) A->B:noise A<-B:ok[/li]
[li] peer A (slin16) peer B (slin16) native-bridge A<->B ok[/li]
[li] peer A (slin16) peer B (slin16) not native-bridge A<->B noise[/li][/ol]

lowering AGC level to 10 (ten) in 1st and 3rd cases removes most of noise but the voice still corrupted, muting input stream on A remove noise at all.

Looks like byte order issue on codec translation.

Appears on Asterisk 13.6 and 13.1cert2 32bit.
On Asterisk 11.7 (32bit) the problem is absent.

What should I check also? Any suggestions?

With best regards,
Victor.

Update:

Problem appears on every translation between slin and other codec on the direction from asterisk to slin. Tested with slin8/slin16 and (ulaw/alaw/gsm). Reverse direction (slin to asterisk) has no problem.

Doesn’t depend on OS and virtualisation: tested on Ubuntu 14.04 LTS 32bit (VMware WS, vbox, bareHW), FreeBSD 10.2 i386 (asterisk 13.4, vbox, built from ports).

Clients:
slin16: MicroSIP 3.10.9, custom HW device
other: antiSIP 4.2.9 (Android), SFLphone 1.3.0, Zoiper 3.3.25608

Example of rtp packet sent from asterisk to slin peer:

0000 80 76 4a 8c 00 00 0a c0 62 77 b1 28 86 00 2d 00 .vJ.....bw.(..-. 0010 ff ff 41 00 94 00 81 00 20 00 0c 00 93 00 34 01 ..A..... .....4. 0020 16 01 11 00 0a ff fc fe da ff a3 00 91 00 ea ff ................ 0030 5f ff 13 ff a9 fe 23 fe 16 fe d6 fe d6 ff 57 00 _.....#.......W. 0040 59 00 6d 00 b3 00 a6 00 10 00 9b ff 00 00 ed 00 Y.m............. 0050 53 01 bc 00 d1 ff 62 ff 6a ff 61 ff 2e ff 42 ff S.....b.j.a...B. 0060 ce ff 58 00 52 00 d9 ff 8e ff d3 ff 61 00 ac 00 ..X.R.......a... 0070 6f 00 df ff 6d ff 61 ff a8 ff ec ff f0 ff c3 ff o...m.a......... 0080 a0 ff 94 ff 7b ff 58 ff 7d ff 29 00 13 01 9b 01 ....{.X.}.)..... 0090 75 01 fb 00 b3 00 b2 00 a5 00 5f 00 0f 00 df ff u........._..... 00a0 99 ff f7 fe 34 fe f5 fd 9c fe c4 ff a4 00 e0 00 ....4........... 00b0 c4 00 b3 00 a4 00 58 00 e8 ff cb ff 38 00 c1 00 ......X.....8... 00c0 c4 00 33 00 a0 ff 7b ff 91 ff 6e ff 2b ff 63 ff ..3...{...n.+.c. 00d0 59 00 6c 01 ab 01 e3 00 d9 ff 6a ff af ff 08 00 Y.l.......j..... 00e0 e9 ff 67 ff 0c ff 3f ff e8 ff 86 00 a4 00 47 00 ..g...?.......G. 00f0 f0 ff 13 00 95 00 dd 00 93 00 19 00 19 00 a4 00 ................ 0100 03 01 85 00 5e ff 74 fe 72 fe 22 ff c2 ff d8 ff ....^.t.r."..... 0110 8e ff 5b ff 7e ff dc ff 37 00 6a 00 71 00 58 00 ..[.~...7.j.q.X. 0120 2f 00 16 00 31 00 7d 00 c3 00 ba 00 50 00 cb ff /...1.}.....P... 0130 88 ff a5 ff f0 ff 20 00 20 00 0d 00 00 00 ef ff ...... . ....... 0140 c8 ff 9d ff a0 ff e4 ff 40 00 6c 00 48 00 f3 ff ........@.l.H... 0150 9f ff 69 ff 5d ff 93 ff 1f 00 da 00 55 01 35 01 ..i.].......U.5. 0160 93 00 eb ff a9 ff cb ff 08 00 26 00 18 00 e0 ff ..........&..... 0170 88 ff 47 ff 6c ff ff ff 94 00 b1 00 4f 00 e1 ff ..G.l.......O... 0180 c1 ff d4 ff cf ff a2 ff 7d ff 74 ff 6b ff 58 ff ........}.t.k.X. 0190 6d ff d5 ff 67 00 c3 00 b5 00 5f 00 18 00 23 00 m...g....._...#. 01a0 84 00 f9 00 24 01 e2 00 77 00 4b 00 69 00 71 00 ....$...w.K.i.q. 01b0 17 00 82 ff 0d ff d2 fe ab fe 9f fe ed fe 93 ff ................ 01c0 1f 00 39 00 29 00 72 00 03 01 2b 01 78 00 65 ff ..9.).r...+.x.e. 01d0 dc fe 3d ff 18 00 c8 00 05 01 db 00 6f 00 f6 ff ..=.........o... 01e0 b9 ff d7 ff 17 00 20 00 ea ff bc ff c6 ff ec ff ...... ......... 01f0 02 00 11 00 26 00 0f 00 91 ff e7 fe ab fe 2b ff ....&.........+. 0200 f9 ff 60 00 37 00 03 00 40 00 c8 00 04 01 a0 00 ..`.7...@....... 0210 d7 ff 35 ff 1d ff 99 ff 57 00 ce 00 a6 00 0c 00 ..5.....W....... 0220 96 ff a3 ff fa ff 2a 00 2e 00 5c 00 b6 00 b4 00 ......*...\..... 0230 fe ff 1c ff ee fe 8d ff 1e 00 e6 ff 2e ff c0 fe ................ 0240 db fe 0a ff fd fe 04 ff 88 ff 5f 00 04 01 32 01 .........._...2. 0250 14 01 e0 00 a3 00 75 00 85 00 cc 00 f3 00 b7 00 ......u......... 0260 41 00 e6 ff af ff 67 ff 0d ff ee fe 2b ff 78 ff A.....g.....+.x. 0270 7c ff 55 ff 6c ff de ff 50 00 68 00 30 00 ec ff |.U.l...P.h.0... 0280 b7 ff 90 ff 99 ff 07 00 c3 00 52 01 ..........R.

With best regards,
Victor.