Topics

Troubleshooting ThumbDV HW AMBE chip with Analog_Bridge

David Ranch
 


Hello Everyone,

I have a working DMR TG to Analog DVSwitch setup working here using the included "Project 25 IMBE Encoder/Decoder Fixed-Point implementation" SW emulation on an Rpi3B+.  It was recommended to go with a hardware AMBE solution for the best audio quality so I bought a NWDigital ThumbDV.  It seems things the new hardware is functioning:

   - ThumbDV seen as /dev/ttyUSB0
   - ThumbDV LEDs light up when people are talking on the DMR talk group
   - No errors in dmesg
   - No errors shown from the Analog_Bridge output from STDOUT
   - Load on the Rpi is around 0.35


Yet the resulting analog audio is segmented up.  When I say segmented up, I mean the audio is coming through but I'm hearing gaps in the analog audio every 300ms or so (a guess) and it seems to be substantially slowed down compared to the audio I hear on a DMR HT.  What's especially interesting that at the end of a long transmission, the Rpi can be 15-20 seconds delayed  though the pitch of the voice is still correct!  That's some SERIOUS buffering that is not experienced when using the SW vocoder.
 

I did some various research on the web and found the AMBEtest4.py script at:

   https://raw.githubusercontent.com/DVSwitch/Analog_Bridge/master/scripts/AMBEtest4.py

but it seems this is a Python2 script but my Rpi only has Python3.  I did install all the required Python modules and did port the various print statements to by Python3 compatible but I started getting into some difficult errors that I couldn't get past.  Does anyone have a version of this that's Python3 compatible?

Any other  thoughts on why this might be happening?  If I switch back to the SW IMBE vocoder, the analog audio is smooth with a average load of 0.90.

--David
KI6ZHD


cat /etc/lsb-release
LSB_VERSION=1.4
DISTRIB_ID=Arch
DISTRIB_RELEASE=rolling
DISTRIB_DESCRIPTION="Arch Linux"


Linux ww6bay-asl 4.14.97-1-ARCH #1 SMP Tue Feb 5 20:10:34 UTC 2019 armv7l GNU/Linux


Analog_Bridge.ini
----------------------------------------------------------------------------------------------------------------------------------
; Analog_Bridge configuration file.                                                       
;   This file should be placed in either /etc or it can be                                
;   supplied as a path on the Analog_Bridge command line.                                 

; General Section describes settings for Analog_Bridge itself.
;   For RPI, don't forget to modprobe snd_pcm_oss to get the devices populated
[GENERAL]                                                                    
logLevel = 2                            ; Show messages and above 0=No logging, 1=Debug, 2=Message, 3=Info, 4=Warning, 5=Error, 6=Fatal

; Metadata management
exportMetadata = true                   ; Export metadata to USRP partner (transcode setups require this)
subscriberFile = /var/lib/dvswitch/subscriber_ids.csv   ; DMR ID to callsign lookup data                

; General vocoder setup information
decoderFallBack = false                ; Allow software AMBE decoding if a hardware decoder is not found
useEmulator = false                     ; Use the MD380 AMBE emulator for AMBE72 (DMR/YSFN/NXDN)       
emulatorAddress = 127.0.0.1:2470        ; IP address and port of the server                            

; Audio devices are normally not needed when in gateway service.  These devices should
; only be set when local monitor or dongle modes are required.
outputAudioDevice = /dev/null           ; Audio device /dev/null, /dev/dsp1, portaudio, etc
inputAudioDevice = /dev/null            ; Only used for dongle mode

; Below values are for using this as a local DMR dongle (no ASL needed)
useMicrophone = false                   ; Use app as just a fancy dongle for DMR
useVox = false                          ; If using dongle mode (useMicrophone), enable VOX
voxDecay = 2                            ; Hang time in seconds
voxTrigger = 200                        ; Value to trip PTT (0-32767)

; Information for xx_Bridges (Where xx is MMDVM, HB, IPSC)
[AMBE_AUDIO]
server = 127.0.0.1                      ; IP address of xx_Bridge.py
fromDMRPort = 31100                     ; was rxport; AMBE frames from xx_Bridge (should match "toGatewayPort" in xx_Bridge.cfg)
toDMRPort = 31103                       ; was txport; AMBE frames from xx_Bridge (should match "fromGatewayPort" in xx_Bridge.cfg)
ambeMode = DMR                          ; DMR, DMR_IPSC, DSTAR, NXDN, P25, YSFN, YSFW
minTxTimeMS = 2000                      ; Minimum time in MS for hang delay
gatewayDmrId = <removed>                ; ID the DMR listener will see when Allstar people speak; the repeater's main DMR ID; ID to use when transmitting from Analog_Bridge
repeaterID = <removed>                   ; private DMR ID used in the MMDVM bridge config; ID of source repeater
txTg = 31075                            ; TG to use for all frames received from Analog_Bridge -> xx_Bridge
txTs = 2                                ; Slot to use for frames received from Analog_Bridge -> xx_Bridge
colorCode = 1                           ; Color Code to assign DMR frames

