AllStarLink / app_rpt

Refactoring and upgrade of AllStarLink's app_rpt, etc.
8 stars 6 forks source link

Move USB Tune Settings #276

Closed tsawyer closed 6 months ago

tsawyer commented 8 months ago

Move the tune settings from the existing separate tune files into their respective channel driver .conf file. Modify channel drivers and tune menus for both simple USB and USB radio.

Current simple USB files

-rw-r--r-- 1 asterisk asterisk 14K Jan 22 15:01 simpleusb.conf
-rw-r--r-- 1 asterisk asterisk  97 Jan 22 15:01 simpleusb_tune_usb_1998.conf
-rw-r--r-- 1 asterisk asterisk  97 Jan 15 07:14 simpleusb_tune_usb_1999.conf

Proposed simple USB files

-rw-r--r-- 1 asterisk asterisk 14K Jan 22 15:01 simpleusb.conf

Proposed simple USB file format

simpleusb.conf.zip

(ZIP contains a single file, excerpted here):

; If you are going to use this channel driver, you MUST enable it in modules.conf
; change:
; noload => chan_simpleusb.so       ; CM1xx USB Cards with Radio Interface Channel Driver (No DSP)
; to:
; load => chan_simpleusb.so         ; CM1xx USB Cards with Radio Interface Channel Driver (No DSP)

; SimpleUSB configuration

[general]

[1998]

eeprom = 0                          ; EEPROM installed: 0,1
                                    ; 0 = no (default)
                                    ; 1 = yes

hdwtype = 0                         ; Leave this set to 0 for USB sound fobs modified using
                                    ; the instructions from usbfob.pdf. Use a setting of 
                                    ; 1 is for Dingotel/Sph interfaces.

; Receiver parameters
rxboost = 0                         ; 0 = 20db attenuator inserted, 1= 20db attenuator removed
                                    ; Set to 1 for additonal gain if using a low-level receiver output

carrierfrom = usbinvert             ; no,usb,usbinvert
                                    ; no - no carrier detection at all
                                    ; usb - from the COR line on the USB sound fob (Active high)
                                    ; usbinvert - from the inverted COR line on the USB sound fob (Active low)

ctcssfrom = no               ; no,usb,usbinvert
                                    ; no - CTCSS decoding, system will be carrier squelch
                                    ; usb - CTCSS decoding using input from USB sound fob (Active high)
                                    ; usbinvert - from the inverted CTCSS line on the USB sound fob (Active low)

deemphasis = no                     ; enable de-emphasis (input from discriminator)

plfilter = yes                      ; enable PL filter

rxondelay = 0                       ; Number of 20mSec intervals following the release of PTT.
                                    ; Uncomment and/or adjust for simplex nodes to eliminate "Ping Ponging"
                                    ; or "Relay Racing". A positive value here will instruct the usbradio
                                    ; driver to ignore the COR line for a specified number of 20mSec
                                    ; intervals following the release of PTT. Use this ONLY on simplex
                                    ; nodes, and leave commented out for repeaters or other full duplex nodes.

txoffdelay = 0                      ; Ignore the reciever for a specified number of 20 millisecond
                                    ; intervals after the transmitter unkeys.
                                    ; This is useful when setting up a half-duplex link with an existing
                                    ; repeater, where you need to ignore the repeater's hangtime.

; Transmitter parameters
txmixa = voice                      ; Left channel output (A): no,voice
                                    ; no - Do not output anything
                                    ; voice - output voice only

txmixb = no                         ; Right channel output (B): no,voice
                                    ; no - Do not output anything
                                    ; voice - output voice only

txboost = 0

invertptt = 0                       ; Invert PTT: 0,1
                                    ; 0 - ground to transmit
                                    ; 1 - open to transmit

preemphasis = 0                     ; Perform standard 6db/octave pre-emphasis

; pager = no                        ; no,a,b (e.g. pager = b means "put the normal repeat audio on channel A, and the pager audio on channel B")

; duplex3 = 0                       ; duplex 3 gain setting (0 to disable)

; name=1998
; devicenum=0
devstr=5-1:1.0
rxmixerset=500
txmixaset=500
txmixbset=500

[1999]

