Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Using an RTL2838 (AKA RTL2832) as SDR and DVB?

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
ab1jx
Posts: 111
Joined: 2016-01-23 21:28
Location: Heath, MA, USA
Has thanked: 2 times
Contact:

Using an RTL2838 (AKA RTL2832) as SDR and DVB?

#1 Post by ab1jx »

I've got a couple of these $20 dongles around that I bought to use for SDR (Software Defined Radio) and they work reasonably well for that. But they were originally designed as a DVB for television reception so I'd like to be able to use one for that once in a while. The problem is that DVB use involves kernel-level modules as drivers, which then conflict with the SDR stuff. So I'm guessing the simplest to use thing would be write scripts which blacklist and unblacklist the DVB stuff. So you'd run the unblacklist script, reboot before doing DVB, then do the reverse for SDR. SDR (rtl-* and Gnuradio) doesn't need kernel modules to run.

Once I set up DVB under Linux (different DVB) and used it with Myth-TV, but that was at least 8 years ago. I'm much more familiar with SDR. And I'm not that interested in watching TV anyway, I'd like to be able to get the program guide data mostly. I've got 2 dongles and a Pi and an amd64 machine running Debian to play with. I remember that setting up DVB breaks SDR so I'd like a way to switch back and forth.

User avatar
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: Using an RTL2838 (AKA RTL2832) as SDR and DVB?

#2 Post by ralph.ronnquist »

You might consider using virtual machines for the alternative dongle control modes. Especially if the control mode competition is merely down to software choice. Though I'd guess the actual dongle(s) also get tied to the one or the other mode, so you'd have to run the VM's exclusively.

ab1jx
Posts: 111
Joined: 2016-01-23 21:28
Location: Heath, MA, USA
Has thanked: 2 times
Contact:

Re: Using an RTL2838 (AKA RTL2832) as SDR and DVB?

#3 Post by ab1jx »

I've never tried virtual machines, I suspect they're not terribly efficient. But it brings another idea to mind: Use a Raspberry Pi and keep 2 different SD cards set up for the 2 purposes, it's like swappable hard drives. Or maybe something better like the ODROID-C2.

ab1jx
Posts: 111
Joined: 2016-01-23 21:28
Location: Heath, MA, USA
Has thanked: 2 times
Contact:

Re: Using an RTL2838 (AKA RTL2832) as SDR and DVB?

#4 Post by ab1jx »

Well, like I said, I'm no expert on DVB. I followed the instructions at https://www.linuxtv.org/wiki/index.php/ ... ce_Drivers

And I now have modules. But the rtl2832 one doesn't load on boot. I can modprobe it and see:

Code: Select all

lsmod | grep 2832
rtl2832                11267  0 
dvb_core               85021  1 rtl2832
i2c_mux                 2457  1 rtl2832
But there's also no /dev/dvb or /dev/v4l anything, and femon finds nothing.

User avatar
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: Using an RTL2838 (AKA RTL2832) as SDR and DVB?

#5 Post by ralph.ronnquist »

I'm as far from expert on this, but my TV is a laptop with four USB DVB dogles that label themselves as "Leadtek WinFast DTV Dongle Gold". The laptop has the foreign OS labelling itself "Ubuntu 12.04.5 LTS", but I'd say it's near enough to Debian for being somewhat relevant.

Anyhow, for reasons unknown, adding the dongles automagically triggers loading of (standard) modules rc_leadtek_y04g0051, rc_core, dvb_core, dvb_usb, and dvb_usb_af9015 plus a fair few IR related ones. I could't easily find the associated udev rules, so I don't know why. But it's Ubuntu rather than Debian anyhow. If I have time I'll dig deeper.

You might have some luck adding modules manually.

ab1jx
Posts: 111
Joined: 2016-01-23 21:28
Location: Heath, MA, USA
Has thanked: 2 times
Contact:

Re: Using an RTL2838 (AKA RTL2832) as SDR and DVB?

#6 Post by ab1jx »

I put doing this on my Pi on hold for a little while and I'm trying it on my HP laptop (AMD64). Trying to build the modules from linuxtv.org I run into what looks like a missing header but I have no idea what, or why this works on the Pi. So on the Pi last night I did:

Code: Select all

cd /
grep -r AUDIO_DMA_SIZE_MIN . &> /tmp/headr.txt
Where AUDIO_DMA_SIZE_MIN is a macro that's defined somewhere on the Pi but not on the HP. I'm still waiting more than 12 hours later. I reniced it to -5 this morning and I have a tail -f running on headr.txt that is showing output, but it rarely shows up in Top. Google doesn't find AUDIO_DMA_SIZE_MIN either.

This is my stream of error messages, there are a few macros not getting defined. If anybody recognizes them and can tell me what's missing it would help.

Code: Select all

  CC [M]  /usr/src/misc/dvb/media_build/v4l/tw68-risc.o
  CC [M]  /usr/src/misc/dvb/media_build/v4l/tw686x-core.o
  CC [M]  /usr/src/misc/dvb/media_build/v4l/tw686x-video.o
  CC [M]  /usr/src/misc/dvb/media_build/v4l/tw686x-audio.o