; Information for USRP channel driver.  This interface uses PCM to transfer audio information
; There are two typical configurations, ASL and Transcode.  ASL (AllstarLink) is for analog clients connected
; to a digital network.  Transcode is when Analog_Bridge actually points its PCM interfaces back at itself,
; causing a TLV <-- (pcm <--> pcm) --> TLV type of architecture.
;   When using ASL, this matches the rpt.conf ASL file with a setting like:
;   rxchannel = usrp/127.0.0.1:34001:32001
;   When Transcoding, make toASLPort equal to the other instance fromASLPort (crossover)
[USRP]
server = 127.0.0.1                      ; IP address of Allstar/Asterisk
toASLPort = 32001                       ; Analog_Bridge <-- ASL
fromASLPort = 34001                     ; Analog_Bridge --> ASL
aslAudio = AUDIO_UNITY                  ; Audio to ASL (AUDIO_UNITY, AUDIO_USE_AGC, AUDIO_USE_GAIN)
agcGain = -20                           ; Gain (in db) of the AGC filter
dmrAudio = AUDIO_UNITY                  ; Audio from ASL (AUDIO_UNITY, AUDIO_USE_GAIN, AUDIO_BPF)
dmrGain = 0.35                          ; Gain factor of audio from ASL (0.0-1.0)

; Information for DV3000 hardware decoder
;   There are two configuration modes: IP (AMBEServer) and serial (direct connect hardware)
;   Use top server and port if using AMBEServer
;   Use bottom server/port and serial = true if using the DV3000u (thumbdv)
;   Did you run AMBETest4.py before using this?
[DV3000]
; server = 127.0.0.1                      ; IP address of AMBEServer
; port = 2460                             ; Port of AMBEServer
server = /dev/ttyUSB0                 ; Device of DV3000U on this machine
port = 460800                         ; Baud rate of the dongle
serial = true                         ; Use serial (DV3000U) or IP
----------------------------------------------------------------------------------------------------------------------------------


[root@ww6bay-asl Analog_Bridge]# /opt/Analog_Bridge/Analog_Bridge /opt/Analog_Bridge/Analog_Bridge.ini
I: 2019-09-06 03:00:10.769 Analog Bridge Version 1.1 Wed  9 May 05:56:17 EDT 2018                    
I: 2019-09-06 03:00:10.769 Copyright (C) 2018 DVSwitch, INAD.                                        
I: 2019-09-06 03:00:10.769 Created by Mike N4IRR and Steve N4IRS                                     
I: 2019-09-06 03:00:10.769 Analog Bridge comes with ABSOLUTELY NO WARRANTY                           
I: 2019-09-06 03:00:10.769                                                                           
I: 2019-09-06 03:00:10.769 This software is for use on amateur radio networks only,                  
I: 2019-09-06 03:00:10.770 it is to be used for educational purposes only. Its use on                
I: 2019-09-06 03:00:10.770 commercial networks is strictly prohibited.                               
I: 2019-09-06 03:00:10.770                                                                           
I: 2019-09-06 03:00:10.770 Analog Bridge is starting                                                 
M: 2019-09-06 03:00:10.770 Setting [GENERAL] logLevel -> 2                                           
M: 2019-09-06 03:00:10.770 Setting [GENERAL] exportMetadata -> true                                  
M: 2019-09-06 03:00:10.770 Setting [GENERAL] subscriberFile -> /var/lib/dvswitch/subscriber_ids.csv  
M: 2019-09-06 03:00:10.770 Setting [GENERAL] decoderFallBack -> false                                
M: 2019-09-06 03:00:10.770 Setting [GENERAL] useEmulator -> false                                    
M: 2019-09-06 03:00:10.770 Setting [GENERAL] emulatorAddress -> 127.0.0.1:2470
M: 2019-09-06 03:00:10.770 Setting [GENERAL] outputAudioDevice -> /dev/null
M: 2019-09-06 03:00:10.770 Setting [GENERAL] inputAudioDevice -> /dev/null
M: 2019-09-06 03:00:10.770 Setting [GENERAL] useMicrophone -> false
M: 2019-09-06 03:00:10.770 Setting [GENERAL] useVox -> false
M: 2019-09-06 03:00:10.771 Setting [GENERAL] voxDecay -> 2
M: 2019-09-06 03:00:10.771 Setting [GENERAL] voxTrigger -> 200
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] server -> 127.0.0.1
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] fromDMRPort -> 31100
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] toDMRPort -> 31103
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] ambeMode -> DMR
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] minTxTimeMS -> 2000
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] gatewayDmrId -> <removed>
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] repeaterID -> <removed>
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] txTg -> 31075
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] txTs -> 2
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] colorCode -> 1
M: 2019-09-06 03:00:10.771 Setting [USRP] server -> 127.0.0.1
M: 2019-09-06 03:00:10.771 Setting [USRP] toASLPort -> 32001
M: 2019-09-06 03:00:10.771 Setting [USRP] fromASLPort -> 34001
M: 2019-09-06 03:00:10.771 Setting [USRP] aslAudio -> AUDIO_UNITY
M: 2019-09-06 03:00:10.771 Setting [USRP] agcGain -> -20
M: 2019-09-06 03:00:10.771 Setting [USRP] dmrAudio -> AUDIO_UNITY
M: 2019-09-06 03:00:10.771 Setting [USRP] dmrGain -> 0.35
M: 2019-09-06 03:00:10.771 Setting [DV3000] server -> /dev/ttyUSB0
M: 2019-09-06 03:00:10.771 Setting [DV3000] port -> 460800
M: 2019-09-06 03:00:10.772 Setting [DV3000] serial -> true
W: 2019-09-06 03:00:10.772 ioctl reset error
W: 2019-09-06 03:00:10.772 ioctl speed error
W: 2019-09-06 03:00:10.772 ioctl stereo error
W: 2019-09-06 03:00:10.772 ioctl setfmt error
M: 2019-09-06 03:00:10.772 Audio In/Out Device: /dev/null
I: 2019-09-06 03:00:10.772 Open UDP listener on 127.0.0.1:31100
I: 2019-09-06 03:00:10.772 Open USRP on 127.0.0.1:32001
M: 2019-09-06 03:00:10.772 Connecting to DV3000 hardware......
M: 2019-09-06 03:00:10.808 Begin DV3000 decode
Project 25 IMBE Encoder/Decoder Fixed-Point implementation
Developed by Pavel Yazev E-mail: pyazev@...
Version 1.0 (c) Copyright 2009
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; see the file ``LICENSE'' for details.
I: 2019-09-06 03:00:10.808 Subscriber IDs loaded: 0
I: 2019-09-06 03:00:10.808 Default extended metadata <3107955>
I: 2019-09-06 03:00:10.809 Using hardware AMBE vocoder
I: 2019-09-06 03:00:10.809 Starting Analog_Bridge --> USRP thread
I: 2019-09-06 03:00:10.809 Open UDP listener on 127.0.0.1:34001
I: 2019-09-06 03:00:10.809 Starting USRP --> HB_Bridge thread

Steve N4IRS
 

David,
There are typically 2 issues with the ThumbDV on a RPi:
1: Power, The ThumbDV is very sensitive  to power drops See <https://dvswitch.groups.io/g/main/message/315?p=,,,20,0,0,0::relevance,,DV3000u,20,2,0,5521534>
2: FTDI latency, as root:
    cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
    If the result is greater then 1
    echo 1 > /sys/bus/usb-serial/devices/ttyUSB0/latency_timer

73, Steve N4IRS


On 9/6/19 12:32 AM, David Ranch wrote:

Hello Everyone,

I have a working DMR TG to Analog DVSwitch setup working here using the included "Project 25 IMBE Encoder/Decoder Fixed-Point implementation" SW emulation on an Rpi3B+.  It was recommended to go with a hardware AMBE solution for the best audio quality so I bought a NWDigital ThumbDV.  It seems things the new hardware is functioning:

   - ThumbDV seen as /dev/ttyUSB0
   - ThumbDV LEDs light up when people are talking on the DMR talk group
   - No errors in dmesg
   - No errors shown from the Analog_Bridge output from STDOUT
   - Load on the Rpi is around 0.35


Yet the resulting analog audio is segmented up.  When I say segmented up, I mean the audio is coming through but I'm hearing gaps in the analog audio every 300ms or so (a guess) and it seems to be substantially slowed down compared to the audio I hear on a DMR HT.  What's especially interesting that at the end of a long transmission, the Rpi can be 15-20 seconds delayed  though the pitch of the voice is still correct!  That's some SERIOUS buffering that is not experienced when using the SW vocoder.
 

I did some various research on the web and found the AMBEtest4.py script at:

   https://raw.githubusercontent.com/DVSwitch/Analog_Bridge/master/scripts/AMBEtest4.py