eeprom = 0                          ; EEPROM installed: 0,1
                                    ; 0 = no (default)
                                    ; 1 = yes

hdwtype = 0                         ; Leave this set to 0 for USB sound fobs modified using
                                    ; the instructions from usbfob.pdf. Use a setting of 
                                    ; 1 is for Dingotel/Sph interfaces.

; Receiver parameters
rxboost = 0                         ; 0 = 20db attenuator inserted, 1= 20db attenuator removed
                                    ; Set to 1 for additonal gain if using a low-level receiver output

carrierfrom = usbinvert             ; no,usb,usbinvert
                                    ; no - no carrier detection at all
                                    ; usb - from the COR line on the USB sound fob (Active high)
                                    ; usbinvert - from the inverted COR line on the USB sound fob (Active low)

ctcssfrom = no               ; no,usb,usbinvert
                                    ; no - CTCSS decoding, system will be carrier squelch
                                    ; usb - CTCSS decoding using input from USB sound fob (Active high)
                                    ; usbinvert - from the inverted CTCSS line on the USB sound fob (Active low)

deemphasis = no                     ; enable de-emphasis (input from discriminator)

plfilter = no                      ; enable PL filter

rxondelay = 0                       ; Number of 20mSec intervals following the release of PTT.
                                    ; Uncomment and/or adjust for simplex nodes to eliminate "Ping Ponging"
                                    ; or "Relay Racing". A positive value here will instruct the usbradio
                                    ; driver to ignore the COR line for a specified number of 20mSec
                                    ; intervals following the release of PTT. Use this ONLY on simplex
                                    ; nodes, and leave commented out for repeaters or other full duplex nodes.

txoffdelay = 0                      ; Ignore the reciever for a specified number of 20 millisecond
                                    ; intervals after the transmitter unkeys.
                                    ; This is useful when setting up a half-duplex link with an existing
                                    ; repeater, where you need to ignore the repeater's hangtime.

; Transmitter parameters
txmixa = voice                      ; Left channel output (A): no,voice
                                    ; no - Do not output anything
                                    ; voice - output voice only

txmixb = no                         ; Right channel output (B): no,voice
                                    ; no - Do not output anything
                                    ; voice - output voice only

txboost = 0

invertptt = 0                       ; Invert PTT: 0,1
                                    ; 0 - ground to transmit
                                    ; 1 - open to transmit

preemphasis = 0                     ; Perform standard 6db/octave pre-emphasis

; pager = no                        ; no,a,b (e.g. pager = b means "put the normal repeat audio on channel A, and the pager audio on channel B")

; duplex3 = 0                       ; duplex 3 gain setting (0 to disable)

eeprom = 0                          ; EEPROM installed: 0,1
                                    ; 0 = no (default)
                                    ; 1 = yes

hdwtype = 0                         ; Leave this set to 0 for USB sound fobs modified using
                                    ; the instructions from usbfob.pdf. Use a setting of 
                                    ; 1 is for Dingotel/Sph interfaces.

; Receiver parameters
rxboost = 0                         ; 0 = 20db attenuator inserted, 1= 20db attenuator removed
                                    ; Set to 1 for additonal gain if using a low-level receiver output

carrierfrom = usbinvert             ; no,usb,usbinvert
                                    ; no - no carrier detection at all
                                    ; usb - from the COR line on the USB sound fob (Active high)
                                    ; usbinvert - from the inverted COR line on the USB sound fob (Active low)

ctcssfrom = no               ; no,usb,usbinvert
                                    ; no - CTCSS decoding, system will be carrier squelch
                                    ; usb - CTCSS decoding using input from USB sound fob (Active high)
                                    ; usbinvert - from the inverted CTCSS line on the USB sound fob (Active low)

deemphasis = no                     ; enable de-emphasis (input from discriminator)

plfilter = yes                      ; enable PL filter

rxondelay = 0                       ; Number of 20mSec intervals following the release of PTT.
                                    ; Uncomment and/or adjust for simplex nodes to eliminate "Ping Ponging"
                                    ; or "Relay Racing". A positive value here will instruct the usbradio
                                    ; driver to ignore the COR line for a specified number of 20mSec
                                    ; intervals following the release of PTT. Use this ONLY on simplex
                                    ; nodes, and leave commented out for repeaters or other full duplex nodes.

