Return to LanScape's home page Go back a page...       Active TopicsActive Topics   Display List of Forum MembersMember List   Knowledge Base SearchSearch   HelpHelp  RegisterRegister  LoginLogin

LanScape VOIP Media Engine™ - Technical Support
 LanScape Support Forum -> LanScape VOIP Media Engine™ - Technical Support
Subject Topic: Broken Audio in SingleLinePhone Sample Project Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
fdfrye
Intermediate
Intermediate


Joined: February 01 2008
Location: United States
Posts: 23
Posted: February 11 2008 at 11:02am | IP Logged Quote fdfrye

I am experiencing badly broken audio (both mic and headset) when using the SingleLinePhone sample application. I have a co-worker who is able to use the sample with no problems on both our asterisk boxes, whereas the audio appears broken on my machine against both boxes. The audio buffer settings do not rememdy the problem. The higher I set those settings the worse my choppiness gets. I even experience the same broken audio during the playback of the "ENABLE_START_AUDIO_SPLASH" sound sequence. It appears all my trouble is happening in the interface between LanScape and my sound card driver, but I have no way to troubleshoot or prove this. Any ideas?
Back to Top View fdfrye's Profile Search for other posts by fdfrye
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: February 11 2008 at 3:37pm | IP Logged Quote support

Hi Dan,


Hmm… that does not sound good. We do not have any open issues regarding what you are describing. We need more info regarding your operating system, host machine and multimedia hardware installed. Its got to be something simple. Please repost with the above info.

We are not exactly sure of the VOIP deployment you are testing against. Please tell us a bit about your test VOIP deployment.

One thing you may want to try is this:
The samples can be used to call each other directly (not using a SIP proxy or registrar). Set up the soft phone sample on one machine in your private network and set up another sample app (like the 6 line IVR server) and call the IVR server from the soft phone directly. Make sure not to have the soft phone registered with your asterisk box. You should have crystal clear audio between the two sample apps.

Also, if you use the above setup and you call the IVR server using aLaw or uLaw codecs, all the in-band DTMF detection should work as expected.

Support

Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
fdfrye
Intermediate
Intermediate


Joined: February 01 2008
Location: United States
Posts: 23
Posted: February 11 2008 at 4:03pm | IP Logged Quote fdfrye

Thanks for the reply,

I am running the 5.12.8 dll-only upgrade as my LanScape Media Engine. I am running a version of the SingleLinePhone VS2005 sample project (upgraded to run under VS 2008.) My operating system is 32-bit Windows Vista Business Edition with all the available updates installed. I am running on a Dell Precision M6300 Laptop with a Sigmatel "High-Definition" sound card.

I have been using a combination of soft-phone to soft-phone calls (on the same Asterisk Box) and also calls from soft-phone to a PSTN-line using a VOIP Trunk on my asterisk box. I have experimented with the Noise Discrimination and Jitter settings -no luck. I have also changed the codec version -no change. I am currently using uLaw.

An interesting note is...when I enabled call recording and record my call, the .wav file plays back flawlessly. That makes me think there is just some kind of interaction between LanScape and my soundcard that isn't working quite right. Obviously, sound playback and recording seems normal and fine from all other applications...
Back to Top View fdfrye's Profile Search for other posts by fdfrye
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: February 11 2008 at 5:26pm | IP Logged Quote support

Dan,

Using one other machine and your laptop in your local LAN, let us know if you can call direct sample app to sample app as we described earlier.

Support
Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
fdfrye
Intermediate
Intermediate


Joined: February 01 2008
Location: United States
Posts: 23
Posted: February 12 2008 at 9:14am | IP Logged Quote fdfrye

I installed and tested my LanScape Media Engine on another machine within my LAN. This was a Dell Optiplex 320 Desktop running 32-Bit Windows XP Professional with a SoundMax Integrated High-Definition Audio soundcard. I connect both machines to my asterisk box using different extensions and the SingleLinePhone sample. Both connect fine, the Optiplex machine plays the start-up sample fine with no audio distortion. My Laptop continues to have distorted audio. I am able to carry on a conversation across the LAN using the two soft-phones. It is difficult to prove during a conversation that one machine is working correctly and the other is not, because the distortion on the Laptop happens to incoming and outgoing audio, making the audio sound distorted on both sides of the conversation. Due to the perfect sound quality on the Optiplex during startup, I assume this is the case and that there is either an imcompatibility with my Laptop hardware, or with Windows Vista.
Back to Top View fdfrye's Profile Search for other posts by fdfrye
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: February 13 2008 at 3:31pm | IP Logged Quote support

