Weird rtl_fm bug

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/osmocom-sdr@lists.osmocom.org/.

Alan Corey alancorey at yahoo.com
Fri May 24 02:49:16 UTC 2013


This only affects scanning, or specifically searching a range of frequencies.  I could hear it in the example from usage -f 118M:137M:25k.  For some reason the step changes as the loop executes so the frequencies look like:

118950000
118975000
119000000  ok to here
119257000
119282000
119307000
119332000
119357000
119382000
119407000
119432000
119457000
119482000
119507000
119532000
119789000
119814000
119839000
119864000

The frequencies should be at 25 KHz intervals.

I don't have a diff because I have several other changes in my version, but my frequency_range() now looks like:

void frequency_range(struct fm_state *fm, char *arg)
{
        char *start, *stop, *step;
        int i;
        int frst, frstp, frdelta;
        start = arg;
        stop = strchr(start, ':') + 1;
        stop[-1] = '\0';
        step = strchr(stop, ':') + 1;
        step[-1] = '\0';
        frst = (int)atofs(start);
        frstp = (int)atofs(stop);
        frdelta = (int)atofs(step);
        fprintf(stderr,"start: %i, stop: %i, step: %i\n",frst,frstp,frdelta);
// step was changing here somehow:
//      for(i=(int)atofs(start); i<=(int)atofs(stop); i+=(int)atofs(step))
        for (i=frst; i<=frstp; i+=frdelta)
        {
                fm->freqs[fm->freq_len] = (uint32_t)i;
                fm->freq_len++;
        }
        stop[-1] = ':';
        step[-1] = ':';
}

I added the fr* variables and used them in the loop.  It sounds better now that none of the frequencies are off.  I'm also logging and those frequencies look OK.

  Alan


-----

Radio Astronomy - the ultimate DX
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/osmocom-sdr/attachments/20130523/78b847dc/attachment.htm>


More information about the osmocom-sdr mailing list