Kworld UB499-2T: Difference between revisions

From LinuxTVWiki
Jump to navigation Jump to search
(Added instructions for downloading the kernel source for ubuntu/mythbuntu. Added a common problems section.)
Line 143: Line 143:
'''Note:''' I could not make this driver (10.12.30.1) or the old one (10.04.19.1) work in Fedora 14. Fedora 14 uses kernel 2.6.35. I had to upgrade the kernel to 2.6.37 and it worked following the procedures described below for kernel 2.6.37, but I had to use version 10.12.30.1, the earlier version (10.04.19.1) didn't work for me on kernel 2.6.37.
'''Note:''' I could not make this driver (10.12.30.1) or the old one (10.04.19.1) work in Fedora 14. Fedora 14 uses kernel 2.6.35. I had to upgrade the kernel to 2.6.37 and it worked following the procedures described below for kernel 2.6.37, but I had to use version 10.12.30.1, the earlier version (10.04.19.1) didn't work for me on kernel 2.6.37.


=== Updating for the 2.6.36 & 2.6.37 kernel ===
=== Updating for the 2.6.36, 2.6.37, 2.6.38 and 2.6.29 kernels ===


I have created two 10.12.30.1 versions (i686 and x64) that work with kernel 2.6.37 following the procedure below.
I have created two 10.12.30.1 versions (i686 and x64) that work up to kernel 2.6.39 following the procedure below.


You can download them here:
You can download them here:

Revision as of 08:23, 24 June 2011

Vendor
Device/Model
Supported ID on
Interface
Hardware Firmware Comment / Pictures URL E
KWorld UB499-2T See Device page. IT9135 Yes from Kernel 3.2 048d:9135 USB2.0 ITE IT9135 dvb-usb-it9135-01.fw Jump to the place where you can edit this entry
KWorld UB499-2T T09 Yes, in kernel since 3.2 1b80:e409 USB2.0 IT9137 dvb-usb-it9137-01.fw Jump to the place where you can edit this entry


The KWorld UB499-2T is a USB dual tuner. It contains the Afatech/ITE IT9135 hardware. It is not supported directly by V4L, however, a driver is available along with instructions for installation from http://wasietsmet.nl/linux/zolid-usb-dvb-t-tuner-van-de-aldi-linux-drivers/. This page is in Dutch, however English installation instructions for Ubuntu are provided below.

I have tested the driver on Mythbuntu 10.04 with kerner version 2.6.32. The dual tunar appears to function perfectly, however, I have not made any attept to get the included IR receiver and remote working.

The IT9137 version (packaged as KWorld UB499-2T) tested and both tuners working with the 9135 driver above with Mythtv 0.23 on Ubuntu 10.04 kernel 2.6.32-24-generic.

lsusb dump

Bus 001 Device 009: ID 048d:9135 Integrated Technology Express, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x048d Integrated Technology Express, Inc.
  idProduct          0x9135 
  bcdDevice            2.00
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           46
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           4
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)

Installation Instructions

These instructions have been written after my work colleague Axel pointed me to the Dutch page http://wasietsmet.nl/linux/zolid-usb-dvb-t-tuner-van-de-aldi-linux-drivers/ which contains a link to the drivers and installation instructions in Dutch. Although it is relatively easy to translate the page using an online translator I thought it sensible to add a section here in the v4l wiki in English for completeness.

Again thanks to those mentioned above.

If you don't allready have them install linux headers for your kernel and gcc

 sudo apt-get install linux-headers-$(uname -r) gcc

Create a folder for the source code (for example in your Documents folder) and cd into it.

 mkdir IT9135_SRC_i686_patch
 cd IT9135_SRC_i686_patch

Download the driver source code from http://wasietsmet.nl/wp-content/uploads/2010/07/IT9135_SRC_i686_patch.tar.gz to your new folder either using your browser or using

 wget http://wasietsmet.nl/wp-content/uploads/2010/07/IT9135_SRC_i686_patch.tar.gz

Unpack the sourcecode and run the install script. Follow the onscreen instructions entering option 1 to install the module

 tar xvzf IT9135_SRC_i686_patch.tar.gz
 ./installer.sh

Load the module

 sudo modprobe dvb-usb-it9135

Test the tuner is working by scanning for channels. First find the correct file for your transmitter then scan. The example below lists all files for uk transmitters then uses uk-EmleyMoor. Modify the ls command to list all transmitters or those in your country and replace uk-EmleyMoor with the file for the transmitter you use. If the scan succeeds you have successfully installed the tuner.

 ls /usr/share/dvb/dvb-t | grep uk-
 scan /usr/share/dvb/dvb-t/uk-EmleyMoor

Ensure that the module is loaded on reboot by adding it to your /etc/modules file using your favourite text editor, eg to use nano

 sudo nano /etc/modules

then add the line

 dvb-usb-it9135

to the file.

Supporting Newer Kernels

The driver linked above only supports kernels up to 2.6.33. For newer kernels please follow the instructions below.

Updating for the 2.6.34 & 2.6.35 kernels

just use the new driver that was recently posted on the same dutch forum (http://wasietsmet.nl/linux/zolid-usb-dvb-t-tuner-van-de-aldi-linux-drivers/)

http://wasietsmet.nl/wp-content/uploads/2010/07/V10.12.30.1.zip

just read the read me in the file and follow it's instructions.

Note: I could not make this driver (10.12.30.1) or the old one (10.04.19.1) work in Fedora 14. Fedora 14 uses kernel 2.6.35. I had to upgrade the kernel to 2.6.37 and it worked following the procedures described below for kernel 2.6.37, but I had to use version 10.12.30.1, the earlier version (10.04.19.1) didn't work for me on kernel 2.6.37.

Updating for the 2.6.36, 2.6.37, 2.6.38 and 2.6.29 kernels

I have created two 10.12.30.1 versions (i686 and x64) that work up to kernel 2.6.39 following the procedure below.

You can download them here:

http://www.omcentre.com.au/fileadmin/user_upload/kworld_UB499-2T/IT9135-10.12.30.1_i686.tar.bz2

http://www.omcentre.com.au/fileadmin/user_upload/kworld_UB499-2T/IT9135-10.12.30.1_x64.tar.bz2

To install the i686 as root:

wget http://www.omcentre.com.au/fileadmin/user_upload/kworld_UB499-2T/IT9135-10.12.30.1_i686.tar.bz2
tar xvfj IT9135-10.12.30.1_i686.tar.bz2
cd IT9135_SRC
make
make install

To install the x64 one follow the same procedure replacing i686 with x64.

The 2.6.36 kernel introduced a big change towards removing the Big Kernel Lock, which was finally removed in 2.6.37. As a result the module mentioned above wouldn't build.

At the bottom of the Cellie's post there is a link to an updated source package that is supposed to work with the 2.6.36 kernel, however I wasn't able to make this work. The Release Notes indicate an updated firmware in that package, but a cmp between the firmware in the initially posted v10.04.19.1 and the updated v10.12.30.1 for x86 & amd64 appear to be identical. The notes also indicate better support for PIP so I'd like to get this going at some point.

I'm no C programmer, and much less a kernel hacker, but I found enough info to be able to patch the v10.04.19.1 module to build and fully function on these kernels. The following patch includes the necessary ioctl change for kernels >= 2.6.36, along with the other changes for kernels > 2.6.33.

To use the patch

  • Enter the unpacked source folder for the IT9135_SRC_i686_patch.tar.gz package
  • Save the following patch to patch_file
  • Use "patch -p0 < patch_file" to apply the changes to the source
  • Run the helper script below to populate the necessary sources from the kernel tree
  • Use the installer as instructed in the source to build & install the module
--- IT9135_SRC/Makefile	2011-02-05 23:26:01.000000000 +0000
+++ IT9135_SRC.orig/Makefile	2010-04-19 01:11:40.000000000 +0100
@@ -106,6 +106,9 @@
 ifneq (,$(findstring 2.6.33,$(CURRENT)))
 	@cp -f v4l/kernel-2.6.33/* ./
 endif
+ifneq (,$(findstring 2.6.36,$(CURRENT)))
+	@cp -f v4l/kernel-2.6.36/* ./
+endif
 
 	@(cp DemodAPI/*.* ./; cp src/*.* ./)
 #make -C $(KSRC) SUBDIRS=$(PWD) modules
--- IT9135_SRC/src/it9135-core.c	2011-02-05 23:26:23.000000000 +0000
+++ IT9135_SRC.orig/src/it9135-core.c	2010-04-19 01:11:40.000000000 +0100
@@ -63,7 +63,7 @@
 	.owner =		THIS_MODULE,
 	.open =		it9135_usb_open,
 	.release =	it9135_usb_release,
-	.ioctl =		it9135_usb_ioctl,
+	.unlocked_ioctl =		it9135_usb_ioctl,
 };
 
 /*
--- IT9135_SRC/src/usb2impl.c	2011-02-05 23:26:32.000000000 +0000
+++ IT9135_SRC.orig/src/usb2impl.c	2010-04-19 01:11:40.000000000 +0100
@@ -1,6 +1,6 @@
 /*#define __USB2IMPL_C__ for Linux  */
 // all for Linux
-#include <linux/autoconf.h>
+#include <generated/autoconf.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>

The following script will create the necessary headers folder in the unpacked source so you can compile the module. This script assumes you have the kernel sources unpacked to /usr/src/linux

 #!/bin/bash

KERNEL_VERSION=$(uname -r | cut -d. -f1-3)

if [ -d "IT9135_SRC/v4l/kernel-${KERNEL_VERSION}" ]; then
	echo "Looks like this kernel has already been configured.  Exiting."
	exit 1
else
	mkdir IT9135_SRC/v4l/kernel-${KERNEL_VERSION}
fi

REQD="dvb_frontend.h
dmxdev.h
dvb_ringbuffer.h
dvb_demux.h
dvb-pll.h
dvb-usb.h
dvb_net.h
dvbdev.h
demux.h
dvb-usb-ids.h"

for x in $REQD; do
	echo -n "Processing $x: "
	find /usr/src/linux/drivers/media/dvb/ -name "$x" -print0 -exec cp "{}" IT9135_SRC/v4l/kernel-${KERNEL_VERSION} \;
	echo
done

Updating for the 2.6.38 and Beyond

Ugh, this is pain, but will probably need to be done each time there is a new kernel version.

  • Download V10.12.30.1.zip and extract it
  • Run the installer based on your system (i686 or x64)
  • When it's asking you to install / remove the driver fire up another terminal, and copy folder /tmp/ite-install somewhere (I copy it to my home folder)
  • quit the installer (it won't work any way)
  • go to ite-install/installer/IT9135_SRC/
  • You'll have to manually patch Makefile to add support for your new kernel (replace xx with your installed kernel version)
ifneq (,$(findstring 2.6.xx,$(CURRENT)))
	@cp -f v4l/kernel-2.6.xx/* ./
endif
  • You'll have to manually patch src/it9135-core.c and change the line:
.ioctl = it9135_usb_ioctl,

to

.unlocked_ioctl = it9135_usb_ioctl,
  • download your kernel sources and extract it somewhere. Make sure it has the file /drivers/media/dvb/dvb-usb/dvb-usb.h
for ubuntu/mythbuntu type the following (for the tar command, make sure the file name matches what you downloaded):
sudo apt-get source linux-image-$(uname -r)
tar -jxvf linux-source-2.6.38.tar.bz2
  • run the script posted for v2.6.36/37 but make sure you edit it so it points to where you extracted the kernel source
  • run make, if it generates any errors, they should be easy to fix (I had to rename v4l/kernel-2.6.38-8-generic to v4l/kernel-2.6.38)
  • run make install
  • it _should_ work.

Common problems

  • make fails due to missing files.
    • You need to edit the script posted for v2.6.36/37 to point to where you extracted the kernel source. If you run the script without editing it, it won't copy the files properly and the build will fail.
  • make works fine, but when I plug in the capture card it doesn't work, I get messages like "dvb_usb_it9135: disagrees about version of symbol ..." in the kernel logs.
    • You have downloaded or copied the wrong kernel sources when building your driver. Make sure the kernel source you downloaded matches your actual running kernel.