Koozali.org: home of the SME Server

Hearable difference in sound quality for Asterisk install ?

Offline arne

  • ****
  • 1,116
  • +0/-4
I have tried a number of Asterisk installations on diverce Linux distros, including the SME server.

From this testing I got a conclusion that is so strange that I can hardly believe it myself. (Really don't know if it is just a series of coincidents ..)

For me I think it sounds like that it is hearable differences in sound quality, depending on the type or "kind" of linux distro it is installed on.

For me it sounds like (right or wrong) that all more complex linux distros tend to reduce the audio quality while more minimalistic installations tend to give bether sound performance (.. impossible .. I agree, but still it is like that there is that hearable difference in sound quality.)

The best sound quality during my experimenting have been obtained from Astlinux that is a very basic Linux/Asterisk bundle, just filling approx 30 MB for all software (Linux + Asterisk). When comparing with Centos 4.3 with a original Digium Asterisk sourcecode installation, the sound quality has been quite clearly hearable bether for the Astlinux installations.

Could it be something with the Asterisk as a realtime datastream processor that should have the access to the processor power allone - I don't know.

Possible the best installation of Asterisk with the SME server is on its own box behind the SME gateway .. I don't know.

Is there anybody else ou there that thinks that different Asterisk servers "sounds different", or is this my wild imagination ?

Today I run my Asterisk server as a Astlinux flashram installation on a Pentuim 800 located behind the gateway. This gives no hearable difference in sound quality between the ip telephony and a ordinary telephone.

When I use Centos 4.3 with Digium sourceode, I think that the difference can be heared.

By the way all the PC's I have used for the testing has been with rathe low power, that might be a part of the problem.

I courious if there is anyboudy else that thinks different Asterisk installations sounds different.

I do not use any telephony cards, it's plain ip telephony.

Best reg Arne.
......

mwolff

Hearable difference in sound quality for Asterisk install ?
« Reply #1 on: June 26, 2006, 10:34:58 PM »
the answer is that asterisk use CPU. And some distrib use a lot CPU (Graphical interface ...)
How you install your distrib and asterisk is very important for sound quality.
For our production servers, we have define charts to define the right configuration regarding number users, used applications, codecs ...

Offline arne

  • ****
  • 1,116
  • +0/-4
Hearable difference in sound quality for Asterisk install ?
« Reply #2 on: June 26, 2006, 11:10:15 PM »
The Centos 4.3 installations I have used for testing has been text based only, but it has not been minimum instasllations as I have used it for compiling the ASsterisk souce code etc. On the other side I have tried to run them with as few processes as possible.

I think that this problem / observation is a rather imporant one, if it should be right and not just a result of a series of coincidents.

In one way it is a rather logical thing to add the Asterisk ip telephony server dunctionality to a general server gateway like the SME server.

On the other side, if it should be a right observation that the Asterisk server function does not live to well together with other (server) processes, then the right conclusion should be not to build it all into one box, but to keep it as two boxes with one specialized Asterisk server box behind the SME gateway.

Actually I have not directely been comparing a Asterisk installation on the SME server with Astlinux. I have rather used Centos 4.3 as platform.

I would actually prefere to be wrong about my observations.

To day I run them as two separate boxes (SME server and Astlinux), and it works very well, but I would be very happy to build it all into one box, if perfomance and sound quality can be maintained.

Arne.
......

Offline arne

  • ****
  • 1,116
  • +0/-4
Hearable difference in sound quality for Asterisk install ?
« Reply #3 on: June 26, 2006, 11:19:33 PM »
By the way .. while testing I have used identical configuration files for the Aterisk servers (codecs, etc) and some times also the identical same hardware. The difference in sound quality still seems to repeat from installation to installation.

A Asterisk sorcecode installation running on Centos 4.3 and on a XP 1500 / with 512 MB RAM also has porer sound quality than Astlinux running on a HP thinclient with a Transmeta 1000 processor and 128 MB ram.

One should possible believe that a more powerfull processor should / might improve the sound quality, but this might / might not be the case either ..
......

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Hearable difference in sound quality for Asterisk install ?
« Reply #4 on: June 27, 2006, 08:10:10 AM »
Easy enough to prove.  Use the asterisk PlayBack cmd to play the same recorded sound clip on each of the contending systems and record the output at the handset back into another computer.  Then simply run the two samples against a spectral analyser and see if there is any material difference.  There are several gpl offerings out there that do a good enough job to confirm or deny what your ears and wetware are telling you.


Kind Regards

Selintra

Offline arne

  • ****
  • 1,116
  • +0/-4
Hearable difference in sound quality for Asterisk install ?
« Reply #5 on: June 27, 2006, 11:30:00 AM »
Thanks for info, but I'm actually quite sure there have been clearly hearable differences between the Asterisk installations I have made.

On the other hand I find this rather hard to understand from a technical pint of view.

I have not compared those Asterisk installations that has been made for the SME server with Astlinux at all. (Only Digium sourcecode installations on Centos 4.3 versus Astlinux)

I find it in so way rather "unreasonable" that a Centos 4.3 with Asterisk and with allmost all processes turned off should perform so much porer than the Astlinux (That have only something like 20 processes, Asterisk included and everything running from ram.)

One other difference than hearable difference in sound is that using the the telephone makes less load to the processor for the Astlinux than for Centos 4.3/Asterisk.

With Centos 4.3/Asterisk, while testing in my home, it is possible to make a processor load of 1-2 persent while using all the telephones I have. With Astlinux it is not more than 0.1-0.2 persent (if such small values is acurate enough.)

I don't know if I believe to much about things like spectral analyzers and things like that. Dont know if I believe to much in the playback function for testing either. It is not realtime, but a recording.

What's instersting me is what I can hear when using the telephone realtime.

What I'm courious about is there is also other that has made these observations, or is it just me, my testing and a number of coincidents ??

And really - I would hope to be wrong, because I do n ot like to have that extra PC box running Asterisk. (And I have still not compared with the asterisk installation for the SME server.)
......

WillKemp

Hearable difference in sound quality for Asterisk install ?
« Reply #6 on: June 27, 2006, 01:19:23 PM »
Quote from: "arne"
On the other hand I find this rather hard to understand from a technical pint of view.

[......]

I find it in so way rather "unreasonable" that a Centos 4.3 with Asterisk and with allmost all processes turned off should perform so much porer than the Astlinux (That have only something like 20 processes, Asterisk included and everything running from ram.)


One possible technical aspect to look at is latency. This can be affected by several things - including, of course, hardware. The way the kernel is configured can make a difference to this - in recent kernels there are configuration options for the pre-emption model, which can have a big effect on latency. There are probably also other kernel options which can affect latency to some extent. It is latency that is affected most by running xwindow, etc.

Have a read of this page to get a bit of an idea about tuning a Linux system for low latency: http://ccrma.stanford.edu/planetccrma/software/installtwosix.html#SECTION00020900000000000000

Offline arne

  • ****
  • 1,116
  • +0/-4
Hearable difference in sound quality for Asterisk install ?
« Reply #7 on: June 28, 2006, 08:37:44 PM »
Thanks for this interesting info.

I googled this link myself:
http://mnis.fr/ocera_support/rtos/c1393.html

Actually the situation when I think it is a quite hearable difference in sound quality, is not when it is a steady flow of datas the one way or the other, it is mainly when two persons try to speak in two ends of "the line" simustinely.

When both persons try to speak at the same time its allmost like it generates a series of some "pauses" of a leght of a fraction of a second. Thats what its sonds like, and thise make the whole connection to sond a bit like "ip telephony".

When using Astlinux that is made for IP telephony only, it is reasonably to believe that this contains a kernel that is optimized for IP telephony and realtime processing of datas.

When using Astlinux there is no problems with two persons speaking at the same time at all. It still sounds completely "smooth" like a analogue telephony line. There is no "ip telephony sound" at all.

But what about Asterisk at the SME server, does this give "ip telephony sound" or will it typically give "a analogue telephony sound" ? (I have runned Asterisk at SME server before, but I did not compare with other installations.)  

If this eventually should be a problem what should then be the solution for the problem ?

1. To compile a modified kernel, optimized for ip telephony ?

2. To keep gateway, web server, file server etc in one box and the ip telephony server in one other box, because those server functions does not perform well together ?

Actually I have not really checked out if Asterisk at SME server realy gives a "ip telephony sound".

Anybody who has any toughts about or experiences with that ?

(One day I will set up an Astlinux box and a SME server box with Asterisk to compare, but I have not done that yet. It would be nice if it should apear that the sound quality is the same.)

Best reg Arne.
......

Offline arne

  • ****
  • 1,116
  • +0/-4
Hearable difference in sound quality for Asterisk install ?
« Reply #8 on: June 28, 2006, 09:04:42 PM »
What about Asterisk@home, it is a more complex installation, but does it give "ip telephony sound" ?

I have not compared, but I believe that my Asterisk@home installations (that I started with) did not give to bad sound quality (??).

If sound quality eventually should be a problem when using Asterisk at the SME server, could it eventuelly be an idea to transfer the asterisk@home / Trixbox kernel over to the SME server ?

Could this eventually help ? .. Just an idea.
......

WillKemp

Hearable difference in sound quality for Asterisk install ?
« Reply #9 on: June 28, 2006, 11:25:05 PM »
Quote from: "arne"
http://mnis.fr/ocera_support/rtos/c1393.html

Yeah, that's a bit out of date now, as the low latency stuff is built into the 2.6 kernel, as well as some realtime possibility. However, the principles explained in it are useful to understand.

Quote
When both persons try to speak at the same time its allmost like it generates a series of some "pauses" of a leght of a fraction of a second.

That's weird. I can't say i've noticed that myself. Although i have noticed some similar effects. That sort of thing is a common effect of an echo canceller somewhere in the audio path. However, that's not necessarily what's causing what you're hearing.

Quote
When using Astlinux there is no problems with two persons speaking at the same time at all. It still sounds completely "smooth" like a analogue telephony line. There is no "ip telephony sound" at all.

Is that on the same hardware?

Quote
But what about Asterisk at the SME server, does this give "ip telephony sound" or will it typically give "a analogue telephony sound" ?

Well, as i said, i haven't experienced it myself, i don't think. It's very hard to tell sometimes, though, as there are a lot of different factors affecting the sound of a call.

Quote
If this eventually should be a problem what should then be the solution for the problem ?

If you're experiencing those differences with the same hardware, then that suggests kernel configuration could be the solution. If it's not the same hardware, then it's a lot more complicated.

Quote
1. To compile a modified kernel, optimized for ip telephony ?

How about trying the Astlinux kernel with your other distribution? That should prove if it's the kernel or not. It would be interesting to know the result of this.

Quote
2. To keep gateway, web server, file server etc in one box and the ip telephony server in one other box, because those server functions does not perform well together ?

I think, if you were running a PBX with a high load on it, it would be silly to have other services running on the system. However, for a small installation, it should be possible to configure a shared system so that it works well, i think.

Quote
(One day I will set up an Astlinux box and a SME server box with Asterisk to compare, but I have not done that yet. It would be nice if it should apear that the sound quality is the same.)

Make sure the hardware is identical!

Offline arne

  • ****
  • 1,116
  • +0/-4
Hearable difference in sound quality for Asterisk install ?
« Reply #10 on: June 29, 2006, 01:09:09 AM »
Quote:
When using Astlinux there is no problems with two persons speaking at the same time at all. It still sounds completely "smooth" like a analogue telephony line. There is no "ip telephony sound" at all.

Is that on the same hardware?


*********

Yes, I think I hve tested with tree-four different hardwares and the Astlinux gives superior sound quality compared with a standard Centos 4.3 installation every time. Hardware have been Pentium 800, Duron 1200, XP 1500 and a HP Compaq thinclient. Actually the thin client with Astlinux performs bether than any of the PCs. (And this I find tht rather strange.)


*********

About transfering the Astlinux kernel. Dont know exactely how to do that, but could look into it. Could be an interresting experiment.


*********

By the way, thanks a lot for a lot of interesting info.
......

Offline arne

  • ****
  • 1,116
  • +0/-4
Hearable difference in sound quality for Asterisk install ?
« Reply #11 on: June 29, 2006, 01:17:14 AM »
By the way, I think the hardware itself does not have so much to say for the sound quality.

I some time think that there is a small hearable diffrerece between the HP thinclient and the Pentuim 800 both with Astlinux, but this differende is so small so that there is not a practical problem. (The pentium 800 might have slightely bether sound, but the difference is allmost hearable.)

If I use Centos 4.3 / Digium Asterisk on the pentium 800, people will normally tell me that there is something stange with my telephony sound or they will ask me if I have a IP telephone.
......

WillKemp

Hearable difference in sound quality for Asterisk install ?
« Reply #12 on: June 29, 2006, 02:15:36 AM »
Quote from: "arne"
Actually the thin client with Astlinux performs bether than any of the PCs. (And this I find tht rather strange.)

Maybe that's not so strange. Apart from transcoding, the main hardware/software interaction in a PBX will be I/O - i.e., the network interface(s).

I would expect a thin client to have as low a latency in the network interface as possible - as all the processing is done remotely and I/O is the important factor in the thing working well.

For normal, non-audio use, there's no real need to worry about the latency of a network interface - as it doesn't really affect the throughput. But with realtime audio, the network interface should have as low  a latency as possible. Also,  interactions between interrupts and the operating systems other loops - to say nothing of other things going on on the motherboard etc - could cause all sorts of weird stuff.

The specifics of the hardware configuration as well as the kernel configuration have the potential to have a noticeable effect on this sort of application.

Offline arne

  • ****
  • 1,116
  • +0/-4
Hearable difference in sound quality for Asterisk install ?
« Reply #13 on: June 29, 2006, 04:22:22 PM »
Thanks for in teresting info / interesting points of view again.

I think that this theory about "latecy" gives good reason. Thats actually also how it sounds when it does not perform to well. It is allmost as one can heart that there is some "lack of musicality" in the audio signal.

I will compare it with the situation when the first Digital CD players arrived on the market. It was claimed that this is digital sound with perfect quality. Still it did not sound like music, at lest not the first generation of CD players.

I think this is an interesting way to view a Asterisk server, not just another service on a server, also somethink like an "acoustic intrument", with more or less "acoustic properties" or "musicality" in the way it performs.

Still I have not compared a Asterisk installation on a SME server with Astlinux (that is my refference), and there is not anybody else that have mentioned if Asterisk at SME server sonds like "ip telephony" or not. I will hope to make a test installation when I come home from holiedays.

Nothing will really surprice me when it comes to ip telephony - things just have just to be tried and tested. I would expect Asterisk at SME server to sound a bit like "ip telephony", on the other hand it would not surprice me if it should sound perfectely well either ..
......

WillKemp

Hearable difference in sound quality for Asterisk install ?
« Reply #14 on: June 29, 2006, 10:29:41 PM »
Quote from: "arne"
I would expect Asterisk at SME server to sound a bit like "ip telephony", on the other hand it would not surprice me if it should sound perfectely well either ..

I think that would depend entirely on what hardware is being used - plus, of course, the usual factors: network quality, ITSP quality, PSTN quality, etc...

WillKemp

Hearable difference in sound quality for Asterisk install ?
« Reply #15 on: June 30, 2006, 02:16:27 AM »
Well, i've built the 2.6.16.22 kernel with low latency preemption configured and installed it in my SME server. I'll let you know if i notice any difference!

Offline arne

  • ****
  • 1,116
  • +0/-4
Hearable difference in sound quality for Asterisk install ?
« Reply #16 on: July 03, 2006, 09:48:22 PM »
But these factors have ben hold constant without any change:

hardware, configuration files, network quality, ITSP quality, PSTN quality, etc...

First Astlinux has been installed to PC A, and Centos 4.3 / Asterisk on PC B.

PC A with Astlinux have had clearly bether sound.

Then the whole setup have been reversed. PC B have got Astlinux. PC A have got Centos 4.3 / Asterisk.

PC B With Astlinux has then got clealy bether sound.

Sound quality has been checked with connection to 5 different external sip service providers (termination). Astlinux has given superior sound quality for all tested connections, and for all tested hardware.

Number of running processes for the Cenos 4.3 installations have been reduced to a minumum, anf there have (of cource) been no x-win.

It could be a lot of coinsidents, and still I find this in some way "unbelievable", so sooner or later I will make some more testing.
......

Offline arne

  • ****
  • 1,116
  • +0/-4
Hearable difference in sound quality for Asterisk install ?
« Reply #17 on: July 03, 2006, 09:49:45 PM »
I did not see your last post .. this test result would be very interesting :-)
......

