R820T tuner support in librtlsdr

9,593 views
Skip to first unread message

Adam Nielsen

unread,
Sep 8, 2012, 7:15:13 PM9/8/12
to Ultra-cheap SDR
FYI for those of you who aren't subscribed to the Osmocom list.

If you're not using Linux, you'll either have to compile rtlsdr.dll yourself
or wait for a new version to appear. If you're using Balint's ExtIO_USRP.dll
it will probably have to have a new hint added for this tuner, so this code
probably won't be ready to use just yet.

Cheers,
Adam.

-------- Original Message --------
Date: Sat, 08 Sep 2012 19:51:25 +0200
From: Steve Markgraf <st...@steve-m.de>
To: osmoc...@lists.osmocom.org <osmoc...@lists.osmocom.org>
Subject: R820T tuner support in librtlsdr

Hi list,

yesterday I committed code for the Rafael Micro R820T tuner to
librtlsdr.

Sticks with this combination (RTL2832 + R820T) are relatively new on
the market. The main difference to all the other supported tuners so
far is that it uses a Low-IF (3.57 MHz) architecture instead of
Zero-IF. That means the tuner is only connected to the In-Phase ADC
input, and the internal downconverter of the RTL2832 is generating the
complex samples. This has the benefit of having no DC offset spike in
the middle of the spectrum.

So far the tuner driver comes straight from the kernel driver that
Realtek supplies, and setting gain manually is not supported yet,
although functions for that seem to exist.

There is still is a lot that needs to be done, the best thing most
likely would be to completely rewrite the driver, or at least clean it
up dramatically. Initializing the tuner takes way too long at the
moment, since the driver produces a lot of I2C traffic, most of it
being redundant as it seems.

The driver originally had a frequency limitation of 40 MHz to 900 MHz,
but tests showed that the PLL of my stick can achieve lock up to 1766
MHz, and indeed both ADS-B at 1090 MHz and L-Band DAB at 1463 MHz, as
well as GMR at 1556 MHz can be received just fine with the R820T.
Also, the PLL could lock again at 1850 MHz to 1860 MHz, and the
reception of a GSM 1800 BTS at 1854 MHz worked as well.

Some initial comparisons [1] between the E4000 and R820T seem to hint
at the R820T being a bit more sensitive, especially visible in the
Tetra screenshots.

Given that the supply of E4000-based sticks is dwindling, I'm pleased
to see a new tuner that has the potential of becoming a good
replacement, and staying for a while on the market.

Regards,
Steve

[1] http://steve-m.de/projects/rtl-sdr/tuner_comparison

mr.sneezy

unread,
Sep 9, 2012, 12:19:10 AM9/9/12
to ultra-c...@googlegroups.com

Adam, thanks for passing the information back to this forum.
Very interesting info from Steve, and very positive towards being able to use the R820T.

I'm one of the Windows users, so I'll have to be patient about waiting for a new DLL.
I wish I knew enough about the programming to help, the best I can offer right now is come over and make strong cups of coffee for somebody who can :)

Cheers, Martin

Ballymunboy

unread,
Sep 9, 2012, 6:05:44 PM9/9/12
to ultra-c...@googlegroups.com
Heh, Guys,

Datasheets and other info, gathered in one place,  for the Realtek RTL2832U, the Elonics E400, the Raphael R820T and other tuners.

https://docs.google.com/folder/d/0B6wW18mYskvBRHJNbUMzRV90X0k/edit

cheers, a


--
You received this message because you are subscribed to the Google Groups "Ultra Cheap SDR" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ultra-cheap-sdr/-/gjB_5gOhVtUJ.

To post to this group, send email to ultra-c...@googlegroups.com.
To unsubscribe from this group, send email to ultra-cheap-s...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ultra-cheap-sdr?hl=en.

Michi Sakayama

unread,
Sep 11, 2012, 12:24:41 AM9/11/12
to ultra-c...@googlegroups.com
You know, I'd LOVE to do builds of rtlsdr.dll, and I've successfuly retrieved the code from git, and started the build, but honestly I can't make heads of tails of it in VC++2010 or using gcc with cygwin.
 
If anyone could even give a hint on build steps on Windows, i'd be really grateful - and I think a lot of others would, too.
 
