Ambe Codec Software

broken image


Software AMBE is extremely handy for folks running cloud based conference bridges like DV Switch, or XLX Reflectors that allow hams to cross communicate between digital modes, promoting interoperability and cutting down on digital fragmentation. The owners of the AMBE patent do not offer it as software. They only offer it as hardware. This is one of the reasons I don't do DMR or, really, any other digital mode. I believe ham radio should be based on open standards. This is an AMBE hardware codec. With this you can communicate on the DMR, D-Star, and Fusion digital amateur radio networks, all straight from your computer. This can be done using free software such as BlueDV or DudeStar. It can also be paired with a raspberry pi to work as an AMBE server. ( details to follow soon ).

DMR (short for Digital Mobile Radio) is a digital mode that is used on the amateur radio bands. Its main advantage over regular, analog radio is that the quality degrades better than analog radio: when moving further away from an analog radio, the quality decreases. With digital radio, the quality more or less stays the same up until the cut-off point. Another advantage is that it has two timeslots, so two users can use the same frequency without interfering with each other.

DMR is also an open standard, so in theory multiple manufacturers should be able to build DMR radios. This happens, but the vocoder (voice encoder/decoder) is not open: it uses AMBE as its codec, which is proprietary and patented. This is less than ideal in my opinion: I think it goes against the radio amateur spirit to use a closed, proprietary codec. Other codecs should be used, such as the open-source Codec 2. The main issue holding back innovation is compatibility with existing radios: if you had a hand-held that only talks Codec 2, it would not be able to communicate with all other radios still using AMBE as vocoder.

In amateur radio, there's a concept of repeaters: they are often stationed on top of a high vantage point, and relay the messages radio amateurs send to them. Hams use repeaters to extend their coverage. DMR also has a concept of repeaters: they take messages for one talk group and send them over the internet to other repeaters that are listening to this talk group. These repeaters then retransmit the message, enabling even radio amateurs that are on different continents to communicate.

One of these repeater networks, and by far the largest, is the BrandMeister network. It has repeaters all over the globe that are each linked to their country's master server. These master servers are in turn also linked to each other. It's possible to add your own hotspot (a mini-repeater with very low transmitting power) to the network. By doing this, one could have DMR coverage in their house, even if they aren't able to reach other repeaters.

The issue me and some friends have been dealing with is that without a radio, it's almost impossible to listen to DMR calls: hose.brandmeister.network is a web interface for doing exactly that, but it's often very laggy and frequently just doesn't work. In the past we solved this by having one person hold their radio near their computer's microphone and re-broadcast the audio to our Mumble server (Mumble is a free, open source, low latency, high quality voice chat application). This is less than ideal, because this person would appear much louder, and because the already pretty low audio quality would get even worse. This led me to the idea of hooking up the BrandMeister network to Mumble directly: that way, there is almost no latency and the quality is optimal.

BrandMeister has two ways to do this: they have a Simple External Application API, and an Open DMR Terminal protocol. Both are built on top of their self-written Rewind-protocol, on top of UDP. The Simple External Application API is, as I later found out, meant for bridges to different services, so this would be the appropriate protocol to use. Cost of capture one. It however requires a separate set of credentials you need to ask for, and the master server of your country needs to be configured to allow this. The Open DMR Terminal protocol is meant for hotspots, and only requires a password you can get from the BrandMeister self-care settings panel. The two protocols are very similar, so adapting the current bridge to use SEA in the future should be easy.

The entire pipeline:

Ambe Codec Software

./dmr-brandmeister | python2 decode72to49.py | python3 to_ambe_format_file.py | qemu-arm md380tools/emulator/md380-emu -d | sox --buffer 256 -r 8000 -e signed-integer -L -b 16 -c 1 -t raw /dev/stdin -t raw -r 48000 /tmp/dmr.fifo

The software I adapted to get the AMBE-encoded audio is BrandMeister's callrec. This piece of Go software connects to the BrandMeister network and gets all AMBE packets destined for a configured talk group. Each audio packet received from this tool consists of three forward error corrected AMBE frames. Each frame is 9 bytes (72 bits) long, but I saw most AMBE decoders take 49-bit packets. This puzzled me for a while, but I eventually figured out the 72 bit packets are still wrapped in Forward Error Correction. The BrandMeister wiki calls this 'mode 33', but I didn't really find any information about this anywhere online.

I then removed the FEC with some code adapted from dmr_utils. This turns the packets from 72 bits long into 49 bits long packets. The next step in the chain would be an AMBE decoder. This could be a dongle with an AMBE vocoder chip on it, or it can be software; when choosing the latter, please verify that this is legal where you live since the AMBE codec is patented. In Belgium, patent law doesn't apply for non-commercial actions in a private setting, but I am not a lawyer, and certainly not yours, so verify this before decoding AMBE in software.

The software decoder I used is based on the MD380 firmware: Travis Goodspeed extracted the firmware of this radio and then packed the software AMBE decoder into an ARM ELF (ELF is the Linux binary format, like you have EXE on Windows). This binary can then be executed with qemu-arm, a userland emulator for ARM binaries, or natively executed on single board computers like the Raspberry Pi. Before sending the packets to this tool, they were first formatted into the .amb file format (the same format that DSD, Digital Speech Decoder, also uses).

This results in a stream of 8000 bits per second of raw, PCM audio. This audio then gets upsampled to 48000 bits per second and sent to a FIFO (a special sort of file that is used to exchange data between processes). We upsample the audio for two reasons: by default, Mumble uses this bitrate and because effects applied on this audio stream will sound better. A small Ruby application then sends this to the Mumble server (with the help of the mumble-ruby library).

That concludes the whole setup of bridging DMR to Mumble. The repositories are here for the SEA protocol and here for the Open DMR terminal protocol. I recommend using the SEA protocol repo if at all possible (it has better documentation and setup instructions).

If you have any questions, remarks or find this article useful, please send me an email.

Ambe Codec Software Download

73, ON3WPI

First some history:
Depending on your point of view, Jon Lech Johansen is either your hero or adversary. To the copyright industry, Jon Lech Johansen has been a detriment to their policy of control since the advent of DeCSS (Decrypt Content Scrambling System.)
At the age of 15, 'DVD Jon' wrote a computer program that allowed users to copy DVDs. Then he posted it on the Internet. A Norwegian private school awarded him a prize for making an outstanding contribution to society. The Norwegian government indicted him.
Jon spent 3 long years in the Norwegian courts proving his innocence. The American movie industry pressured the Norwegian Economic Crime Unit to press charges against Jon Lech Johansen in 2000 for allegedly bypassing the CSS copy protection on DVDs.

Early on; Bruce Perens, K6BP, amateur radio and open source advocate voiced concerns about D-Star's use of a proprietary vocoder. Asking; does it really fit into the spirit of the hobby? Bruce makes a strong argument that an Open Source vocoder needs to be developed.
In May 2008, he announced that he will investigate the development of an alternative codec. The Codec2 Project: Next-Generation Audio Codecs and Vocoders for Two-Way Radio.
Ambe codec software download
In August 2009 David Rowe, VK5DGR, began designing and implementing a replacement codec under the GPL.
'Proprietary codecs typically have small, novel parts of the algorithm protected by patents. However proprietary codecs also rely heavily on large bodies of public domain work. The patents cover perhaps 5% of the codec algorithms. Proprietary codec designers did not invent most of the algorithms they use in their codec. Typically, the patents just cover enough to make designing an interoperable codec very difficult. These also tend to be the parts that make their codecs sound good.'

Two open source compatible codec's that come to mind:
Thomson Multimedia and Fraunhofer Society originally controlled the patents and licensing of the MP3 audio codec. Tip-toeing around the patented parts of the algorithms the LAME encoder was developed as free software application used to encode audio into the MP3 file format.
You might be surprised to find out that formats like Mp3 are actually someone's intellectual property, because the vast majority of Mp3 players and encoders don't pay royalties and are based on easily available implementations that have been out for years.
The DivX codec (used to compress lengthy video segments into small sizes while maintaining relatively high visual quality.) was actually an attempt by the now defunct U.S. retailer Circuit City to develop a video rental system requiring special discs and players.
The Xvid codec became a primary free and open source competitor offering comparable quality. It too was developed by tip-toeing around the patented parts of the DivX algorithms.
Ambe Codec Software
In August 2009 David Rowe, VK5DGR, began designing and implementing a replacement codec under the GPL.
'Proprietary codecs typically have small, novel parts of the algorithm protected by patents. However proprietary codecs also rely heavily on large bodies of public domain work. The patents cover perhaps 5% of the codec algorithms. Proprietary codec designers did not invent most of the algorithms they use in their codec. Typically, the patents just cover enough to make designing an interoperable codec very difficult. These also tend to be the parts that make their codecs sound good.'

Two open source compatible codec's that come to mind:
Thomson Multimedia and Fraunhofer Society originally controlled the patents and licensing of the MP3 audio codec. Tip-toeing around the patented parts of the algorithms the LAME encoder was developed as free software application used to encode audio into the MP3 file format.
You might be surprised to find out that formats like Mp3 are actually someone's intellectual property, because the vast majority of Mp3 players and encoders don't pay royalties and are based on easily available implementations that have been out for years.
The DivX codec (used to compress lengthy video segments into small sizes while maintaining relatively high visual quality.) was actually an attempt by the now defunct U.S. retailer Circuit City to develop a video rental system requiring special discs and players.
The Xvid codec became a primary free and open source competitor offering comparable quality. It too was developed by tip-toeing around the patented parts of the DivX algorithms.
Many codecs, containers, file formats and other systems have been hacked to pieces and continue to be despite being the property of one party.
GIF images (up till 2006 when the patents expired) used a patented LZW compression scheme.
PDF is owned by Adobe but has been implemented by numerous others. there are many open-source and non-approved PDF viewers, editors and creators.
Unauthorized FLV players and converters exist as well. The same can be seen with real audio, real video, various Quicktime codecs, Dolby Digital AC3, AAC, and many others.
Think about it... Do you like your freedoms? Thank those who have taken the time reverse engineered something. Welcome those types with open hands to the hobby. Those types of experimenters are just what this hobby once was and still can be.

Ambe Codec Software Mac


{Update May 2010}
Interestingly enough the Digital Speech Decoder and xMBE codec library - can decode and recover the audio from P25 (Phase 1) IMBE, D-Star (AMBE), as well as Mototrbo/DMR (AMBE+2). The open source software was unveiled by anonymous authors in May 2010. It seemsto have possibly stemmed from the May 2008 OP25 project, that provides asoftware IMBE voice encoder/decoder. APCO Project 25 traces back to theearly 1990's required publication of the IMBE and AMBE codec algorithms, whichof course is how both projects came about.
It is important to note that so far there have been no take-down or patent violations filed from DVSI for these hobbyist adventures. It should also be noted that the important patent claims may expire in 2015. Basically all patents covering the AMBE-1000 chip have either expired or are not enforceable, due to disclosures made by DVSI. See Bruce Peren's AMBE Exposed document for further information.
It should also be mentioned that for most U.N. member states; non-commercial/research usage of patented technology is covered by exceptions on the definition of 'patent infringement.' Ref

Also worth reading: The Right To Reverse Engineer




broken image