Project

General

Profile

Dvb-t giving error DTV_CLEAR failed [e=Inappropriate ioctl for device]

Added by Oleg _ over 5 years ago

Version of TVHeadend?: HTS Tvheadend 4.2.8-27~g5c1b37b50
Running on what OS and version?: rockpro64 4.4.167-1211-rockchip-ayufan-gc0e6710e24fa
Package that came with the OS or something you compiled yourself?: Tried docker and "deb http://apt.tvheadend.org/stable raspbian-stretch main"
Adapter/tuner chipset or make/model?: USB Realtek Semiconductor Corp. RTL2838 DVB-T

Hello,
I am not sure how to troubleshoot below errors i am getting when creating new dvb-t network and trying to scan. I tried it in docker and installing locally from raspbian stretch repository but it is the same. What logs should i gather in order to find out where the problem is?

2019-06-17 13:47:33.193 mpegts: 570MHz in DVB-T Network - tuning on Realtek RTL2832 (DVB-T) #0 : DVB-T #0
2019-06-17 13:47:33.193 linuxdvb: Realtek RTL2832 (DVB-T) #0 : DVB-T #0 - DTV_CLEAR failed [e=Inappropriate ioctl for device]
2019-06-17 13:47:33.193 mpegts: 546MHz in DVB-T Network - tuning on Realtek RTL2832 (DVB-T) #0 : DVB-T #0
2019-06-17 13:47:33.194 linuxdvb: Realtek RTL2832 (DVB-T) #0 : DVB-T #0 - DTV_CLEAR failed [e=Inappropriate ioctl for device]

Below is the output of dmesg when connecting usb card.

[13562.188701] usb 1-1: new high-speed USB device number 3 using ehci-platform
[13562.354338] usb 1-1: New USB device found, idVendor=0bda, idProduct=2838
[13562.373025] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[13562.391678] usb 1-1: Product: RTL2838UHIDIR
[13562.399362] usb 1-1: Manufacturer: Realtek
[13562.404854] usb 1-1: SerialNumber: 00000001
[13562.420544] usb 1-1: dvb_usb_v2: found a 'Realtek RTL2832U reference design' in warm state
[13562.488875] usb 1-1: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[13562.494958] DVB: registering new adapter (Realtek RTL2832U reference design)
[13562.509327] i2c i2c-11: Added multiplexed i2c bus 12
[13562.514891] rtl2832 11-0010: Realtek RTL2832 successfully attached
[13562.520673] usb 1-1: DVB: registering adapter 0 frontend 0 (Realtek RTL2832 (DVB-T))...
[13562.527062] r820t 12-001a: creating new instance
[13562.544882] r820t 12-001a: Rafael Micro r820t successfully identified
[13562.554150] rtl2832_sdr rtl2832_sdr.11.auto: Registered as swradio0
[13562.559579] rtl2832_sdr rtl2832_sdr.11.auto: Realtek RTL2832 SDR attached
[13562.564900] rtl2832_sdr rtl2832_sdr.11.auto: SDR API is still slightly experimental and functionality changes may follow
[13562.582761] Registered IR keymap rc-empty
[13562.588370] rc rc0: Realtek RTL2832U reference design as /devices/platform/fe3c0000.usb/usb1/1-1/rc/rc0
[13562.594324] input: Realtek RTL2832U reference design as /devices/platform/fe3c0000.usb/usb1/1-1/rc/rc0/input5
[13562.601127] rc rc0: lirc_dev: driver dvb_usb_rtl28xxu registered at minor = 0, raw IR receiver, no transmitter
[13562.606987] usb 1-1: dvb_usb_v2: schedule remote query interval to 200 msecs
[13562.621152] usb 1-1: dvb_usb_v2: 'Realtek RTL2832U reference design' successfully initialized and connected


Replies (9)

RE: Dvb-t giving error DTV_CLEAR failed [e=Inappropriate ioctl for device] - Added by Oleg _ over 5 years ago

saen acro wrote:

Cheap software tuner
modinfo rtl2832_sdr

https://github.com/gat3way/r820tweak
https://github.com/ambrosa/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0

Thank you for your post with information. I am not really sure how should i approach it but i just tried to follow instructions on how to install things and failed at both of them. Would you be able to let me know what is the overall idea of both of those, if i understand correctly i need to install kernel module first and use r820tweak to fine tune settings?

Below is modinfo rtl2832_sdr output

root@rockpro64:~# modinfo rtl2832_sdr
filename:       /lib/modules/4.4.167-1211-rockchip-ayufan-gc0e6710e24fa/kernel/drivers/media/dvb-frontends/rtl2832_sdr.ko
license:        GPL
description:    Realtek RTL2832 SDR driver
author:         Antti Palosaari <[email protected]>
depends:
intree:         Y
vermagic:       4.4.167-1211-rockchip-ayufan-gc0e6710e24fa SMP mod_unload aarch64
parm:           emulated_formats:enable emulated formats (disappears in future) (bool)

I was not able to make module i got below errors after executing make.

make -C /usr/src/linux-headers-`uname -r` SUBDIRS=/root/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0 modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.167-1211-rockchip-ayufan-gc0e6710e24fa'
  CC [M]  /root/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.o
gcc: error: unrecognized command line option '-mgeneral-regs-only'
gcc: error: unrecognized command line option '-mcmodel=large'
scripts/Makefile.build:277: recipe for target '/root/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.o' failed
make[2]: *** [/root/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.o] Error 1
Makefile:1479: recipe for target '_module_/root/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0' failed
make[1]: *** [_module_/root/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.167-1211-rockchip-ayufan-gc0e6710e24fa'
Makefile:41: recipe for target 'default' failed
make: *** [default] Error 2

I tried to make r820 tweak and got below error

root@rockpro64:~/r820tweak# make
gcc -fPIC -Wall -O2 -g -Iinclude -I/usr/include/libusb-1.0 -I/usr/include/libusb-1.1   -c -o src/librtlsdr.o src/librtlsdr.c
src/librtlsdr.c:30:20: fatal error: libusb.h: No such file or directory
 #include <libusb.h>
                    ^
compilation terminated.
<builtin>: recipe for target 'src/librtlsdr.o' failed
make: *** [src/librtlsdr.o] Error 1

RE: Dvb-t giving error DTV_CLEAR failed [e=Inappropriate ioctl for device] - Added by Oleg _ over 5 years ago

saen acro wrote:

http://palosaari.fi/linux/
happy reading

I read the website good few times and i am not sure what to take from it. Please correct me if i am wrong but i identified that my device "0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T" that uses RTL2382U reference design and that it was implemented on kernel 3.7, it mentions that it can be integrated in older kernels but nothing about newer kernels as i believe kernel i have is 4.4.

Any advice where should i go from here?

RE: Dvb-t giving error DTV_CLEAR failed [e=Inappropriate ioctl for device] - Added by saen acro over 5 years ago

You have non X86 kernel
4.4.167-1211-rockchip
maby weak support of media tree

RE: Dvb-t giving error DTV_CLEAR failed [e=Inappropriate ioctl for device] - Added by Oleg _ over 5 years ago

saen acro wrote:

You have non X86 kernel
4.4.167-1211-rockchip
maby weak support of media tree

Yes it is a rockpro64 arm cpu. This card worked in older release partially with tvheadened, i could watch live streams in vlc without problems but i was getting freezes when playing in kodi. But i have to use this newer release as in older i was getting problems with pcie sata controller and my hard drives.
What are my options, how to tackle this problem? Do i need to try to update driver somehow? Is it possible to identify which library is missing or causing problems?

RE: Dvb-t giving error DTV_CLEAR failed [e=Inappropriate ioctl for device] - Added by saen acro over 5 years ago

Update driver or kernel, change distro,
or take other tuner :D

RE: Dvb-t giving error DTV_CLEAR failed [e=Inappropriate ioctl for device] - Added by Oleg _ over 5 years ago

saen acro wrote:

Update driver or kernel, change distro,
or take other tuner :D

Thank you for clarification. I am not able to change distro purely for the reason it is openmediavault nas and i spent a lot of time familiarizing with it and configuring it in vm on old esxi box.
Updating driver i assume using provided url https://github.com/ambrosa/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0 ?
What tuner would you think is most likely to work with arm cpu and tvheadend well and support DVB-T/MPEG-4?

RE: Dvb-t giving error DTV_CLEAR failed [e=Inappropriate ioctl for device] - Added by Oleg _ about 5 years ago

Just an update as i forgot completely about it and wasn't using this tuner. It is working now with below image and tv headend version in case anyone is looking for this.

I have upgraded rockpro64 image with stretch-openmediavault-rockpro64-0.8.3-1141-arm64.img, uname -r shows 4.4.167-1213-rockchip-ayufan-g34ae07687fce and using linuxserver/tvheadend docker with "release-4.2" tag, tvheadend version HTS Tvheadend 4.2.8-31~g0a60f73ee.

root@mynas:~# modinfo rtl2832_sdr
filename:       /lib/modules/4.4.167-1213-rockchip-ayufan-g34ae07687fce/kernel/drivers/media/dvb-frontends/rtl2832_sdr.ko
license:        GPL
description:    Realtek RTL2832 SDR driver
author:         Antti Palosaari <[email protected]>
depends:
intree:         Y
vermagic:       4.4.167-1213-rockchip-ayufan-g34ae07687fce SMP mod_unload aarch64
parm:           emulated_formats:enable emulated formats (disappears in future) (bool)

    (1-9/9)