Dan,

Thanks for your last description. Sorry for the delay of this post. If the sample application boots up with the “audio splash” sounding OK, that is good. If the “audio splash” does not sound OK (broken or choppy as you describe) that says something about your laptop’s ability to support accurate multimedia timing. Other apps that record or playback audio that sounds good are probably using a deeper buffering scheme than what the default is for the media engine. We will explain more below.

Basic Explanation:
The VOIP Media Engine has internal digital mixer software that needs to execute every 20Ms +/- 1Ms. When the media engine boots, it can play an “audio splash” to the multimedia hardware via an internal software “master playback mixer”. If this “audio splash” sample block data does not get mixed in a timely manner and passed to the Windows MMI API (i.e. the standard low level wave In and Out APIs), the mixed sample blocks for the “audio splash” will play back on your multimedia hardware broken or choppy as you have described. If this is true, you should be able modify the audio buffering the media engine uses to reduce or completely remove the choppy audio playback.

There are three startup parameter values used to control internal signal path audio buffering. They are:

int PlaybackBufferingDefault;
int PlaybackBufferingDuringSounds;
int PhoneLineTransmitBuffering;

See the Developer’s reference for the START_SIP_TELEPHONY_PARAMS structure for complete information.

Generally speaking , the crappier the host PC’s ability to have accurate multimedia timing, the higher you have to set the above three values to mask a certain amount of broken or choppy audio. This comes at the price of introducing audio latency in the signal paths.

A good experiment would be to set the PlaybackBufferingDefault and PlaybackBufferingDuringSounds values to something like 10 (that would be 200Ms buffering) and restart the sample app. The broken “audio splash” should go away or at least diminish to a large degree. If it does not, try a setting of 20 (400Ms) for each setting.

If you perform the above test and the “audio splash” sounds good, then we pretty much have determined that the multimedia timing capability of your laptop hardware + Vista is not so good. The next question would be: Why is this so? Is it a Vista multimedia driver issue or what?

Also, when the media engine starts, it adjusts the multimedia timer resolution for the VOIP app (process) to 1Ms resolution. It does this by calling the following Windows APIs: timeGetDevCaps() and timeBeginPeriod().

The media engine then uses the Windows API timeGetTime() throughout to sample time intervals as needed by the software.

For a simple test, you can download a utility from the LanScape web site that will test to see if multimedia timing can be set to 1Ms on your laptop. Here is the URL:

http://www.lanscapecorp.com/Binary/GetSystemTimerResolution. exe

When you run the utility, it should report something like the following:

Code:

System timer resolution:
Min = 1 Ms
Max = 1000000 Ms

Trying to set timer resolution to 1 Ms...
Timer resolution set to 1 Ms.
Restoring previous timer resolution...
Original timer resolution restored.



If the utility does not report as shown above, we have a problem.

Try the buffer settings we described above and repost with your results. Also tell us what the above utility reports for your machine.

Thanks,

Support

Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
fdfrye
Intermediate
Intermediate


Joined: February 01 2008
Location: United States
Posts: 23
Posted: February 13 2008 at 4:05pm | IP Logged Quote fdfrye

Guys,

I ran GetSystemTimerResolution.exe and received the exact same text as you included in your last post. I then moved onto your buffer changes (which I had already attempted) and your values of 10, then 20 make the problem increasingly worse as I increase the audio buffer values. Let me know if you have any other ideas...
Back to Top View fdfrye's Profile Search for other posts by fdfrye
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: February 13 2008 at 4:22pm | IP Logged Quote support

Dan,

That says something. What, we do not know yet. You are running the v5.12.8.0 media engine image, aren’t you?


There are two undocumented APIs:

Code:

TELEPHONY_RETURN_VALUE VOIP_API GetMixerResampleState(
           SIPHANDLE hStateMachine,
           BOOL *pEnableState
           );