but it seems this is a Python2 script but my Rpi only has Python3.  I did install all the required Python modules and did port the various print statements to by Python3 compatible but I started getting into some difficult errors that I couldn't get past.  Does anyone have a version of this that's Python3 compatible?

Any other  thoughts on why this might be happening?  If I switch back to the SW IMBE vocoder, the analog audio is smooth with a average load of 0.90.

--David
KI6ZHD


cat /etc/lsb-release
LSB_VERSION=1.4
DISTRIB_ID=Arch
DISTRIB_RELEASE=rolling
DISTRIB_DESCRIPTION="Arch Linux"


Linux ww6bay-asl 4.14.97-1-ARCH #1 SMP Tue Feb 5 20:10:34 UTC 2019 armv7l GNU/Linux


Analog_Bridge.ini
----------------------------------------------------------------------------------------------------------------------------------
; Analog_Bridge configuration file.                                                       
;   This file should be placed in either /etc or it can be                                
;   supplied as a path on the Analog_Bridge command line.                                 

; General Section describes settings for Analog_Bridge itself.
;   For RPI, don't forget to modprobe snd_pcm_oss to get the devices populated
[GENERAL]                                                                    
logLevel = 2                            ; Show messages and above 0=No logging, 1=Debug, 2=Message, 3=Info, 4=Warning, 5=Error, 6=Fatal

; Metadata management
exportMetadata = true                   ; Export metadata to USRP partner (transcode setups require this)
subscriberFile = /var/lib/dvswitch/subscriber_ids.csv   ; DMR ID to callsign lookup data                

; General vocoder setup information
decoderFallBack = false                ; Allow software AMBE decoding if a hardware decoder is not found
useEmulator = false                     ; Use the MD380 AMBE emulator for AMBE72 (DMR/YSFN/NXDN)       
emulatorAddress = 127.0.0.1:2470        ; IP address and port of the server                            

; Audio devices are normally not needed when in gateway service.  These devices should
; only be set when local monitor or dongle modes are required.
outputAudioDevice = /dev/null           ; Audio device /dev/null, /dev/dsp1, portaudio, etc
inputAudioDevice = /dev/null            ; Only used for dongle mode

; Below values are for using this as a local DMR dongle (no ASL needed)
useMicrophone = false                   ; Use app as just a fancy dongle for DMR
useVox = false                          ; If using dongle mode (useMicrophone), enable VOX
voxDecay = 2                            ; Hang time in seconds
voxTrigger = 200                        ; Value to trip PTT (0-32767)

; Information for xx_Bridges (Where xx is MMDVM, HB, IPSC)
[AMBE_AUDIO]
server = 127.0.0.1                      ; IP address of xx_Bridge.py
fromDMRPort = 31100                     ; was rxport; AMBE frames from xx_Bridge (should match "toGatewayPort" in xx_Bridge.cfg)
toDMRPort = 31103                       ; was txport; AMBE frames from xx_Bridge (should match "fromGatewayPort" in xx_Bridge.cfg)
ambeMode = DMR                          ; DMR, DMR_IPSC, DSTAR, NXDN, P25, YSFN, YSFW
minTxTimeMS = 2000                      ; Minimum time in MS for hang delay
gatewayDmrId = <removed>                ; ID the DMR listener will see when Allstar people speak; the repeater's main DMR ID; ID to use when transmitting from Analog_Bridge
repeaterID = <removed>                   ; private DMR ID used in the MMDVM bridge config; ID of source repeater
txTg = 31075                            ; TG to use for all frames received from Analog_Bridge -> xx_Bridge
txTs = 2                                ; Slot to use for frames received from Analog_Bridge -> xx_Bridge
colorCode = 1                           ; Color Code to assign DMR frames

; Information for USRP channel driver.  This interface uses PCM to transfer audio information
; There are two typical configurations, ASL and Transcode.  ASL (AllstarLink) is for analog clients connected
; to a digital network.  Transcode is when Analog_Bridge actually points its PCM interfaces back at itself,
; causing a TLV <-- (pcm <--> pcm) --> TLV type of architecture.
;   When using ASL, this matches the rpt.conf ASL file with a setting like:
;   rxchannel = usrp/127.0.0.1:34001:32001
;   When Transcoding, make toASLPort equal to the other instance fromASLPort (crossover)
[USRP]
server = 127.0.0.1                      ; IP address of Allstar/Asterisk
toASLPort = 32001                       ; Analog_Bridge <-- ASL
fromASLPort = 34001                     ; Analog_Bridge --> ASL
aslAudio = AUDIO_UNITY                  ; Audio to ASL (AUDIO_UNITY, AUDIO_USE_AGC, AUDIO_USE_GAIN)
agcGain = -20                           ; Gain (in db) of the AGC filter
dmrAudio = AUDIO_UNITY                  ; Audio from ASL (AUDIO_UNITY, AUDIO_USE_GAIN, AUDIO_BPF)
dmrGain = 0.35                          ; Gain factor of audio from ASL (0.0-1.0)

; Information for DV3000 hardware decoder
;   There are two configuration modes: IP (AMBEServer) and serial (direct connect hardware)
;   Use top server and port if using AMBEServer
;   Use bottom server/port and serial = true if using the DV3000u (thumbdv)
;   Did you run AMBETest4.py before using this?
[DV3000]
; server = 127.0.0.1                      ; IP address of AMBEServer
; port = 2460                             ; Port of AMBEServer
server = /dev/ttyUSB0                 ; Device of DV3000U on this machine
port = 460800                         ; Baud rate of the dongle
serial = true                         ; Use serial (DV3000U) or IP
----------------------------------------------------------------------------------------------------------------------------------


[root@ww6bay-asl Analog_Bridge]# /opt/Analog_Bridge/Analog_Bridge /opt/Analog_Bridge/Analog_Bridge.ini
I: 2019-09-06 03:00:10.769 Analog Bridge Version 1.1 Wed  9 May 05:56:17 EDT 2018                    
I: 2019-09-06 03:00:10.769 Copyright (C) 2018 DVSwitch, INAD.                                        
I: 2019-09-06 03:00:10.769 Created by Mike N4IRR and Steve N4IRS                                     
I: 2019-09-06 03:00:10.769 Analog Bridge comes with ABSOLUTELY NO WARRANTY                           
I: 2019-09-06 03:00:10.769                                                                           
I: 2019-09-06 03:00:10.769 This software is for use on amateur radio networks only,                  
I: 2019-09-06 03:00:10.770 it is to be used for educational purposes only. Its use on                
I: 2019-09-06 03:00:10.770 commercial networks is strictly prohibited.                               
I: 2019-09-06 03:00:10.770                                                                           
I: 2019-09-06 03:00:10.770 Analog Bridge is starting                                                 
M: 2019-09-06 03:00:10.770 Setting [GENERAL] logLevel -> 2                                           
M: 2019-09-06 03:00:10.770 Setting [GENERAL] exportMetadata -> true                                  
M: 2019-09-06 03:00:10.770 Setting [GENERAL] subscriberFile -> /var/lib/dvswitch/subscriber_ids.csv  
M: 2019-09-06 03:00:10.770 Setting [GENERAL] decoderFallBack -> false                                
M: 2019-09-06 03:00:10.770 Setting [GENERAL] useEmulator -> false                                    
M: 2019-09-06 03:00:10.770 Setting [GENERAL] emulatorAddress -> 127.0.0.1:2470
M: 2019-09-06 03:00:10.770 Setting [GENERAL] outputAudioDevice -> /dev/null
M: 2019-09-06 03:00:10.770 Setting [GENERAL] inputAudioDevice -> /dev/null
M: 2019-09-06 03:00:10.770 Setting [GENERAL] useMicrophone -> false
M: 2019-09-06 03:00:10.770 Setting [GENERAL] useVox -> false
M: 2019-09-06 03:00:10.771 Setting [GENERAL] voxDecay -> 2
M: 2019-09-06 03:00:10.771 Setting [GENERAL] voxTrigger -> 200
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] server -> 127.0.0.1
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] fromDMRPort -> 31100
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] toDMRPort -> 31103
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] ambeMode -> DMR
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] minTxTimeMS -> 2000
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] gatewayDmrId -> <removed>
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] repeaterID -> <removed>
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] txTg -> 31075
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] txTs -> 2
M: 2019-09-06 03:00:10.771 Setting [AMBE_AUDIO] colorCode -> 1
M: 2019-09-06 03:00:10.771 Setting [USRP] server -> 127.0.0.1
M: 2019-09-06 03:00:10.771 Setting [USRP] toASLPort -> 32001
M: 2019-09-06 03:00:10.771 Setting [USRP] fromASLPort -> 34001
M: 2019-09-06 03:00:10.771 Setting [USRP] aslAudio -> AUDIO_UNITY
M: 2019-09-06 03:00:10.771 Setting [USRP] agcGain -> -20
M: 2019-09-06 03:00:10.771 Setting [USRP] dmrAudio -> AUDIO_UNITY
M: 2019-09-06 03:00:10.771 Setting [USRP] dmrGain -> 0.35
M: 2019-09-06 03:00:10.771 Setting [DV3000] server -> /dev/ttyUSB0
M: 2019-09-06 03:00:10.771 Setting [DV3000] port -> 460800
M: 2019-09-06 03:00:10.772 Setting [DV3000] serial -> true
W: 2019-09-06 03:00:10.772 ioctl reset error
W: 2019-09-06 03:00:10.772 ioctl speed error
W: 2019-09-06 03:00:10.772 ioctl stereo error
W: 2019-09-06 03:00:10.772 ioctl setfmt error
M: 2019-09-06 03:00:10.772 Audio In/Out Device: /dev/null
I: 2019-09-06 03:00:10.772 Open UDP listener on 127.0.0.1:31100
I: 2019-09-06 03:00:10.772 Open USRP on 127.0.0.1:32001
M: 2019-09-06 03:00:10.772 Connecting to DV3000 hardware......
M: 2019-09-06 03:00:10.808 Begin DV3000 decode
Project 25 IMBE Encoder/Decoder Fixed-Point implementation
Developed by Pavel Yazev E-mail: pyazev@...
Version 1.0 (c) Copyright 2009
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; see the file ``LICENSE'' for details.
I: 2019-09-06 03:00:10.808 Subscriber IDs loaded: 0
I: 2019-09-06 03:00:10.808 Default extended metadata <3107955>
I: 2019-09-06 03:00:10.809 Using hardware AMBE vocoder
I: 2019-09-06 03:00:10.809 Starting Analog_Bridge --> USRP thread
I: 2019-09-06 03:00:10.809 Open UDP listener on 127.0.0.1:34001
I: 2019-09-06 03:00:10.809 Starting USRP --> HB_Bridge thread


David Ranch
 


Hello Steve,

Thanks for the reply. 

There are typically 2 issues with the ThumbDV on a RPi:
1: Power, The ThumbDV is very sensitive  to power drops See <https://dvswitch.groups.io/g/main/message/315?p=,,,20,0,0,0::relevance,,DV3000u,20,2,0,5521534>

Yes.. I saw that post.  This is currently being driven by a 5.1v @ 2.5A supply which should be good but I'll try others.

2: FTDI latency, as root:
    cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
    If the result is greater then 1
    echo 1 > /sys/bus/usb-serial/devices/ttyUSB0/latency_timer

Ok, I have the following:
--
cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
16
--

I'll change that down to 1 as recommended and I'll see what that does.

Beyond that, I assume the versions I'm running, the Analog_Bridge config and log output looks good?

--David
KI6ZHD

David Ranch
 

Hello Steve,

    echo 1 > /sys/bus/usb-serial/devices/ttyUSB0/latency_timer

I'm happy to report that this resolved my issue and the audio quality issue is resolved!  If I can make a recommendation, on page 16 of https://docs.google.com/document/d/1eN50Csr29eAprBu7eKA0Bfa2XUcsXw5iktY1Ey-Qjkg/edit , consider adding tothe "Insert vocoder discussion here" section.  Something like:

   - Enable the "Project 25 IMBE Encoder/Decoder Fixed-Point implementation" codec

    This is the default setting and generally has good audio quality

    Analog_Bridge.ini

          [GENERAL]
          decoderFallBack = true
          useEmulator = false
          [DV3000]
          ;server = /dev/ttyUSB0                 ; Device of DV3000U on this machine
          ;port = 460800                         ; Baud rate of the dongle
          ;serial = true                         ; Use serial (DV3000U) or IP


   - Enable the md380-emu codec

    This has good audio quality (possibly better than the IMBE software vocoder):

       Document how the md380-emu process will be started

       Analog_Bridge.ini

          [GENERAL]
          decoderFallBack = false
          useEmulator = true
          [DV3000]
          ;server = /dev/ttyUSB0                 ; Device of DV3000U on this machine
          ;port = 460800                         ; Baud rate of the dongle
          ;serial = true                         ; Use serial (DV3000U) or IP


   - Enable HW AMBE codec

    This is the default setting and generally has good audio quality (possibly better than the IMBE software vocoder):


      - Connect the HW device directly to your computer (no USB hubs if possible)

      - Edit the Analog_Bridge.ini
          [GENERAL]
          decoderFallBack = false
          useEmulator = false
          [DV3000]
          server = /dev/ttyUSB0                 ; Device of DV3000U on this machine
          port = 460800                         ; Baud rate of the dongle
          serial = true                         ; Use serial (DV3000U) or IP



      - If used with a Raspberry Pi and you experience audio issues:

         - When connected to the Raspberry Pi, run the "dmesg" command and confirm which serial port it's beeing
          seen as.  The default is /dev/ttyUSB0 unless that device is already in use

         - Make sure that the serial RX/TX LEDs are lighting up on the USB device when receiving / transmitting signals

         - You might need to change your USB latency with:
          echo 1 | sudo tee /sys/bus/usb-serial/devices/ttyUSB0/latency_timer

         - Use a proper power supply for your Rpi as the AMBE chips are reknown for being very sensitive to
          voltage sags

