On Sun, Apr 14, 2013 at 04:09:49PM +0000, Jona Joachim wrote:
> On 2013-04-12, Stuart Henderson <s...@spacehopper.org> wrote:
> >
> > --5L6AZ1aJH5mDrqCQ
> > Content-Type: text/plain; charset=us-ascii
> > Content-Disposition: inline
> >
> > I thought I'd write a port for this while I wait for my dongle to arrive
> > and thought I'd send it out in case anyone wants to give it a try.
> > No idea if it works on OpenBSD as-is or if it needs more work :)
> 
> It actually seems to work pretty well:
> 
> ugen2 at uhub0 port 2 "Realtek RTL2838UHIDIR" rev 2.00/1.00 addr 2
> 
> asterix% rtl_test -t
> Found 1 device(s):
>   0:  ezcap USB 2.0 DVB-T/DAB/FM dongle
> 
> Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle
> Found Elonics E4000 tuner
> Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0
> 21.5 24.0 29.0 34.0 42.0 
> Benchmarking E4000 PLL...
> [E4K] PLL not locked for 52000000 Hz!
> [E4K] PLL not locked for 2222000000 Hz!
> [E4K] PLL not locked for 1112000000 Hz!
> [E4K] PLL not locked for 1248000000 Hz!
> E4K range: 53 to 2221 MHz
> E4K L-band gap: 1112 to 1248 MHz
> 
> asterix% uname -a
> OpenBSD asterix.my.domain 5.3 GENERIC.MP#60 amd64
> 
> I was able to capture samples but I don't know yet how to exploit them.
> Are you aware for example of a way to play FM radio samples?
>
Here are some examples:
http://kmkeen.com/rtl-demod-guide/index.html,
but i rtl_fm coredumps:

rtl_fm -W -f 98.2M 
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000009

Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle
Found Elonics E4000 tuner
Oversampling input by: 2x.
Oversampling output by: 4x.
Buffer size: 6.02ms
Tuned to 98556000 Hz.
Sampling at 1360000 Hz.
Output at 32000 Hz.
Exact sample rate is: 1360000.050439 Hz
Tuner gain set to automatic.
Abort trap (core dumped) 
-----------------------------------------------------------------------
gdb /usr/local/bin/rtl_fm rtl_fm.core  
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "amd64-unknown-openbsd5.3"...
Core was generated by `rtl_fm'.
Program terminated with signal 6, Aborted.
Reading symbols from /usr/lib/libpthread.so.17.0...done.
Loaded symbols for /usr/lib/libpthread.so.17.0
Loaded symbols for /usr/local/bin/rtl_fm
Reading symbols from /usr/local/lib/librtlsdr.so.0.0...done.
Loaded symbols for /usr/local/lib/librtlsdr.so.0.0
Reading symbols from /usr/local/lib/libusb-1.0.so.1.0...done.
Loaded symbols for /usr/local/lib/libusb-1.0.so.1.0
Symbols already loaded for /usr/lib/libpthread.so.17.0
Reading symbols from /usr/lib/libm.so.8.0...done.
Loaded symbols for /usr/lib/libm.so.8.0
Reading symbols from /usr/lib/libc.so.67.0...done.
Loaded symbols for /usr/lib/libc.so.67.0
Reading symbols from /usr/libexec/ld.so...done.
Loaded symbols for /usr/libexec/ld.so
#0  0x00001f104264a9da in kill () at <stdin>:2
2       <stdin>: No such file or directory.
        in <stdin>
(gdb) bt
#0  0x00001f104264a9da in kill () at <stdin>:2
#1  0x00001f10426ae2ca in abort () at
/usr/src/lib/libc/stdlib/abort.c:70
#2  0x00001f1048d9a8a5 in pthread_mutex_unlock (mutexp=Variable "mutexp"
is not available.
) at /usr/src/lib/librthread/rthread_sync.c:218
#3  0x00001f0e3f1029d6 in full_demod (fm=0x7f7fffdfab70) at
/usr/ports/pobj/rtl-sdr-0.20130412/rtl-sdr-0.20130412/src/rtl_fm.c:583
#4  0x00001f0e3f102bb4 in demod_thread_fn (arg=Variable "arg" is not
available.
) at
/usr/ports/pobj/rtl-sdr-0.20130412/rtl-sdr-0.20130412/src/rtl_fm.c:641
#5  0x00001f1048d9913e in _rthread_start (v=Variable "v" is not
available.
) at /usr/src/lib/librthread/rthread.c:122
#6  0x00001f10426363bb in __tfork_thread () at
/usr/src/lib/libc/arch/amd64/sys/tfork_thread.S:75
Cannot access memory at address 0x1f1049225000
-----------------------------------------------------------------------
Another thing im not sure about is tuned frequency and ctrl+c doesn't
work:
rtl_sdr capture1.bin -s 1.8e6 -f 98.2M
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000013

Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle
Found Rafael Micro R820T tuner
Tuned to 100000000 Hz.
Reading samples in async mode...
^CSignal caught, exiting!
^CSignal caught, exiting!
^CSignal caught, exiting!
Hangup
-----------------------------------------------------------------------
Dumping eprom seems to work:
rtl_eeprom -r E4000-Edump.bin 
Found 1 device(s):
  0:  ezcap USB 2.0 DVB-T/DAB/FM dongle

Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle
Found Elonics E4000 tuner

Current configuration:
__________________________________________
Vendor ID:              0x0bda
Product ID:             0x2838
Manufacturer:           Realtek
Product:                RTL2838UHIDIR
Serial number:          00000009
Serial number enabled:  yes
IR endpoint enabled:    yes
Remote wakeup enabled:  no
__________________________________________

Dump to E4000-Edump.bin successful.
-----------------------------------------------------------------------
hexdump EE4000-dump.bin                                      
0000000    3228    0bda    2838    16a5    1012    5203    6500    6100
0000010    6c00    7400    6500    6b00    1c00    5203    5400    4c00
0000020    3200    3800    3300    3800    5500    4800    4900    4400
0000030    4900    5200    1200    3003    3000    3000    3000    3000
0000040    3000    3000    3900    0000    0000    0000    0200    0000
0000050    0000    0000    0000    0000    0000    0000    0000    0000
*
0000080    ffff    ffff    ffff    ffff    ffff    ffff    ffff    ffff
*
0000100
-----------------------------------------------------------------------
Lower sampling frequency seems to work better than default 2048000:
rtl_test -s 1e6 
Found 1 device(s):
  0:  ezcap USB 2.0 DVB-T/DAB/FM dongle

Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle
Found Elonics E4000 tuner
Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0
21.5 24.0 29.0 34.0 42.0 
Exact sample rate is: 1000000.026491 Hz

Info: This tool will continuously read from the device, and report if
samples get lost. If you observe no further output, everything is fine.

Reading samples in async mode...
^CSignal caught, exiting!
^CSignal caught, exiting!
^CSignal caught, exiting!
Hangup

That's so far:)

Reply via email to