Request for advice on making a Media Centre [Solved]

Discussions Regarding Software

Moderator: Moderators

Request for advice on making a Media Centre [Solved]

Postby Fitzcarraldo » Tue Dec 22, 2009 22:47

My Freeview (UK digital terrestrial TV) set-top box is playing up, so I would like to replace it with a nettop box and a DVB-T digital Freeview TV tuner USB stick, running Sabayon Linux and media centre software.

I was wondering if anyone has set up a media centre using Sabayon Linux to view live digital terrestrial TV plus other multimedia (DVDs, VideoCDs, AVI files, DivX files, MKV files, MP3 files, etc.)? If you have actually done this with Sabayon Linux, I would be grateful for advice on the hardware and software you are using, how you set it up, and any other useful information.

As I understand it, XBMC cannot play live digital terrestrial TV from a DVB-T tuner USB stick, so unfortuantely XBMC is not an option.

The other media centre software I know of is MythTV, which I know can handle DVB-T TV USB sticks. Has anyone here been successful using MythTV under Sabayon Linux with USB DVB-T tuner sticks?

Come to that, has anyone been successful using other media centre applications running under Sabayon Linux with USB DVB-T tuner sticks?

I looked for DVB-T tuner USB sticks on Amazon UK, and two that mention Linux and seem to be good bets for a media centre project are:

- Hauppauge WinTV-NOVA-T USB Stick - DVB-T Digital Freeview TV tuner stick (known to work with Linux)

