Postcards from the Bleeding Edge
Sunday, September 05, 2010

  My most interesting failures, #3: VOIP

In 2001, while at Montavista, I started working on embedding asterisk on various platforms. It was totally accidental! I needed something to test the sip phones I was working on, and didn't have budget for a commercial SIP server, so I got asterisk running one day on a 386 box, and later PPC, mips and arm platforms. I was mightily impressed with what asterisk could do.

The SIP stack I was fiddling with was ultimately released as the "sophia" stack. I don't know to what extent the stack got used, but Asterisk on the other hand, went places....

Over the next few years I got very enthusiastic about asterisk and VOIP in general, as did a lot of people. I switched from mostly doing embedded work on tiny processors to high end servers. I maintained VOIP links to all the main VOIP providers at the time, blogged VON, spoke at a couple astercons, and helped get a wireless VOIP provider, wiline.com, off the ground.

Back in November, 2005, I started work on an embedded VOIP PBX intended for a private jet aircraft. Noise suppression and echo cancellation on an aircraft is a difficult problem - you have a huge amount of background noise you need to eliminate just in order to get the actual sound out of the microphone, and you still have to echo cancel the rest. The (struggling) design I inherited was built around a Intel arm chip which had a little support for DSP instructions, with some co-processors onboard that were a deep, dark mystery. There was no way Intel was going to release information on how to make those co-processors work to J. Random Company! And without being able to use those, it was just a fairly fast arm chip with no special features worth mentioning

There was ALSO no way the (commercial) code this company had intended to use would scale up from being a multi-line SIP phone to being a PBX, either, so I ported asterisk (AGAIN) in a matter of weeks and managed to meet most of the feature set required in the contract that way. Conference calling worked GREAT, for example.

But I and nobody else on the team could beat the echo cancellation problem on the analog handsets. We eventually threw a big FPGA on the board in the hope we'd eventually come up with a solution. The project was canceled in March of 2006. Ultimately I recreated the asterisk port, and finally got around to pushing out the last few core changes to asterisk required to make it work on a various architectures out to the mainline.

I don't know if the competing project for it ever got off the ground; it was saner as it used digital handsets throughout. (If you think FCC certification is hard, try FAA!) But... soon afterwards a functional asterisk made it into openwrt, and people started regularly embedding the VOIP PBX services into NASes, wireless access points and related devices.

Getting echo cancellation solved was something the indefatigable and brilliant David Rowe, whose PHD thesis was in speech compression, put his mind to at around the same time.

In addition to slowly perfecting oslec, he designed and produced an amazing board that got asterisk working on a low end, yet cool processor - the blackfin - which lacked virtual memory and a floating point co-processor. He announced the project's existence in late 2006. My first email message to David, was something like: "You're crazy, but you're my kind of crazy". We got to be buddies.

In 2008 I spent a few months in Australia, visiting with David and his family. At the time he was working on the IP08. We also kicked around ideas for what became the Mesh Potato.

The IP04 had been a success at both the open hardware development model, and in reducing the cost of a small business PBX.

It had flaws however - with the CPU lacking a MMU it had memory fragmentation problems and was inherently less reliable than a CPU that had a MMU. Asterisk itself, at the time, wasn't so reliable either. Wedge in some sort of gui like
FreePBX into the limited memory available, and it would die...
reliably. Please note - it is plausible to build embedded products without a MMU but it takes a lot more software development time and testing - and the IP04 IS useful without a GUI and as a product... and multiple, simpler guis than FreePBX have appeared for it - it remains, 2 years later an amazing cost reduction that nobody has matched since, and the software continues to improve.

Those issues didn't stop one vendor from trying to scale that hardware design up from 4 to 8 channels. Hardware-wise, this was pretty simple, just add more analog boards to the bus and you were done... But they'd neglected to analyze the software stack...

Under the loads were testing, the oslec echo canceler got to 5 channels and the whole box basically crashed, using up 100% of CPU. There wasn't enough oomph left over to run asterisk itself after coping with the echo cancellation problem, multiple voip connections, etc. , the problems started showing up at 4 channels and became pathological at 5.