I ran into problems with the compiler not able to find pthreads on cygwin (even though as far as I know, cygwin has threads support native), and problems with libusb on Visual Studio, as apparently libusb1.0 isnt "fully supported" under windows yet.
 
Any hints? I've got an RT820 too, and would like to see it work...

Mikhail Genin

unread,
Sep 11, 2012, 2:18:04 AM9/11/12
to ultra-c...@googlegroups.com
I wrote to the person who did the last assembly DLL (Hoernchen, email: la (at) tfc-server (dot) de). What would he do a new build. But the answer from him, I have not yet received. Try to write to him again. Maybe he will say.

вторник, 11 сентября 2012 г., 8:24:41 UTC+4 пользователь Michi Sakayama написал:

Michi Sakayama

unread,
Sep 11, 2012, 5:25:53 AM9/11/12
to ultra-c...@googlegroups.com
Well, I found out how... But, this is for rtlsdr.dll, not librtl2832++.dll, so no ext_IO support.. But it'll work in sdr# with the RT820, and it does seem to be working. I could look at steps to port this over into librtl2832++.dll later, but i've been up all night figuring this out - which i'm sure is elementary to some folks: however it hasn't been shared at all.
 
But, my RT820 dongle is working just fine in at least SDR# now; but I sure would like to be able to make it work with Ext_IO.
 
For some reason I have a feeling folks are going to be upset at me if I were to post this here. I'm not really sure why, but I have a feeling there's a reason that no one has been sharing it... So, please email me if you want the steps to build rtlsdr.dll from the latest osmocom git source in Windows. I can send that to you.
 
Hopefully librtl2832++.dll will be updated soon. If not i'll look into seeing if I can make it work.
 
 
 
-michi

Adam Nielsen

unread,
Sep 11, 2012, 7:42:05 AM9/11/12
to ultra-c...@googlegroups.com
> For some reason I have a feeling folks are going to be upset at me if I were
> to post this here. I'm not really sure why, but I have a feeling there's a
> reason that no one has been sharing it... So, please email me if you want the
> steps to build rtlsdr.dll from the latest osmocom git source in Windows. I can
> send that to you.

No problem posting it here. I've heard the Osmocom list are a bit funny about
it, but I think this group is happy for anyone to help! If you get the
compiling working well, I know there are a few people here who would love to
have the experimental direct-sampling branch included in your binaries. You
should be able to use git to rebase that branch onto the R820T code so you
only have to compile one .dll that has both R820T and direct-sampling support.

> Hopefully librtl2832++.dll will be updated soon. If not i'll look into seeing
> if I can make it work.

Having spent a few weeks recently trying to get some code compiling under
Visual C++ I know how painful it can be. But once you've done one bit of
code, the next should be much easier!

Cheers,
Adam.

Michi Sakayama

unread,
Sep 11, 2012, 12:44:46 PM9/11/12
to ultra-c...@googlegroups.com
Well, then here it goes..  I'd hate to upset Osmocom, but these really are just build steps!
 
I'd like someone to try this to double-check my list of steps here, I noted them down when it was pretty late!
 
So, consider this preliminary for now!
----
 
1) Install GitShell and Git for Windows (http://git-scm.com/download/win)
4) Install GTK+ Runtime for Windows (http://downloads.sourceforge.net/gtk-win/gtk2-runtime-2.24.8-2011-12-03-ash.exe?download) - make sure it gets appended to your PATH variable in windows.

8) Extract pkg-config.exe from pkg-config_0.xx-x_win32.zip to something like c:\tools\pkg-config.exe
9) Extract libusb to something like c:\tools\libusb-include (make sure (libusb-1.0.lib under \MS32\static AND the libusb.h under the \include\libusb-1.0 directory are there.)
10) Extract pthreads to something like c:\tools\pthreads-include (make sure the Pre-built.2\include dir and \lib\x86\pthreadVC2.lib are in there)