- ClimaxDigital TV DVB-T USB Stick Freeview and HDTV (the manufacturer lists Linux as one of the OS's supported)

so I've ordered the ClimaxDigital stick as it is a little cheaper than the Hauppauge stick.

I was thinking of buying one of the following nettops for the media centre, as I've read reasonable reviews about them:

Aspire Revo R3600L
Operating System: Windows Vista Home Premium (which I would wipe and install Sabayon Linux)
Processor: Intel Atom N230
Memory: 2 Gb
Hard Drive: 160 Gb
Optical Drive: None
Graphics: NVIDIA ION
USB Ports: 6
Network Card: 10/100/1000 Mbps Ethernet
Wireless: 802.11 B/G/N
VGA Port
HDMI Port
eSATA Port
7.1 HD Audio
Card Reader: 4-in-1
Keyboard & Mouse

or

Asus Eee Box EB1012
Operating System: Windows 7 Premium (which I would wipe and install Sabayon Linux)
Processor: Intel Atom Dual Core N330
Memory: 2 Gb
Hard Drive: 250 Gb
Optical Drive: None
Graphics: NVIDIA ION
USB Ports: 6
Network Card: 10/100/1000 Mbps Ethernet
Wireless: 802.11 B/G/N
VGA Port
HDMI Port
eSATA Port
5.1 HD Audio
Card Reader: 5-in-1
Wired Keyboard & Mouse

I have a ten year old, but perfectly good, Sony KV-25C5D Trinitron TV (CRT) with S-Video input sockets, SCART input sockets and Composite Video input sockets. At the moment it is connected to a Sagem Freeview (terrestrial digital TV) set-top box. I don't want to get rid of the Sony TV as it works fine, so I'll need to buy a VGA to S-Video adapter.

Any advice from someone with actual experience of doing this would be really appreciated. Thanks in advance.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7981
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Request for advice on making a Media Centre

Postby Fitzcarraldo » Wed Dec 23, 2009 4:25

I've been doing a bit of research and it appears that it is possible to get live DVB-T TV in XBMC via a "backend daemon" ([LINUX] DVB-T for XBMC with native TV-tuning support?) but apparently it does not permit recording (unlike MythTV).

Anyway, the 'backend daemon' Tvheadend TV steaming server looks interesting and, what's even more interesting, there's an up to date ebuild for it in Gentoo Bugzilla Report No. 288022.

I don't want to spend a lot of time installing and setting up MythTV in Sabayon Linux, so was considering installing Mythbuntu, which apparently is an out-of-the-box MythTV solution, albeit running under Ubuntu rather than SL. However, I might just give XBMC with Tvheadend a try under SL first to see how well it works.

The author of Tvheadend has also produced Showtime, which is a multimedia player similar to XBMC, and can be used as a front-end to Tvheadend. From the comments on the Showtime/Tvheadend Web site, Showtime is still in heavy development (e.g. LIRC does not work, so I'd have to use Bluetooth instead), but it looks usable. Unfortunately, though, there is no ebuild for Showtime, so I would have to compile it from scratch.

I've also now found out about some other Linux media centres: Boxee, Elisa (now named Moovida, or is that a different media player?), Entertainer, Freevo, GeeXboX and Linuxmce. As far as I can tell, the only two that have built-in DVB-T support are Freevo and MythTV.

So my choices look like the following so far (probably in order of attempting them, and depending on whether they even work with the hardware I'm proposing to use):

1. XBMC + Tvheadend running under SL, both installed via Portage ebuilds.

2. MythTV running under Ubuntu, installed from the Mythbuntu LiveDVD/Installer.

3. Freevo running under SL, installed via Portage ebuild: Gentoo Wiki - Freevo.

4. MythTV running nder SL, installed via Portage ebuild: Gentoo Wiki - MythTV. It looks complicated to install.

5. Showtime + Tvheadend running under SL (Showtime compiled from scratch; Tvheadend installed via Portage ebuild).
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7981
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Request for advice on making a Media Centre

Postby wolfden » Wed Dec 23, 2009 5:15

I don't know much about this area, but have heard good things about choice #2 Mythbuntu
wolfden
Sharecropper
 
Posts: 9050
Joined: Sat Jan 14, 2006 0:55
Location: Midwest USA

Re: Request for advice on making a Media Centre

Postby Fitzcarraldo » Thu Dec 24, 2009 15:48

Well, the DVB-T USB stick arrived yesterday, only two days after I ordered it. It's actually an ezcap USB 2.0 DVB-T Stick model EzTV860 manufactured by Chinese company Forward Video Co. ltd. (http://www.szforwardvideo.com). ClimaxDigital are just the UK distributors.

Apart from the USB stick itself (which has a standard coaxial TV aerial socket in one end), the box contained a tiny indoor antenna with stand, a CD for Windows XP/Vista/Seven (driver plus GUI to install driver, plus TV GUI) and Linux (driver plus Bash installation script for driver), and a remote controller.

I decided to test the stick with my laptop first, before paying hard-earned cash for a nettop.

I installed the driver and GUI on my laptop under Windows XP and it works perfectly. The supplied tiny indoor antenna is useless: no channels were discovered when I scanned with the supplied antenna. However, when I plugged the cable from my rooftop TV aerial into the USB stick, a channel scan detected fifty Freeview channels (TV and radio) and they play perfectly. The Windows GUI works well and is comprehensive and easy to use: I can adjust the aspect ratio, play TV full-screen, record TV programmes, and so on.

Then I 'safely removed' the stick, booted into SL and plugged the stick back in. The dmesg command showed that the device had been detected:

Code: Select all
[  824.424054] usb 1-4: new high speed USB device using ehci_hcd and address 4
[  824.544491] usb 1-4: New USB device found, idVendor=15a4, idProduct=1001
[  824.544494] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  824.544496] usb 1-4: Product: AF9035A USB Device
[  824.544498] usb 1-4: Manufacturer: Afa Technologies Inc.
[  824.544500] usb 1-4: SerialNumber: AF0102020700001
[  824.544644] usb 1-4: configuration #1 chosen from 1 choice
[  824.548975] input: Afa Technologies Inc. AF9035A USB Device as /devices/pci0000:00/0000:00:1d.7/usb1/1-4/1-4:1.1/input/input9
[  824.549123] generic-usb 0003:15A4:1001.0001: input,hidraw0: USB HID v1.01 Keyboard [Afa Technologies Inc. AF9035A USB Device] on usb-0000:00:1d.7-4/input1


However I was not able to install the Linux driver provided on the CD that came with the stick. Unlike the slick Windows installation application, the Linux installation script is very basic. Interestingly, the Bash script has a binary tarball incorporated into it (non-ASCII in a section following the ASCII Bash commands): when you run the script it parses itself, strips out the binary part to create a temporary tarball, extracts the contents and issues a make command to compile the driver. I suppose the manufacturer has done it this way to make it difficult for the user to get his hands on the source code. In any event, the installation script fails without any helpful diagnostic information:

Code: Select all
acertm8215 v9.08.14.1 # sh ITE-Linux-AF903x-v9.08.14.1.sh                                                     
1. Install ITEtech AF9035 Driver                                                                               
2. Remove  ITEtech AF9035 Driver                                                                               
Please Input Your Choise:                                                                                     
1                                                                                                             
Please wait a minute                                                                                           
cp: cannot stat `api/.*.o.cmd': No such file or directory                                                     
make -C /lib/modules/2.6.31-sabayon/build SUBDIRS=/tmp/ite-install/installer/AF903x_SRC modules               
make[1]: Entering directory `/usr/src/linux-2.6.31-sabayon'                                                   
  CC [M]  /tmp/ite-install/installer/AF903x_SRC/af903x-core.o                                                 
In file included from /tmp/ite-install/installer/AF903x_SRC/af903x-core.c:1:                                   
/tmp/ite-install/installer/AF903x_SRC/af903x.h:15:21: error: dvb-usb.h: No such file or directory             
In file included from /tmp/ite-install/installer/AF903x_SRC/type.h:4,                                         
                 from /tmp/ite-install/installer/AF903x_SRC/demodulator.h:5,                                   
                 from /tmp/ite-install/installer/AF903x_SRC/af903x.h:17,                                       
                 from /tmp/ite-install/installer/AF903x_SRC/af903x-core.c:1:                                   
/tmp/ite-install/installer/AF903x_SRC/userdef.h:11:1: warning: "NULL" redefined                               
In file included from include/linux/kernel.h:12,                                                               
                 from /tmp/ite-install/installer/AF903x_SRC/af903x.h:6,                                       
                 from /tmp/ite-install/installer/AF903x_SRC/af903x-core.c:1:                                   
include/linux/stddef.h:10:1: warning: this is the location of the previous definition                         
In file included from /tmp/ite-install/installer/AF903x_SRC/demodulator.h:5,                                   
                 from /tmp/ite-install/installer/AF903x_SRC/af903x.h:17,                                       
                 from /tmp/ite-install/installer/AF903x_SRC/af903x-core.c:1:                                   
/tmp/ite-install/installer/AF903x_SRC/type.h:6:1: warning: "IN" redefined                                     
In file included from /tmp/ite-install/installer/AF903x_SRC/type.h:4,                                         
                 from /tmp/ite-install/installer/AF903x_SRC/demodulator.h:5,                                   
                 from /tmp/ite-install/installer/AF903x_SRC/af903x.h:17,                                       
                 from /tmp/ite-install/installer/AF903x_SRC/af903x-core.c:1:                                   
/tmp/ite-install/installer/AF903x_SRC/userdef.h:21:1: warning: this is the location of the previous definition
In file included from /tmp/ite-install/installer/AF903x_SRC/demodulator.h:5,                                   
                 from /tmp/ite-install/installer/AF903x_SRC/af903x.h:17,                                       
                 from /tmp/ite-install/installer/AF903x_SRC/af903x-core.c:1:                                   
/tmp/ite-install/installer/AF903x_SRC/type.h:7:1: warning: "OUT" redefined                                     
In file included from /tmp/ite-install/installer/AF903x_SRC/type.h:4,                                         
                 from /tmp/ite-install/installer/AF903x_SRC/demodulator.h:5,                                   
                 from /tmp/ite-install/installer/AF903x_SRC/af903x.h:17,                                       
                 from /tmp/ite-install/installer/AF903x_SRC/af903x-core.c:1:                                   
/tmp/ite-install/installer/AF903x_SRC/userdef.h:22:1: warning: this is the location of the previous definition
In file included from /tmp/ite-install/installer/AF903x_SRC/af903x-core.c:1:                                   
/tmp/ite-install/installer/AF903x_SRC/af903x.h:201: error: array type has incomplete element type             
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c:5: warning: data definition has no type or storage class   
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c:5: warning: type defaults to ‘int’ in declaration of ‘DVB_DEFINE_MOD_OPT_ADAPTER_NR’                                                                                     
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c:5: warning: parameter names (without types) in function declaration                                                                                                       
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c: In function ‘af903x_probe’:                               
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c:34: error: implicit declaration of function ‘dvb_usb_device_init’                                                                                                         
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c:34: error: ‘adapter_nr’ undeclared (first use in this function)                                                                                                           
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c:34: error: (Each undeclared identifier is reported only once                                                                                                             
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c:34: error: for each function it appears in.)               
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c: In function ‘af903x_suspend’:                             
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c:51: warning: passing argument 2 of ‘DL_CheckTunerInited’ from incompatible pointer type                                                                                   
/tmp/ite-install/installer/AF903x_SRC/af903x.h:218: note: expected ‘enum Bool *’ but argument is of type ‘bool *’                                                                                                             
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c:52: warning: passing argument 2 of ‘DL_CheckTunerInited’ from incompatible pointer type                                                                                   
/tmp/ite-install/installer/AF903x_SRC/af903x.h:218: note: expected ‘enum Bool *’ but argument is of type ‘bool *’                                                                                                             
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c: At top level:                                             
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c:94: error: ‘dvb_usb_device_exit’ undeclared here (not in a function)                                                                                                     
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c: In function ‘af903x_module_init’:                         
/tmp/ite-install/installer/AF903x_SRC/af903x-core.c:104: error: implicit declaration of function ‘info’       
make[2]: *** [/tmp/ite-install/installer/AF903x_SRC/af903x-core.o] Error 1                                     
make[1]: *** [_module_/tmp/ite-install/installer/AF903x_SRC] Error 2                                           
make[1]: Leaving directory `/usr/src/linux-2.6.31-sabayon'                                                     
make: *** [default] Error 2                                                                                   
make error

To investigate what was happening I hacked the installation script. I worked out how to extract from it the binary part and convert it to a tarball, from which I could then extract the driver source code and makefiles. From these I discovered that the latest version of the driver (written in August 2009) is only written for Linux kernels up to 2.6.29. I hacked the make scripts and added instructions for the 2.6.30 and 2.6.31 kernels, but it still will not build. I have therefore sent an e-mail to the Forward video support team. I'm not holding my breath, though.

So perhaps I should have paid a bit more and bought the Hauppauge stick, although who knows if that would have worked?

I decided to go ahead and install Tvheadend anyway, to see if at least that could be done. I copied the five relevant ebuild files from Gentoo Bugzilla Report No. 288022 to my Desktop. I also downloaded the source code tarball for Tvheadend to my Desktop. I then executed the following commands to install Tvheadend:

Code: Select all
mkdir -p /usr/local/portage/media-tv/tvheadend/files/
cp /home/fitzcarraldo/Desktop/ffmpeg.patch /usr/local/portage/media-tv/tvheadend/files/
cp /home/fitzcarraldo/Desktop/settingspath.patch /usr/local/portage/media-tv/tvheadend/files/
cp /home/fitzcarraldo/Desktop/tvheadend-2.7-r1.ebuild /usr/local/portage/media-tv/tvheadend/
cd /usr/local/portage/media-tv/tvheadend/
cp /home/fitzcarraldo/Desktop/hts-tvheadend_2.7.tar.gz /usr/portage/distfiles/
cp /home/fitzcarraldo/Desktop/tvheadend.initd /usr/local/portage/media-tv/tvheadend/files/
cp /home/fitzcarraldo/Desktop/anonaccess /usr/local/portage/media-tv/tvheadend/files/
ebuild tvheadend-2.7-r1.ebuild manifest
emerge -1v tvheadend
rc-update add tvheadend default
/etc/init.d/tvheadend start


I then entered the URL http://127.0.0.1:9981 in the Firefox address bar, and the Tvheadend GUI was displayed. The default username and password are set as "*" on the Tvheadend GUI configuration page, i.e. anyone can access the TV backend. I left those as they were for the time being.

I then launched XBMC and added a Videos source htsp://127.0.0.1:9982/ (I named it "TV" but it can be named whatever you want). There is a thread about using Tvheadend in the XBMC forums which is worth browsing through: http://xbmc.org/forum/showthread.php?t=51945. Tvheadend looks very good. Because I was not able to install the driver for the DVB-T USB stick, Tvheadend could not use it, so a configuration field in the Tvheadend Web GUI did not show any available DVB-T cards. Nevertheless, whenever I launched and shutdown XBMC the log window of Tvheadend indicated what had happened, so it looks like XBMC would work if I had a functioning DVB-T stick. Darn it! :evil:

So I'm going to wait a while to see if I get any response from Forward Video regarding the Linux driver. I'm in a quandary, now, because the stick works perfectly in Windows, so perhaps I should just throw in the towel and build a Windows-based media centre. :cry:
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7981
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Request for advice on making a Media Centre

Postby Stupot » Thu Dec 24, 2009 16:50

I am also working on a Media Center for my own personal use, but I intend to use mythtv's backend with xbmc as the frontend.

I bought a card from http://www.pchdtv.com/ which makes tv tuners for linux specifically. It doesn't appear that they support the DVB standard though, or I would have spoken up sooner.
Stupot
Sagely Hen
 
Posts: 1545
Joined: Wed Feb 14, 2007 3:44
Location: St. Louis, MO, USA

Re: Request for advice on making a Media Centre

Postby Fitzcarraldo » Fri Dec 25, 2009 2:54

In case anyone else is trying to get a DVB-T USB stick working -- whatever the manufacturer and model -- notice in the output from dmesg that I posted earlier that the usbhid driver incorrectly thinks that my DVB-T stick is a keyboard:

Code: Select all
[  824.549123] generic-usb 0003:15A4:1001.0001: input,hidraw0: USB HID v1.01 Keyboard [Afa Technologies Inc. AF9035A USB Device] on usb-0000:00:1d.7-4/input1

It is necessary to stop the usbhid driver from doing this, because the DVB-T stick certainly isn't a keyboard.

Now, if the usbhid driver is a kernel module (CONFIG_USB_HID=m in the kernel config) then the way to tell the usbhid driver to ignore this specific device, as it has its own driver, would be to pass an option to the usbhid driver by putting the following line in the file /etc/modprobe.d/usbhid.conf

Code: Select all
options usbhid quirks=0x15a4:0x1001:0x0004

where 0x15a4 is the Vendor ID and 0x1001 is the Product ID, both obtained by looking at the output of either the dmesg or lsusb commands, and the 0x0004 flag is HID_QUIRK_IGNORE, which tells the usbhid driver to ignore the device.

However, in the case of SL the usbhid driver is not a module, it's built into the kernel (CONFIG_USB_HID=y in the kernel config), so the way to tell the usbhid driver to ignore this specific device, as it has its own driver, would be to pass the option to the usbhid as a boot parameter, by editing /boot/grub/grub.conf and adding the following boot parameter to the end of the kernel boot line:

Code: Select all
usbhid.quirks=0x15a4:0x1001:0x0004

Then when I reboot I see the following for the DVB-T stick in the dmesg output:

Code: Select all
[  196.322403] usb 1-1.4: new high speed USB device using ehci_hcd and address 13
[  196.414896] usb 1-1.4: New USB device found, idVendor=15a4, idProduct=1001
[  196.414903] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  196.414909] usb 1-1.4: Product: AF9035A USB Device
[  196.414913] usb 1-1.4: Manufacturer: Afa Technologies Inc.
[  196.414917] usb 1-1.4: SerialNumber: AF0102020700001
[  196.415183] usb 1-1.4: configuration #1 chosen from 1 choice

Compare the new dmesg output above with the old dmesg output in my previous post. You can see that the usbhid driver now ignores the DVB-T stick and it is no longer listed as a keyboard. :)

Now, if I could just get a compiled af903x driver (dvb-usb-af903x.ko) and firmware (I think it would be named dvb-usb-af903x.fw or perhaps just af903x.fw) for this Forward Video ezcap DVB-T stick, I think I'd be up and running, as everything else is now configured correctly. I would just need to copy the driver file to the directory /lib64/modules/2.6.31-sabayon/kernel/drivers/media/dvb/dvb-usb/, and the firmware file to the directory /lib64/firmware/, and then reboot. :cry:
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7981
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Request for advice on making a Media Centre

Postby Fitzcarraldo » Mon Dec 28, 2009 17:59

I did some more hacking and got the driver to install in Sabayon Linux 5.0 (upgraded) amd64 edition, but it still does not work.

Here's what I did:

1. Extracted the directory /home/fitzcarraldo/Desktop/v9.08.14.1/installer/ from the composite ASCII-binary script /home/fitzcarraldo/Desktop/v9.08.14.1/ITE-Linux-AF903x-v9.08.14.1.sh by entering the following command:

Code: Select all
tail -n +52 /home/fitzcarraldo/Desktop/v9.08.14.1/ITE-Linux-AF903x-v9.08.14.1.sh | tar zxf - >/dev/null 2>.err

2. Edited /home/fitzcarraldo/Desktop/v9.08.14.1/installer/AF903x_SRC/Makefile and changed "lib" to "lib64" in the path of the environment variables KDIR, KDIR26 and DEST.

3. Edited /home/fitzcarraldo/Desktop/v9.08.14.1/installer/AF903x_SRC/Makefile and added:

Code: Select all
ifneq (,$(findstring 2.6.30,$(CURRENT)))
        @cp -f v4l/kernel-2.6.30/* ./   
endif                                   
ifneq (,$(findstring 2.6.31,$(CURRENT)))
        @cp -f v4l/kernel-2.6.31/* ./   
endif                                   
ifneq (,$(findstring 2.6.32,$(CURRENT)))
        @cp -f v4l/kernel-2.6.32/* ./   
endif

after:

Code: Select all
ifneq (,$(findstring 2.6.29,$(CURRENT)))
        @cp -f v4l/kernel-2.6.29/* ./   
endif

4. Performed Steps 1 and 2 on /home/fitzcarraldo/Desktop/v9.08.14.1/installer/AF903x_SRC/Makefile.release

5. Copied /home/fitzcarraldo/Desktop/v9.08.14.1/installer/AF903x_SRC/v4l/kernel-2.6.29/ and its contents to create new directories /home/fitzcarraldo/Desktop/v9.08.14.1/installer/AF903x_SRC/v4l/kernel-2.6.30/, /home/fitzcarraldo/Desktop/v9.08.14.1/installer/AF903x_SRC/v4l/kernel-2.6.31/ and /home/fitzcarraldo/Desktop/v9.08.14.1/installer/AF903x_SRC/v4l/kernel-2.6.32/

6. Edited /usr/src/linux/include/linux/firmware.h and added the line:

Code: Select all
#define FIRMWARE_NAME_MAX 30

before the line:

Code: Select all
#define FW_ACTION_NOHOTPLUG 0

7. Edited /home/fitzcarraldo/Desktop/v9.08.14.1/installer/AF903x_SRC/api/driver_tua9001.c and commented out (added "//" in front of) the lines:

Code: Select all
//#elif defined(CRYSTAL_19.2_MHZ)   /*  Frequency 19.2 MHz */
//  i2cseq[0] = 0x01;
//  i2cseq[1] = 0xA0;
//  i2cBusWrite (TUNERs_TUA9001_DEVADDR, 0x1d, i2cseq, 2);
//  /* Note: Insert optimised register values for 0x40 / 0x41 for used crystal */
//  /* contact application support for further information */
//#elif defined(CRYSTAL_20.48_MHZ)   /*  Frequency 20,48 MHz */
//  i2cseq[0] = 0x01;
//  i2cseq[1] = 0xA8;
//  i2cBusWrite (TUNERs_TUA9001_DEVADDR, 0x1d, i2cseq, 2);
//  /* Note: Insert optimised register values for 0x40 / 0x41 for used crystal */
//  /* contact application support for further information */

8. Ran the installer script as root user:

Code: Select all
cd /home/fitzcarraldo/Desktop/v9.08.14.1/installer
sh installer.sh

It runs to completion.

The module is now loaded if I plug the device in:

Code: Select all
lsmod | grep dvb
dvb_usb_af903x       1088768  0
dvb_usb                14096  1 dvb_usb_af903x
dvb_core               88246  1 dvb_usb
i2c_core               21012  6 dvb_usb,radeon,drm,i2c_algo_bit,videodev,i2c_i801

but dmesg shows a problem of some kind with the loading of the module:

Code: Select all
[  156.413401] usb 1-1.4: new high speed USB device using ehci_hcd and address 12
[  156.505885] usb 1-1.4: New USB device found, idVendor=15a4, idProduct=1001
[  156.505892] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  156.505898] usb 1-1.4: Product: AF9035A USB Device
[  156.505902] usb 1-1.4: Manufacturer: Afa Technologies Inc.
[  156.505906] usb 1-1.4: SerialNumber: AF0102020700001
[  156.506812] usb 1-1.4: configuration #1 chosen from 1 choice
[  156.507416]         DRIVER_RELEASE_VERSION : v9.08.14.1
[  156.507421]         FW_RELEASE_VERSION     : v8_8_63_0
[  156.507425]         API_RELEASE_VERSION    : 200.20090402.0
[  156.920879] [Device_init] Error 1
[  156.920914] dvb_usb_af903x: probe of 1-1.4:1.0 failed with error -12

--------------------------------------------------------------------------------
I have just tried to install the DVB-T stick driver in an x86 edition, rather than an x86_64/amd64 edition, of Sabayon Linux, and with an earlier kernel on another of my laptops. I used Sabayon Linux 4.0-r1 x86 edition upgraded to the 2.6.28-sabayon kernel. I used the Linux software from the stick manufacturer, and made no changes to it. It was successful.

I launched the installer as the root user:

Code: Select all
sh ITE-Linux-AF903x-v9.08.14.1.sh

and the Bash script ran to completion.

When I then inserted the stick, the output for it in dmesg is:

Code: Select all
[  559.166036] usb 1-1: new high speed USB device using ehci_hcd and address 4
[  559.286786] usb 1-1: configuration #1 chosen from 1 choice
[  559.291390] input: Afa Technologies Inc. AF9035A USB Device as /class/input/input10
[  559.291777] generic-usb 0003:15A4:1001.0001: input,hidraw0: USB HID v1.01 Keyboard [Afa Technologies Inc. AF9035A USB Device] on usb-0000:00:10.3-1/input1
[  560.053878] AF903X: af903x_module_init
[  560.053920]         DRIVER_RELEASE_VERSION : v9.08.14.1
[  560.053923]         FW_RELEASE_VERSION     : v8_8_63_0
[  560.053926]         API_RELEASE_VERSION    : 200.20090402.0
[  560.204187] X:6352 conflicting memory types d8000000-e0000000 write-combining<->uncached-minus
[  560.204194] reserve_memtype failed 0xd8000000-0xe0000000, track write-combining, req write-combining
[  560.307695] X:8456 freeing invalid memtype d8000000-e0000000
[  560.561410] dvb-usb: found a 'ITEtech USB2.0 DVB-T Recevier' in warm state.
[  560.636945] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[  560.637707] DVB: registering new adapter (ITEtech USB2.0 DVB-T Recevier)
[  560.638991] DVB: registering adapter 0 frontend 0 (AF903X USB DVB-T)...
[  560.650559] dvb-usb: ITEtech USB2.0 DVB-T Recevier successfully initialized and connected.
[  560.650599] usbcore: registered new interface driver dvb_usb_af903x

and the module was loaded:

Code: Select all
sabayonx86 v9.08.14.1 # lsmod | grep dvb
dvb_usb_af903x        795464  0
dvb_usb                20364  1 dvb_usb_af903x
i2c_core               22804  2 dvb_usb,i2c_viapro

So I made the usbhid driver ignore the stick using the same method as before, and now the output in dmesg for the stick is:

Code: Select all
[  179.574052] usb 1-1: new high speed USB device using ehci_hcd and address 4
[  179.694812] usb 1-1: configuration #1 chosen from 1 choice
[  179.700704] input: Afa Technologies Inc. AF9035A USB Device as /class/input/input10
[  179.701482] generic-usb 0003:15A4:1001.0001: input,hidraw0: USB HID v1.01 Keyboard [Afa Technologies Inc. AF9035A USB Device] on usb-0000:00:10.3-1/input1
[  179.907450] X:6440 conflicting memory types d8000000-e0000000 write-combining<->uncached-minus
[  179.907457] reserve_memtype failed 0xd8000000-0xe0000000, track write-combining, req write-combining
[  179.913166] X:7315 freeing invalid memtype d8000000-e0000000
[  179.995511] AF903X: af903x_module_init
[  179.995576]         DRIVER_RELEASE_VERSION : v9.08.14.1
[  179.995578]         FW_RELEASE_VERSION     : v8_8_63_0
[  179.995581]         API_RELEASE_VERSION    : 200.20090402.0
[  180.538287] dvb-usb: found a 'ITEtech USB2.0 DVB-T Recevier' in warm state.
[  180.614566] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[  180.615552] DVB: registering new adapter (ITEtech USB2.0 DVB-T Recevier)
[  180.616507] DVB: registering adapter 0 frontend 0 (AF903X USB DVB-T)...
[  180.627684] dvb-usb: ITEtech USB2.0 DVB-T Recevier successfully initialized and connected.
[  180.627727] usbcore: registered new interface driver dvb_usb_af903x

As you can see from the dmesg output, the stick is in the 'warm state', successfully initialised and connected. However for some reason usbhid still sees the device as a keyboard. Perhaps I would need to do something else in the case of a 2.6.28 kernel. Anyway, the stick's driver seems to be working, as Tvheadend now shows the stick on its configuration page. :)

So it looks like I'll need to use an x86 edition of Linux (*) as I can't get it to work under an x86_64 edition (mind you, I have not tried building the driver with a 64-bit 2.6.28 kernel). I wonder if the hacks I gave earlier for kernel versions 2.6.30 to 2.6.32, excluding changing "lib" to lib64", would work with an x86 edition of Linux and the 2.6.30 to 2.6.32 versions of the kernel?

* Actually, come to think of it, does an x86_64 Linux distribution work with the Atom CPUs in these nettops?

EDIT: To answer my own question about whether the Atom N320 and N330 CPUs would support a 64-bit distribution, I have checked the specifications for those two CPUs, and they would as they both support the x86_64 architecture. The N320 is a single-core CPU, and the N330 is a dual-core CPU.

EDIT2: Actually, the more I look into it, the more I think it is not a problem of using an x86_64 distribution but rather the version of the kernel. I don't think my hack of using the 2.6.29 kernel af903x driver source code files for the 2.6.30 to 2.6.32 kernel is valid. I don't have a spare PC to install an x86_64 edition of SL and a 2.6.29 kernel (the stick manufacturer's CD has driver source code for up to the 2.6.29 kernel), but I would not be surprised if the driver installer worked with that combination.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7981
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Request for advice on making a Media Centre

Postby Fitzcarraldo » Tue Dec 29, 2009 19:33

Of the two DVB-T USB sticks I mentioned in an earlier post, I should have plumped for the Hauppage WinTV-NOVA-T USB Stick instead of the ezcap EzTV860, as the demodulator in it seems to be better supported by the Linux kernel. Bad luck, really, and it shows that you need to look into manufacturer's claims of Linux compatibility in more detail first. I think the AF9035 demodulator in the ezcap EzTV860 is newer than the demodulator in the Hauppage stick, and support is not widespread yet (the driver is not built into the kernel; it's only an external module supplied by one or two manufacturers). No doubt kernel support for the AF9035 will eventually become better, but that does not help me right now. Actually, I should have dug deeper in the kernel documentation before splashing out.

I'll find a good home for the ezcap EzTV860 stick with one of my Windows-using family, as I don't want to be limited to using a 2.6.29 kernel on my future media centre, and I can't wait for Forward Video to release a driver module for newer versions of the kernel. I've already ordered an AVerTV Volar Black HD A850 USB DVB-T stick, as I subsequently discovered that it is explicitly mentioned in the kernel release notes for the 2.6.30 kernel (http://kernelnewbies.org/Linux_2_6_30). The driver is not a module; it is built into the kernel (http://www.avermedia.eu/avertv/UK/Produ ... spx?Id=432). So I am more hopeful that this stick will work. Fingers crossed.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7981
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Request for advice on making a Media Centre

Postby Fitzcarraldo » Wed Dec 30, 2009 17:33

The AVerTV Volar Black HD (A850) DVB-T USB stick arrived today. :)

I plugged it in to a USB socket on my laptop running SL x86_64 with 2.6.32 kernel and KDE 4.3.3, and the output from dmesg showed the following:

Code: Select all
[  212.524466] usb 1-1.4: new high speed USB device using ehci_hcd and address 11
[  212.604236] usb 1-1.4: New USB device found, idVendor=07ca, idProduct=850a
[  212.604244] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  212.604249] usb 1-1.4: Product: A850 DVBT
[  212.604253] usb 1-1.4: Manufacturer: AVerMedia
[  212.604257] usb 1-1.4: SerialNumber: 302121301393000
[  212.604541] usb 1-1.4: configuration #1 chosen from 1 choice
[  212.743524] dvb-usb: found a 'AverMedia AVerTV Volar Black HD (A850)' in cold state, will try to load a firmware
[  212.743530] usb 1-1.4: firmware: requesting dvb-usb-af9015.fw
[  212.752166] dvb-usb: did not find the firmware file. (dvb-usb-af9015.fw) Please see linux/Documentation/dvb/ for more details on firmware-problems. (-2)
[  212.752184] dvb_usb_af9015: probe of 1-1.4:1.0 failed with error -2
[  212.752218] usbcore: registered new interface driver dvb_usb_af9015


There is no mention of Linux in either the installation guide or the CD that came with the stick. :evil: However, I googled the missing firmware file name "dvb-usb-af9015.fw" and found a link to the firmware file on the linuxtv.org Wiki site. I dowloaded dvb-usb-af9015.fw from the link given on the page http://linuxtv.org/wiki/index.php/DVB-T_USB_Devices and copied it to /lib64/firmware/ and now dmesg displays:

Code: Select all
[  717.571390] usb 1-1.4: new high speed USB device using ehci_hcd and address 12
[  717.650895] usb 1-1.4: New USB device found, idVendor=07ca, idProduct=850a
[  717.650903] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  717.650909] usb 1-1.4: Product: A850 DVBT
[  717.650913] usb 1-1.4: Manufacturer: AVerMedia
[  717.650917] usb 1-1.4: SerialNumber: 302121301393000
[  717.651198] usb 1-1.4: configuration #1 chosen from 1 choice
[  717.676457] dvb-usb: found a 'AverMedia AVerTV Volar Black HD (A850)' in cold state, will try to load a firmware
[  717.676464] usb 1-1.4: firmware: requesting dvb-usb-af9015.fw
[  717.682439] dvb-usb: downloading firmware from file 'dvb-usb-af9015.fw'
[  717.759148] dvb-usb: found a 'AverMedia AVerTV Volar Black HD (A850)' in warm state.
[  717.759872] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[  717.760491] DVB: registering new adapter (AverMedia AVerTV Volar Black HD (A850))
[  718.174349] af9013: firmware version:4.95.0
[  718.179375] DVB: registering adapter 0 frontend 0 (Afatech AF9013 DVB-T)...
[  718.205107] MXL5005S: Attached at address 0xc6
[  718.205112] dvb-usb: AverMedia AVerTV Volar Black HD (A850) successfully initialized and connected.


I restarted the Tvheadend initscript:

Code: Select all
/etc/init.d/tvheadend restart

and now Tvheadend (http://localhost:9981/extjs.html) in the browser GUI sees the stick. I then used the Tvheadend browser GUI to select my nearest Freeview (free-to-air digital TV) transmitter. I had to select Crystal Palace, as another transmitter which is also listed (along with many other UK locations) and is not too far away, would not work. Then I had to tell Tvheadend to map the DVB services to channels. It took a couple of minutes for Tvheadend to scan and register all the channels. (As with the ezcap stick, the supplied tiny aerial is useless; the stick is only able to detect channels if an external roof-mounted TV aerial is connected to it.)

Then I launched XBMC (which is still configured as per my earlier post) and... IT WORKS! Sharp digital TV in XBMC. :cheers:

I have to configure each TV channel in XBMC to turn off subtitles and, for some channels, turn on audio. It's great.

So now I can go ahead and buy a nettop for the next part of my project. 8)
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7981
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Request for advice on making a Media Centre

Postby Fitzcarraldo » Sat Mar 20, 2010 0:00

Well, I got my nettop yesterday and have spent today installing SL and configuring it. I plumped for the ASRock ION 330HT in the end, as it has had very good reviews. Fortunately it works beautifully with SL.

EDIT (March 25, 2010 11:09 UTC): The only thing that does not work under SL is the IR receiver built into the PC; there is no driver module lirc_wb677.ko available for Gentoo/SL. ASRock supply via their Web site a compiled lirc_wb677.ko for Ubuntu 9.10 (kernel 2.6.31) but, despite a lot of hacking and compiling a module lirc_wb677.ko under SL, I have not been able to get the IR receiver working. A work-around would be to buy a USB IR receiver, which would work with LIRC and the supplied IR remote controller (or a third-party IR remote controller).

EDIT (March 28, 2010 10:10 UTC): I have now got the ASRock IR receiver and the ASRock remote controller working nicely under SL with the 2.6.33 kernel. The remote controller works very well with XBMC. See the above-mentioned thread on the ASRock ION 330HT for how I achieved this.

There's a new version of Tvheadend (version 2.10) and a new ebuild for it. You'll need to download the files from Gentoo Bugzilla Report No. 288022, and the tarball from the Tvheadend site (Google it). To install:

Code: Select all
mkdir -p /usr/local/portage/media-tv/tvheadend/files/
cp /home/fitzcarraldo/Downloads/tvheadend-ffmpeg.patch /usr/local/portage/media-tv/tvheadend/files/
cp /home/fitzcarraldo/Downloads/tvheadend.initd /usr/local/portage/media-tv/tvheadend/files/
cp /home/fitzcarraldo/Downloads/tvheadend.confd /usr/local/portage/media-tv/tvheadend/files/
cp /home/fitzcarraldo/Downloads/tvheadend-2.10.ebuild /usr/local/portage/media-tv/tvheadend/
cd /usr/local/portage/media-tv/tvheadend/
cp /home/fitzcarraldo/Downloads/hts-tvheadend_2.10.tar.gz /usr/portage/distfiles/
ebuild tvheadend-2.10.ebuild manifest
emerge -1v tvheadend
rc-update add tvheadend default

See my previous posts for how to configure Tvheadend and XBMC.

To display the output of the nettop on my old Sony TV (which only has a choice of SCART, Composite Video and S-Video inputs) I use a VGA to RCA/S-VIDEO/VGA converter (manufacturer Lenkeng, model LKV-2000) to connect the 15-pin VGA socket on the nettop to an S-Video socket on the TV:

Image

and a good-quality stereo 3.5mm jack plug to twin phono RCA lead, gold, 1.5M to connect the stereo 3.5 mm jack socket on the nettop to two RCA audio sockets on the TV.

Image
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7981
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Next

Return to Software in General

Who is online

Users browsing this forum: No registered users and 3 guests