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

If disabled, make sure we don't try calling rade_text_* with a null pointer. #794

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

tmiw
Copy link
Collaborator

@tmiw tmiw commented Jan 5, 2025

This PR prevents calling rade_text_rx() on EOO if the user's disabled reporting. Without this change, errors similar to the following are possible:

image (1)

@tmiw tmiw merged commit 524d0b8 into v2.0-dev Jan 6, 2025
4 checks passed
@Tyrbiter
Copy link

Tyrbiter commented Jan 7, 2025

I think this commit may have stopped EOO text working in the most recent couple of builds I have tested. I have reporting enabled, but even with very strong signals I see no decodes since using the older build without this commit.

@tmiw
Copy link
Collaborator Author

tmiw commented Jan 7, 2025

I think this commit may have stopped EOO text working in the most recent couple of builds I have tested. I have reporting enabled, but even with very strong signals I see no decodes since using the older build without this commit.

Not sure how since this is just a null pointer check that got added. Are you able to confirm that the commit in v2.0-dev prior to this one works fine?

@Tyrbiter
Copy link

Tyrbiter commented Jan 7, 2025

I have dropped this commit and will report what happens once I find some on air signals from stations with EOO-text enabled. There are a few in the UK.

Are there some RADE test wav files with EOO text included that I can try?

@barjac
Copy link

barjac commented Jan 7, 2025

I have dropped this commit and will report what happens once I find some on air signals from stations with EOO-text enabled. There are a few in the UK.

I can appear on 160, 80, 60 or 40m this evening or some time tomorrow to do some testing if you wish.

It's a long shot but do you have an AllStar/EchoLink node for talk-back if needed?

@Tyrbiter
Copy link

Tyrbiter commented Jan 7, 2025

I have dropped this commit and will report what happens once I find some on air signals from stations with EOO-text enabled. There are a few in the UK.

I can appear on 160, 80, 60 or 40m this evening or some time tomorrow to do some testing if you wish.

If you could simply come up on 40m then I can see if a high RADE SNR means I get a decode of the callsign, it didn't work for any of you earlier on 60m despite 20dB SNR at times. I have reverted what I suspect is the commit that broke it. Of course it could simply be that the fast fading channel is breaking the EOO Text where the RADE codec just doesn't care.

It's a long shot but do you have an AllStar/EchoLink node for talk-back if needed?

No, sorry I don't.

@barjac
Copy link

barjac commented Jan 7, 2025

Are you receiving?
I can switch to 60m if not.

@tmiw
Copy link
Collaborator Author

tmiw commented Jan 7, 2025

I wonder if it's some sort of audio delay between the application and say, pipewire. Maybe you can try different values for "RX/TX Delay" (Tools->Options->Rig Control) and seeing if that helps?

@Tyrbiter
Copy link

Tyrbiter commented Jan 7, 2025

Some experimentation this evening revealed that even with good 10dB+ SNR on RADE we are failing to get EOO-Text detection on a significant percentage of overs. What happens is that as the transmitting station drops PTT there is almost no noise heard if EOO detection is successful, but if it isn't there is a noticeable amount of garbage "speech-alike" sound which is a bit like 700 modes sound with marginal error rates.

I don't think this particular commit is the problem, but maybe some more debug output from the receive side at end of over would be useful.

@tmiw
Copy link
Collaborator Author

tmiw commented Jan 7, 2025

Some experimentation this evening revealed that even with good 10dB+ SNR on RADE we are failing to get EOO-Text detection on a significant percentage of overs. What happens is that as the transmitting station drops PTT there is almost no noise heard if EOO detection is successful, but if it isn't there is a noticeable amount of garbage "speech-alike" sound which is a bit like 700 modes sound with marginal error rates.

I don't think this particular commit is the problem, but maybe some more debug output from the receive side at end of over would be useful.

It does kinda sound like PTT may be dropping too soon at least some of the time. I'd suggest trying the RX/TX Delay option I mentioned above; perhaps there's some value for delay that will make decodes more likely.

Also, do you have any recordings that you can try playing back? We can at least see if that decodes reliably too.

@Tyrbiter
Copy link

Tyrbiter commented Jan 7, 2025

I would expect PTT to be held until EOO-Text blocks are sent, and indeed the debug shows that:

20:56:48 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/pipeline/TxRxThread.cpp:649: Triggering sending of EOO
20:56:48 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/pipeline/RADETransmitStep.cpp:178: Queueing 1152 EOO samples to output FIFO
20:56:48 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/pipeline/RADETransmitStep.cpp:97: Returning 160 EOO samples (remaining in FIFO: 992)
20:56:48 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/pipeline/RADETransmitStep.cpp:97: Returning 160 EOO samples (remaining in FIFO: 832)
20:56:48 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/pipeline/RADETransmitStep.cpp:97: Returning 160 EOO samples (remaining in FIFO: 672)
20:56:48 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/pipeline/RADETransmitStep.cpp:97: Returning 160 EOO samples (remaining in FIFO: 512)
20:56:48 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/pipeline/RADETransmitStep.cpp:97: Returning 160 EOO samples (remaining in FIFO: 352)
20:56:48 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/pipeline/RADETransmitStep.cpp:97: Returning 160 EOO samples (remaining in FIFO: 192)
20:56:48 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/pipeline/RADETransmitStep.cpp:97: Returning 160 EOO samples (remaining in FIFO: 32)
20:56:48 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/pipeline/RADETransmitStep.cpp:97: Returning 32 EOO samples (remaining in FIFO: 0)
20:56:49 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/ongui.cpp:911: All TX finished, going out of PTT

What I was wondering is if some extra debug might be useful before these messages are output:

20:53:07 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/pipeline/rade_text.c:210: mean amplitude: 1.798888
20:53:07 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/pipeline/rade_text.c:220: Estimated BER: 0.000000
20:53:07 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/pipeline/rade_text.c:334: rxCRC: 7, calcCRC: 7, decodedStr: G4MKT
20:53:07 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/freedv_interface.cpp:114: FreeDVInterface::OnRadeTextRx_: received G4MKT
20:53:08 INFO /home/bdm/git/freedv-gui-v2.0-ms-rade-snr/src/main.cpp:1920: Reporting callsign G4MKT @ SNR 10, freq 3642500 to reporting services.

I have not looked at the rade_text.c code to see what might be available at that point, but maybe we need to see what has been detected to actually call the code that output the debug above. Is that part of the RADE demodulator/decoder function?

@barjac
Copy link

barjac commented Jan 7, 2025

@Tyrbiter
After our QSO this evening I moved to Top Band and used the Derby 160m SDR as monitor.
The second instance of FreeDV is the same ms-rade-snr version running on the same hardware with different configuration.

During some long CQ sessions I discovered that the callsign reporting is working perfectly when using the voice keyer, the callsign is also appearing in the text area below the 'scope'. No misses seen at all.

When using the PTT I am hearing the garbage at EOO that you reported to me on 80m and no callsign is reported.

I do already have 100ms TX/RX delay set up in FreeDV as I have been testing a linear amplifier.

This makes me wonder if its a timing issue since I assume that the manual PTT OFF event and the program controlled VK EOO will be initiated in totally different ways.

@Tyrbiter
Copy link

Tyrbiter commented Jan 7, 2025

That's very useful information @barjac, @tmiw can have a look at the different code paths to see what might be happening.

@tmiw
Copy link
Collaborator Author

tmiw commented Jan 8, 2025

I created #800 as a place to put some WIP stuff while we figure this out. It's possible that the PR as is will help, but I'm not fully sure yet. Give it a try and leave comments there?

@barjac
Copy link

barjac commented Jan 8, 2025

I have done some more testing tonight using latest ms-rade-snr (#d47135)

Following on from "I'd suggest trying the RX/TX Delay option I mentioned above; perhaps there's some value for delay that will make decodes more likely."

Yes, that makes a difference.
In a nutshell, 100ms is not enough, around 200ms and above seems to cause the receiving freedv instance to crash and 300ms on my system is working correctly with occasional crashes.

G4DYA was using this version today and he was also crashing during RX during the net.

First the crash:
Traceback (most recent call last): File "/home/baz/freedv-rade/freedv-gui/build_linux/rade_src/radae_rxe.py", line 163, in get_snrdB_3k_est return int(self.receiver.snrdB_3k_est) ValueError: cannot convert float NaN to integer Error: call to get_snrdB_3k_est

I will re-test the delay in #93c1a0 which did not crash.

OK, been re-testing #93c1a0 and I have seen the crash a couple of times but with 300ms delay the callsign is reporting reliably using PTT.

I got the feeling that the crashes were more likely with low SNRs (QSB) but could be wrong.

`21:40:44 DEBUG /home/baz/freedv-rade/freedv-gui/src/pipeline/rade_text.c:310: RX symbol: -0.213445, -0.817682
21:40:44 DEBUG /home/baz/freedv-rade/freedv-gui/src/pipeline/rade_text.c:313: RX symbol rotated: -0.213445, -0.817682, amp: 0.598271
21:40:44 INFO /home/baz/freedv-rade/freedv-gui/src/pipeline/rade_text.c:210: mean amplitude: 0.598271
21:40:44 INFO /home/baz/freedv-rade/freedv-gui/src/pipeline/rade_text.c:220: Estimated BER: 0.000000
21:40:44 INFO /home/baz/freedv-rade/freedv-gui/src/pipeline/rade_text.c:334: rxCRC: 7, calcCRC: 7, decodedStr: G4MKT
21:40:44 INFO /home/baz/freedv-rade/freedv-gui/src/freedv_interface.cpp:114: FreeDVInterface::OnRadeTextRx_: received G4MKT
21:40:44 INFO /home/baz/freedv-rade/freedv-gui/src/main.cpp:1920: Reporting callsign G4MKT @ SNR 10, freq 1987000 to reporting services.

4330 state: search valid: 1 0 25 Dthresh: 0.04 Dtmax12: 0.16 0.31 tmax: 124 fmax: 7.50 SNRdB: 16.55
4331 state: candidate valid: 0 0 1 Dthresh: 0.04 Dtmax12: 0.04 0.31 tmax: 769 fmax: -2.50 SNRdB: 16.55
`

@tmiw
Copy link
Collaborator Author

tmiw commented Jan 9, 2025

Looks like #799 got created for the crash bug, so we'll add further comments over there.

@g4dya
Copy link

g4dya commented Jan 10, 2025

barjac and I did a test earlier today, both running 2a40daa with no extra TX/RX delay in the Rig Control tab. Both eoo callsigns and snr are now showing in FreeDV reporter reliably. The callsign seems to need an snr of a plus a few dB to work reliably, a bit more than needed to decode speech.

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.

4 participants