gabrielzmt / asterisk-chan-dongle

Automatically exported from code.google.com/p/asterisk-chan-dongle
Other
0 stars 0 forks source link

one way audio with K3765 on Openwrt #112

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. outbound calls on dongle
2. inbound calls on dongle
3.

What is the expected output? What do you see instead?
GSM -> Voip    is ok, clear audio;
Voip -> GSM    noise instead of channel audio

What version of the product are you using? On what operating system?

chan_dongle: Huawei 3G Dongle Channel Driver, Version 1.1, Revision 10
Asterisk 1.8.10.1  running on Openwrt  BARRIER BREAKER (1, r35362) 
Linux OpenWrt 3.3.8 #8 Mon Feb 4 12:58:18 CET 2013 armv5tel GNU/Linux

dongle: K3765
firmware: 11.126.03.09.00

Please provide any additional information below.

Tried also replacing the original option.c file with the one from 
kmod-huawei-voice, but nothing changed

Original issue reported on code.google.com by davoli.f...@gmail.com on 22 Feb 2013 at 8:07

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
though i m not sure what is making the problem , but two factors should be 
taken in to consideration . first : cellular companies support alaw/ulaw codecs 
( in my telco's case) . may be the soft phone client or voip hard phone you are 
using is making call with other codecs like GSM etc . Second : USB dongles on 
embeded platform lacks enough electric power. mostly embeded platform need 9 
volt and 200mAmp for itself supposedly how can that embeded board can power USB 
dongle (USB Dongle needs 5 volt and 500mAmp while making and receiving voice 
call ) .. i'm telling you again these might not be specific to your problems. 
but just take these in to consideration . a couple of week before i compiled 
openwrt firmware from trunk ( Barrier Breaker) with Asterisk 11.2.X. with this 
patch on Atheros processor based board . 
https://lists.openwrt.org/pipermail/openwrt-devel/2013-February/018701.html
and it runs perfectly now with external power to USB Dongle E180.

Regards, 
Ali . 

Original comment by alihmd....@gmail.com on 26 Feb 2013 at 1:24

GoogleCodeExporter commented 8 years ago
Dear Ali,

thank you for your reply, my openwrt is connected as trunk to an elastix main 
server, the codec between the two machines is slin, that is what the dongle 
wants (i prefer not to make codec translation on openwrt, it has much to do and 
low resources), I also thought it was an indiannes problem, but the CPU is 
little endian, and asterisk is compiled with the --little-endian directive, so 
should be fine. Finally yes, it could be a power issue even if I doubt it since 
the platform I'm using is the Seagate GoFlex Home that is supposed to spin a 
3,5 sata HDD, I will try to put an hub in between and definitely use asterisk 
11 instead.
One last thing that may be useful to debug this: I tried with both K3765 and 
E1762 firmwares, nothing changed…

Regards,
Federico

Original comment by davoli.f...@gmail.com on 26 Feb 2013 at 1:36

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Federico , if your board has 12 volt and 2amp power requirement then you need 
to minus your HDD power consumption and also minus your board power consumption 
, then you can find if your USB dongle is getting the enough power or not ,one 
more thing you need to do if it feasible for you for testing purpose only . i 
don't know if you did it already or not . remove the elasix pbx from your pc to 
openwrt box. use ( PC <-> openwrtbox )counterpath's eyebeam free version and 
then make call and receive call. ( just for testing purpose) . would be better 
to move to asterisk 11. i think it's a codec translation issue. ( may be i m 
wrong).

Original comment by alihmd....@gmail.com on 26 Feb 2013 at 2:21

GoogleCodeExporter commented 8 years ago
I will definitely do so and let you know; about the power issue, the HDD is not 
plugged, so the board should have enough power for the dongle, but i will put a 
hub in between just to be sure its not that.
Btw, is slin the correct codec for the dongle or is the box supposed to pass an 
alaw/ulaw/gsm stream to it.
thanks again.

Original comment by davoli.f...@gmail.com on 26 Feb 2013 at 2:30

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Federico, turn on ulaw on openwrt box for the time being and see if the problem 
is gone or not . that's my dumb guess. becoz once i enabled only gsm on sip 
phone and when i called via dongle i heard high noise . then i again had to 
switch to ulaw . 
if your openwrt box and sip client is ulaw-enabled i don't think transcoding 
will occur , but if your telco support ulaw and you are calling via slin then 
your openwrt box will transcode slin to ulaw , if by any chance your openwrt 
box doesn't have any ulaw codecs then you'll hear strange noise . 

here is little ref  : 
http://www.dslreports.com/forum/r25146039-Asterisk-GV-outgoing-calls-with-Asteri
sk1.8~start=140

Transcoding would occur whenever two legs of the call use a different codec. As 
a quick hace, if the service and user are US based, just set everything to ulaw.
-m

Original comment by alihmd....@gmail.com on 27 Feb 2013 at 1:43

