-
Notifications
You must be signed in to change notification settings - Fork 549
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
Restore demodulator settings after recreating it #1040
Restore demodulator settings after recreating it #1040
Conversation
629135d
to
ad224da
Compare
Destroying the whole receiver in #1036 seems like a heavy-handed approach that's now resulting in the need to add more complexity to the receivers here. Do you think it would be simpler to just add a reset method to the receivers that would re-initialize things like IIR blocks? |
Fix regression, introduced in e5e16cc. Store all demodulator settings to private class members. Restore all stored settings after the demodulator is recreated in connect_all to match actual settings. Track state of RDS decoder and restore it too to prevent a freeze.
ad224da
to
befc713
Compare
I don't think so. Resetting IIR blocks by calling set_taps may be enough to fix the white waterfall and no sound issue, but this would leave the second bug (triggering gnuradio/gnuradio#5436) open. Recreating the whole receiver is quick and efficient fix. If the receiver will be changed: more modulations added, digital modes and more, then we'll have to track IIR block usage and not forget to add them to reset method. More work, more code, more possible bugs. I have updated the linked issue: #1039. It looks, like this is a separate bug, not a regression after e5e16cc... And it looks, like #1030 should be reopened with slightly different description: "Random GUI freeze after stopping WAV recorder and changing receiver settings".
|
Done. See my branch https://github.com/vladisslav2011/gqrx/tree/white_waterfall_reset_iir. |
What I had in mind was to destroy & recreate the IIR blocks, not just set the taps. |
Hmmm... |
Oh, nice!
Sounds good. Whether or not we go with this approach, it will be good to understand which blocks have an infinite impulse response and therefore cannot tolerate invalid input. |
The Simple Squelch block does use an IIR filter under the covers, so that would explain it: |
Also, its |
The second attempt: https://github.com/vladisslav2011/gqrx/tree/white_waterfall_reset_iir2 |
Why not? I'd want to understand why that's the case before rejecting the approach. |
It does not work, because there are still invalid samples in the buffer... |
There are 2 reasons, why resetting iir filters does not work:
|
The https://github.com/vladisslav2011/gqrx/tree/white_waterfall_reset_iir2 branch does not work well on my 'weak' test system - Intel Atom N270 (single core, 32-bit only) laptop. The waterfall gets restored, but the sound does not. |
In that case, an alternate solution for #1030 would be needed, but a temporary workaround might be more appropriate there since gnuradio/gnuradio#5436 should eventually be fixed. |
The restart is not required. Disabling/enabling "DC Cancel" is enough to fix the 'White waterfall' for one time. Switching from narrow to WFM and back or vice versa is enough to restore the sound for one time. The #1018 is not so critical, as some crashes are. It's more a usability issue. I've faced it multiple times while trying to play different IQ files, downloaded from internet to test AFSK1200 tool for regressions (have not found correct AX.25 recording yet). #1036 is a quick attempt to fix it in easy way. It exposed the #1039 and introduced a small regression (triggering gnuradio/gnuradio#5436 after switching input devices with RDS decoder enabled). Both issues are fixed by this PR. From my point of view, always resetting the receiver after demodulator/input device change is good thing as it leaves much less points, where more regressions, related to triggering gnuradio/gnuradio#5436, may be introduced.
There is an alternate fix, included here: https://github.com/vladisslav2011/gqrx/commits/white_waterfall_reset_iir2 |
Closing this, as it's not needed now that #1036 is reverted. |
There were still plenty of places that gnuradio/gnuradio#5436 could be triggered even after #1036. I'd rather make a targeted workaround (as in #1049) instead of redesigning Gqrx to work around an upstream bug that will eventually be gone. |
Agreed, stream tags might be a good solution. |
Fix regression, introduced in e5e16cc.
Store filter limits and shape to private class members.
Restore filter bandwidth/offset, squelch level, cw offset after the
demodulator is recreated in connect_all to match actual settings.
Track state of RDS decoder and restore it too to prevent a freeze.