#1 2020-12-06 12:01:27

user11
Member
Registered: 2015-09-18
Posts: 23

Codec2 digital voice communication

What do you think about using Codec2 in 450bps mode over the AFSK1200 or some other modulation?

Here is the codec2 page: http://www.rowetel.com/?page_id=452

I've build small proof of concept application for Android, which enables such communication: https://github.com/sh123/codec2_talkie

Instead of sending AX25 frames over KISS it just encodes speech into codec2 and sends them over KISS to the modem and back.

Haven't tested it much, so could have some bugs.

Last edited by user11 (2020-12-06 12:05:19)

Offline

#2 2020-12-06 13:53:59

DB1NTO
Member
Registered: 2014-12-01
Posts: 65

Re: Codec2 digital voice communication

Wow! Very interesting... Thanks for your work & sharing with us!
Can you please add USB/serial communication instead of Bluetooth only?
It should be possible to use PicoAPRS for that! PicAPRS can used as an USB TCN on Android right now (with APRSDroid).
Your App can make PicoAPRS digital voice capable!
Hope to read more about your App in future.

73
Taner
DB1NTO

Offline

#3 2020-12-07 13:05:27

user11
Member
Registered: 2015-09-18
Posts: 23

Re: Codec2 digital voice communication

DB1NTO wrote:

It should be possible to use PicoAPRS for that! PicAPRS can used as an USB TCN on Android right now (with APRSDroid).
Your App can make PicoAPRS digital voice capable!
Hope to read more about your App in future.

Thank you, yes, USB support will be useful for devices, which do not have Bluetooth on board, so USB could be used for both power and data.

Offline

#4 2020-12-07 18:44:26

DB1NTO
Member
Registered: 2014-12-01
Posts: 65

Re: Codec2 digital voice communication

Hi..
yes of course, it is usefull... but can you please add USB support to your app?

Offline

#5 2020-12-07 22:37:40

DB1NTO
Member
Registered: 2014-12-01
Posts: 65

Re: Codec2 digital voice communication

Tested with TH-D74E
Connection via Bluetooth works. TH-D74 is set to KISS TNC but do not TX when i press the talk button (it shows red color and TX in the upper right corner) in the App... loopback disabled.
But receiving and decoding with TH-D74 works! Very impressed about this App!
Thanks a lot for sharing with us.
When USB with PicoAPRS works, people can use PicoAPRS for digital Voice communication :-)
I think a lot of people will love your app...

Offline

#6 2020-12-08 12:32:27

user11
Member
Registered: 2015-09-18
Posts: 23

Re: Codec2 digital voice communication

DB1NTO wrote:

When USB with PicoAPRS works, people can use PicoAPRS for digital Voice communication :-)
I think a lot of people will love your app...

I've made 0.2 release with USB support (115200, 8 bit, 1 stop bit and parity - none), unfortunately, do not have hardware to make proper testing between two devices. If you will pick app from android prompt when connected then app will use USB connectivity.

About TH-D74, need to check specs, maybe requires some KISS initialization / CSMA magic or uses different KISS port index, currently app does not configure CSMA parameters for real time speech

Last edited by user11 (2020-12-08 14:08:40)

Offline

#7 2020-12-08 18:55:23

DB1NTO
Member
Registered: 2014-12-01
Posts: 65

Re: Codec2 digital voice communication

Hi
I can find only the source code of release 0.2.
No compiled APK in GitHub.
Maybe you have forget to publish?

Offline

#8 2020-12-08 19:14:20

user11
Member
Registered: 2015-09-18
Posts: 23

Re: Codec2 digital voice communication

Check, reuploaded.

Offline

#9 2020-12-08 19:30:14

DB1NTO
Member
Registered: 2014-12-01
Posts: 65

Re: Codec2 digital voice communication

it works!  you are fabulous!  the transmission quality is not yet very high but it works!  I will communicate it through my Twitter account.  you should have some fans soon :-)

Offline

#10 2020-12-08 19:51:46

user11
Member
Registered: 2015-09-18
Posts: 23

Re: Codec2 digital voice communication

Oh, cool, thank you, it uses 450 bps codec by default, you can compare speech quality in loopback mode, if it does not differ then there is no much to do except selecting codec2 mode with higher bitrate.

Last edited by user11 (2020-12-08 19:51:59)

Offline

#11 2020-12-08 20:01:20

DB1NTO
Member
Registered: 2014-12-01
Posts: 65

Re: Codec2 digital voice communication

Voice quality problem found. It was my second TNC, not your app!
It works as expected and very acceptable audio quality!
Good work guy!
Left only TX problem with TH-D74
Receiving works.

Last edited by DB1NTO (2020-12-08 20:02:13)

Offline

#12 2020-12-09 00:26:25

DB1NTO
Member
Registered: 2014-12-01
Posts: 65

Re: Codec2 digital voice communication

Maybe i found some more bug with USB Serial connection. The connection itself seems to be working. Also Voice TX via USB/Serial is possible.
But received packets are completely ignored (status "RX/TX/IDLE" does not change).


transmitting with TH-D74 works! V 0.3 (alpha), thanks!

Offline

#13 2020-12-09 08:46:19

user11
Member
Registered: 2015-09-18
Posts: 23

Re: Codec2 digital voice communication

DB1NTO wrote:

Maybe i found some more bug with USB Serial connection. The connection itself seems to be working. Also Voice TX via USB/Serial is possible.
But received packets are completely ignored (status "RX/TX/IDLE" does not change).

transmitting with TH-D74 works! V 0.3 (alpha), thanks!

Made release 0.4 with RX bug fix, please try.

Glad to hear that TH-D74 works, it needs CSMA to be disabled to properly operate with real time speech, this is done now with P KISS command code from the application by default.

Last edited by user11 (2020-12-09 10:56:05)

Offline

#14 2020-12-09 21:01:25

DB1NTO
Member
Registered: 2014-12-01
Posts: 65

Re: Codec2 digital voice communication

Hi... Tried two different smartphones (Huawei P20 and Samsung S10 5G) and two different USB/Serial TNC with CP2102 Chip.
On both units TX works fine, but receiving is only possible via Buetooth.

In Serial mode there is no reaction on the app.
I have installed the latest 0.5 alpha

Offline

#15 2020-12-09 22:10:30

DB1NTO
Member
Registered: 2014-12-01
Posts: 65

Re: Codec2 digital voice communication

Transmission via Bluetooth over the TH-D74E works, but the transmission is interrupted every second for a short period (TX LED on Kenwood off).
Transmitting with my other Bluetooth equipment works without breaks. These may a problem on TH-D74 or on the initialisation from the app?

Offline

#16 2020-12-09 22:47:22

user11
Member
Registered: 2015-09-18
Posts: 23

Re: Codec2 digital voice communication

Hi, published version 0.6, RX over USB works now with specially built test modem. With Kenwood it might be some additional CSMA logic.

Offline

#17 2020-12-09 22:49:47

DB1NTO
Member
Registered: 2014-12-01
Posts: 65

Re: Codec2 digital voice communication

maybe you should contact me directly via mail or Whatsapp etc... ;-)
thanks again for releasing 0.6 alpha.
Now TX and RX in both directions work via Bluetooth and also USB-Serial

I have some problems with transmitting or receiving voice without distortions. Sometimes the voice is very clear, sometimes distorted.
Also sometimes when i change the TX rate, voice is completely distorded even on local loopback test. Changing the TX rate forth and back helps mostly but transmitting over the air is dificult for now.

Offline

#18 2020-12-09 23:15:32

user11
Member
Registered: 2015-09-18
Posts: 23

Re: Codec2 digital voice communication

Not sure, needs more testing. Distortions might occur if codec data rate is higher than channel speed, it does not buffer/store audio frames before playback, so only 450/700C bps should be suitable for AFSK1200 and they might sound quite robotic for the ear especially when comparing to analog FM or DMR, where AMBE codec is running at 3600 bps. I also noticed that distortions happen when audio level is too high (too close to the mic), for that purpose added audio level indicators.

Last edited by user11 (2020-12-09 23:27:01)

Offline

#19 2020-12-09 23:50:38

DB1NTO
Member
Registered: 2014-12-01
Posts: 65

Re: Codec2 digital voice communication

I think the problem is that there are small gaps between the packets.
If the packet is tramsmitted before the next packet comes, PTT will be released. But if we switch again to TX, we have some TX delay.
This may be too long for continuous voice packets.

If i set to 1200bps, you are right... it works very bad or not.
I think we need a solution to prevent the transmitter from break the transmission in parts.

one more bug found. If you change the rotation of your smartphone, the connection to the TNC will disconnected immediately. No difference between USB/Serial and Bluetooth.

The most other functions seems now to work!

Offline

#20 2020-12-10 07:31:23

user11
Member
Registered: 2015-09-18
Posts: 23

Re: Codec2 digital voice communication

DB1NTO wrote:

I think the problem is that there are small gaps between the packets.
If the packet is tramsmitted before the next packet comes, PTT will be released. But if we switch again to TX, we have some TX delay.
This may be too long for continuous voice packets.

If i set to 1200bps, you are right... it works very bad or not.
I think we need a solution to prevent the transmitter from break the transmission in parts.

one more bug found. If you change the rotation of your smartphone, the connection to the TNC will disconnected immediately. No difference between USB/Serial and Bluetooth.

The most other functions seems now to work!

There is TXtail parameter, which is the amount of time to keep transmitter keyed after the packet is sent out. Probably, this parameter needs to be increased for speech frames. There is a KISS 0x04 command, with the latest release sending it on TNC initialization together with CSMA configuration parameters.

Fixed screen rotation issue in the last release, also made small optimizations for USB transfer, tested with loopback USB/Bluetooth modem and it is running smoothly.

Last edited by user11 (2020-12-10 12:13:26)

Offline

#21 2020-12-10 22:06:07

DB1NTO
Member
Registered: 2014-12-01
Posts: 65

Re: Codec2 digital voice communication

Hi,

v 0.8 has fixed the rotation disconnect bug.
But audio transmission is still interrupted in most cases (but not in all constellations).

Tested:
1. TX via TH-D74 over Bluetooth -> RX via PicoAPRS via USB/Serial: Still gaps in transmisson, TX LED from TH-D74 blinks (TX off) sometimes. (mode 450 and 700)
2. reverse direction: very little gaps (also TX off)! working acceptable in mode 700. If i change to mode 450 the gaps are much longer (smaller packets?)
3: TX and RX via Bluetooth (RX is a MicroModem on prototype Board): Gaps but maybe the reason is my breadboard setup.

Found two strange problems.
My TH-D74 crashes some time so i have to reboot the Kenwood! Have forgotten if the problem was on RX or TX.
And even when i do not change the bitrate, the voice will be complete scrambled. Transmitted via radio as well as in local loopback!
Only changing the bitrate to some value and back fixes this problem for some time but it will occur again after some time (not that much time!)

At this time i only have one direction and mode with acceptable audio transmission. But i like the possibilities from your app! Really great.
Hope to see more improvements :-)

Offline

#22 2020-12-11 17:50:00

user11
Member
Registered: 2015-09-18
Posts: 23

Re: Codec2 digital voice communication

I haven't tested yet on AFSK1200 modems, only with LoRa modems, works quite good when modems are close by and no packet loss. To get speech without gaps they need at least 170% of data rate for given Codec2 bit rate, 450/700 worked fine on 1300 bps (can decode down to -129 dbm), higher rate Codec2 modes required higher LoRa data rates. Usually, frequent RX-IDLE switching is an indicator. For AFSK modems there might be need to increase TxTail if modem does not handle KISS 0x04 command code. If I remember correctly, AFSK modems can do 2400 baud, maybe worth trying...

Last edited by user11 (2020-12-11 17:55:20)

Offline

#23 2020-12-11 22:36:56

DB1NTO
Member
Registered: 2014-12-01
Posts: 65

Re: Codec2 digital voice communication

You are right...
After some testing, i can confirm that the TX-delay and also the TX-tail has effect to the voice gaps.
I defined a very low TX-delay and also a low TX-tail for more frequency economy and also a lowest possible band usage.
But the voice packets are so small, that the transceiver is keyed and released very often.
I see no solution for that because some TNC may not have the possibility to define this value and if they have the possibility, it may very hard to match exactly the packet transmission time.

Maybe you can pack more audio frames in one AX.25 packet to minimize overhead? As i know, you can pack a payload of 256 bytes in one frame.
And in release 0.10 i have trouble to get Bluetooth connected. It need some retry to success. After successfully connect, the connection works as expected.

73

Offline

#24 2020-12-12 11:09:41

user11
Member
Registered: 2015-09-18
Posts: 23

Re: Codec2 digital voice communication

Made new 0.11 release with more stable Bluetooth re-connects.

With larger packet size there might be longer gaps in speech on packet loss with some modems, which drop packets when CRC check fails, but probably CRC check failures could be ignored, because if some bits are broken it will cause small audio scramble, which could be unnoticeable for the ear.

Currently, app sends KISS 0x04 command on startup with longer TxTail if modem handles 0x04 then there is no need for static modem re-configuration. Maybe packet size could be made configurable in the app to give some room for experiments or just increased based on the codec2 bit rate.

Last edited by user11 (2020-12-12 15:49:55)

Offline

#25 2020-12-14 17:25:44

user11
Member
Registered: 2015-09-18
Posts: 23

Re: Codec2 digital voice communication

Made some testing with two LibAPRS based AFSK1200 modems.

I think LibAPRS does not use KISS tail and preamble which are coming with KISS commands, it handles only scma slot and persistence kiss commands.

When set these parameters using APRS_setPreamble and APRS_setTail stations do not switch to RX between packets anymore, default value of 35 ms for tail is rather small for continuous stream of speech packets with gaps.

With 450 bps codec2 is kinda ok, 700 still has some gaps, probalby gonna work with some optimizations in LibAPRS, higher modes are out of the scope for AFSK1200, need higher bit rate.

Last edited by user11 (2020-12-14 17:55:54)

Offline

Board footer

Powered by FluxBB