Implement the "vocoder extension" to use Codec 2 with D-STAR#118
Open
chazapis wants to merge 2 commits into
Open
Implement the "vocoder extension" to use Codec 2 with D-STAR#118chazapis wants to merge 2 commits into
chazapis wants to merge 2 commits into
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? |
Collaborator
As far as I know, not yet. At least not the commercial devices. |
Author
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/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: