Popping noise problem

View: New views
5 Messages — Rating Filter:   Alert me  

Popping noise problem

by frankmail007 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I'm using OpenAL in a few my projects for iPhone becuase it's portable and easy to use. But the popping noise problem puzzled my for quite long time although I managed to by pass the problem by some tricks in some of my project. I'm here agina to seek for a decent solution.

My problem is I always get popping noise when I'm trying to stop a source which is still playing. I tried to adjust the gain to 0 or move the source very far or even move the offset to the end of the buffer, the problem can't be solved. ( There is about 10ms silence at the end of the sound file).

Then I tried to create a timer when I'm going t stop a source. The gain of this source will be reduced gradually to near 0, for example 0.0001 and then I move the offset to the end of the buffer. The popping sound will not exist any more this time. However this is not the perfect solution because it takes time to stop a source. In my case it'll take about 500ms to stop a source. That means this source can't be reused within this duration. That limits the maximum number of sources at the same time. I'm not sure what is the maximum number of sources can be used in iPhone. Smebody told me it's 32.  That means there are at most 32 sources can be used within 500ms which leads to problem in my new project. My new project only need at most 12 to 16 sources at the same time. But due to the popping noise problem, it will easily use more than 32 sources.

Can anybody advise what should I do to overcome this problem? Or I should use some other audio library? ( I tried AudioUnit, it's perfect to meet my requirement but it's not portable.)

Thanks,

Frank


     
_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

RE: Popping noise problem

by Pingwah Leronz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
I haven't experienced this , so this is just a wild suggestion,
but what happens if instead of just stopping the source, you assign an empty buffer
to the source, then stop that?

eg. have a silence buffer?

it sounds kind of backwards, and I'm guessing stopping the silence buffer would create the pop noise too?

Like I said, haven't experienced this, but its worth a try.

Andrew


> Date: Mon, 3 Aug 2009 22:12:08 -0700
> From: frankmail007@...
> Subject: [Openal]Popping noise problem
> To: Openal@...
> CC:
>
>
> I'm using OpenAL in a few my projects for iPhone becuase it's portable and easy to use. But the popping noise problem puzzled my for quite long time although I managed to by pass the problem by some tricks in some of my project. I'm here agina to seek for a decent solution.
>
> My problem is I always get popping noise when I'm trying to stop a source which is still playing. I tried to adjust the gain to 0 or move the source very far or even move the offset to the end of the buffer, the problem can't be solved. ( There is about 10ms silence at the end of the sound file).
>
> Then I tried to create a timer when I'm going t stop a source. The gain of this source will be reduced gradually to near 0, for example 0.0001 and then I move the offset to the end of the buffer. The popping sound will not exist any more this time. However this is not the perfect solution because it takes time to stop a source. In my case it'll take about 500ms to stop a source. That means this source can't be reused within this duration. That limits the maximum number of sources at the same time. I'm not sure what is the maximum number of sources can be used in iPhone. Smebody told me it's 32. That means there are at most 32 sources can be used within 500ms which leads to problem in my new project. My new project only need at most 12 to 16 sources at the same time. But due to the popping noise problem, it will easily use more than 32 sources.
>
> Can anybody advise what should I do to overcome this problem? Or I should use some other audio library? ( I tried AudioUnit, it's perfect to meet my requirement but it's not portable.)
>
> Thanks,
>
> Frank
>
>
>
> _______________________________________________
> Openal mailing list
> Openal@...
> http://opensource.creative.com/mailman/listinfo/openal


Web IM has arrived! Use Windows Live Messenger from your Hotmail inbox
_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

Re: Popping noise problem

by E. Wing :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 8/3/09, Hao Zhou <frankmail007@...> wrote:
>
> I'm using OpenAL in a few my projects for iPhone becuase it's portable and
> easy to use. But the popping noise problem puzzled my for quite long time
> although I managed to by pass the problem by some tricks in some of my
> project. I'm here agina to seek for a decent solution.

I haven't experienced this, but it sounds like you have a reproducible
test case. Please file a bug with Apple if you haven't already done
so.

> That
> limits the maximum number of sources at the same time. I'm not sure what is
> the maximum number of sources can be used in iPhone. Smebody told me it's
> 32.

I have independently verified that 32 is the max for simultaneously
playing sounds with my own test programs (with a few caveats).
(However, Apple is free to change this number at any time as it is
undocumented. You should file an enhancement request with Apple if you
need more.)

-Eric
_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

Re: Popping noise problem

by E. Wing :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 8/4/09, Pingwah Leronz <pingwah_leronz@...> wrote:
>
> I haven't experienced this , so this is just a wild suggestion,
> but what happens if instead of just stopping the source, you assign an empty
> buffer
> to the source, then stop that?
>

