Complex FIR and Stereo support for rtl_fm

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/.

Michał Morański michal.moranski at gmail.com
Mon Sep 16 12:09:31 UTC 2013


W dniu 2013-09-16 11:38, Miroslav Slugeň pisze:
> Hi, i used git from 14.9.2013, if you get errors from actual git it 
> could be because some functions might go into upstream, i also add as 
> attachment just rtl_fm.c so just replace it your version with this 
> version and it should work.
Thanks for rapid answer. I just compiled your code.
First, i got this message when compiling:
/usr/lib/gcc/i486-linux-gnu/4.4.3/include/emmintrin.h:32:3: error: 
#error "SSE2 instruction set not enabled"
Then i've added line to CMakeLists.txt:
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-msse -msse2 -msse3")
After that i was able to compile the code, but with some warnings:

/usr/src/rtl-sdr/src/rtl_fm.c: In function ‘low_pass_complex’:
/usr/src/rtl-sdr/src/rtl_fm.c:451: warning: dereferencing pointer ‘v_r’ 
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:436: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:452: warning: dereferencing pointer ‘v_i’ 
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:436: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c: In function ‘low_pass_real’:
/usr/src/rtl-sdr/src/rtl_fm.c:769: warning: dereferencing pointer ‘v_m’ 
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:755: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:850: warning: dereferencing pointer ‘v_m’ 
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:872: warning: dereferencing pointer ‘v_m’ 
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:834: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:851: warning: dereferencing pointer ‘v_p’ 
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:834: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:852: warning: dereferencing pointer ‘v_s’ 
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:873: warning: dereferencing pointer ‘v_s’ 
does break strict-aliasing rules

Now i got segfaults when i try to run rtl_fm -X -f 90.4e6 :
root at dabplus:/usr/src/rtl-sdr# rtl_fm -X -f 90.4e6 -
Found 1 device(s):
   0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Lifeview LV5TDeluxe
Found Fitipower FC0013 tuner
Oversampling input by: 6x.
Oversampling output by: 1x.
Buffer size: 7.11ms
Tuned to 90704000 Hz.
Sampling at 1152000 Hz.
Output at 48000 Hz.
LP Complex: FIR hamming (SSE2), size: 32
LP Real: FIR hamming stereo (SSE2), size: 64
Tuner gain set to automatic.
Tuner AGC ON.
De-epmhasis IIR: 50.0 us
Segmentation fault

My processor:
root at dabplus:/usr/src/rtl-sdr# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 28
model name      : Intel(R) Atom(TM) CPU D525   @ 1.80GHz
.....
root at dabplus:/usr/src/rtl-sdr# cat /etc/issue
Ubuntu 10.04.4 LTS \n \l

root at dabplus:/usr/src/rtl-sdr# uname -r
2.6.32-38-generic-pae



>
> I have RDS decoder also, but it is very ugly and not all issues are 
> solved.
Wow :) If you searching for help with that you can count on me.

>
> Miroslav Slugeň
> +420 724 825 885
>
> Michał Morański napsal(a):
>> W dniu 2013-09-13 15:22, Miroslav Slugeň pisze:
>>> Hi again,
>>>
>>> I am working on my own SDR project for Stereo FM radio support, but i
>>> would like to also improve quality for rtl_fm application, i made
>>> unoficial patch to add:
>>>
>>> Complex FIR - to filter strong signals close to wanted signal
>>> Real FIR - to filter pilot from FM
>>> Stereo FIR
>>> Stereo Deemphasis
>>> AGC support - it can give better resolution of IQ data
>>>
>>> Some other improvments in FM radio code.
>>>
>>> All FIR filters has 3 possible variants, simple, LUT, SSE2 instricts,
>>> of course SSE is the fastest one and it should works on Intel Atoms,
>>> but not on ARM.
>>>
>>> Feel free to use any part of code in any of you programs, I know that
>>> this code is little to much to add it into rtl_fm, but maybe it could
>>> somebody help to recieve HW stereo FM radio.
>>>
>>> Speed of SSE code is much better than anything you can get around
>>> here, on Core i7 it consume only 5% of one CPU, so i could demodulate
>>> at least 80 channels at the same time in stereo quality of course.
>>>
>>> I tried this code only on AMD64 and GCC Linux, so i am not sure if it
>>> can be compiled under windows.
>>>
>> Hi! Very nice to hear, that someone working on Stereo FM reception. I'm
>> building a small remote devices with rtl-dongles as fm stereo receivers.
>> Now i'm using gnu-radio to decode fm-stereo, but as you all know,
>> gnu-radio is a large and heavy project and it's wasting its
>> capatibilities in that role.
>> It would be very nice if native rtl-sdr software can decode fm-stereo.
>>
>> Which version of rtl-sdr was used as base version? I'm getting errors
>> after applying the patch to last version:
>>
>> patching file rtl_fm.c
>> Hunk #2 succeeded at 47 (offset 5 lines).
>> Hunk #3 succeeded at 87 (offset 9 lines).
>> Hunk #4 succeeded at 144 (offset 9 lines).
>> Hunk #5 succeeded at 169 (offset 9 lines).
>> Hunk #6 succeeded at 190 (offset 9 lines).
>> Hunk #7 FAILED at 239.
>> Hunk #8 FAILED at 258.
>> Hunk #9 succeeded at 314 (offset 13 lines).
>> Hunk #10 succeeded at 420 (offset 13 lines).
>> Hunk #11 succeeded at 994 (offset 13 lines).
>> Hunk #12 FAILED at 1106.
>> Hunk #13 succeeded at 1148 (offset 15 lines).
>> Hunk #14 succeeded at 1259 (offset 35 lines).
>> Hunk #15 succeeded at 1268 (offset 35 lines).
>> Hunk #16 succeeded at 1290 (offset 35 lines).
>> Hunk #17 succeeded at 1301 with fuzz 2 (offset 36 lines).
>> Hunk #18 succeeded at 1351 (offset 38 lines).
>> Hunk #19 succeeded at 1378 (offset 38 lines).
>> Hunk #20 succeeded at 1389 (offset 38 lines).
>> Hunk #21 succeeded at 1508 (offset 50 lines).
>> Hunk #22 succeeded at 1527 (offset 50 lines).
>> 3 out of 22 hunks FAILED -- saving rejects to file rtl_fm.c.rej
>>
>> P.S. Are you planning to add support for RDS in the future?
>>
>> Regards, Michał.
>>
>>





More information about the osmocom-sdr mailing list