TELEPHONY_RETURN_VALUE VOIP_API SetMixerResampleState(
           SIPHANDLE hStateMachine,
           BOOL EnableState
           );



Call the SetMixerResampleState() API with the EnableState parameter to FALSE (zero). Run the sample on your laptop again. Please report back. We will explain more in a bit…


Support
Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
fdfrye
Intermediate
Intermediate


Joined: February 01 2008
Location: United States
Posts: 23
Posted: February 14 2008 at 9:12am | IP Logged Quote fdfrye

I tried making the call to SetMixerResampleState in a few different places.

I did not notice a difference with any of my attempts. I also combined using that call with the default buffer settings of 2,4,2 and also your suggest settings of 10 and 20.

The choppiness worsened as I increased the settings just as it had before when I was not calling SetMixerResampleState. Keep me posted on any other ideas.

I am pretty curious as to why the recorded call would sound different than my live audio through headset and mic. I would assume the recorded audio would have to go through the same low-level recording APIs also and would experience whatever is causing my problems.
Back to Top View fdfrye's Profile Search for other posts by fdfrye
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: February 14 2008 at 10:30am | IP Logged Quote support

Hi Dan,

Thanks for your latest info. This choppy audio issue you reported bugs us. We would really like to know what is causing this.

You can call the SetMixerResampleState() API proc any time after a successful return from the StartSipTelephony() proc. You only have to call the SetMixerResampleState() proc once.

If you did this and it made no difference, that in a way is good because we recently added media resampling to the media engine to reduce voice path latency and we needed to make sure that the resampling is not causing the issue.

If the SetMixerResampleState() API proc made no difference, then remove the proc from your code.

The very strange thing is this: If you have broken audio, increasing the buffering levels has to have a better effect. We believe what you say but it makes no sense.

What we need to do is get your app to boot with the audio splash enabled using the buffer settings of 2,4,2 and have it sound good. If we can get there, then calls should also be OK.

Question 1:
Would it be possible for you to record the actual audio you hear when the app boots and send that to us in either raw PCM samples or as a wave file? We would like to hear it – it will give us a better idea as to the problem.

We are going to create an FTP support account for you. That way you do not have to use Skip’s or Dennis’s FTP accounts. We will email you the login info shortly.


Question 2:
Have you tried running the media engine sample on other Vista Boxes? This is important. We need to know if its Vista in general or something specific to your laptop.

Question 3:
Does your laptop have power saving features enable or ACPI (Advanced Configuration and Power Interface) enabled. If so, try disabling ACPI and see if it makes any difference. For ACPI, see this WikipediA reference:
http://en.wikipedia.org/wiki/Advanced_Configuration_and_Powe r_Interface




One thing that would be very useful is to see the time slice loop times of the internal digital mixers. One way we can do this is by calling the following undocumented proc after the media engine starts:

Code:

TELEPHONY_RETURN_VALUE VOIP_API SetTransmitMixerTimingState(
            SIPHANDLE hStateMachine,
            int PhoneLine,
            char *pTimingFileName,
            BOOL Enable
            );



Here is what we need to do:
1)     Call this proc in your code for phone line 0.
2)     Turn off “noise discrimination (see the SetNoiseDiscriminationEnableState() API proc)
3)     Make a call using phone line 0.
4)     Talk continuously for 10 to 20 seconds and hang up.
5)     Terminate your test app.
6)     Upload the generated timing file to your FTP account. We will look at it.


Thanks Dan. We know this sucks…


Support



Notes:

This post discusses VOIP Media Engine undocumented API procedures that are used for internal test purposes. Do not use these API procedures in your VOIP applications.

Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
fdfrye
Intermediate
Intermediate


Joined: February 01 2008
Location: United States
Posts: 23
Posted: February 29 2008 at 1:00pm | IP Logged Quote fdfrye

I have not forgotten about you guys. Since the problem exists only on my machine, the priority for solving this issue has been lessened. I still have every intention of getting you the information you requested as soon as I am able. Thanks again for your quick and in-depth research into my issue.
Back to Top View fdfrye's Profile Search for other posts by fdfrye
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: February 29 2008 at 2:33pm | IP Logged Quote support

Hi Dan,

Thanks for the update. We look forward to any info you can offer.

Support
Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
fdfrye
Intermediate
Intermediate