txoffdelay = 0                      ; Ignore the reciever for a specified number of 20 millisecond
                                    ; intervals after the transmitter unkeys.
                                    ; This is useful when setting up a half-duplex link with an existing
                                    ; repeater, where you need to ignore the repeater's hangtime.

; Transmitter parameters
txmixa = voice                      ; Left channel output (A): no,voice
                                    ; no - Do not output anything
                                    ; voice - output voice only

txmixb = no                         ; Right channel output (B): no,voice
                                    ; no - Do not output anything
                                    ; voice - output voice only

txboost = 0

invertptt = 0                       ; Invert PTT: 0,1
                                    ; 0 - ground to transmit
                                    ; 1 - open to transmit

preemphasis = 0                     ; Perform standard 6db/octave pre-emphasis

; pager = no                        ; no,a,b (e.g. pager = b means "put the normal repeat audio on channel A, and the pager audio on channel B")

; duplex3 = 0                       ; duplex 3 gain setting (0 to disable)

[1998]

eeprom = 0                          ; EEPROM installed: 0,1
                                    ; 0 = no (default)
                                    ; 1 = yes

hdwtype = 0                         ; Leave this set to 0 for USB sound fobs modified using
                                    ; the instructions from usbfob.pdf. Use a setting of 
                                    ; 1 is for Dingotel/Sph interfaces.

; Receiver parameters
rxboost = 0                         ; 0 = 20db attenuator inserted, 1= 20db attenuator removed
                                    ; Set to 1 for additonal gain if using a low-level receiver output

carrierfrom = usbinvert             ; no,usb,usbinvert
                                    ; no - no carrier detection at all
                                    ; usb - from the COR line on the USB sound fob (Active high)
                                    ; usbinvert - from the inverted COR line on the USB sound fob (Active low)

ctcssfrom = no               ; no,usb,usbinvert
                                    ; no - CTCSS decoding, system will be carrier squelch
                                    ; usb - CTCSS decoding using input from USB sound fob (Active high)
                                    ; usbinvert - from the inverted CTCSS line on the USB sound fob (Active low)

deemphasis = no                     ; enable de-emphasis (input from discriminator)

plfilter = no                      ; enable PL filter

rxondelay = 0                       ; Number of 20mSec intervals following the release of PTT.
                                    ; Uncomment and/or adjust for simplex nodes to eliminate "Ping Ponging"
                                    ; or "Relay Racing". A positive value here will instruct the usbradio
                                    ; driver to ignore the COR line for a specified number of 20mSec
                                    ; intervals following the release of PTT. Use this ONLY on simplex
                                    ; nodes, and leave commented out for repeaters or other full duplex nodes.

txoffdelay = 0                      ; Ignore the reciever for a specified number of 20 millisecond
                                    ; intervals after the transmitter unkeys.
                                    ; This is useful when setting up a half-duplex link with an existing
                                    ; repeater, where you need to ignore the repeater's hangtime.

; Transmitter parameters
txmixa = voice                      ; Left channel output (A): no,voice
                                    ; no - Do not output anything
                                    ; voice - output voice only

txmixb = no                         ; Right channel output (B): no,voice
                                    ; no - Do not output anything
                                    ; voice - output voice only

txboost = 0

invertptt = 0                       ; Invert PTT: 0,1
                                    ; 0 - ground to transmit
                                    ; 1 - open to transmit

preemphasis = 0                     ; Perform standard 6db/octave pre-emphasis

; pager = no                        ; no,a,b (e.g. pager = b means "put the normal repeat audio on channel A, and the pager audio on channel B")

; duplex3 = 0                       ; duplex 3 gain setting (0 to disable)

; name=1999
; devicenum=1
devstr=5-2:1.0
rxmixerset=500
txmixaset=500
txmixbset=500

#tryinclude custom/simpleusb.conf
KB4MDD commented 8 months ago

@tsawyer does this change need to recognize an existing tune file and copy the settings to the appropriate section in main config file, if they do not exist in the main tune file?

tsawyer commented 8 months ago

I suspect tune files will not exist in the asl3 configs if this change is implemented. Is there a concern for migrations from asl2? Are we supporting migrations?