GoogleCodeExporter commented 8 years ago
theoretically transcoding will not occur under this scenario :{ your sip client 
(ulaw ) <-> elastix (sending and receving in ulaw )  <->  openwrt (sending and 
receiving in ulaw ) <-> your telco (ulaw ) } . this scenario will only 
pass-through ulaw . so no heavy load of transcoding on both elastix and 
openwrt. 

transcoding will occur :  { your softphone (ulaw) <-> elastix (slin) <-> 
openwrt (will transcode  slin to ulaw to adjust with telco's calling code or 
formate or will fail if ulaw is or the required codec is not present ) }
hope that'll get you understand the problem ( any body can correct me if i m 
wrong . in this way they'll help me to understand better ) . 

Original comment by alihmd....@gmail.com on 27 Feb 2013 at 1:55

GoogleCodeExporter commented 8 years ago
Wait, now I don't really know how chan modules are implemented in asterisk, so 
maybe I will say something wrong (please correct me in that case) but the if 
you look at the structure ast_channel_tech in channel.c under capabilities 
there is only AST_FORMAT_SLINEAR that is slin, that's why I think the stream 
can only be passed in this format to the dongle. Than inside the dongle I have 
no idea of what happens, maybe is translated to the codec suitable for the 
carrier, but is not our business anymore :) please correct me if I'm wrong.

Original comment by davoli.f...@gmail.com on 27 Feb 2013 at 8:35

GoogleCodeExporter commented 8 years ago
Well, I have to make some more tests but apparently if the codec is translated 
from alaw to slin inside the openwrt the call is perfect both ways with crystal 
clear audio. I think I will adopt this solution, slin to alaw is not a taught 
job, the box can afford it, the problem should than be on the main elastix, and 
I still think is an endianness related issue, since I remember I read somewhere 
that slin endianness is not always well defined... who knows

Original comment by davoli.f...@gmail.com on 27 Feb 2013 at 8:59

GoogleCodeExporter commented 8 years ago
Federico, most problems related to slin has been solved in asterisk 11 ,you 
should giv it a try . when i do asterisk -rvvvvvvd and i receive or make call 
through dongle it shows me that calls are being made with ulaw codecs ,if i 
unload ulaw and try with other codecs it just won't work. i m still learning so 
i might miss many critical points . and it is possible that i mislead you. :D . 
but i m sure that transcoding depends on what voice codec is being used by 
cellular carrier .
kindly post your success result here . i've to implement such type of scenario 
in a couple of month. USB dongles will be connected through an embeded platform 
and i'll use another asterisk box in the middle for transcoding purpose and 
terminate other trunks to that box. The developer of this project can better 
describe the codec handling stuff .i never managed to understand C structure :D 

Original comment by alihmd....@gmail.com on 27 Feb 2013 at 10:30

GoogleCodeExporter commented 8 years ago
I tried with asterisk 11, i get a segmentation fault :(
this is the last log entries:

[Mar  1 09:24:59] DEBUG[9636]: devicestate.c:467 do_state_change: Changing 
state for Dongle/dongle0 - state 2 (In use)
[Mar  1 09:24:59] DEBUG[9636]: devicestate.c:442 devstate_event: device 
'Dongle/dongle0' state '2'
Segmentation fault
@OpenWrt:/root#

Original comment by davoli.f...@gmail.com on 2 Mar 2013 at 10:57

GoogleCodeExporter commented 8 years ago
maybe this is more interesting...

[Mar  1 09:29:10] DEBUG[9674]: devicestate.c:467 do_state_change: Changing 
state for Dongle/dongle0 - state 2 (In use)
[Mar  1 09:29:10] DEBUG[9674]: devicestate.c:442 devstate_event: device 
'Dongle/dongle0' state '2'
    -- Dongle/dongle0-0100000000 is making progress passing it to IAX2/dongles-1642
[Mar  1 09:29:10] DEBUG[9699][C-00000000]: channel.c:613 channel_read: 
[dongle0] read call idx 1 state 2 audio_fd 11
Segmentation fault

Original comment by davoli.f...@gmail.com on 2 Mar 2013 at 11:01

GoogleCodeExporter commented 8 years ago
now i m hopeless . you know i had to rebuild the firmware from source ( BARRIER 
BREAKER)  and the toolchain too. then it worked .but i don't use IAX ,dongle is 
changing it's state nicely ,but interacting with IAX causing seg fault. 
developer of this project can save us

Original comment by alihmd....@gmail.com on 2 Mar 2013 at 7:04

GoogleCodeExporter commented 8 years ago
now im using asterisk 18 that translates from slin to alaw and it works fine, 
really good audio quality, stable, im really enthusiast of it, a gsm gateway 
for 15 euro still impresses me! 
if the seg problem will be solved i will switch to ast 11, but now i dont want 
to touch it anymore :) i suggest you to keep ast 18, the only problem i had was 
with the timing module, i dont know why incoming stream was scrambled, i 
removed it.
btw, i would really some of the developers to comment the slin/alaw question, 
and what kind of stram is passed to the dongle (for me is slin, but is it 
always like that?), i got quite curious.