By hand coding the assembly for the blackfin on the IP04 and using the onboard scratchpad ram, I sped up the oslec routine by about 25% - but it took an epic fight with the toolchain at the time to make it work at all. The loop control register was ill-supported, and without it getting reliably dumped on the stack, I couldn't make the parallelism inherent in the blackfin architecture function to it's fullest extent. The core loop was only 10 (8!?) lines of assembly, as I recall, but this core routine couldn't work as written, with threads, without revamping the entire compiler!

I filed bugs, and started work on getting a new uclinux blackfin toolchain functioning (I also wanted ipv6 support!) but left Australia before I got anywhere. Other people were working on it, perhaps the work was completed, I should check.

Even if I'd managed to speed up the code by another few percent it wasn't going to be enough to get the IP08 to work under the full workload we were trying.

Update The IP08 DID ship, and under saner workloads than what we were trying, works just fine - so David Rowe tells me.

Perhaps there are faster blackfins now, with more onboard scratch ram.... At the time I daydreamed of just embedding oslec into an FPGA...

Along the way, by optimizing oslec's code path for modern architectures, I halved oslec's run-time via some pre-processor magic. While that is a worthwhile optimization for the thousands of asterisk servers out there, I still haven't bothered to get that into the main oslec tree or into the Linux kernel. It doesn't seem worth it. Analog telephony doesn't matter much anymore - the VOIP world is going digital anyway. One of these days I'll dig up the work. Or maybe David Rowe still has it, or someone else has done it already.

Update David tells me that many of my mods were not bit-accurate, but I do remember this last as being bit-accurate...

If ipv6 ever gets off the ground, getting sip to work the way it was designed to work would be worthwhile. But as things stand today, Skype works so darn well and is so ubiquitous that there seems to be no point in continuing working on sip based VOIP. Yet, there are many features of asterisk and freeswitch that I like - voicemail to email as one example - IVR - I used to have a converter for podcasts into on-hold music...

After using skype almost exclusively for the past 3 years, I am seriously annoyed at how bad the quality of the average cell phone connection is in the USA and in Nicaragua. While I was in the USA this past spring, I tried both AT&T and Verizon on multiple phones and was beset with difficulties - even going within their own networks.Quality is a metric nobody's figured out how to charge for. Maybe one day people will become so disgusted that they will en mass migrate to something else. Some, like me, for years now, have just leaned up against a nearby wireless access point with a Nokia n800 and made a skype call.

My verizon Droid won't transmit skype over anything but 3G. Skype over 3G sucks just as bad as the cell service does. I didn't know that skype had been crippled when I bought the phone, and if I had a choice I'd return it for that reason.

If I could, I would probably discontinue the voice component of the cellular service entirely. The data features (just the integrated GPS with biking directions!) are awesome enough as they stand.

TransConf

Sometime around 2005, I started working on what I thought was a genuinely new idea - conference call transcription - something that had a sound market need - how many meetings with 4, 8, 12 people or more, have you attended where you couldn't remember who agreed to do what? Or a good idea got arbitrarily rejected because it was out of the blue, so new, that nobody understood it at the time, and simply didn't register?

I called the enterprise, "TransConf".

I got stuck on multiple things: The normal (for me!) Lack of funding, and infrastructure, and an inability to find the words to describe a concept that only newly existed. While working on the idea, I found especially discouraging, watching people use freeconferencecalls.com for everything, eliminating the core revenue opportunity - I saw transcription as an add-on, and better conference calling general a highly desireable feature.

I also observed (disgustedly) that many people wanted plausible deniability for anything they'd said in a meeting and DIDN'T want anything written down, or searchable.

I got also got stuck on the software: I wanted a voip conferencing solution that would spacially locate the various individuals in your head, with stereo processing and a head transfer function.

I tried to produce (with ardour) something that handled multichannel audio playback well, with a pedal, to aid the transcriptionist, and ardour wasn't ready yet (and still has no decent windows version).

I'm using a pedal and ardour now for similar work, so ardour is ready, asterisk and freeswitch are ready, but is the world?

I let the domain name expire years ago.