11) Run gitshell, Issue "git clone git://git.osmocom.org/rtl-sdr.git c:/rtl-sdr-src"  (or "git clone git://git.osmocom.org/rtl-sdr.git -b steve-m/direct_sampling c:/rtl-sdr-src" for the direct sampling branch)
13) Run Cmake-GUI
14) Set your cmake source to c:\rtl-sdr-src
15) Set your Cmake destination to something like c:\rtl-sdr-proj
16) Check 'advanced' on cmake
17) Set LIBUSB_INCLUDE_DIR to c:\tools\libusb-include\include\libusb-1.0\
18) Set LIBUSB_LIBRARIES to c:\tools\libusb-include\MS32\static\libusb-1.0.lib
19) Set THREADS_PTHREADS_INCLUDE_DIR to c:\tools\pthreads-include\Pre-built.2\include\
20) Set THREADS_PTHREADS_WIN32_LIBRARY to c:\tools\pthreads-include\Pre-built.2\lib\x86\pthreadVC2.lib
21) Set PKG_CONFIG_EXECUTABLE to c:\tools\pkg-config.exe
22) hit "configure" (if any libusb errors show up, just hit it again, it seems to need to cycle through to get everything)
23) hit "generate" - it should say 'generate successful' or the sort.
24) Open the rtlsdr ".sln" (solution) file in c:\rtl-sdr-proj.  Choose "Visual C++ 2010".
25) Under "rtlsdr_shared" -> "source files", edit "librtlsdr.c"
26) In the include section, add #include <windows.h>
27) Right before the 'void rtlsdr_set_gpio_bit(...)' function, and after struct e4k_state e4k_s; };  add this code:
 
/*---between these lines---*/
 
void usleep(int waitTime)
{
   __int64 time1 = 0, time2 = 0, freq=0;
 
 QueryPerformanceCounter((LARGE_INTEGER *) &time1);
 QueryPerformanceFrequency((LARGE_INTEGER *)&freq);

 do{
  QueryPerformanceCounter((LARGE_INTEGER *) &time2);
 }
while((time2-time1) < waitTime);
}
 
/*---between these lines---*/

28) Hit F7 to build
29) Your new rtlsdr.dll should build into c:/rtl-sdr-proj/src/debug (or RelWithDebInfo.) along with the rtl_tcp, rtl_sdr and rtl_test executables.
 
 
...Putting this into sdr# will allow you to run the R820T just fine. As of my test last night, as Adam noted, the direct-sampling branch doesnt work with R820T yet.
As Adam also indicated there, you should be able to rebase both the direct-sampling branches and master...
NOTE! Some of these steps may be redundant, but this is how I got it to go -- the 'rendundant' cds and checkouts, in my case, were to get git to recognize the branches.
 
1) Run GitShell
2) Issue the following in place of Step 11 above
 
$ git config --global user.email your...@address.com
$ git clone git://git.osmocom.org/rtl-sdr.git c:/rtl-sdr-src-merge
$ git clone git://git.osmocom.org/rtl-sdr.git -b steve-m/direct_sampling c:/rtl-sdr-src-dir
$ cd c:/rtl-sdr-src-dir
$ cd c:/rtl-sdr-src-merge
$ git checkout steve-m/direct_sampling
$ git checkout master
$ git rebase master steve-m/direct_sampling
Then do the above steps using c:/rtl-sdr-src-merge as the source.
 
Please let me know how this works!
 
-michi

voidxar

unread,
Sep 12, 2012, 12:22:26 PM9/12/12
to ultra-c...@googlegroups.com

Hi all,

Does which ebay seller is selling dongles with the R820T chip ? I would like to give this dongle a try.

Kelvin

darky

unread,
Sep 13, 2012, 4:36:49 AM9/13/12
to ultra-c...@googlegroups.com

Amogh Desai

unread,
Oct 28, 2012, 2:58:45 PM10/28/12
to ultra-c...@googlegroups.com
How can i use HDSDR with R820T dongle ??

Adam Nielsen

unread,
Oct 28, 2012, 6:06:49 PM10/28/12
to ultra-c...@googlegroups.com
> How can i use HDSDR with R820T dongle ??

Try downloading RelWithDebInfo.zip from here:

http://sdr.osmocom.org/trac/wiki/rtl-sdr

It's the last link at the end of the page. Unzip it into the HDSDR folder and
it should work.

Cheers,
Adam.



lH

unread,
Nov 16, 2012, 3:32:15 PM11/16/12
to ultra-c...@googlegroups.com
Hallo Michi
 
I have do so and have some questions.
 
First Question :
 
How can I do :Set LIBUSB_LIBRARIES to   ....: ??     can I make    a     Add Entry  ?
 
 
Ater Step 22 the Message:
 
The C compiler identification is unknown

Check for working C compiler: bcc32

CMake Error: your C compiler: "bcc32" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.

CMake Error: Internal CMake error, TryCompile configure of cmake failed

Check for working C compiler: bcc32 -- broken

CMake Error at C:/Program Files (x86)/  ....
 
 
 
 
Microsoftvisual studio 2012 is present. can I use it? 
- lutz

DJ0MY

unread,
Nov 20, 2012, 2:59:07 PM11/20/12
to ultra-c...@googlegroups.com
To my knowledge there is perhaps no new extio.dll yet for use with HDSDR and supportig R820...
(if someone knows an extio.dll with R820 support please post a link here)
 
You can only use the newest rtlsdr.dll from osmocom with R820 support in other SDR software such as SDR# which supports this dll...
 
This means that for R820 on a windows machine the only option is to use SDR#

Adam Nielsen

unread,
Nov 21, 2012, 2:54:07 AM11/21/12
to ultra-c...@googlegroups.com
> To my knowledge there is perhaps no new extio.dll yet for use with HDSDR
> and supportig R820...

Doesn't the Osmocom ExtIO support R820? It should be available from the
usual place on the Osmocom website.

Cheers,
Adam.

Arnie W8DU

unread,
Dec 13, 2012, 11:46:10 AM12/13/12
to ultra-c...@googlegroups.com
Wondering if you can tell me where to get the driver that supports a DVB-T with R820T tuner? I cannot get my dongle to be seen by any of the software, including SDR#, HDSDR or SDR-radio. 
Tnx...Arnie W8DU

Arnie W8DU

unread,
Dec 13, 2012, 11:46:49 AM12/13/12
to ultra-c...@googlegroups.com
I should have specified, this is for Windows XP.
Tnx...Arnie W8DU

David J Taylor

unread,
Dec 14, 2012, 2:07:01 AM12/14/12
to ultra-c...@googlegroups.com
Wondering if you can tell me where to get the driver that supports a DVB-T
with R820T tuner? I cannot get my dongle to be seen by any of the software,
including SDR#, HDSDR or SDR-radio.
Tnx...Arnie W8DU
========================================

Usually, software is supplied on the CD which comes with the stick, or you
can download from the manufacturer's Web site.

73,
David GM8ARV
--
SatSignal Software - Quality software written to your requirements
Web: http://www.satsignal.eu
Email: david-...@blueyonder.co.uk

jdow

unread,
Dec 14, 2012, 2:23:18 AM12/14/12
to ultra-c...@googlegroups.com
On 2012/12/13 23:07, David J Taylor wrote:
> Wondering if you can tell me where to get the driver that supports a DVB-T with
> R820T tuner? I cannot get my dongle to be seen by any of the software, including
> SDR#, HDSDR or SDR-radio.
> Tnx...Arnie W8DU
> ========================================
>
> Usually, software is supplied on the CD which comes with the stick, or you can
> download from the manufacturer's Web site.
>
> 73,
> David GM8ARV

Both dongles I received had DVB/FM software with them but no SDR software.

You may get hints from this site:
http://rtlsdr.org/softwarewindows

SDRSharp does have support for R820T. I've not read, yet, that HDSDR has
grown that support.

{^_^}

David J Taylor

unread,
Dec 14, 2012, 2:40:35 AM12/14/12
to ultra-c...@googlegroups.com
========================================

Yes, but the request was for DVB-T software, as I read it. Perhaps "a
DVB-T" meant the device and not receiving TV. So he should be OK with SDR#
for radio reception.

73,
David

jdow

unread,
Dec 14, 2012, 3:31:22 AM12/14/12
to ultra-c...@googlegroups.com
I was not sure if he really meant receive DVB with a dongle that has an
R820T or he meant receive with a DVB dongle that has an R820T. (That's
rephrasing his request the two possible ways of clarifying ambiguity.)

If it's the former, Win 7 will download it all too easily. If it's the
latter, SDRSharp works.

{^_-}
Reply all
Reply to author
Forward
0 new messages