WillKemp

Hearable difference in sound quality for Asterisk install ?
« Reply #18 on: July 04, 2006, 10:51:42 AM »
Quote from: "arne"
Astlinux has given superior sound quality for all tested connections, and for all tested hardware.

Ok, for your final test, now copy the kernel image and the ramdisk image (.img) from the Astlinux sytem's /boot to /boot in the Centos system, then copy the /lib/modules/<version> tree from Astlinux to Centos, then modify /etc/grub.conf on the Centos machine and try booting the Astlinux kernel in the Centos system.

I don't think i've left anything out, that ought to work.

Offline arne

  • ****
  • 1,116
  • +0/-4
Hearable difference in sound quality for Asterisk install ?
« Reply #19 on: July 04, 2006, 10:13:22 PM »
This sounds like a very interesting experiment .. unfortunately I'm on holiedays in Odessa, Ukraina just now, so I can't test anything before I'm home. Quite sure I will try when I'm home.

Have you tested ? How did it work ? Any hearable difference ? Did the Astlinux kernel work well for web server, fie server, etc.

I'm rather courious about what would be the result of such a test ....

(Actually it would not surprice me if the Astlinux kernel worked well on a sme server and if there were an hearable difference in the sound quality for the Asterisk server (?????))

Will I have to go home ?
......

