Summary:ASTERISK-11742: Unable to record Speex
Reporter:Nicholas Blasgen (nblasgen)Labels:
Date Opened:2008-03-28 04:08:38Date Closed:2011-06-07 14:07:24
Versions:Frequency of
Environment:Attachments:( 0) 20080328__bug12321.diff.txt
Description:    -- Executing [500@realtimedb:3] Record("SIP/test-091a8d58", "test-account:wav,0,30") in new stack
   -- <SIP/test-091a8d58> Playing 'beep.gsm' (language 'en')
[Mar 28 02:00:58] WARNING[12563]: codec_speex.c:232 speextolin_framein: Out of buffer space
[Mar 28 02:00:58] WARNING[12563]: codec_speex.c:232 speextolin_framein: Out of buffer space

I have no issues playing files, just recording.  I've tested with Asterisk 1.4-SVN and Asterisk Trunk, both compiled tonight.  I've tested with Speex 1.1.12 as well as Speex 1.0.5.  I've tried recording from X-Lite and a self made pjlib based client.  I've really tried everything.  Searching the web I've found references to this exact issue from 2004.  Maybe it's an X-Lite issue, but pjlib is an open source library that I would have expected to work if it was a simple issue with X-Lite missunderstanding the SpeeX RFC.

So again, no issue listening to files in a broad range of formats (though I focused on WAV files).  But I can't record to WAV.  Other posts say the same is true with recording voice mails.
Comments:By: Tilghman Lesher (tilghman) 2008-03-28 10:04:21

I'd like to see how far you are above the buffer size, so please apply this patch, and reply back with the new warning messages.

By: Nicholas Blasgen (nblasgen) 2008-03-28 15:17:16

[Mar 28 13:18:46] WARNING[17254]: codec_speex.c:232 speextolin_framein: Out of buffer space: 8000 + 160 > 8000
[Mar 28 13:18:46] WARNING[17254]: codec_speex.c:232 speextolin_framein: Out of buffer space: 8000 + 160 > 8000
[Mar 28 13:18:46] WARNING[17254]: codec_speex.c:232 speextolin_framein: Out of buffer space: 8000 + 160 > 8000
[Mar 28 13:18:46] WARNING[17254]: codec_speex.c:232 speextolin_framein: Out of buffer space: 8000 + 160 > 8000

Quick Google search for `speextolin_framein` returns plenty of issues that seem similar.


By: Brett Bryant (bbryant) 2008-07-17 10:15:59

nblasgen, I've tested this with speex 1.1.12 / asterisk 1.4.18, and couldn't reproduce this issue. Do you have any more information that could help with testing?

By: Nicholas Blasgen (nblasgen) 2008-07-18 03:16:27

Tonight is not the night.  I'll follow up in 48 hours.  I just tried upgrading to the newest SVN copy of Asterisk and had some major problems, so I need to get some sleep before trying to figure out how to recover my system :)

By: Nicholas Blasgen (nblasgen) 2008-07-22 22:45:58

Same issue with X-Lite.

[Jul 22 20:59:46] WARNING[2546]: codec_speex.c:240 speextolin_framein: Out of buffer space

Asterisk 1.4.21-2
SpeeX 1.1.12
X-Lite 1.5.19 build 47737
CentOS 5.1

By: Nicholas Blasgen (nblasgen) 2008-09-30 12:58:54

Might as well make an update a few months later:

Asterisk SVN-branch-1.4-r144925
[Sep 30 11:16:43] WARNING[580]: codec_speex.c:240 speextolin_framein: Out of buffer space


To answer bbryant's question from July, I don't believe the issue is with Asterisk at all.  I've read enough about SpeeX saying how different people read the RFC different ways.  I believe the issue is specific to X-Lite.  Now I have tried with an open source SIP SpeeX client as well and had the same issue, but they could be copying X-Lite's method.  Could be much like Internet Explorer.  IE is plain bad, but companies like Firefox need to build those same issues into their browser to make it work.

If you've tried X-Lite and don't have that issue, then let me give you SSH access to one of my development systems and you can fool around if you wish.  Could be an issue with CentOS.

By: Terry Wilson (twilson) 2008-11-17 16:41:30.000-0600

I have tested this under Ubuntu and asterisk trunk recording, monitoring, etc. to wav seems to work for me from Eyebeam (haven't tried xlite)

By: Terry Wilson (twilson) 2008-11-17 16:59:22.000-0600

nblasgen, I also tested against xlite 3.0 for Mac and had no problems.  My only microphone is firewire-based and I don't have firewire ports on my linux box, so I can't try with xlite 2.0 for Linux.  Since you reported that this is probably a problem with xlite, and I can't reproduce here yet, I'm tempted to close this one out.  I'll wait a few days to see if you respond before doing so, though.  If you could test against a trunk checkout, I'd appreciate it.

By: Nicholas Blasgen (nblasgen) 2008-11-17 22:55:16.000-0600

I am on a business trip for another day.  When I am back I'll compile the newest SVN and test it with Eyebeam on both OS X and Vista.  I'm glad to hear that it's working for someone.  If I encounter an issue, I'll also try installing on Slackware (though sadly it's an OS I haven't used in many upon many years).

By: Nicholas Blasgen (nblasgen) 2008-11-18 00:10:47.000-0600

Close this case.  It works perfectly right now and might have worked perfectly for a long time too--I'm not going to bother to check unless requested.

I feel stupid but at the same time Asterisk didn't detect it either.  CentOS repo uses 1.0.5 and installs to /usr/lib/libspeex.so.1.  SpeeX on tarbar compile installs to /usr/local/lib/libspeex.so.1.  So it seems for quite a while I had two versions installed in different locations.  When compiling Asterisk, the ./configure program was looking in /usr/local/lib/ it seems and using that codec.  After install, Asterisk I noticed was looking for the /usr/lib/ file--not the one the ./configure app had decided to use.

Anyways, it just ended up being a cluster f*ck.  Everything seems to work right now.  I'm not sure why the previous versions failed, but if for the past 6 months I've had multiple versions of SpeeX installed, I can only blame myself.


Asterisk SVN-branch-1.4-r157163
eyeBeam 1.5 (rev 47069 on Mac OS X)

And I had tested eyeBeam on the system before upgrading and finding this additional issue, and it failed at that time.  So case closed.  Very likely my fault but now we know there is a fix if this comes up again.

By: Terry Wilson (twilson) 2008-11-18 00:14:08.000-0600

Glad to hear it is working for you now!