Joined: February 01 2008
Location: United States
Posts: 23
Posted: April 10 2008 at 2:39pm | IP Logged Quote fdfrye

Hello,

After speaking with Randal again today, he reminded me of this issue. I took a moment to record a sample of the audio during the startup splash and posted it in my ftp account with the filename splash_brokenaudiosample.wav. Hope this helps some.
Back to Top View fdfrye's Profile Search for other posts by fdfrye
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: April 10 2008 at 3:35pm | IP Logged Quote support

Thanks Danny.

It really does sound terrible. We will investigate....

Support

Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: April 18 2008 at 7:58am | IP Logged Quote support

Hi Danny,

Update on the Qos RTP stream monitor console app we promised your team:


Just wanted to give you a heads up that we are working all day today to complete the test console VOIP app + docs that we promised your group last week. It’s been very busy here.

Anyway, we will get this test RTP monitor app (with C++ source code) together today (it’s the high priority for today) and hopefully get it to you with basic docs before the end of the day. We apologize that it has been a whole week but sometimes other interruptions must be serviced.

We will post later today with the results.

Thanks for your patience,


Support

Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
fdfrye
Intermediate
Intermediate


Joined: February 01 2008
Location: United States
Posts: 23
Posted: April 21 2008 at 10:55am | IP Logged Quote fdfrye

Hey guys,

I realized I still owed you a timing log. It has been uploaded to my ftp account as "timinglog.log." I am not sure at all what these values represent, and I may have been having a little bit of latency with our outbound provider. If the values seem totally crazy, maybe I can work out a better test while dialing a local SIP extension instead of an external phone number. The audio issues do seem to have nothing to do with the type of call being places, or the routes through which it is being places. Also, it seems like I still owe you results from a Vista test. This is more of a hassle than anything else, but will try that next...
Back to Top View fdfrye's Profile Search for other posts by fdfrye
 
fdfrye
Intermediate
Intermediate


Joined: February 01 2008
Location: United States
Posts: 23
Posted: April 21 2008 at 4:00pm | IP Logged Quote fdfrye

I am sure there are still a lot of avenues we can venture down here, but I wanted to add one last peice of information...

On the laptop in question, I have attempted to run a utility mentioned in a lot of audio-recording forums. It is designed to measure the latency of DPCs on Windows platforms. Other users have posted about having abnormally high latencies with certain Motherboard/Hardware configurations.

I have found many users complain about my laptop model specifically. I am not able to follow any advice from any forum and lower my latency after countless efforts. Perhaps, if I were to find a magic solution, it would also rectify this audio corruption.

Here is a link to the utility:

http://www.thesycon.de/deu/latency_check.shtml

If my assumption is correct, if you find a machine with very bad performance according to this utility, you will be able to repro my problem.
Back to Top View fdfrye's Profile Search for other posts by fdfrye
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: April 22 2008 at 3:22pm | IP Logged Quote support

Danny,

The utility you point out is pretty good. We will take a closer look at it.

The numbers from your log that you uploaded are the execution loop times of a phone line transmit mixer. The digital mixers in the media engine are all based off of the same code. All we wanted to do was to get a feeling for the execution mixer loop times as it executes on your laptop. These loop times represent your machine’s ability to maintain a steady audio stream when playing back sample data to your multimedia hardware or out any active phone line.

The numbers are horrible. We see from the timing log that you must have made an outgoing call for 6.08 seconds. The average mixer loop time on your machine computes out to be 96.85526 Ms. No wonder why your audio sounds like garbage. The loop time must be an average of 20Ms +/-1 Ms – always.

The digital mixers in the media engine are designed such that over time, they average out all timing errors. The goal is to have execution times at a steady 20Ms. From your data in the log file, this is not occurring. The only way the digital mixers could be this far off is if your multimedia time base on your host machine is not being updated accurately by the operating system. If the time base the media engine depends on is for some reason not periodically accurate, things are not going to work.

Regarding Deferred Procedure Calls:
If you have determined that your host machine has terrible hardware interrupt delays or similar long DPC delays, then something will have to be done to replace the drivers for the hardware at fault. At the very least it would be good to identify the offending driver and at least disable it if it is not a critical system function.