WillKemp

Hearable difference in sound quality for Asterisk install ?
« Reply #20 on: July 04, 2006, 10:58:40 PM »
Quote from: "arne"
Have you tested ?

No. I may check it out though - when i get round to downloading Astlinux.

Quote
Will I have to go home ?

No. It will still be there when you get back! ;-)

WillKemp

Hearable difference in sound quality for Asterisk install ?
« Reply #21 on: July 09, 2006, 09:57:30 AM »
Here's a couple of interesting articles on stuff related to what we've been discussing. The second one specifically mentions about the realtime requirements of VoIP.

http://www.linuxdevices.com/articles/AT4503827066.html

http://www.linuxdevices.com/articles/AT9837719278.html

Offline arne

  • ****
  • 1,116
  • +0/-4
Hearable difference in sound quality for Asterisk install ?
« Reply #22 on: July 12, 2006, 03:07:46 PM »
Thanks for interesting info again. I have just moved from Ukraina to the republic of Moldova, so it's not so easy to test things out, here either, but its still interesting to work on "the theory".

I think that the following can be summed up:

1. Signal prossessing and data transport for Asterisk is a realtime application.

2. It has been recognized for a while that a standard Linux kernel do not perform "true realtime prosessing".

3. In environments that is working with or using ip telephony it has been quite usual to concider that IP telephony gives slightly porer sound quality than ordinary analogue telephony.

The interesting question is then: When the real time signal processing is performed by the same kernel that also handle quite other processeses like web servers, dastabase servers, etc, will this reduce the capabilyty to perform true realtime processing for the IP telephony function ?

I think that in some way it is likely to believe that the answer is "yes" and that the properties of the kernel, how the Asterisk program is processed by the kernel and the amount of load on the kernel by other processes will have influence on the real time capability, and therebay also the audio sound quality.

If this should be true, one basic design rule for well functioning Asterisk servers (and other iptelephony servers) should be: Let the ip telephony server allways have its own dedicated processor, and never try to mix it with general server processes and general processing platforms like the SME server.

It would be very interesting if also someone testet out for instance Astlinux as the dedicated Asterisk server versus Asterisk on sme or Centos as a more general distro, to come up with a conclusion - yes, there is actually a difference in sound quality, or the oposit - no, there is no hearable difference at all.

Actually I do not trust myself, to much but, I believe that there is a hearable difference that can be confirmed.

From this interesting discussion I will say the well known words - I'm still confused (and I have a bit daubt about it all), but on a higher level.

Anybody else that has tested and compared sound quality ?
......