SV: [Speex-dev] How to detect SpeexBits corruption

Tom Grandgent tgrand at canvaslink.com
Thu Jan 25 11:20:26 PST 2007


Jean-Marc,

I hate to say such things about Speex, especially when I've been 
unable to make such problems consistently reproducible.  It takes 
a great deal of patience and effort to track down a rarely 
occurring problem like this in a production VOIP system.  I ended 
up solving my problems by being more careful with the input to the 
encoder and switching to an SVN version of Speex.  This was a long 
time ago, though.

So, I don't have any examples of how current Speex can enter a 
bad state.  But here's one from the past:

http://lists.xiph.org/pipermail/speex-dev/2005-December/004010.html

Tom

Jean-Marc Valin <jean-marc.valin at usherbrooke.ca> wrote:
> 
> Tom Grandgent a écrit :
> > You might not be doing anything wrong.  Speex is stateful and can 
> > get into a bad state sometimes.  It's happened to me too, but not 
> > recently.  And I've seen such bugs reported on this list and fixed.  
> > I suggest several approaches to solving the problem:
> 
> Tom, can you give an example of how Speex can enter a "bad state"? I
> don't see how that could happen, but if you have an example, I can
> probably fix it.
> 
> > 2) Try to make the problem trivially reproducible for others so that 
> > the bug (if it exists) can be tracked down and fixed.  You must 
> > identify exactly which version of Speex you're using and provide 
> > sample data, code, and instructions so that someone else can 
> > reproduce the problem with minimal effort.
> 
> I'd like to add something for everyone: *please* try and reproduce the
> problem with speexenc/speexdec instead of your own code. It's less
> likely to be buggy and a bug that can be reproduced from those will get
> my attention *much* more quickly.
> 
> > 3) Try to be nice to Speex.  Don't feed the decoder corrupted data, 
> > out of order data, data with gaps, etc.  Put extra checks in your 
> > code/protocol to make sure you're decoding exactly the data that 
> > the encoder produced.  You might be surprised at the result.  Also 
> > keep in mind that the nature of the audio data itself may be 
> > triggering the problem, especially if it is unusual in some way.
> 
> Again, do you have examples of that happening.
> 
> Cheers,
> 
> 	Jean-Marc
> 
> > Good luck,
> > 
> > Tom
> > 
> > jesus <jmorion at toomeeting.com> wrote:
> >> thank you, i will explain it more detailed:
> >>
> >> I use libspeex in an activeX project compiled on Visual C++ 2003 
> >> (Windows XP).
> >>
> >> I have one array of SpeexBits and other of decoder states. The first 
> >> time a user speaks, i create and initialize the elements of those arrays 
> >> who correspond to his user_id. Next packets of this user are decoded 
> >> using those elements. The decoder instance is always the same for every 
> >> user packets.
> >>
> >> It works fine most time, but sometimes one user begins to sound like 
> >> voice hits and the others still sounds ok. At that point, if i destroy 
> >> his elements of the two arrays and re-create and initialize, it solves.
> >>
> >> OK, I will read speechenc/dec just one more time.
> >>
> >> Thank you.
> >>
> >> Jonas Tärnström wrote:
> >>> You're doing something wrong.
> >>> Read the documentation and check speechenc/dec just one more time.
> >>>
> >>> If that wouldn't help I'd suggest posting samples of your source code
> >>> and describe what platform/compiler/os you're using.
> >>>
> >>> //JT
> >>>
> >>>
> >>> -----Ursprungligt meddelande-----
> >>> Från: speex-dev-bounces at xiph.org [mailto:speex-dev-bounces at xiph.org] För
> >>> jesus
> >>> Skickat: den 22 januari 2007 19:43
> >>> Till: speex-dev at xiph.org
> >>> Ämne: [Speex-dev] How to detect SpeexBits corruption
> >>>
> >>> Hello,
> >>>
> >>> im using speex library on my vo ip project, but some times, after it 
> >>> works ok, it begins to play noises (like voice hits) decoding the 
> >>> packets of one source (the others sound ok).
> >>>
> >>> I finally found that reseting SpeexBits and decoder state it solves.
> >>>
> >>> If i cant avoid this problem, i wish to solve when it occours, but ¿how 
> >>> to detect this?
> >>>
> >>> Please, if anyone has experiment this issue i will thank any help.
> >>>
> >>> by MJM.
> >>> _______________________________________________
> >>> Speex-dev mailing list
> >>> Speex-dev at xiph.org
> >>> http://lists.xiph.org/mailman/listinfo/speex-dev
> >>>  
> >>>
> >>>
> >>>   
> >>
> >>
> >> _______________________________________________
> >> Speex-dev mailing list
> >> Speex-dev at xiph.org
> >> http://lists.xiph.org/mailman/listinfo/speex-dev
> > _______________________________________________
> > Speex-dev mailing list
> > Speex-dev at xiph.org
> > http://lists.xiph.org/mailman/listinfo/speex-dev
> > 
> > 


More information about the Speex-dev mailing list