Working on VOIP related technologies was a fun and cool phase in my life, and I'm glad to see others continue to work in it - not only on cooler, cleaner codecs, and more robust servers like freeswitch, but embedded devices like the mesh potato, better phones, video, and so on....

Labels: ,

 
David Täht writes about politics, space, copyright, the internet, audio software, operating systems and surfing.


Resume,Songs,
My new blog, NeX-6, My facebook page
Orgs I like
The EFF - keeping free speech in the world
Musical stuff I like
Jeff, Rick, Ardour, Jack
Prior Rants - Sharing your home network better in a time of covi... Designing for the disconnect Email lists going down the memory hole Instituting saner, professional source code manage... Wireless and Wifi in 2015 - not what I dreamed of Saving wifi! Fixing Bufferbloat! Fighting the vend... Virgin Media - Fixing the epidemic of bufferbloat ... 49... and trying to find my navel Wheels down on mars! Tracking the landing of Curiosity, from Seattle
Best of the blog:
Uncle Bill's Helicopter - A speech I gave to ITT Tech - Chicken soup for engineers
Beating the Brand - A pathological exploration of how branding makes it hard to think straight
Inside the Internet Mind - trying to map the weather within the global supercomputer that consists of humans and google
Sex In Politics - If politicians spent more time pounding the flesh rather than pressing it, it would be a better world
Getting resources from space - An alternative to blowing money on mars using NEAs.
On the Columbia - Why I care about space
Authors I like:
Doc Searls
Where's Cherie?
UrbanAgora
Jerry Pournelle
The Cubic Dog
Evan Hunt
The Bay Area is talking
Brizzled
Zimnoiac Emanations
Eric Raymond
Unlocking The Air
Bob Mage
BroadBand & Me
SpaceCraft
Selenian Boondocks
My Pencil
Transterrestial Musings
Bear Waller Hollar
Callahans
Pajamas Media BlogRoll Member

If you really want to, you can poke through the below links as well.