--David
KI6ZHD

Waldek SP2ONG
 

Hi David

If I setup to use md380-emu in follwoing:

- Enable the md380-emu codec

    This has good audio quality (possibly better than the IMBE software vocoder):

       Document how the md380-emu process will be started

       Analog_Bridge.ini

          [GENERAL]
          decoderFallBack = false
          useEmulator = true
          [DV3000]
          ;server = /dev/ttyUSB0                 ; Device of DV3000U on this machine
          ;port = 460800                         ; Baud rate of the dongle
          ;serial = true                         ; Use serial (DV3000U) or IP


Analog_Bridge is stoping and in log is follwoing info

D: 2019-09-07 06:54:52.723 Attempt to  init DV3000 in DMR mode
M: 2019-09-07 06:54:52.723 Connecting to DV3000 hardware......
W: 2019-09-07 06:54:53.730 DV3000 not found at 127.0.0.1:2460
I: 2019-09-07 06:54:53.931 Subscriber IDs loaded: 140597
I: 2019-09-07 06:54:53.931 Connecting to emulator on host 127.0.0.1:2500
F: 2019-09-07 06:54:53.931 DV3000 not found!, aborting.

My md380-emu is running on port 2500  but when I setup


          [GENERAL]
          decoderFallBack =true
          useEmulator = true
          [DV3000]
          ;server = /dev/ttyUSB0                 ; Device of DV3000U on this machine
          ;port = 460800                         ; Baud rate of the dongle
          ;serial = true                         ; Use serial (DV3000U) or IP



D: 2019-09-07 06:54:56.972 Attempt to  init DV3000 in DMR mode
M: 2019-09-07 06:54:56.972 Connecting to DV3000 hardware......
W: 2019-09-07 06:54:57.979 DV3000 not found at 127.0.0.1:2460
I: 2019-09-07 06:54:58.179 Subscriber IDs loaded: 140597
I: 2019-09-07 06:54:58.179 Connecting to emulator on host 127.0.0.1:2500
W: 2019-09-07 06:54:58.179 Using software MBE decoder version 1.2.3
W: 2019-09-07 06:54:58.179 Using software OP25 IMBE/AMBE vocoder



On Fri, Sep 6, 2019 at 09:59 PM, David Ranch wrote:
- Enable the md380-emu codec

    This has good audio quality (possibly better than the IMBE software vocoder):

       Document how the md380-emu process will be started

       Analog_Bridge.ini

          [GENERAL]
          decoderFallBack = false
          useEmulator = true
          [DV3000]
          ;server = /dev/ttyUSB0                 ; Device of DV3000U on this machine
          ;port = 460800                         ; Baud rate of the dongle
          ;serial = true                         ; Use serial (DV3000U) or IP

Waldek SP2ONG
 

I would like someone to confirm whether to use md380 in Analog_Bridge should be such a setting: ??? :

decoderFallBack = false                 ; Allow software AMBE decoding if a hardware decoder is not found
useEmulator = true                      ; Use the MD380 AMBE emulator for AMBE72 (DMR/YSFN/NXDN)
emulatorAddress = 127.0.0.1:2500        ; IP address and port of the md380 server

for  me not working

Steve N4IRS
 

No,
To use the emulator you must enable decoderFallBack and useEmulator.

Steve N4IRS


On 9/7/19 3:40 AM, Waldek SP2ONG wrote:
I would like someone to confirm whether to use md380 in Analog_Bridge should be such a setting: ??? :

decoderFallBack = false                 ; Allow software AMBE decoding if a hardware decoder is not found
useEmulator = true                      ; Use the MD380 AMBE emulator for AMBE72 (DMR/YSFN/NXDN)
emulatorAddress = 127.0.0.1:2500        ; IP address and port of the md380 server

for  me not working

Steve N4IRS
 

David,
I will consider adding the text to the howto. One change is that the AMBE chip is not sensitive to voltage sags. The ThumbDV is sensitive to voltage sags.

Steve N4IRS


On 9/7/19 12:59 AM, David Ranch wrote:
Hello Steve,

    echo 1 > /sys/bus/usb-serial/devices/ttyUSB0/latency_timer

I'm happy to report that this resolved my issue and the audio quality issue is resolved!  If I can make a recommendation, on page 16 of https://docs.google.com/document/d/1eN50Csr29eAprBu7eKA0Bfa2XUcsXw5iktY1Ey-Qjkg/edit , consider adding tothe "Insert vocoder discussion here" section.  Something like:

   - Enable the "Project 25 IMBE Encoder/Decoder Fixed-Point implementation" codec

    This is the default setting and generally has good audio quality

    Analog_Bridge.ini

          [GENERAL]
          decoderFallBack = true
          useEmulator = false
          [DV3000]
          ;server = /dev/ttyUSB0                 ; Device of DV3000U on this machine
          ;port = 460800                         ; Baud rate of the dongle
          ;serial = true                         ; Use serial (DV3000U) or IP


   - Enable the md380-emu codec

    This has good audio quality (possibly better than the IMBE software vocoder):

       Document how the md380-emu process will be started

       Analog_Bridge.ini

          [GENERAL]
          decoderFallBack = false
          useEmulator = true
          [DV3000]
          ;server = /dev/ttyUSB0                 ; Device of DV3000U on this machine
          ;port = 460800                         ; Baud rate of the dongle
          ;serial = true                         ; Use serial (DV3000U) or IP


   - Enable HW AMBE codec

    This is the default setting and generally has good audio quality (possibly better than the IMBE software vocoder):


      - Connect the HW device directly to your computer (no USB hubs if possible)

      - Edit the Analog_Bridge.ini
          [GENERAL]
          decoderFallBack = false
          useEmulator = false
          [DV3000]
          server = /dev/ttyUSB0                 ; Device of DV3000U on this machine
          port = 460800                         ; Baud rate of the dongle
          serial = true                         ; Use serial (DV3000U) or IP



      - If used with a Raspberry Pi and you experience audio issues:

         - When connected to the Raspberry Pi, run the "dmesg" command and confirm which serial port it's beeing
          seen as.  The default is /dev/ttyUSB0 unless that device is already in use

         - Make sure that the serial RX/TX LEDs are lighting up on the USB device when receiving / transmitting signals

         - You might need to change your USB latency with:
          echo 1 | sudo tee /sys/bus/usb-serial/devices/ttyUSB0/latency_timer

         - Use a proper power supply for your Rpi as the AMBE chips are reknown for being very sensitive to
          voltage sags

--David
KI6ZHD

Waldek SP2ONG
 

Ok, Steve, thank you. I thought I was using the wrong configuration to use md380-emu.
Although in the log you can not see that md380 will be used. There is information that


I: 2019-09-07 06:54:58.179 Connecting to emulator on host 127.0.0.1:2500
W: 2019-09-07 06:54:58.179 Using software MBE decoder version 1.2.3
W: 2019-09-07 06:54:58.179 Using software OP25 IMBE/AMBE vocoder

Still, sometimes strange audio using md380 (Jackhammer) occurs. It changes the port of md380-emu and sometimes helps, but I think this is not the reason for strange audio.

TG9AOR
 

Hello Friend. Message #2143 addresses a procedure to verify the latency timer.

As for me, I gave up on integrating DSTAR to the node because of this very same issue, even if the timer is set to 1, the USB device is in a powered USB hub. This past saturday, as I was rebuilding my AllStar Node I gave C4FM a try with the NWDigital ThmbDV in stead of the md380-emu. While it does not stutter, The audio does get fragmented. Pi is on the local LAN, as well as the USB Device.

I ended up using the md380-emu for C4FM as well.


73
--
José Roberto Ruíz García Salas
TG9AOR

Steve N4IRS
 

Plug the ThumbDV directly into the host. No hub. Run  AMBEtest4.py to verify proper operation.

Sent via smoke signal (AT&T)


From: main@DVSwitch.groups.io <main@DVSwitch.groups.io> on behalf of TG9AOR <qrz@...>
Sent: Monday, September 9, 2019 1:33:51 PM
To: main@DVSwitch.groups.io <main@DVSwitch.groups.io>
Subject: Re: [DVSwitch] Troubleshooting ThumbDV HW AMBE chip with Analog_Bridge
 
Hello Friend. Message #2143 addresses a procedure to verify the latency timer.

As for me, I gave up on integrating DSTAR to the node because of this very same issue, even if the timer is set to 1, the USB device is in a powered USB hub. This past saturday, as I was rebuilding my AllStar Node I gave C4FM a try with the NWDigital ThmbDV in stead of the md380-emu. While it does not stutter, The audio does get fragmented. Pi is on the local LAN, as well as the USB Device.

I ended up using the md380-emu for C4FM as well.


73
--
José Roberto Ruíz García Salas
TG9AOR