Unfortunately, this won't work. It is an OpenAL error to change the
buffer on a playing source. (And I know first hand that Apple's
implementation won't change the buffer on a playing source.)

-Eric
_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

RE: Popping noise problem

by Daniel PEACOCK :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message





Hi All,

I'm not familiar with the iPhone OpenAL capabilities in terms of voice
counts and OpenAL Sources to know what you should expect.

In terms of the audible pop when stopping a playing Source ... I think you
are doing the right thing by fading it to silence.   Have you tried
experimenting with the duration of your fade (500ms sounds higher than
necessary) - but it does depend a lot on how often the OpenAL
implementation actually commits a new gain level.

An alternative idea, which will involve you doing a lot more work on the
application side is ...

If you stream all your audio to OpenAL via Source Buffer Queues you could
handle the fade to silence yourself.  e.g. Stream the audio in small
chunks, e.g 4 Buffers of 25ms.  (The smaller the buffer duration the better
- but will increase the chance of break-up)   When you need to stop a
source, set a flag, that indicates that you should feed it one more chunk
of audio - but before passing the data to the Buffer, ramp the sample
values to 0.   This would have the advantage that the fade could be done
much quicker as you would be able to introduce a per-sample fade out.  Then
you can stop feeding data to that Source, and wait for it to stop
naturally.

NOTE : You could try to keep the Source playing by starting to queue data
from the new sound effect (e.g straight after the old sample's fade-out
buffer has been queued).  However you will have to be careful about when to
commit any new source parameters (e.g gain, position, etc ...) as you
wouldn't want to commit these values while the old sound is still fading
out, or do it too late because otherwise the new sound will be audible with
the wrong parameters.

Dan
Creative Labs (UK) Ltd.

Notice
The information in this message is confidential and may be legally
privileged.  It is intended solely for the addressee.  Access to this
message by anyone else is unauthorized.  If you are not the intended
recipient,  any disclosure,  copying or distribution of the message,  or
any action taken by you in reliance on it,  is prohibited and may be
unlawful.  If you have received this message in error,  please delete it
and contact the sender immediately.  Thank you.

Creative Labs UK Ltd company number 2658256 registered in England and Wales
at Belmont Road, Belmont Place, Maidenhead, Berkshire, SL6 6TB



                                                                           
             Pingwah Leronz                                                
             <pingwah_leronz@h                                            
             otmail.com>                                                To
             Sent by:                  OpenAL Open Source mailing list    
             openal-bounces@op         <openal@...>    
             ensource.creative                                          cc
             .com                                                          
                                                                   Subject
                                       RE: [Openal]Popping noise problem  
             08/04/2009 08:25                                              
             AM                                                            
                                                                           
                                                                           
                                                                           
                                                                           




I haven't experienced this , so this is just a wild suggestion,
but what happens if instead of just stopping the source, you assign an
empty buffer
to the source, then stop that?

eg. have a silence buffer?

it sounds kind of backwards, and I'm guessing stopping the silence buffer
would create the pop noise too?

Like I said, haven't experienced this, but its worth a try.

Andrew


> Date: Mon, 3 Aug 2009 22:12:08 -0700
> From: frankmail007@...
> Subject: [Openal]Popping noise problem
> To: Openal@...
> CC:
>
>
> I'm using OpenAL in a few my projects for iPhone becuase it's portable
and easy to use. But the popping noise problem puzzled my for quite long
time although I managed to by pass the problem by some tricks in some of my
project. I'm here agina to seek for a decent solution.
>
> My problem is I always get popping noise when I'm trying to stop a source
which is still playing. I tried to adjust the gain to 0 or move the source
very far or even move the offset to the end of the buffer, the problem
can't be solved. ( There is about 10ms silence at the end of the sound
file).
>
> Then I tried to create a timer when I'm going t stop a source. The gain
of this source will be reduced gradually to near 0, for example 0.0001 and
then I move the offset to the end of the buffer. The popping sound will not
exist any more this time. However this is not the perfect solution because
it takes time to stop a source. In my case it'll take about 500ms to stop a
source. That means this source can't be reused within this duration. That
limits the maximum number of sources at the same time. I'm not sure what is
the maximum number of sources can be used in iPhone. Smebody told me it's
32. That means there are at most 32 sources can be used within 500ms which
leads to problem in my new project. My new project only need at most 12 to
16 sources at the same time. But due to the popping noise problem, it will
easily use more than 32 sources.
>
> Can anybody advise what should I do to overcome this problem? Or I should
use some other audio library? ( I tried AudioUnit, it's perfect to meet my
requirement but it's not portable.)

>
> Thanks,
>
> Frank
>
>
>
> _______________________________________________
> Openal mailing list
> Openal@...
> http://opensource.creative.com/mailman/listinfo/openal

Web IM has arrived! Use Windows Live Messenger from your Hotmail inbox
_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

ForwardSourceID:NT0006E426

_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal