The codec server: digital voice for SDR-SLC

FM, AM, SSB and CW work in the SDR-SLC client straight away. For DMR, YSF (System Fusion) and D-STAR you need one more small piece of software on your network: the codec server. This page explains what it does, why it is a separate program, and how to get it running.

What it does

The digital voice modes don’t send your voice as audio. They send it as compact voice frames: about 50 tiny packets per second, produced by a voice codec from the AMBE family. DMR and YSF use AMBE+2, D-STAR uses the original AMBE.

Turning those frames back into speech, and your microphone audio into frames, is the codec’s job. Everything else is done by the client:

  • demodulating the signal;
  • finding the voice frames, slot timing and error correction;
  • callsigns, talkgroups, DG-IDs and repeater handling.

The codec server does only the conversion in the middle:

receive:   radio → client (demodulate, extract frames) → codec server → client → speaker
transmit:  microphone → client → codec server → client (build bursts, modulate) → radio

Each 20 ms frame makes a round trip over your local network, a matter of a millisecond or two, so you won’t hear the difference.

Why isn’t it built into the client?

That would be simpler, and it was considered. There are three reasons it lives in its own program.

1. The AMBE codec isn’t free. AMBE and AMBE+2 belong to Digital Voice Systems, Inc. (DVSI), which sells them as chips and as licensed software. The open-source software decoders are clever reconstructions, but the AMBE algorithms may be covered by patents in some countries. The SDR-SLC client is a paid app sold worldwide through the App Store, so building an unlicensed AMBE implementation into it isn’t an option. A separate, free, open-source program that you choose to run is a different matter. You can check the situation in your country before you use it, or skip the question entirely by using a licensed DVSI chip.

2. The open-source decoder is GPL. The software vocoder, mbelib-neo, is published under the GNU GPL. That licence lets anyone use it, on the condition that any program built with it is also published as open source. The client isn’t open source, so the two stay separate programs that talk over the network. The codec server is GPL itself, and its source is public.

3. The best codec is a chip, and the chip lives on USB. The cleanest audio comes from DVSI’s own AMBE-3000 chip, found in the DVMEGA DVstick30, the ThumbDV and similar USB sticks. App Store apps on the Mac run in a sandbox, and the SDR-SLC client deliberately doesn’t access USB devices. The codec server runs on Linux, where a USB stick is simply a serial port.

And it turns out to be the better design anyway

  • One stick serves everything. A single DVstick on the Pi in the shack serves every client in the house. The server handles up to 16 conversions at once, and gives the chip to whichever stream is actually carrying voice.
  • It sits next to the radio. Put it on the same Raspberry Pi as your SDR. There’s nothing to install on the Mac, and nothing to plug into it.
  • It improves without an app update. A better decoder or a new mode is a server update.
  • It’s open to everyone. The codec server speaks the same open SDR-SLC protocol as the radios. Anyone writing their own SDR client can use it, and anyone can write a codec server for different hardware.

Chip or software?

The codec server, sdr-slc-vocoderd, works with or without a chip:

With an AMBE-3000 stickWithout a stick
DecoderDVSI’s own chipmbelib-neo (open source)
Audio qualitythe referenceclose to the chip
Licencethe chip is licensed by DVSIcheck the patent situation in your country
Extra costa USB sticknothing

With a stick, the chip does the work, and software takes over any stream the chip isn’t serving at that moment, frame by frame, without gaps. Plug a stick in or pull it out while it’s running, and the server simply switches.

Do I need it?

  • For FM, AM, SSB and CW: no.
  • To listen to DMR, YSF or D-STAR: yes, with any receiver setup.
  • To transmit DMR, YSF or D-STAR: yes, with the bladeRF setup.

It runs on Linux: on the same Raspberry Pi as your radio, or on any other Debian, Ubuntu or Raspberry Pi OS machine on your network. It needs no Internet connection.

Install it

The installation is the same everywhere, takes about ten minutes, and is included in each setup guide:

Once it’s running, it appears in the client under Discover, next to your radio, as SLC-VOCODER-<hostname>. Add it, and DMR, YSF and D-STAR work.

Source code, options and the technical details: github.com/pa2ix/sdr-slc-vocoderd.

Credits

The codec server stands on the shoulders of others: mbelib-neo by arancormonk, descended from the original mbelib, and f4exb’s serialDV, which served as the reference for talking to the AMBE-3000.

73, Ivo PA2IX