-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the "vocoder extension" to use Codec 2 with D-STAR #118
base: master
Are you sure you want to change the base?
Conversation
Implementation of the "vocoder extension" by SV9OAN, as described in https://github.com/chazapis/pydv, which allows the use of the open source Codec 2 with D-STAR. With the changes here, xlxd/ambed can be used to transcode and bridge the two formats. The solution implemented uses an additional DExtra listener on a different port (30201 instead of 30001). The new port is to be used by reflectors using the "ORF" prefix (Open ReFlector). Any client connected to an ORF reflector will receive streams encoded with Codec 2. All other D-STAR protocol handlers will still send out data encoded with AMBE. Note that the protocol/port only affects data transmitted by the reflector. The stream vocoder is recognized by all protocol handlers, so a client can still transmit data using any vocoder on any port. The rationale behind this is that DExtra links may be used by repeaters or other reflectors, so it is not really possible to know what their clients support. So, nothing will change when linking a repeater to an XRF reflector, but will do when linking to an ORF one. Summary of code changes in xlxd: * Added protocol "DExtra Open", listening on port 30201. The protocol handler is subclassed from DExtra. Minor changes were required to make the DExtra implementation more "abstract" to allow that. * Codec used no longer a protocol client property. All D-STAR protocol handlers use the header to determine the protocol. DMR protocol handlers just specify the appropriate codec when opening a stream. * DV frames now also include Codec 2 data. * Interface with ambed changed to 1 codec in, 2 codecs out. * Interface with other xlx peers changed to accommodate the enlarged DV frames, so compatible peers will exchange fully transcoded streams. * Major version changed to 3, to recognize peer compatibility. Summary of code changes to ambed: * Added (virtual) interface class for Codec 2. * Vocodec channels now have 3 interfaces (1 in, 2 out) and are grouped together in triplets. Each group contains all possible permutations of respective interfaces - 3 channels. Only one channel from each group can be used at a given time. * When an incoming packet is decoded in the interface loop, it is duplicated and sent to two separate voice queues (one for each outgoing codec). * Interface changed to 1 codec in, 2 codecs out. * Major version changed to 2, as the interface is incompatible with previous versions.
The "vocoder extension" by SV9OAN, for using the open source Codec 2 with D-STAR has been extended to include a mode for FEC (https://github.com/chazapis/pydv). With Codec 2 mode 2400, each encoded voice fragment fits into just 6 bytes. The 3 remaining bytes are used to protect the first 24 bits of the voice data with two applications of the (23, 12) Golay code. Code changes include defining a new codec in both xlxd and ambed. In ambed, every Codec 2 interface has now one channel for each Codec 2 mode. Also, channel groups have an additional channel, as Codec 2 mode 2400 is used only as input.
Is there any end-user hardware that supports codec2? |
As far as I know, not yet. At least not the commercial devices. |
No "end-user" radios (yet). However, since Codec 2 is open source software, you can run it on a Raspberry Pi or even a mobile phone - any hardware really. What this patch then does, is enable using xlxd as a transcoder, from Codec 2 software-only solutions (or mobile applications) to "typical" end-user radios using the AMBE codec and vice versa. Read all about it here: https://tapr.org/38th-arrl-and-tapr-digital-communications-conference/2019-2-sv9oan/ |
Implementation of the "vocoder extension" by SV9OAN, as described in pydv, which allows the use of the open source Codec 2 with D-STAR. With the changes here, xlxd/ambed can be used to transcode and bridge the two formats.
The solution implemented uses an additional DExtra listener on a different port (30201 instead of 30001). The new port is to be used by reflectors using the "ORF" prefix (Open ReFlector). Any client connected to an ORF reflector will receive streams encoded with Codec 2. All other D-STAR protocol handlers will still send out data encoded with AMBE. Note that the protocol/port only affects data transmitted by the reflector. The stream vocoder is recognized by all protocol handlers, so a client can still transmit data using any vocoder on any port. The rationale behind this is that DExtra links may be used by repeaters or other reflectors, so it is not really possible to know what their clients support. So, nothing will change when linking a repeater to an XRF reflector, but will do when linking to an ORF one.
Summary of code changes in xlxd:
Summary of code changes to ambed: