Linux USB tuner sticks not seen in TVheadend
#1
Good evening everyone,

I installed Kody 17.6 on a new Ubuntu 18.04 virtual machine. This VM is running on a HP Gen10 microserver. I have two USB tuner sticks plugged into the Microserver but TVheadend does not see them. One of them is meant for DVB-C, the other one for DVB-T (French and Belgian DVB-T so no DVB-T2)

The command "rtl_test" gives this result :

wile-e@tnt-cable-vm:~$ rtl_test
Found 2 device(s):
  0:  astrometadvbt2, dvbt2, SN:
  1:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Astrometa DVB-T/DVB-T2
Detached kernel driver
Found Rafael Micro R828D tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
[R82XX] PLL not locked!
Sampling at 2048000 S/s.


When I go in 192.168.0.3:9981, I see no adapter under Configuration > DVB Inputs > TV Adapters as described in this tutorial at step 2.

Can anyone advise on what to do next? Is it a driver problem? A missing add-on?

Thanks,
wile-e
Reply
#2
Have you tried to download the matching Firmware and copied it to the Systems Firmware folder (e.g. /var/lib/firmware)?
Reply
#3
Don't think that usb stick needs any firmware. @wile_e check the output of dmesg after a fresh boot of your VM with the stick plugged in and make sure it's getting picked up and identified correctly.  See here and here .
Learning Linux the hard way !!
Reply
#4
Thanks for the replies. I had a look at these links and I now have this :
[   31.340088] usb 1-2.1: dvb_usb_v2: schedule remote query interval to 200 msecs
[   31.384280] usb 1-2.1: dvb_usb_v2: 'Realtek RTL2832U reference design' successfully initialized and connected
[   31.387031] usb 1-2.2: dvb_usb_v2: found a 'Astrometa DVB-T2' in warm state
[   32.309455] usb 1-2.2: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[   32.309474] dvbdev: DVB: registering new adapter (Astrometa DVB-T2)
...
[   32.424194] usb 1-2.2: dvb_usb_v2: schedule remote query interval to 200 msecs
[   32.465452] usb 1-2.2: dvb_usb_v2: 'Astrometa DVB-T2' successfully initialized and connected
...
wile-e@tnt-cable-vm:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 15f4:0131 HanfTek
Bus 001 Device 005: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
Bus 001 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 001 Device 004: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 001 Device 002: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

A 'lsusb -s 1:5 -v command gives several product information and seems OK.

When going back to 192.168.0.3:9981, I now see the two TV adapters under Configuration > DVB Inputs > DVB Adapters. Both have the name 'Realtek RTL 2832'. Is it right so far? Can I scan for channels (how?)? Or is there something else to configure?

Sorry if these may be basic questions but this is my first implementation of Kodi.

Thanks,
wile-e
Reply
#5
Yeah, that looks right. You need to go (in TVH) to configuration -> dvb inputs -> networks and add a network (dvb-t).  Then go to dvb inputs -> tv adapters and click on the tuner underneath the bit that says /dev/dvb/adapter0.  You'll get a box on the right where you can rename the tuner etc.  What you need to do is click on 'networks' and select the network you just created.  Make sure 'enabled' is ticked at the top and tick ( if they aren't already) initial scan and idle scan.  Save that.

I think at this point tvh will start scanning but if not, go back to the networks tab, click on the network to select it and then click force scan.  Once the scan is finished, you need to go to the services tab and click on map services, map all services.

Now you should have a list of channels under 'channel/EPG'.  Basic setup is now done.
Learning Linux the hard way !!
Reply
#6
No, this is not working.
I have this 'Parameters' Box with the 'Basic Settings' where I renamed the adapter 'Realtek RTL2832 (DVB-T) #0 : DVB-T #0' into 'TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0'
In 'Networks', I created a 'TNT' network with 'France : fr-All' as Pre-defined muxes, Disable for 'Network discovery' and UTF-8 as 'Character Set'.
In 'PArameters' again, the DVB adapter is linked to the 'TNT' Network'.
When I 'Force scan', the Scan queue' goes up to 40 and then slowly down to 0 but he number of Services remains 0.
For the test, it has only one DVB adapter connected, the one for DVB-T. Signal is present as this cable was formerly at the rear of the TV with all channels available on the TV.
Reply
#7
Does it work if you set 'Network Discovery' to 'New muxes and changed muxes' and 'character set' to 'AUTO' ?

Also, in the bottom right of the TVH window there is a chevron (two ^, one on top of the other).  If you click that, after a second or two the window will expand to show the TVH log.  If you do your scan with that window open, you should be able to see TVH tuning to each mux in turn.

I get this sort of thing when TVH is idle scanning.
Code:
2018-10-01 08:35:37.839 subscription: 1259: "scan" subscribing to mux "11778V", weight: 2, adapter: "Freesat Tuner 1", network: "DVB-S Network", service: "Raw PID Subscription"
2018-10-01 08:35:37.839 mpegts: 11126.5V in DVB-S Network - tuning on Freesat Tuner 2
2018-10-01 08:35:37.901 subscription: 125A: "scan" subscribing to mux "11126.5V", weight: 2, adapter: "Freesat Tuner 2", network: "DVB-S Network", service: "Raw PID Subscription"

At the very least, if there are any errors in that window, it may indicate what is going on.
Learning Linux the hard way !!
Reply
#8
Hi,
I have following parameters :
Network name : TNT
Pre-defined muxes : 'empty' (was not kept in memory since yesterday)
Provider network name : TNT
Network ID : 0
Network discovery : new muxes only (as you advised)
Ignore provider"s channel numbers : not selected
SAT>IP source number : 0
Character set : AUTO (as you advised)
Skip startup scan : not selected
Idle scan muxes : not selected
USe service IDs as channel numbers : not selected
EIT time offset : UTC+1

Frequencies where programs are available : 474, 490, 498, 514, 522 & 546 Mhz.

The log :

2018-10-01 22:18:52.998 mpegts: 642MHz in TNT - tuning on TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0
2018-10-01 22:18:52.999 subscription: 0125: "scan" subscribing to mux "642MHz", weight: 6, adapter: "TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0", network: "TNT", service: "Raw PID Subscription"
2018-10-01 22:18:53.759 linuxdvb: Unable to provide UNC value.
2018-10-01 22:18:57.998 mpegts: 642MHz in TNT - scan no data, failed
2018-10-01 22:18:57.998 subscription: 0125: "scan" unsubscribing
2018-10-01 22:18:57.999 mpegts: 786MHz in TNT - tuning on TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0
2018-10-01 22:18:57.999 subscription: 0127: "scan" subscribing to mux "786MHz", weight: 6, adapter: "TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0", network: "TNT", service: "Raw PID Subscription"
2018-10-01 22:19:03.001 mpegts: 786MHz in TNT - scan no data, failed
2018-10-01 22:19:03.001 subscription: 0127: "scan" unsubscribing
2018-10-01 22:19:03.002 mpegts: 666MHz in TNT - tuning on TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0
2018-10-01 22:19:03.003 subscription: 0129: "scan" subscribing to mux "666MHz", weight: 6, adapter: "TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0", network: "TNT", service: "Raw PID Subscription"
2018-10-01 22:19:08.001 mpegts: 666MHz in TNT - scan no data, failed
2018-10-01 22:19:08.002 subscription: 0129: "scan" unsubscribing
2018-10-01 22:19:08.002 mpegts: 578MHz in TNT - tuning on TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0
2018-10-01 22:19:08.002 subscription: 012B: "scan" subscribing to mux "578MHz", weight: 6, adapter: "TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0", network: "TNT", service: "Raw PID Subscription"
2018-10-01 22:19:13.002 mpegts: 578MHz in TNT - scan no data, failed
2018-10-01 22:19:13.002 subscription: 012B: "scan" unsubscribing
2018-10-01 22:19:13.002 mpegts: 546MHz in TNT - tuning on TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0
2018-10-01 22:19:13.002 subscription: 012D: "scan" subscribing to mux "546MHz", weight: 6, adapter: "TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0", network: "TNT", service: "Raw PID Subscription"
2018-10-01 22:19:18.002 mpegts: 546MHz in TNT - scan no data, failed
2018-10-01 22:19:18.002 subscription: 012D: "scan" unsubscribing
2018-10-01 22:19:18.002 mpegts: 498MHz in TNT - tuning on TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0
2018-10-01 22:19:18.002 subscription: 012F: "scan" subscribing to mux "498MHz", weight: 6, adapter: "TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0", network: "TNT", service: "Raw PID Subscription"
2018-10-01 22:19:23.002 mpegts: 498MHz in TNT - scan no data, failed
2018-10-01 22:19:23.002 subscription: 012F: "scan" unsubscribing
2018-10-01 22:19:23.003 mpegts: 570MHz in TNT - tuning on TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0
2018-10-01 22:19:23.003 subscription: 0131: "scan" subscribing to mux "570MHz", weight: 6, adapter: "TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0", network: "TNT", service: "Raw PID Subscription"
2018-10-01 22:19:28.003 mpegts: 570MHz in TNT - scan no data, failed
2018-10-01 22:19:28.003 subscription: 0131: "scan" unsubscribing
2018-10-01 22:19:28.003 mpegts: 738MHz in TNT - tuning on TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0
2018-10-01 22:19:28.003 subscription: 0133: "scan" subscribing to mux "738MHz", weight: 6, adapter: "TNTRealtek RTL2832 (DVB-T) #0 : DVB-T #0", network: "TNT", service: "Raw PID Subscription"
...
Reply
#9
Could be a missing driver Sad

Can you, unplug the stick, wait a second or two, plug it back in and grab the tail end of dmesg, showing it getting detected and set up.  Your dmesg output before was snipped I believe as I don't see the tuner identified there, just the demod and the usb bridge.
Learning Linux the hard way !!
Reply
#10
Here is the output of dmesg

[   59.283643] usb 1-2.1: DVB: adapter 0 frontend 0 frequency 0 out of range (174000000..862000000)
[16164.167278] rfkill: input handler disabled
[66556.311057] r820t 1-003a: r820t_write: i2c wr failed=-11 reg=1d len=1: dd
[153969.258745] r820t 1-003a: r820t_write: i2c wr failed=-11 reg=0d len=1: 53
[184296.741271] usb 1-2.1: USB disconnect, device number 5
[184296.785671] r820t 1-003a: r820t_write: i2c wr failed=-19 reg=06 len=1: b1
[184296.786903] r820t 1-003a: destroying instance
[184296.787450] dvb_usb_v2: 'Astrometa DVB-T2:1-2.1' successfully deinitialized and disconnected
[184552.032371] usb 1-2.1: new high-speed USB device number 6 using xhci_hcd
[184552.576899] usb 1-2.1: New USB device found, idVendor=15f4, idProduct=0131
[184552.576903] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[184552.576905] usb 1-2.1: Product: dvbt2
[184552.576906] usb 1-2.1: Manufacturer: astrometadvbt2
[184552.617386] usb 1-2.1: dvb_usb_v2: found a 'Astrometa DVB-T2' in warm state
[184553.267875] usb 1-2.1: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[184553.267892] dvbdev: DVB: registering new adapter (Astrometa DVB-T2)
[184553.272696] i2c i2c-0: Added multiplexed i2c bus 1
[184553.272699] rtl2832 0-0010: Realtek RTL2832 successfully attached
[184553.272716] usb 1-2.1: DVB: registering adapter 0 frontend 0 (Realtek RTL2832 (DVB-T))...
[184553.272779] r820t 1-003a: creating new instance
[184553.283509] r820t 1-003a: Rafael Micro r820t successfully identified
[184553.285310] rtl2832_sdr rtl2832_sdr.0.auto: Registered as swradio0
[184553.285313] rtl2832_sdr rtl2832_sdr.0.auto: Realtek RTL2832 SDR attached
[184553.285315] rtl2832_sdr rtl2832_sdr.0.auto: SDR API is still slightly experimental and functionality changes may follow
[184553.302388] Registered IR keymap rc-empty
[184553.302472] rc rc0: Astrometa DVB-T2 as /devices/pci0000:00/0000:00:15.0/0000:03:00.0/usb1/1-2/1-2.1/rc/rc0
[184553.302513] input: Astrometa DVB-T2 as /devices/pci0000:00/0000:00:15.0/0000:03:00.0/usb1/1-2/1-2.1/rc/rc0/input8
[184553.302993] lirc lirc0: lirc_dev: driver ir-lirc-codec (dvb_usb_rtl28xxu) registered at minor = 0
[184553.302998] usb 1-2.1: dvb_usb_v2: schedule remote query interval to 200 msecs
[184553.318357] usb 1-2.1: dvb_usb_v2: 'Astrometa DVB-T2' successfully initialized and connected
[184559.479862] usb 1-2.1: DVB: adapter 0 frontend 0 frequency 0 out of range (174000000..862000000)
wile-e@tnt-cable-vm:~$

EDIT :
I did nothing inbetween. Just 'forced scan' again. I now get 23 channels 'discovered' from 3 different frequencies : 11 French TV channels and 12 Flemish radios and TV channels.
I get a bad signal for the Flemish (that's normal as the antenna is not in that direction) and no image at all for the French channels (although the antenna is in that direction and that I get a quite strong signal when connected to the TV). Also, I do not get all the muxes from France.
EPG is received for all the 23 channels.
Reply
#11
Rafael Micro r820t successfully identified is linux identifying the tuner, but.... there is no driver installed for it.  Makes me wonder if your stick has the Sony CXD2837ER demod in it.  If so, there IS a patch for the linux_media drivers but it has never been merged afaict.

The patch is https://patchwork.linuxtv.org/patch/20565/   The only commit I can find referencing that chip (https://git.linuxtv.org/media_tree.git/c...9182e80456 ) uses a different interface.  Reason I suspect this may be your issue - https://tvheadend.org/boards/4/topics/32993
Learning Linux the hard way !!
Reply
#12
Sorry, but it seems to me you're using rtl_sdr drivers. You have to use normal media_build drivers, otherwise tvheadend can't see the tuner.
Bye,
sdf
Reply
#13
@BlackEagle
How do I apply the patch?

@
I tried to apply 'media_build' but the process doesn't go to the end. Here is an overview of the error messages

wile-e@tnt-cable-vm:~/media_build$ ./build

If you are experiencing problems building the v4l-dvb tree, please try
building against a vanilla kernel before reporting a bug.

Vanilla kernels are available at http://kernel.org.
On most distros, this will compile a newly downloaded kernel:

cp /boot/config-`uname -r` <your kernel dir>/.config
cd <your kernel dir>
make all modules_install install

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.
VIDEO_CROS_EC_CEC: Requires at least kernel 4.19.0
VIDEO_DW9714: Requires at least kernel 9.255.255
VIDEO_I2C: Requires at least kernel 4.16.0

  CC [M]  /home/wile-e/media_build/v4l/ov772x.o
/home/wile-e/media_build/v4l/ov772x.c: In function 'ov772x_probe':
/home/wile-e/media_build/v4l/ov772x.c:1372:17: error: implicit declaration of function 'devm_regmap_init_sccb'; did you mean 'devm_regmap_init_ac97'? [-Werror=implicit-function-declaration]
  priv->regmap = devm_regmap_init_sccb(client, &ov772x_regmap_config);
                 ^~~~~~~~~~~~~~~~~~~~~
                 devm_regmap_init_ac97
/home/wile-e/media_build/v4l/ov772x.c:1372:15: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  priv->regmap = devm_regmap_init_sccb(client, &ov772x_regmap_config);
               ^
cc1: some warnings being treated as errors
scripts/Makefile.build:339: recipe for target '/home/wile-e/media_build/v4l/ov772x.o' failed
make[3]: *** [/home/wile-e/media_build/v4l/ov772x.o] Error 1
Makefile:1552: recipe for target '_module_/home/wile-e/media_build/v4l' failed
make[2]: *** [_module_/home/wile-e/media_build/v4l] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-4.15.0-34-generic'
Makefile:51: recipe for target 'default' failed
make[1]: *** [default] Error 2
make[1] : on quitte le répertoire « /home/wile-e/media_build/v4l »
Makefile:26: recipe for target 'all' failed
make: *** [all] Error 2
build failed at ./build line 526

W: Le fichier configuré « stable-4.2/i18n/Translation-en » ne sera pas pris en compte car le dépôt « https://dl.bintray.com/tvheadend/deb xenial InRelease » ne dispose pas de la source « stable-4.2 » (erreur de saisie dans sources.list ?)
W: Le fichier configuré « stable-4.2/i18n/Translation-fr_LU » ne sera pas pris en compte car le dépôt « https://dl.bintray.com/tvheadend/deb xenial InRelease » ne dispose pas de la source « stable-4.2 » (erreur de saisie dans sources.list ?)
W: Le fichier configuré « stable-4.2/i18n/Translation-fr » ne sera pas pris en compte car le dépôt « https://dl.bintray.com/tvheadend/deb xenial InRelease » ne dispose pas de la source « stable-4.2 » (erreur de saisie dans sources.list ?)
W: Le fichier configuré « stable-4.2/dep11/Components-amd64.yml » ne sera pas pris en compte car le dépôt « https://dl.bintray.com/tvheadend/deb xenial InRelease » ne dispose pas de la source « stable-4.2 » (erreur de saisie dans sources.list ?)
W: Le fichier configuré « stable-4.2/dep11/icons-48x48.tar » ne sera pas pris en compte car le dépôt « https://dl.bintray.com/tvheadend/deb xenial InRelease » ne dispose pas de la source « stable-4.2 » (erreur de saisie dans sources.list ?)
W: Le fichier configuré « stable-4.2/dep11/icons-64x64.tar » ne sera pas pris en compte car le dépôt « https://dl.bintray.com/tvheadend/deb xenial InRelease » ne dispose pas de la source « stable-4.2 » (erreur de saisie dans sources.list ?)
W: Le fichier configuré « stable-4.2/cnf/Commands-amd64 » ne sera pas pris en compte car le dépôt « https://dl.bintray.com/tvheadend/deb xenial InRelease » ne dispose pas de la source « stable-4.2 » (erreur de saisie dans sources.list ?)

Préparation du dépaquetage de .../22-kodi_2%3a17.6+git20180430.1623-final-0bionic_all.deb ...
Dépaquetage de kodi (2:17.6+git20180430.1623-final-0bionic) sur (2:17.6+dfsg1-1ubuntu1) ...
dpkg: erreur de traitement de l'archive /tmp/apt-dpkg-install-0nHY0J/22-kodi_2%3a17.6+git20180430.1623-final-0bionic_all.deb (--unpack) :
 tentative de remplacement de « /usr/share/icons/hicolor/128x128/apps/kodi.png », qui appartient aussi au paquet kodi-data 2:17.6+dfsg1-1ubuntu1
dpkg-deb: erreur: coller subprocess was killed by signal (Relais brisé (pipe))
kodi.service is a disabled or a static unit not running, not starting it.
Préparation du dépaquetage de .../23-kodi-bin_2%3a17.6+git20180430.1623-final-0bionic_amd64.deb ...
Dépaquetage de kodi-bin (2:17.6+git20180430.1623-final-0bionic) sur (2:17.6+dfsg1-1ubuntu1) ...
dpkg: erreur de traitement de l'archive /tmp/apt-dpkg-install-0nHY0J/23-kodi-bin_2%3a17.6+git20180430.1623-final-0bionic_amd64.deb (--unpack) :
 tentative de remplacement de « /usr/bin/kodi », qui appartient aussi au paquet kodi 2:17.6+dfsg1-1ubuntu1
dpkg-deb: erreur: coller subprocess was killed by signal (Relais brisé (pipe))

Des erreurs ont été rencontrées pendant l'exécution :
 /tmp/apt-dpkg-install-0nHY0J/22-kodi_2%3a17.6+git20180430.1623-final-0bionic_all.deb
 /tmp/apt-dpkg-install-0nHY0J/23-kodi-bin_2%3a17.6+git20180430.1623-final-0bionic_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have updated the kernel to v4.17.8 and installed libelf-dev but I don't any firther than that.
Reply
#14
HI

Kernel 5.0 already supports Sony CXD2837ER, when I use Kaffeine I can watch dvb-t2 channels on frontend1.

Buy in TVH still can't load Sony CXD2837ER, what could be the problem?
Reply

Logout Mark Read Team Forum Stats Members Help
USB tuner sticks not seen in TVheadend0