Vinícius Fontes
2010-Feb-25 17:19 UTC
[asterisk-users] MeetMe() and dahdi_dummy on an embedded system
I'm playing around with an ALIX 2D2 board (http://www.pcengines.ch/alix2d2.htm). It's a fanless, x86 system using an AMD Geode processor with 256MB of RAM. Also available are two network interfaces, two USB ports and one serial port (no keyboard or VGA). I'm using the Voyage Linux distro, which basically is Debian Lenny optimized for this board. Asterisk 1.6.1.12 runs fine on the system. The only issue I'm having is with MeetMe(). As there's no DAHDI devices attached, I'm running dahdi_dummy. Audio gets all choppy on MeetMe(), but works fine for other applications such as Playback(). SIP calls also work fine. Most probably it's a timing issue. I connected an Astribank unit with 16 FXS in order to provide timing, and after that I get crystal clear audio on MeetMe(). Of course I wouldn't like to have an expensive Astribank attached to the ALIX board just to provide timing. So my question is: is there any way to improve dahdi_dummy's performance, or maybe some other way to get this to work without the need for a physical DAHDI device? By the way, I have already tried to set internal_timing=yes on asterisk.conf, nothing changed. Here's some relevant info on the system: voyage:~# cat /proc/interrupts CPU0 0: 23 XT-PIC-XT timer 2: 0 XT-PIC-XT cascade 3: 1 XT-PIC-XT 4: 255 XT-PIC-XT serial 7: 9090731 XT-PIC-XT mfgpt-timer 10: 166087 XT-PIC-XT eth0 12: 1110139 XT-PIC-XT ehci_hcd:usb1, ohci_hcd:usb2 14: 14638 XT-PIC-XT ide0 NMI: 0 Non-maskable interrupts LOC: 0 Local timer interrupts SPU: 0 Spurious interrupts ERR: 0 MIS: 0 voyage:~# cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 5 model : 10 model name : Geode(TM) Integrated Processor by AMD PCS stepping : 2 cpu MHz : 498.070 cache size : 128 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu de pse tsc msr cx8 sep pge cmov clflush mmx mmxext 3dnowext 3dnow bogomips : 996.14 clflush size : 32 power management: voyage*CLI> timing test Attempting to test a timer with 50 ticks per second. Using the 'DAHDI' timing module for this test. It has been 1000 milliseconds, and we got 50 timer ticks voyage:~# dahdi_test -vv Opened pseudo dahdi interface, measuring accuracy... 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%) 8192 samples in 8192.000 system clock sample intervals (100.000%)^C --- Results after 21 passes --- Best: 100.000 -- Worst: 100.000 -- Average: 100.000000, Difference: 100.000000 Atenciosamente, Vin?cius Fontes Gerente de Seguran?a da Informa??o Canall Tecnologia em Comunica??es Passo Fundo - RS - Brasil +55 54 2104-7000 Information Security Manager Canall Tecnologia em Comunica??es Passo Fundo - RS - Brazil +55 54 2104-7000
Shaun Ruffell
2010-Feb-25 18:04 UTC
[asterisk-users] MeetMe() and dahdi_dummy on an embedded system
On 02/25/2010 11:19 AM, Vin?cius Fontes wrote:> I'm playing around with an ALIX 2D2 board (http://www.pcengines.ch/alix2d2.htm). It's a fanless, x86 system using an AMD Geode processor with 256MB of RAM. Also available are two network interfaces, two USB ports and one serial port (no keyboard or VGA). I'm using the Voyage Linux distro, which basically is Debian Lenny optimized for this board. > > Asterisk 1.6.1.12 runs fine on the system. The only issue I'm having is with MeetMe(). As there's no DAHDI devices attached, I'm running dahdi_dummy. Audio gets all choppy on MeetMe(), but works fine for other applications such as Playback(). SIP calls also work fine. > > Most probably it's a timing issue. I connected an Astribank unit with 16 FXS in order to provide timing, and after that I get crystal clear audio on MeetMe(). > > Of course I wouldn't like to have an expensive Astribank attached to the ALIX board just to provide timing. So my question is: is there any way to improve dahdi_dummy's performance, or maybe some other way to get this to work without the need for a physical DAHDI device?What version of DAHDI are you using? As long as the host kernel is able to accurately keep accurate wall time, I'm not aware of any conditions that would prevent dahdi_dummy in dahdi-linux 2.2.1 from working fine, so I'm very curious if this isn't the case. In fact, in the trunk of dahdi-linux dahdi_dummy.ko is off by default and dahdi.ko will be able to keep time regardless of whether there are any physical spans connected or configured. -- Shaun Ruffell Digium, Inc. | Linux Kernel Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA Check us out at: www.digium.com & www.asterisk.org
Vinícius Fontes
2010-Feb-25 19:26 UTC
[asterisk-users] MeetMe() and dahdi_dummy on an embedded system
----- "Shaun Ruffell" <sruffell at digium.com> escreveu:> On 02/25/2010 11:19 AM, Vin?cius Fontes wrote: > > I'm playing around with an ALIX 2D2 board > (http://www.pcengines.ch/alix2d2.htm). It's a fanless, x86 system > using an AMD Geode processor with 256MB of RAM. Also available are two > network interfaces, two USB ports and one serial port (no keyboard or > VGA). I'm using the Voyage Linux distro, which basically is Debian > Lenny optimized for this board. > > > > Asterisk 1.6.1.12 runs fine on the system. The only issue I'm having > is with MeetMe(). As there's no DAHDI devices attached, I'm running > dahdi_dummy. Audio gets all choppy on MeetMe(), but works fine for > other applications such as Playback(). SIP calls also work fine. > > > > Most probably it's a timing issue. I connected an Astribank unit > with 16 FXS in order to provide timing, and after that I get crystal > clear audio on MeetMe(). > > > > Of course I wouldn't like to have an expensive Astribank attached to > the ALIX board just to provide timing. So my question is: is there any > way to improve dahdi_dummy's performance, or maybe some other way to > get this to work without the need for a physical DAHDI device? > > What version of DAHDI are you using? As long as the host kernel is > able to accurately keep accurate wall time, I'm not aware of any > conditions that would prevent dahdi_dummy in dahdi-linux 2.2.1 from > working fine, so I'm very curious if this isn't the case. In fact, in > the trunk of dahdi-linux dahdi_dummy.ko is off by default and dahdi.ko > will be able to keep time regardless of whether there are any physical > spans connected or configured.Sorry, forgot to include the DAHDI version. voyage:~# dahdi_cfg -tv DAHDI Tools Version - 2.2.1 DAHDI Version: 2.2.1 Echo Canceller(s): Configuration ===================== I'm almost sure this board's RTC is not very accurate. Is there any way to measure the RTC's accuracy?
Vinícius Fontes
2010-Feb-25 20:22 UTC
[asterisk-users] MeetMe() and dahdi_dummy on an embedded system
----- "Gordon Henderson" <gordon+asterisk at drogon.net> escreveu:> On Thu, 25 Feb 2010, Vin?cius Fontes wrote: > > > ----- "Shaun Ruffell" <sruffell at digium.com> escreveu: > > > >> On 02/25/2010 11:19 AM, Vin?cius Fontes wrote: > >>> I'm playing around with an ALIX 2D2 board > >> (http://www.pcengines.ch/alix2d2.htm). It's a fanless, x86 system > >> using an AMD Geode processor with 256MB of RAM. Also available are > two > >> network interfaces, two USB ports and one serial port (no keyboard > or > >> VGA). I'm using the Voyage Linux distro, which basically is Debian > >> Lenny optimized for this board. > >>> > >>> Asterisk 1.6.1.12 runs fine on the system. The only issue I'm > having > >> is with MeetMe(). As there's no DAHDI devices attached, I'm > running > >> dahdi_dummy. Audio gets all choppy on MeetMe(), but works fine for > >> other applications such as Playback(). SIP calls also work fine. > >>> > >>> Most probably it's a timing issue. I connected an Astribank unit > >> with 16 FXS in order to provide timing, and after that I get > crystal > >> clear audio on MeetMe(). > >>> > >>> Of course I wouldn't like to have an expensive Astribank attached > to > >> the ALIX board just to provide timing. So my question is: is there > any > >> way to improve dahdi_dummy's performance, or maybe some other way > to > >> get this to work without the need for a physical DAHDI device? > >> > >> What version of DAHDI are you using? As long as the host kernel > is > >> able to accurately keep accurate wall time, I'm not aware of any > >> conditions that would prevent dahdi_dummy in dahdi-linux 2.2.1 > from > >> working fine, so I'm very curious if this isn't the case. In fact, > in > >> the trunk of dahdi-linux dahdi_dummy.ko is off by default and > dahdi.ko > >> will be able to keep time regardless of whether there are any > physical > >> spans connected or configured. > > > > Sorry, forgot to include the DAHDI version. > > > > voyage:~# dahdi_cfg -tv > > DAHDI Tools Version - 2.2.1 > > > > DAHDI Version: 2.2.1 > > Echo Canceller(s): > > Configuration > > =====================> > > > I'm almost sure this board's RTC is not very accurate. Is there any > way > > to measure the RTC's accuracy? > > I use these boards too. Brilliant little things. 5 watts and 80+ > concurrent calls handling media before they fall over! Not much good > for > transcoding though... > > http://unicorn.drogon.net/cutie.jpg > > However I have a slightly different approach in that I have my own > semi-custom Linux for them which runs entirely in RAM. I also > custom-compile the kernel for the architecture, and have compiled up > dhadi > and asterisk specifically for that CPU too. (Read my earlier whinges > about > it some time back!) > > dsx$ df -h > Filesystem Size Used Avail Use% Mounted on > /dev/ram0 136M 79M 58M 58% / > /dev/hda3 189M 95M 95M 50% /data > > > dahdi_dummy on my systems use the high resolution timer and not RTC: > > dahdi: Telephony Interface Registered on major 196 > dahdi: Version: 2.2.0-rc2 > dahdi_dummy: Trying to load High Resolution Timer > dahdi_dummy: Initialized High Resolution Timer > dahdi_dummy: Starting High Resolution Timer > dahdi_dummy: High Resolution Timer started, good to go > > Other than a few quick tests, I've not really run many meetmes on one, > but > I have a few dozen of these out in the world with clients so I don't > really know what they're doing with them... However they all use IAX > trunking which I understand requires timing too. > > There's a few tweaks you can do to the system even running the distro > > you're using - make sure no extra services are running - make sure > logging > is minimal and not using fsync on every write (see your syslog config > > file), mount partitions with the noatime and nodiratime flags - use as > > fast a CF card as you can get, and so on. (Google for tuning hints for > > systems like the Acer Aspire One and other similar laptops with SSDs > and > so on) > > Output of ps ax: > > PID TTY STAT TIME COMMAND > 1 ? Ss 0:01 init [2] > 2 ? S< 0:00 [kthreadd] > 3 ? S< 0:00 [ksoftirqd/0] > 4 ? S< 0:00 [events/0] > 5 ? S< 0:00 [khelper] > 60 ? S< 0:00 [kblockd/0] > 67 ? S< 0:00 [khubd] > 106 ? S 0:00 [pdflush] > 108 ? S< 0:00 [kswapd0] > 153 ? S< 0:00 [aio/0] > 737 ? S 0:00 [pdflush] > 1006 ? Ss 0:00 /sbin/syslogd > 1010 ? Ss 0:00 /sbin/klogd -x > 1021 ? Ss 0:00 /usr/sbin/sshd > 1028 ? Ss 0:00 /usr/local/apache2/bin/httpd -k start > 1042 ? Ss 0:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -g > 1047 ? Ssl 0:00 /usr/sbin/asterisk -p > 1086 ? Ss 0:00 /usr/sbin/cron > 1099 ttyS0 Ss 0:00 /bin/login -- > 1323 ? S 0:00 /usr/local/apache2/bin/httpd -k start > 2089 ttyS0 S+ 0:00 -bash > 2094 ? Ss 0:00 sshd: dsx at pts/0 > 2098 pts/0 Ss 0:00 login -h yakko.drogon.net -p -f > 2099 pts/0 R 0:00 -bash > 2109 pts/0 R+ 0:00 ps ax > > Not sure I can get it any more minimal than that! > > GordonJust checked and I'm using the high res timer as well: Feb 25 17:42:32 voyage vmunix: [ 27.028798] dahdi_dummy: Trying to load High Resolution Timer Feb 25 17:42:32 voyage vmunix: [ 27.028816] dahdi_dummy: Initialized High Resolution Timer Feb 25 17:42:32 voyage vmunix: [ 27.028831] dahdi_dummy: Starting High Resolution Timer Feb 25 17:42:32 voyage vmunix: [ 27.028849] dahdi_dummy: High Resolution Timer started, good to go Feb 25 17:42:32 voyage vmunix: [ 27.055253] dahdi: Registered tone zone 20 (Brazil) I also compiled DAHDI and Asterisk from the sources. Took about 2 hours but it finally compiled and is running okay. :) Still not sure what's happening, since even with 2 users on the meetme room I still get the choppy audio. My best guess would be something kernel related. Thinking about recompiling the kernel, but I'm not sure what I could set to maybe solve these issues. Would you mind sharing the kernel version number you're running on your boxes, and if I'm not asking too much, the .config file you used? Thanks a lot in advance.