theori-io / nrsc5

NRSC-5 receiver for rtl-sdr
Other
805 stars 100 forks source link

Add support for primary service mode MP2 #306

Closed argilo closed 1 year ago

argilo commented 1 year ago

Fixes #305.

This pull request does the following:

  1. Adds support for primary service mode MP2. This mode is very similar to mode MP3, except that the P3 logical channel is only half as wide. Because of this difference, it also uses slightly different interleaver parameters. To accomodate this mode, I've added length arguments to some of the functions that process the P3 logical channel.
  2. Adds support for fixed data in logical channels other than P1. To accommodate this, we need one CCC data structure per logical channel, and various functions have to pass around the current logical channel number.
  3. Adds support for L2 PDUs containing only fixed data (and no audio).

All three enhancements were needed to properly receive WAMU, which uses mode MP2 and puts its station logos in data-only L2 PDUs in the P3 logical channel.

argilo commented 1 year ago

The update code appears to work well with all my recordings, and valgrind did not identify any memory corruption bugs. Merging.