DVB-T with the Rok DVB-T 1 Receiver USB stick Marcus Lange (marcus (at) lug-norderstedt.de) v1.2 July, 01st 2007 Command lines and output with different font type v1.1 April, 14th, 2007 fixed some typos, translation into German v1.0 March, 02nd, 2007 initial documentation How to get the Rok DVB-T 1 Receiver USB stick working with Linux Table of Contents 1 About this documentation 2 2 Prerequisites 2 2.1 What is described here? 2 2.2 What is not described? 2 3 Needed components 2 3.1 Hardware 2 3.2 Software 3 4 Setup the DVB-T stick 3 4.1 Is it recognized? 3 4.2 Install the firmware 5 4.3 Load the kernel module 5 4.4 Make it permanent 6 5 Setup the TV channels 6 5.1 Which TV channels can be received? 6 5.2 The pre-defined channels cannot be used 6 5.3 Create an own channel file 7 6 Is it already working? 8 7 Trouble-shooting 8 7.1 What commands/files are useful for checking things? 8 7.2 The device is connected but the LED is not orange 9 7.3 The stick is recognized (orange LED) but Mplayer shows black windows 9 7.4 Mplayer said that the DVB-T devices are not accessible 9 7.5 The devices files are not existing. How to create them? 10 7.6 How to get rid of these typical MPEG artefacts and/or sound interruptions? 10 7.7 The quality of the TV picture/sound is not satisfying. What to do? 11 7.8 Which video players can be used? 11 8 Credits 12 9 Links 12 10 Todo's 12 1 About this documentation This documentation describes how to setup DVB-T with the Rok DVB-T 1 Receiver USB stick. The setup and documentation was done with Fedora Core 6. Terminal commands that start with a $ (dollar) can be issued as normal user and with # (pound sign) only as root user. Most lines have some comments at the end what the command is doing (also starting with a # ). Of course these must not be entered. 2 Prerequisites 2.1 What is described here? - needed hardware/software/files - setup the hardware - setup the software - create the TV channels - basic function tests - trouble-shooting steps 2.2 What is not described? It is assumed that the general audio/video setup is already working or will be done elsewhere. 3 Needed components 3.1 Hardware - a USB 2.0 slot # regarding the manual USB 1.1 is also working but it was not tested - Rok DVB-T 1 Receiver USB adapter # e.g., available at Amazon for ~50 EUR (on August 2006) 3.2 Software Check that the Linux kernel was compiled with the following options (see e.g., /boot/config-2.6.19-1.2911.fc6): - DVB-T support # CONFIG_DVB and its sub options - Video4Linux support # CONFIG_VIDEO_V4L1 and its sub options - support for the respective USB device # CONFIG_DVB_USB_DTT200U Please note: The standard kernel for FC6 is supporting all these options "out of the box", so no need to recompile it. - firmware file (from Internet) # the "driver" for the device - DVB-T tools (from LinuxTV.org) # to verify that it is working and to scan the TV broadcasting frequencies - DVB-T scanaid (from Johannes-Bauer.com) # to create the TV channel list 4 Setup the DVB-T stick 4.1 Is it recognized? Plug in the device and check with the following commands and sample output if the adapter is recognized at least in a simple way: # lsusb -v # list all connected USB devices with details Bus 002 Device 003: ID 14aa:0226 AVerMedia (again) or C&E Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x14aa AVerMedia (again) or C&E idProduct 0x0226 bcdDevice 5.21 iManufacturer 1 Digital TV Receiver iProduct 2 Digital TV Receiver iSerial 3 20060503 Here you can see that the actual device ID (14aa:0226) and vendor (AVerMedia (again) or C&E) and the used USB 2.0 slot. # dmesg # list all system events Feb 18 13:08:40 fc6 kernel: usb 2-1: new high speed USB device using ehci_hcd and address 2 Feb 18 13:08:40 fc6 kernel: usb 2-1: configuration #1 chosen from 1 choice Feb 18 13:08:41 fc6 kernel: dvb-usb: found a 'WideView WT-220U PenType Receiver (Typhoon/Freecom)' in cold state, will try to load a firmware Feb 18 13:08:41 fc6 firmware_helper[1357]: Loading of /lib/firmware/dvb-usb-wt220u-fc03.fw for usb driver failed: No such file or directory Feb 18 13:08:41 fc6 kernel: dvb-usb: did not find the firmware file. (dvb-usb-wt220u-fc03.fw) Please see linux/Documentation/dvb/ for more details on firmware-problems. (-2) Feb 18 13:08:41 fc6 kernel: usbcore: registered new interface driver dvb_usb_dtt200u Feb 18 13:11:41 fc6 kernel: usb 2-1: USB disconnect, address 2 Here the output means that the device is seen (cold state) but that a firmware is missing. Nice to see that the expected filename and path is already given. 4.2 Install the firmware The device is using a specific firmware. Please do not use the files one from "http://www.linuxtv.org/downloads/firmware/dvb-usb-wt220u-01.fw". The filenames can look similar but it is not working, even not when renaming to the correct filename. So please have a look into Google where to find the correct one (e.g., http://home.arcor.de/efocht/dvb-usb-wt220u-fc03.fw). Open a terminal window and copy the downloaded file to the respective path with the correct filename: # cp /tmp/dvb-wt220u-fc03.fw /lib/firmware/dvb-usb-wt220u-fc03.fw Re-plugin the USB device, wait a few seconds and enter the command "dmesg" again to monitor the ongoing system events. The output should look similar like the following: Feb 18 16:01:31 fc6 kernel: usb 2-1: new high speed USB device using ehci_hcd and address 8 Feb 18 16:01:31 fc6 kernel: usb 2-1: configuration #1 chosen from 1 choice Feb 18 16:01:31 fc6 kernel: dvb-usb: found a 'WideView WT-220U PenType Receiver (Typhoon/Freecom)' in warm state. Feb 18 16:01:31 fc6 kernel: dvb-usb: will use the device's hardware PID filter (table count: 15). Feb 18 16:01:31 fc6 kernel: DVB: registering new adapter (WideView WT-220U PenType Receiver (Typhoon/Freecom)). Feb 18 16:01:31 fc6 kernel: DVB: registering frontend 0 (WideView USB DVB-T)... Feb 18 16:01:31 fc6 kernel: input: IR-receiver inside an USB DVB receiver as /class/input/input3 Feb 18 16:01:31 fc6 kernel: dvb-usb: schedule remote query interval to 300 msecs. Feb 18 16:01:31 fc6 kernel: dvb-usb: WideView WT-220U PenType Receiver (Typhoon/Freecom) successfully initialized and connected. Feb 18 16:01:33 fc6 kernel: dvb-usb: recv bulk message failed: -110 Feb 18 16:01:41 fc6 kernel: drivers/usb/input/hid-core.c: timeout initializing reports Feb 18 16:01:41 fc6 kernel: input: Digital TV Receiver Digital TV Receiver as /class/input/input4 Feb 18 16:01:41 fc6 kernel: input: USB HID v1.10 Keyboard [Digital TV Receiver Digital TV Receiver] on usb-0000:00:0b.1-1 Finally the device was successfully initialized and the LED should shine orange. 4.3 Load the kernel module Now the needed kernel module has to be loaded to create the respective devices files to "talk" to the firmware: # modprobe dvb_usb_dtt200u The created device files are the following: /dev/dvb/adapter0/demux0 /dev/dvb/adapter0/dvr0 /dev/dvb/adapter0/frontend0 /dev/dvb/adapter0/net0 4.4 Make it permanent To do this automatically when Linux is starting, tell the kernel to load the needed module. Enter the following to the "etc/sysconfig/kernel" file. If it is not existing create it (as root): # List here all kernel modules that should be loaded at startup MODULES_LOADED_ON_BOOT="dvb_usb_dtt200u" 5 Setup the TV channels 5.1 Which TV channels can be received? The easiest way to get to the TV channels is to use an already existing listing, but this depends on where you are living. When you are living in Germany, Austria, Switzerland or Luxembourg, this website could help: http://www.vdr-wiki.de/wiki/index.php/DVB-T_channels.conf Copy & paste the suitable data for your region into a text editor and save it in ASCII as "channels.conf" into your Home directory. 5.2 The pre-defined channels cannot be used If the channels from the website are not working, you have to create an own specific for your TV broadcast area. First you have to download a tools suite to create a scanlist with frequencies. The software is here: http://www.linuxtv.org/downloads/linuxtv-dvb-apps-1.1.1.tar.gz Save the file to your preferred compiling location (e.g., /usr/src/dvb). $ cp /tmp/linuxtv-dvb-apps-1.1.1.tar.gz /usr/src/dvb $ tar -xvzf linuxtv-dvb-apps-1.1.1.tar.gz # untar and uncompress the file in one step $ cd linuxtv-dvb-apps-1.1.1 $ make # even with the error messages the software should be compiled successful Now you have to scan which TV channels can be received. The tool needs already a list of frequencies. These can be created by a script file that can be downloaded from here: http://www.johannes-bauer.com/dvbt/dvbt-scanaid-0.03.tar.bz2 Move the file to your build directory and run the script: $ mv /tmp/dvbt-scanaid-0.03.tar.bz2 /usr/src/dvb/linuxtv-dvb-apps-1.1.1/util/scan $ tar -xvjf dvbt-scanaid-0.03.tar.bz2 # untar and uncompress the file in one step $ cd dvbt-scanaid-0.03 $ ./Create_Scanning_Table # start the script Answer the both questions to scan all bandwidth cominations and to enter the channel numbers on which DVB-T is broadcasting in your region: Do you want to try every possible bandwidth/FEC combination possible? [n] y Do you want all channels to be scanned? [n] n But to be sure to get really all possible it is recommended to scan all channels even if it takes some minutes: Do you want to try every possible bandwidth/FEC combination possible? [n] y Do you want all channels to be scanned? [n] y Finally the received frequencies are stored in the "Scanlist.txt" file. 5.3 Create an own channel file To convert the available frequencies into TV channels the "scan" tool from the "linuxtv-dvb-apps" suite has to be used like the following: $./scan dvbt-scanaid-0.03/Scanlist.txt > channels.conf All listed frequencies from the "Scanlist.txt" will be scanned for TV channels. The found channels can be seen with their names in the terminal window. When the scan is done the "channels.conf" file is ready for using. Please have a look into the file to see which TV channels you can receive: $ less channels.conf 6 Is it already working? Run a first TV test, e.g., with Mplayer. If it is not yet installed do it with the command: # yum install mplayer Afterwards start it to see if Mplayerit is working at all: $ mplayer Now move the created "channels.conf" file into the directory for the Mplayer: $ mv channels.conf ~/.mplayer Start the Mplayer with a TV channel: $ mplayer dvb://RTL If you can see the TV screen and hear some sound, the LED should now shine green. It is working. Congratulation and welcome at TV@Linux. If the audio/video quality is a problem or it is working not at all, don't worry. The following are trouble-shooting steps to solve some things. 7 Trouble-shooting 7.1 What commands/files are useful for checking things? The following commands and files are helpful for any trouble-shooting: - /var/log/messages # log file for all system events - dmesg # to see all system events since the last boot - lsmod # to list the loaded kernel modules - lsusb [-v] # to list all plugged USB devices 7.2 The device is connected but the LED is not orange Have a look into the output of "dmesg". If you have the following, then the USB device was seen by but not recognized. Reasons could be: no firmware found, wrong firmware. Make sure the correct file is at the listed location. Feb 18 13:08:40 fc6 kernel: usb 2-1: new high speed USB device using ehci_hcd and address 2 Feb 18 13:08:40 fc6 kernel: usb 2-1: configuration #1 chosen from 1 choice Feb 18 13:08:41 fc6 kernel: dvb-usb: found a 'WideView WT-220U PenType Receiver (Typhoon/Freecom)' in cold state, will try to load a firmware Feb 18 13:08:41 fc6 firmware_helper[1357]: Loading of /lib/firmware/dvb-usb-wt220u-fc03.fw for usb driver failed: No such file or directory Feb 18 13:08:41 fc6 kernel: dvb-usb: did not find the firmware file. (dvb-usb-wt220u-fc03.fw) Please see linux/Documentation/dvb/ for more details on firmware-problems. (-2) Feb 18 13:08:41 fc6 kernel: usbcore: registered new interface driver dvb_usb_dtt200u Feb 18 13:11:41 fc6 kernel: usb 2-1: USB disconnect, address 2 7.3 The stick is recognized (orange LED) but Mplayer shows black windows Make sure that Mplayer can access a valid list for the TV channels that can be received in your area. Normally it is "~/.mplayer.channels.conf". Check also the file permissions: $ ls -la ~/.mplayer Start Mplayer on the command line to see more information about the problem: $ mplayer dvb://RTL 7.4 Mplayer said that the DVB-T devices are not accessible Make sure that the device files for the DVB-T device are accessible for the user who is starting Mplayer. Check that your files are also accessible for the normal user, not only root: $ ls -la /dev/dvb/adapter0/ # shows the directory will all details total 0 drwxr-xr-x 2 foo root 120 Feb 18 23:22 . drwxr-xr-x 3 root root 60 Feb 17 23:22 .. crw------- 1 foo root 212, 4 Feb 18 23:22 demux0 crw------- 1 foo root 212, 5 Feb 18 23:22 dvr0 crw------- 1 foo root 212, 3 Feb 18 23:22 frontend0 crw------- 1 foo root 212, 7 Feb 18 23:22 net0 To change this use the following command: # chown -R foo /dev/dvb # foo is the normal user 7.5 The devices files are not existing. How to create them? The device files will be created automatically if certain conditions are met (firmware loaded, device recognized, kernel module loaded). Important: Due to this it is not recommended to create them on your own but it can be helpful for further troube-shooting: # mkdir -P /dev/dvb/adapter0 # create the subdirs # cd /dev/dvb/adapter0 # change to the new dir # mknod demux0 c 212 4 # create the character files with the name and char-major and char-minor numbers # mknod dvr0 c 212 5 # mknod frontend0 c 212 3 # mknod net0 c 212 7 # chown -R foo /dev/dvb # Change the permissions to the normal user Now check that the device files are correct: # ls -la /dev/dvb/* # shows the directory will all details 7.6 How to get rid of these typical MPEG artefacts and/or sound interruptions? The main point is to find the best location for your DVB-T antenna. Or get a better/bigger one if it is just the pre-delivered bar antenna. In the Internet there is also a tool available that is checking the broadcast quality of the received TV channels: http://www.johannes-bauer.com/dvbt/dvbt-signalaid-0.01.tar.bz2 Please note: The "gnuplot" and "dvbsnoop" packages needs to be available, so install them first if necessary: yum install gnuplot http://dvbsnoop.sourceforge.net/ The graphical plot can be started like the following: ./Start_Analysis & The plot is displayed and running. Now start the Mplayer with a TV channel: mplayer dvb://RTL Watch the graphical plot for the SNR (Signal Noise Ratio). The higher the SNR number, the better the received channel is displayed. You can do this with all TV channels you would like to know the quality. To end the plot just enter the following command: ./Quit_Analysis 7.7 The quality of the TV picture/sound is not satisfying. What to do? First of all check that your normal audio/video setup is running. This can be done with other movies (AVI, MPG, DVDs) and sound files (wav, mp3, ogg). If it is just Mplayer that is working not perfect, it can depend on the specific audio/video hardware that you are using. So, try other audio/video codes and formats. The Mplayer's man pages are very large but there is no way around to find better fine tuning options. Here is my current command line for watching TV with a more detailed description below: mplayer -cache 4096 -vo gl2 -ni -ao oss -fs "dvb://RTL" cache 4096 # cache some bytes first before starting to synchronize the picture and sound vo gl2 # use the video option for OpenGL 2.0 ao oss # use the audio option for OSS fs # start in fullscreen mode dvb://RTL # TV channel like it is named in the "channels.conf" 7.8 Which video players can be used? Today there are a lot of different programs for watching TV. Please have a look for the following reference: http://www.linuxtv.org/wiki/index.php/Software 8 Credits My thanks go to the following people and websites. Without them I would be able to watch TV on Linux: - contributors from LinuxTV.org - Erich Focht for the firmware file - Johannes Bauer for the little DVB-T tools - contributors from Linuxwiki.de - contributors from VDR-Wiki.de 9 Links http://www.linuxtv.org http://home.arcor.de/efocht/dvb-usb-wt220u-fc03.fw http://www.johannes-bauer.com http://linuxwiki.de/Freecom_DVB-T_USB_Stick http://www.vdr-wiki.de/wiki/index.php/DVB-T_channels.conf 10 Todo's Switch to other channels without restarting the video player Use the pre-delivered IR remote control