In file included from /usr/src/misc/dvb/media_build/v4l/tw686x-audio.c:30:0:
/usr/src/misc/dvb/media_build/v4l/tw686x-regs.h:110:28: error: 'SZ_4K' undeclared here (not in a function)
 #define AUDIO_DMA_SIZE_MAX SZ_4K
                            ^
/usr/src/misc/dvb/media_build/v4l/tw686x-audio.c:111:46: note: in expansion of macro 'AUDIO_DMA_SIZE_MAX'
  .buffer_bytes_max = TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX,
                                              ^
/usr/src/misc/dvb/media_build/v4l/tw686x-regs.h:109:28: error: 'SZ_512' undeclared here (not in a function)
 #define AUDIO_DMA_SIZE_MIN SZ_512
                            ^
/usr/src/misc/dvb/media_build/v4l/tw686x-audio.c:112:22: note: in expansion of macro 'AUDIO_DMA_SIZE_MIN'
  .period_bytes_min = AUDIO_DMA_SIZE_MIN,
                      ^
/usr/src/misc/dvb/media_build/v4l/tw686x-audio.c: In function 'tw686x_pcm_prepare':
/usr/src/misc/dvb/media_build/v4l/tw686x-regs.h:111:30: error: 'SZ_8K' undeclared (first use in this function)
 #define AUDIO_DMA_SIZE_MASK (SZ_8K - 1)
                              ^
/usr/src/misc/dvb/media_build/v4l/tw686x-audio.c:181:12: note: in expansion of macro 'AUDIO_DMA_SIZE_MASK'
   reg &= ~(AUDIO_DMA_SIZE_MASK << AUDIO_DMA_SIZE_SHIFT);
            ^
/usr/src/misc/dvb/media_build/v4l/tw686x-regs.h:111:30: note: each undeclared identifier is reported only once for each function it appears in
 #define AUDIO_DMA_SIZE_MASK (SZ_8K - 1)
                              ^
/usr/src/misc/dvb/media_build/v4l/tw686x-audio.c:181:12: note: in expansion of macro 'AUDIO_DMA_SIZE_MASK'
   reg &= ~(AUDIO_DMA_SIZE_MASK << AUDIO_DMA_SIZE_SHIFT);
            ^
/usr/src/misc/dvb/media_build/v4l/tw686x-audio.c: In function 'tw686x_snd_pcm_init':
/usr/src/misc/dvb/media_build/v4l/tw686x-audio.c:309:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/usr/src/linux-headers-3.16.0-4-common/scripts/Makefile.build:262: recipe for target '/usr/src/misc/dvb/media_build/v4l/tw686x-audio.o' failed
make[5]: *** [/usr/src/misc/dvb/media_build/v4l/tw686x-audio.o] Error 1
/usr/src/linux-headers-3.16.0-4-common/Makefile:1352: recipe for target '_module_/usr/src/misc/dvb/media_build/v4l' failed
make[4]: *** [_module_/usr/src/misc/dvb/media_build/v4l] Error 2
Makefile:181: recipe for target 'sub-make' failed
make[3]: *** [sub-make] Error 2
Makefile:8: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-3.16.0-4-amd64'
Makefile:51: recipe for target 'default' failed
make[1]: *** [default] Error 2
make[1]: Leaving directory '/usr/src/misc/dvb/media_build/v4l'
Makefile:26: recipe for target 'all' failed
make: *** [all] Error 2
build failed at ./build line 491.
Well, earlier in the error message it says this:

Code: Select all

WARNING: This is the V4L/DVB backport tree, with experimental drivers
	 backported to run on legacy kernels from the development tree at:
		http://git.linuxtv.org/media-tree.git.
	 It is generally safe to use it for testing a new driver or
	 feature, but its usage on production environments is risky.
	 Don't use it in production. You've been warned.
V4L2_FLASH_LED_CLASS: Requires at least kernel 3.18.0
VIDEO_XILINX: Requires at least kernel 3.17.0
I2C_SI4713: Requires at least kernel 3.17.0
VIDEO_ADV7604: Requires at least kernel 3.17.0
VIDEO_TC358743: Requires at least kernel 3.17.0
VIDEO_TVP5150: Requires at least kernel 3.17.0
VIDEO_MT9P031: Requires at least kernel 3.17.0
VIDEO_MT9V032: Requires at least kernel 3.19.0
VIDEO_SMIAPP: Requires at least kernel 4.0.0
VIDEO_ADP1653: Requires at least kernel 3.17.0
SOC_CAMERA_OV2640: Requires at least kernel 3.17.0
And I'm running Linux hp 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux, my Pi is
Linux raspberrypi 4.4.13-v7+ #894 SMP Mon Jun 13 13:13:27 BST 2016 armv7l GNU/Linux

But come on, I'm trying to build driver modules for a device that's over 5 years old, why is this impossible?

Post Reply