In Windows NT and above, the OS executes “tasks” in this order: Hardware interrupts, Deferred Procedure Calls, Asynchronous Procedure Calls and the user mode process threads that are ready to run.

All the code in the media engine is user mode code. If you have a hardware driver that is generating an interrupt and then scheduling the execution of a DPC routine that is causing tons of delay in the system, multimedia type apps on the system will have issues.

If the fault is due to a system driver and high DPC latency or inaccurate multimedia time base on the host, there is nothing we can do in the media engine to correct this.

Are there any other “real time” related apps that appear to work on your machine?
What is the model number and manufacturer?
What is the max DCP latency the utility reports for your system?


Support


Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
juice
Vetran
Vetran


Joined: December 05 2006
Location: United States
Posts: 139
Posted: July 01 2008 at 12:44pm | IP Logged Quote juice

Hi there,

for long time we were using v5.12.7.21 DLL Only which was working well under Vista and XP, unfortunately it was time bombed so we had to upgrade.

We have tried v5.12.8.1 FULL, v5.12.8.3 DLL Only, v5.12.8.4 DLL Only and with all we had same problem as described above, horrible choppy audio under Vista.

We've collected some information for you:

Test machines
Acer Ferrari 5000 , OS: Vista Ultimate
IBM ThinkPad (don’t know details, but fast), OS: Vista Ultimate

-
We've run the GetSystemTimerResolution.exe and result was successful.
Than tested with the Latency Checker and result was avg below 100us (see ftp)
We have also recorded audio when running lanscape and other real time audio application (see ftp)
On both machines v5.12.7.21 runs just fine, but the v5.12.8.1 and up, terrible choppy audio.

Various engine startup settings (we use buffer default 2,4,2) and system settings did not help.

Is there a chance that we could get extended time bomb on v5.12.7.21 till we resolve the Vista audio problems.

Back to Top View juice's Profile Search for other posts by juice
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: July 01 2008 at 1:03pm | IP Logged Quote support

juice,

Are both hosts single core machines?

Support

Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
juice
Vetran
Vetran


Joined: December 05 2006
Location: United States
Posts: 139
Posted: July 01 2008 at 1:36pm | IP Logged Quote juice

for sure both having two cores,
one is based on AMD Turion 64 x2 and
second is Intel Core2 Duo or Core Duo,
Back to Top View juice's Profile Search for other posts by juice
 
juice
Vetran
Vetran


Joined: December 05 2006
Location: United States
Posts: 139
Posted: July 02 2008 at 2:49am | IP Logged Quote juice

following your question about single core machines, we have made following test, to make sure that our application runs only on one core we have used the SetProcessAffinityMask Function : http://msdn.microsoft.com/en-us/library/ms686223.aspx and successfuly force application to run on one processor

unfortunatelly it did not make a diffrence, however from task manager we could confirm that its running only on one processor.
Back to Top View juice's Profile Search for other posts by juice
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: July 02 2008 at 9:51am | IP Logged Quote support

Good. Got it.

We will be looking into the problem this week for you and Danny....


Support
Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: August 26 2008 at 3:58pm | IP Logged Quote support

Juice and Danny,

We are completing testing of an update that should cure the playback audio problems both of you reported in this thread. We regret the delay but it has taken quite a bit of time to fully research the solution and perform proper code changes and testing. Part of the delay was in locating machines that exhibited the problem.

So far, the results of the changes we have implemented look good. We are able to remove broken/choppy audio on Vista and XP boxes that we have identified. The primary issue is a combination of multimedia hardware and drivers. The playback in the media engine has been changed over to an adaptive algorithm that incorporates time scaling of played sample block data. This in effect allows more robust playback with minimal introduced playback latency and delays.

Our goal is to get this update out sometime tomorrow to your support FTP accounts for download. We will repost again tomorrow when we mount the updated DLL images.

Thanks very much for being patient while waiting for this fix.

Support

Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
juice
Vetran
Vetran


Joined: December 05 2006
Location: United States
Posts: 139
Posted: August 27 2008 at 4:11am | IP Logged Quote juice

Hi there,

that's great news, we will wait for new DLL images, and test them rightaway.

Back to Top View juice's Profile Search for other posts by juice
 

Page of 2 Next >>
  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum






Contact LanScape Hear what the Lawyers have to say How youm may use this site Read your privacy rights