ARCHIVES
06/09/2002 - 06/16/2002 / 07/28/2002 - 08/04/2002 / 08/11/2002 - 08/18/2002 / 08/18/2002 - 08/25/2002 / 08/25/2002 - 09/01/2002 / 09/22/2002 - 09/29/2002 / 11/10/2002 - 11/17/2002 / 12/15/2002 - 12/22/2002 / 12/22/2002 - 12/29/2002 / 12/29/2002 - 01/05/2003 / 01/05/2003 - 01/12/2003 / 01/19/2003 - 01/26/2003 / 01/26/2003 - 02/02/2003 / 02/09/2003 - 02/16/2003 / 02/16/2003 - 02/23/2003 / 03/02/2003 - 03/09/2003 / 03/16/2003 - 03/23/2003 / 04/06/2003 - 04/13/2003 / 04/13/2003 - 04/20/2003 / 04/20/2003 - 04/27/2003 / 05/04/2003 - 05/11/2003 / 05/18/2003 - 05/25/2003 / 05/25/2003 - 06/01/2003 / 06/01/2003 - 06/08/2003 / 06/08/2003 - 06/15/2003 / 06/15/2003 - 06/22/2003 / 06/22/2003 - 06/29/2003 / 06/29/2003 - 07/06/2003 / 07/20/2003 - 07/27/2003 / 07/27/2003 - 08/03/2003 / 08/03/2003 - 08/10/2003 / 08/10/2003 - 08/17/2003 / 08/17/2003 - 08/24/2003 / 08/24/2003 - 08/31/2003 / 08/31/2003 - 09/07/2003 / 09/07/2003 - 09/14/2003 / 09/14/2003 - 09/21/2003 / 09/21/2003 - 09/28/2003 / 09/28/2003 - 10/05/2003 / 10/05/2003 - 10/12/2003 / 10/12/2003 - 10/19/2003 / 10/19/2003 - 10/26/2003 / 10/26/2003 - 11/02/2003 / 11/02/2003 - 11/09/2003 / 11/09/2003 - 11/16/2003 / 11/30/2003 - 12/07/2003 / 12/07/2003 - 12/14/2003 / 12/14/2003 - 12/21/2003 / 12/28/2003 - 01/04/2004 / 01/11/2004 - 01/18/2004 / 01/18/2004 - 01/25/2004 / 01/25/2004 - 02/01/2004 / 02/01/2004 - 02/08/2004 / 02/08/2004 - 02/15/2004 / 02/15/2004 - 02/22/2004 / 02/22/2004 - 02/29/2004 / 02/29/2004 - 03/07/2004 / 03/14/2004 - 03/21/2004 / 03/21/2004 - 03/28/2004 / 03/28/2004 - 04/04/2004 / 04/04/2004 - 04/11/2004 / 04/11/2004 - 04/18/2004 / 04/18/2004 - 04/25/2004 / 04/25/2004 - 05/02/2004 / 05/02/2004 - 05/09/2004 / 05/09/2004 - 05/16/2004 / 05/16/2004 - 05/23/2004 / 05/30/2004 - 06/06/2004 / 06/06/2004 - 06/13/2004 / 06/13/2004 - 06/20/2004 / 06/20/2004 - 06/27/2004 / 06/27/2004 - 07/04/2004 / 07/04/2004 - 07/11/2004 / 07/11/2004 - 07/18/2004 / 07/18/2004 - 07/25/2004 / 08/08/2004 - 08/15/2004 / 08/22/2004 - 08/29/2004 / 08/29/2004 - 09/05/2004 / 09/05/2004 - 09/12/2004 / 09/19/2004 - 09/26/2004 / 09/26/2004 - 10/03/2004 / 10/03/2004 - 10/10/2004 / 10/10/2004 - 10/17/2004 / 10/17/2004 - 10/24/2004 / 10/24/2004 - 10/31/2004 / 10/31/2004 - 11/07/2004 / 11/07/2004 - 11/14/2004 / 11/14/2004 - 11/21/2004 / 11/21/2004 - 11/28/2004 / 11/28/2004 - 12/05/2004 / 12/05/2004 - 12/12/2004 / 12/12/2004 - 12/19/2004 / 12/19/2004 - 12/26/2004 / 12/26/2004 - 01/02/2005 / 01/02/2005 - 01/09/2005 / 01/16/2005 - 01/23/2005 / 01/23/2005 - 01/30/2005 / 01/30/2005 - 02/06/2005 / 02/06/2005 - 02/13/2005 / 02/13/2005 - 02/20/2005 / 02/20/2005 - 02/27/2005 / 02/27/2005 - 03/06/2005 / 03/06/2005 - 03/13/2005 / 03/27/2005 - 04/03/2005 / 04/03/2005 - 04/10/2005 / 04/10/2005 - 04/17/2005 / 05/29/2005 - 06/05/2005 / 06/05/2005 - 06/12/2005 / 06/12/2005 - 06/19/2005 / 06/19/2005 - 06/26/2005 / 06/26/2005 - 07/03/2005 / 07/03/2005 - 07/10/2005 / 07/10/2005 - 07/17/2005 / 07/24/2005 - 07/31/2005 / 07/31/2005 - 08/07/2005 / 08/07/2005 - 08/14/2005 / 08/14/2005 - 08/21/2005 / 08/21/2005 - 08/28/2005 / 08/28/2005 - 09/04/2005 / 09/04/2005 - 09/11/2005 / 09/11/2005 - 09/18/2005 / 09/18/2005 - 09/25/2005 / 09/25/2005 - 10/02/2005 / 10/02/2005 - 10/09/2005 / 10/09/2005 - 10/16/2005 / 10/16/2005 - 10/23/2005 / 10/23/2005 - 10/30/2005 / 10/30/2005 - 11/06/2005 / 11/06/2005 - 11/13/2005 / 11/13/2005 - 11/20/2005 / 11/20/2005 - 11/27/2005 / 11/27/2005 - 12/04/2005 / 12/04/2005 - 12/11/2005 / 12/11/2005 - 12/18/2005 / 12/18/2005 - 12/25/2005 / 01/01/2006 - 01/08/2006 / 01/08/2006 - 01/15/2006 / 01/15/2006 - 01/22/2006 / 01/22/2006 - 01/29/2006 / 01/29/2006 - 02/05/2006 / 02/19/2006 - 02/26/2006 / 03/05/2006 - 03/12/2006 / 03/19/2006 - 03/26/2006 / 03/26/2006 - 04/02/2006 / 04/02/2006 - 04/09/2006 / 04/09/2006 - 04/16/2006 / 04/23/2006 - 04/30/2006 / 05/07/2006 - 05/14/2006 / 05/14/2006 - 05/21/2006 / 05/21/2006 - 05/28/2006 / 06/04/2006 - 06/11/2006 / 06/11/2006 - 06/18/2006 / 06/18/2006 - 06/25/2006 / 06/25/2006 - 07/02/2006 / 07/02/2006 - 07/09/2006 / 07/09/2006 - 07/16/2006 / 07/23/2006 - 07/30/2006 / 08/06/2006 - 08/13/2006 / 08/13/2006 - 08/20/2006 / 09/03/2006 - 09/10/2006 / 09/17/2006 - 09/24/2006 / 09/24/2006 - 10/01/2006 / 10/01/2006 - 10/08/2006 / 10/22/2006 - 10/29/2006 / 11/19/2006 - 11/26/2006 / 11/26/2006 - 12/03/2006 / 12/03/2006 - 12/10/2006 / 12/10/2006 - 12/17/2006 / 12/17/2006 - 12/24/2006 / 12/24/2006 - 12/31/2006 / 01/07/2007 - 01/14/2007 / 01/14/2007 - 01/21/2007 / 01/28/2007 - 02/04/2007 / 02/11/2007 - 02/18/2007 / 02/18/2007 - 02/25/2007 / 02/25/2007 - 03/04/2007 / 03/04/2007 - 03/11/2007 / 03/18/2007 - 03/25/2007 / 04/01/2007 - 04/08/2007 / 04/08/2007 - 04/15/2007 / 04/15/2007 - 04/22/2007 / 04/22/2007 - 04/29/2007 / 04/29/2007 - 05/06/2007 / 05/06/2007 - 05/13/2007 / 05/20/2007 - 05/27/2007 / 05/27/2007 - 06/03/2007 / 06/03/2007 - 06/10/2007 / 06/10/2007 - 06/17/2007 / 06/17/2007 - 06/24/2007 / 07/01/2007 - 07/08/2007 / 07/08/2007 - 07/15/2007 / 07/22/2007 - 07/29/2007 / 07/29/2007 - 08/05/2007 / 08/05/2007 - 08/12/2007 / 08/26/2007 - 09/02/2007 / 09/09/2007 - 09/16/2007 / 09/23/2007 - 09/30/2007 / 09/30/2007 - 10/07/2007 / 10/07/2007 - 10/14/2007 / 10/14/2007 - 10/21/2007 / 10/21/2007 - 10/28/2007 / 10/28/2007 - 11/04/2007 / 11/04/2007 - 11/11/2007 / 11/11/2007 - 11/18/2007 / 11/18/2007 - 11/25/2007 / 11/25/2007 - 12/02/2007 / 12/02/2007 - 12/09/2007 / 12/09/2007 - 12/16/2007 / 12/16/2007 - 12/23/2007 / 12/23/2007 - 12/30/2007 / 01/06/2008 - 01/13/2008 / 02/03/2008 - 02/10/2008 / 02/17/2008 - 02/24/2008 / 02/24/2008 - 03/02/2008 / 03/02/2008 - 03/09/2008 / 03/09/2008 - 03/16/2008 / 03/16/2008 - 03/23/2008 / 03/23/2008 - 03/30/2008 / 03/30/2008 - 04/06/2008 / 04/20/2008 - 04/27/2008 / 04/27/2008 - 05/04/2008 / 05/04/2008 - 05/11/2008 / 05/11/2008 - 05/18/2008 / 05/18/2008 - 05/25/2008 / 05/25/2008 - 06/01/2008 / 06/01/2008 - 06/08/2008 / 06/08/2008 - 06/15/2008 / 06/15/2008 - 06/22/2008 / 06/22/2008 - 06/29/2008 / 07/06/2008 - 07/13/2008 / 07/13/2008 - 07/20/2008 / 07/20/2008 - 07/27/2008 / 07/27/2008 - 08/03/2008 / 08/03/2008 - 08/10/2008 / 08/10/2008 - 08/17/2008 / 08/17/2008 - 08/24/2008 / 08/31/2008 - 09/07/2008 / 09/07/2008 - 09/14/2008 / 09/14/2008 - 09/21/2008 / 09/21/2008 - 09/28/2008 / 09/28/2008 - 10/05/2008 / 10/05/2008 - 10/12/2008 / 10/12/2008 - 10/19/2008 / 10/19/2008 - 10/26/2008 / 10/26/2008 - 11/02/2008 / 11/02/2008 - 11/09/2008 / 11/09/2008 - 11/16/2008 / 11/16/2008 - 11/23/2008 / 12/07/2008 - 12/14/2008 / 12/21/2008 - 12/28/2008 / 12/28/2008 - 01/04/2009 / 01/18/2009 - 01/25/2009 / 01/25/2009 - 02/01/2009 / 03/22/2009 - 03/29/2009 / 05/10/2009 - 05/17/2009 / 05/17/2009 - 05/24/2009 / 05/31/2009 - 06/07/2009 / 06/14/2009 - 06/21/2009 / 06/21/2009 - 06/28/2009 / 06/28/2009 - 07/05/2009 / 07/05/2009 - 07/12/2009 / 07/12/2009 - 07/19/2009 / 07/26/2009 - 08/02/2009 / 08/09/2009 - 08/16/2009 / 08/23/2009 - 08/30/2009 / 09/06/2009 - 09/13/2009 / 09/20/2009 - 09/27/2009 / 09/27/2009 - 10/04/2009 / 10/04/2009 - 10/11/2009 / 10/11/2009 - 10/18/2009 / 10/18/2009 - 10/25/2009 / 10/25/2009 - 11/01/2009 / 11/29/2009 - 12/06/2009 / 12/27/2009 - 01/03/2010 / 01/31/2010 - 02/07/2010 / 02/07/2010 - 02/14/2010 / 02/28/2010 - 03/07/2010 / 03/07/2010 - 03/14/2010 / 03/28/2010 - 04/04/2010 / 04/18/2010 - 04/25/2010 / 05/16/2010 - 05/23/2010 / 05/30/2010 - 06/06/2010 / 06/13/2010 - 06/20/2010 / 06/20/2010 - 06/27/2010 / 07/04/2010 - 07/11/2010 / 07/11/2010 - 07/18/2010 / 07/18/2010 - 07/25/2010 / 08/08/2010 - 08/15/2010 / 08/29/2010 - 09/05/2010 / 09/05/2010 - 09/12/2010 / 09/19/2010 - 09/26/2010 / 09/26/2010 - 10/03/2010 / 10/10/2010 - 10/17/2010 / 10/17/2010 - 10/24/2010 / 10/31/2010 - 11/07/2010 / 11/28/2010 - 12/05/2010 / 12/05/2010 - 12/12/2010 / 12/12/2010 - 12/19/2010 / 12/26/2010 - 01/02/2011 / 03/06/2011 - 03/13/2011 / 03/13/2011 - 03/20/2011 / 05/22/2011 - 05/29/2011 / 08/07/2011 - 08/14/2011 / 08/14/2011 - 08/21/2011 / 09/18/2011 - 09/25/2011 / 10/02/2011 - 10/09/2011 / 10/09/2011 - 10/16/2011 / 11/06/2011 - 11/13/2011 / 01/15/2012 - 01/22/2012 / 04/22/2012 - 04/29/2012 / 06/24/2012 - 07/01/2012 / 08/05/2012 - 08/12/2012 / 08/11/2013 - 08/18/2013 / 03/01/2015 - 03/08/2015 / 10/04/2015 - 10/11/2015 / 11/08/2015 - 11/15/2015 / 12/22/2019 - 12/29/2019 / 04/05/2020 - 04/12/2020 /


Powered by Blogger