Original comment by davoli.f...@gmail.com on 2 Mar 2013 at 7:18

GoogleCodeExporter commented 8 years ago
Federico your curiosity is now refraining me from putting my embeded device in 
to production . i'll switch ast 18 as it seems more stable than ast11. i hope 
the developer will enlighten us if he not bored of reading our comments :) . 
Federico ,did you find ast18 stable for /after  atleast 24 hour contineous 
running ? 

Original comment by alihmd....@gmail.com on 2 Mar 2013 at 7:26

GoogleCodeExporter commented 8 years ago
the system didnt run for 24 hours continuously yet, but I will let you know in 
a couple of days, but consider that the system has also some other heavy tasks, 
mostly related to routing purposes, and the load (i mean calls) is not so high 
(1 per hour maybe, even less), but I would like soon or later to put it under 
pressure to see how it behaves.

Original comment by davoli.f...@gmail.com on 2 Mar 2013 at 7:33

GoogleCodeExporter commented 8 years ago
thanks Fedrico , i'll be waiting . i ran ast11 on 400mhz Ateros and 32mb ram 
with just one dongle ,for 2 or 5 hours it remains stable but after that its not 
that stable , voice quality is too low . it seems the hardware is under heavy 
stress when a call is received or made. 

Original comment by alihmd....@gmail.com on 2 Mar 2013 at 7:40

GoogleCodeExporter commented 8 years ago
but i don't know how asterisk runs perfectly on Blackfin low specs processors . 
i think it's becoz the Blackfin is a DSP too ?

Original comment by alihmd....@gmail.com on 2 Mar 2013 at 7:42

GoogleCodeExporter commented 8 years ago
i dont really know Blackfin but for sure 32 mb of ram and a 400mhz atheros is a 
bit too limited in performances, mine is a marvell kirkwood clocked at 1.2 Ghz 
and with 256 MB of ddr2, its such a nice machine, 

Mem: 20852K used, 105680K free, 0K shrd, 0K buff, 9044K cached
CPU:   0% usr   0% sys   0% nic  99% idle   0% io   0% irq   0% sirq
Load average: 0.20 0.17 0.14 1/60 9716
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
 9674     1 root     S     9500   8%   0% /usr/sbin/asterisk

this is what i get during a call, the cpu is at 24% when the call is set up, 
than it drops to 0 almost, the dongle is doing all the dirty job :D

Original comment by davoli.f...@gmail.com on 2 Mar 2013 at 7:51

GoogleCodeExporter commented 8 years ago
well, i need to get a decent embeded device now :)

Original comment by alihmd....@gmail.com on 2 Mar 2013 at 7:56

GoogleCodeExporter commented 8 years ago
The system has been up for more or less 3 days without any problem :)  rock 
solid!

Original comment by davoli.f...@gmail.com on 4 Mar 2013 at 11:54

GoogleCodeExporter commented 8 years ago
now i really need to switch to ast18 , Thanks Fedrico for your update . man you 
are making me feel jealous, your hardware is also a rock solid :)

Original comment by alihmd....@gmail.com on 7 Mar 2013 at 9:36

GoogleCodeExporter commented 8 years ago
check res_timerfd works, forget res_pthread 

Original comment by bg_...@mail.ru on 27 Apr 2013 at 3:32

GoogleCodeExporter commented 8 years ago
i'm using 3G DONGLE for outbond calls bt its always says call not found 
just let me know the problem ASAP

Original comment by Sainik...@gmail.com on 31 Jul 2014 at 12:11

GoogleCodeExporter commented 8 years ago
Same problem here, Barrier Breaker final (BRCM63XX) + Asterisk 11 + chan_dongle
Vodafone Station - Huawei EchoLife HG553 - 64 Mbites RAM + USB external Overlay

tested Huawei E169 & K3765, same problem on both dongles.

Is there anyone taking care of this issue?

Original comment by cdmaster...@gmail.com on 2 Feb 2015 at 7:49

GoogleCodeExporter commented 8 years ago
Same problem with ast11+openwrt14.04+rb951g-2hnd(ar9344 mips)

OpenWrt*CLI> dongle show version

chan_dongle: Huawei 3G Dongle Channel Driver, Version 1.1, Revision 34
Project Home: http://code.google.com/p/asterisk-chan-dongle
Bug Reporting: http://code.google.com/p/asterisk-chan-dongle/issues/list

root@OpenWrt:~# asterisk -vvvvvvvvvvvvvvvvvvvvvvr
Asterisk 11.15.0, Copyright (C) 1999 - 2013 Digium, Inc. and others.

Original comment by leont...@gmail.com on 12 Apr 2015 at 4:21

GoogleCodeExporter commented 8 years ago
It seems to solve the problem you have to insert the following two lines in 
/etc/asterisk/modules.conf:

noload => res_timing_pthread.so
noload => res_timing_timerfd.so

but by doing this the Music On Hold becomes jerky sad

Original comment by cdmaster...@gmail.com on 23 May 2015 at 10:21