KB4MDD commented 8 months ago

You are correct, tune files will not exist in the full release of ASL3. My concern was for current testers. As these changes are implemented, they will all be broken. The current testers will have to manually copy their tune settings into the respective main configuration file.

I my installs, I have copied the old als2 configuration files for simpleusb and usbradio. (There was no need to retune everything).

If you wanted to support some sort of migration, we would need to handle that in the code or provide a script that would combine the tune file with the main config.

tsawyer commented 8 months ago

What would if the tune settings are not found in the respective configuration?

KB4MDD commented 8 months ago

My initial thought is to create default entries like our sample tune file. When driver is started by app_rpt, it will see if the entries are present, if they are not found, it will update the file with default values. At least default values have to be present for the driver to work.

Allan-N commented 8 months ago

One might think that the driver would start off using default values. Then, the file could be missing (use the defaults), could be filled with just comments (documentation), could include every setting (that would override whatever the driver had as defaults), and as always would have any per-node adjustments.

tsawyer commented 8 months ago

Setting the auto levels to 500 (half scale) in the respective conf file makes sense.

KB4MDD commented 8 months ago

@Allan-N Presently the drivers require a conf file to setup the driver. We must have the associated node number. There are no provisions for default values for the standard simpleusb.conf or usbradio.conf values. There is a provision for a missing tune file.

With that said, a template could be used for default values like app_rpt.

Allan-N commented 8 months ago

@KB4MDD Could the simpletune.conf file end up being as simple as :

[general]
; nothing here but comments as the driver would have default
; values for all of the settings

[node-main](!)
; again, just comments :-)

;devstr=1-1.4:1.0
;rxmixerset=500
;txmixaset=500
;txmixbset=500

[1999](node-main)
; just what's needed / unique
devstr=1-1.4:1.0
rxmixerset=450
KB4MDD commented 8 months ago

I will let @tsawyer comment on the proposal. It really does not matter to me. Since I typically modify the files manually - I do like the comments in the file.

I will note that both usb drivers presently load the [general] section as defaults for the individual nodes. If a key value pair is missing the value from the [general] section is used. I will say that no one probably knows that fact. Our [general] section does not contain key value pairs.

Allan-N commented 8 months ago

I too like comments in the file that describe the various settings/options. That way, one does not need to look elsewhere for the info. One gotcha we have found is that using AMI to update the conf files results in big changes to the white space around the commented lines :-(

InterLinked1 commented 8 months ago

The idea of having large portions of the config files only commenting the defaults is hard to grasp. What's the advantage of it?

It's customary for the sample config to document all the options that are present, so this is really just convention. That's for rpt.conf.sample, simpleusb.conf.sample, etc. although users don't necessarily have to use those - they could have their own config with just the settings they want.

I've found that everyone tends to have differing preferences for these, even between files. But from an Asterisk perspective, all that we're concerned with is publishing a sample config, not "plug'n play" configs that users can expect to use.

Allan-N commented 8 months ago

"I" would be just fine having a thinned down / minimally commented ".conf" file as long as there was some way/place on the system/device to view information on all of the settings (e.g. a ".conf.sample" file, a man page, etc). What "I" don't want is to be out in the field (or somewhere with sketchy internet) with no local information and no access to "online" resources. Yes, this is AllStarLink and one might assume that the internet would be available but that's not always the case.

InterLinked1 commented 8 months ago

"I" would be just fine having a thinned down / minimally commented ".conf" file as long as there was some way/place on the system/device to view information on all of the settings (e.g. a ".conf.sample" file, a man page, etc). What "I" don't want is to be out in the field (or somewhere with sketchy internet) with no local information and no access to "online" resources. Yes, this is AllStarLink and one might assume that the internet would be available but that's not always the case.

Yup, I get that and totally agree with you.

The sample config is available on the system (at least from the source directory) and has everything documented there, regardless of what people are actually using.

And assuming everything is XML documented as well, there's a CLI command to show all the documentation for each setting as well. This doesn't exist now for app_rpt stuff but will be added.

tsawyer commented 8 months ago

@Allan-N This issue is about moving the tune settings. Discussion of comments is not appropriate here.