hbeni / fgcom-mumble

A (flightsim) radio communication simulation based on mumble
GNU General Public License v3.0
17 stars 6 forks source link

Bug: ADF function broken #157

Closed hbeni closed 2 years ago

hbeni commented 2 years ago

Describe the bug ADF is not working with VHF beacon. We have a VHF beacon and tried to tune the ADF to that value (121000 kHz = 121.00 MHz)

Additional context FGFS log:

130.32 [ALRT]:nasal      Nasal runtime error: vector index 1 out of bounds (size: 1)
  130.32 [ALRT]:nasal        at /home/beni/Dokumente/FGFS/work/FGCom-mumble/client/fgfs-addon/radios.nas, line 252
  130.32 [ALRT]:nasal        called from: /home/beni/Dokumente/FGFS/work/FGCom-mumble/client/fgfs-addon/radios.nas, line 281
  130.32 [ALRT]:nasal        called from: /usr/share/games/flightgear-build/install/flightgear/fgdata/Nasal/globals.nas, line 137
  132.38 [ALRT]:nasal      Nasal runtime error: vector index 1 out of bounds (size: 1)
  132.38 [ALRT]:nasal        at /home/beni/Dokumente/FGFS/work/FGCom-mumble/client/fgfs-addon/radios.nas, line 252
  132.38 [ALRT]:nasal        called from: /home/beni/Dokumente/FGFS/work/FGCom-mumble/client/fgfs-addon/radios.nas, line 281
  132.38 [ALRT]:nasal        called from: /usr/share/games/flightgear-build/install/flightgear/fgdata/Nasal/globals.nas, line 137
  134.24 [ALRT]:nasal      Nasal runtime error: vector index 1 out of bounds (size: 1)
  134.24 [ALRT]:nasal        at /home/beni/Dokumente/FGFS/work/FGCom-mumble/client/fgfs-addon/radios.nas, line 252
  134.24 [ALRT]:nasal        called from: /home/beni/Dokumente/FGFS/work/FGCom-mumble/client/fgfs-addon/radios.nas, line 281
  134.24 [ALRT]:nasal        called from: /usr/share/games/flightgear-build/install/flightgear/fgdata/Nasal/globals.nas, line 137
  135.77 [ALRT]:nasal      Nasal runtime error: vector index 1 out of bounds (size: 1)
  135.77 [ALRT]:nasal        at /home/beni/Dokumente/FGFS/work/FGCom-mumble/client/fgfs-addon/radios.nas, line 252
  135.77 [ALRT]:nasal        called from: /home/beni/Dokumente/FGFS/work/FGCom-mumble/client/fgfs-addon/radios.nas, line 281
  135.77 [ALRT]:nasal        called from: /usr/share/games/flightgear-build/install/flightgear/fgdata/Nasal/globals.nas, line 137

Debug log:

FGCom [2022-03-31 08:18:33.163]: [DBG] mumble_onAudioSourceFetched(): plugin active=1; isSpeech=1
FGCom [2022-03-31 08:18:33.163]: [DBG] mumble_onAudioSourceFetched():   plugin active+speech detected from id=141
FGCom [2022-03-31 08:18:33.163]: [DBG] mumble_onAudioSourceFetched():   sender callsign=radioWesnoth
FGCom [2022-03-31 08:18:33.163]: [DBG] mumble_onAudioSourceFetched():   sender registered rmt-radios: 1
FGCom [2022-03-31 08:18:33.163]: [DBG] mumble_onAudioSourceFetched():   check remote radio #0
FGCom [2022-03-31 08:18:33.163]: [DBG] mumble_onAudioSourceFetched():    frequency='121.000'
FGCom [2022-03-31 08:18:33.163]: [DBG] mumble_onAudioSourceFetched():    ptt='1'
FGCom [2022-03-31 08:18:33.163]: [DBG] mumble_onAudioSourceFetched():    txpwr='10.000000'
FGCom [2022-03-31 08:18:33.163]: [DBG] mumble_onAudioSourceFetched():    type='VHF'
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():     PTT detected
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():     check local radios for frequency match (local iid=0)
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():     checking local radio #0
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       frequency='121.0000'
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       operable='1'
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       RDF='0'
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       ptt='0'
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       volume='0.200000'
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       type='VHF'
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       radio models compatible: signalMatchFilter=1.000000
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       local_radio=0  frequency 121.0000 matches!
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       signalStrength=0.998197; direction=241.231430; angle=-1.875985
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():         taking it, its better than the previous one
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():     checking local radio #1
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       frequency='122.7500'
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       operable='1'
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       RDF='0'
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       ptt='0'
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       volume='1.000000'
FGCom [2022-03-31 08:18:33.164]: [DBG] mumble_onAudioSourceFetched():       type='VHF'
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       radio models compatible: signalMatchFilter=0.000000
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():     => nomatch
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():     checking local radio #2
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       frequency=''
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       operable='1'
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       RDF='0'
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       ptt='0'
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       volume='1.000000'
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       type='STRING'
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():     checking local radio #3
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       frequency='121.0000'
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       operable='1'
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       RDF='1'
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       ptt='0'
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       volume='0.000000'
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       type='VHF'
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       radio models compatible: signalMatchFilter=1.000000
FGCom [2022-03-31 08:18:33.165]: [DBG] mumble_onAudioSourceFetched():       local_radio=3  frequency 121.0000 matches!
FGCom [2022-03-31 08:18:33.166]: [DBG] mumble_onAudioSourceFetched():       signalStrength=0.998197; direction=241.231430; angle=-1.875985
FGCom [2022-03-31 08:18:33.166]: [DBG] mumble_onAudioSourceFetched(): update signal data for RDF (141)=radioWesnoth, radio[0]
FGCom [2022-03-31 08:18:33.166]: [DBG] mumble_onAudioSourceFetched():         not taking it. squelch=0.100000, previousBestSignal=0.998197
FGCom [2022-03-31 08:18:33.166]: [DBG] mumble_onAudioSourceFetched():   connected (lcl_type=VHF), bestSignalStrength=0.998197
hbeni commented 2 years ago

Possible cause is the RDF input parser breaks at the nasal error; thus, not updating the input fields anymore.

hbeni commented 2 years ago

Faking RadioID=4 in the rdfinput data field seems to move the needle. Maybe there is just a mismatch between the radios, because the VHF COM1 already picks up the signal?

hbeni commented 2 years ago

It also looks like the protocol's <input>section is not active anymore? We don't receive information on the RDF input node on latest FGFS next.

hbeni commented 2 years ago

echo "RDF:CS_TX=Test,FRQ=123.45,DIR=180.5,VRT=12.5,QLY=0.98,ID_RX=4" | nc -u localhost 19991 moves the needle too. Maybe two issues here: 1. ID mismatch, 2. no input data anymore

hbeni commented 2 years ago

Generated data looks good from the code. ID should be 4. So it currently really looks like the data is either not digested by fgfs or not sent to the proper location.

The plugin debug log says, target port is set to: [mumid=174; iid=0] D-EBHX: clientTgtPort=127.0.0.1:19991

Port seems to be open: udp 0 0 0.0.0.0:19991 0.0.0.0:* 1000 85223 23380/./fgfs

hbeni commented 2 years ago

Reason found: The UDP client startup invocation was not compiled into the binary, because the corresponding C annotation was the wrong way around. If reversed, all is working again...

The nasal errors above are very surely side effects of manual testing.


Fun fact: you can in FGFS tune the ADF to 112000kHz, and thus listen to VHF frequencies.