Skip to content
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

Replace xpmr.c #define with new voxhangtime usbradio.conf parameter #34

Merged
merged 2 commits into from Feb 6, 2023

Conversation

davidgsd
Copy link
Contributor

Fix for Issue #33. Replace xpmr.c '#define XPMR_VOX_HANGTIME' with a new 'voxhangtime' cfg parameter set in usbradio.conf. When using usbradio in carrierfrom=vox mode this is the value the vox hang timer pChan->rxVoxTimer is set to in xpmr.c each time RX audio is detected. Making it configurable allows the default value of 2000mS to be reduced to a shorter time thereby preventing 2 seconds of silence being added to all node user transmissions. A value of 500mS seems to be much more optimal, and in my testing resulted in no false RX CD drops even when not talking. (xpmr.c's vox mode detects even quiet background noise and thereby supports reliable COS detection for radios that do not have a hardware COS line output.) Add the new voxhangtime parm to chan_usbradio.c chan_usbradio_pvt struct, store_config(), xpmr.c createPmrChannel(), xpmr.h t_pmr_chan struct, and to asterisk/configs/usbradio.conf.sample and allstar/configs/usbradio/usbradio.conf.

…fg parameter set in usbradio.conf. When using usbradio in carrierfrom=vox mode this is the value the vox hang timer pChan->rxVoxTimer is set to in xpmr.c each time RX audio is detected. Making it configurable allows the default value of 2000mS to be reduced to a shorter time thereby preventing 2 seconds of silence being added to all node user transmissions. A value of 500mS seems to be much more optimal, and in my testing resulted in no false RX CD drops even when not talking. (xpmr.c's vox mode detects even quiet background noise and thereby supports reliable COS detection for radios that do not have a hardware COS line output.) Add the new voxhangtime parm to chan_usbradio.c chan_usbradio_pvt struct, store_config(), xpmr.c createPmrChannel(), xpmr.h t_pmr_chan struct, and to asterisk/configs/usbradio.conf.sample and allstar/configs/usbradio/usbradio.conf.
@davidgsd
Copy link
Contributor Author

davidgsd commented Nov 18, 2022

Testing done:

  1. Verified voxhangtime is set to default (2000 mS) if cfg does not exist in usbradio.conf. Added some temp log prints and confirmed in messages log eg.
    $ sudo service asterisk restart
    $ astlog
    [Nov 17 19:22:56] NOTICE[3667] chan_usbradio.c: store_config: o->voxhangtime=2000 mS
    [Nov 17 19:22:56] NOTICE[3667] chan_usbradio.c: createPmrChannel() tChan.voxHangTime=2000
    [Nov 17 19:22:56] NOTICE[3667] ./xpmr/xpmr.c: xpmr pChan->voxHangTime: 2000

  2. Then set voxhangtime to 500 in usbradio.conf and verified read in correctly:
    [Nov 17 19:27:17] NOTICE[3843] chan_usbradio.c: store_config: o->voxhangtime=500 mS
    ...

  3. Verified timer val set as expected during node operation, and that carrier detect does indeed drop in ~500mS instead of 2 secs after I unkey:
    [Nov 17 19:28:00] NOTICE[3866] ./xpmr/xpmr.c: VoxTimer=500

I have not tested other configurations than using usbradio in carrierfrom=vox mode. The addition of the extra cfg parm should be unlikely to affect other configurations but ideally other devs can confirm no warnings or other issues happen with eg. usbradio in carrierfrom=dsp mode or with other drivers that use
xpmr.c,

@tsawyer tsawyer merged commit c4d1082 into AllStarLink:develop Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants