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

Reset frame state when sync is acquired. #199

Merged
merged 1 commit into from
Mar 6, 2019

Conversation

argilo
Copy link
Collaborator

@argilo argilo commented Mar 5, 2019

if sync is lost and then regained, PSD CRC errors and audio decoding errors often occur. This happens because the beginning portions of partial PSD & audio packets remain in the frame state, and are then combined with the trailing portions of partial PSD & audio packets from a non-consecutive frame. The 16-bit PSD CRC check prevents most of the bogus PSD packets from being processed, but bogus audio packets are always sent to the AAC decoder since the 8-bit CRCs only apply to the pieces, not the whole packet.

To fix the problem, I've added a frame_reset call when sync is acquired. I tested this by making an IQ recording where I disconnected & reconnected my antenna five times. Prior to this change, 23 PSD CRC errors and 5 audio decode errors occurred, and after the change no errors occurred.

@argilo argilo requested a review from awesie March 5, 2019 13:38
@argilo argilo added the bug label Mar 5, 2019
@argilo argilo merged commit f3898f1 into theori-io:master Mar 6, 2019
@argilo argilo deleted the frame-reset-on-sync branch March 6, 2019 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants