Gilzad is a music composer and a software developer. Most of his life he is busy chilling.


01 Aug - 31 Aug 2010
01 Sep - 30 Sep 2010
01 Nov - 30 Nov 2010
01 Dez - 31 Dez 2011
01 Nov - 30 Nov 2012
01 Feb - 28 Feb 2013
01 Mai - 31 Mai 2013
01 Jun - 30 Jun 2013
01 Mai - 31 Mai 2014
01 Apr - 30 Apr 2015


Gilzad's music
Sounding People
Soundevotion Compo
Musical Android


neueste Kommentare


Powered by Pivot - 1.40.7: 'Dreadwind' 
XML-Feed (RSS 1.0) 
XML: Atom Feed 

« Bluetooth manager | Home | How they wash our bra… »

TeVii S660-S2 on Debian Squeeze

07 09 10 - 22:30 Installing the DVB-S receiver "TeVii S660 S2" on Debian Squeeze... Update: For kernel you will need to upload a different firmware to the device than before. Get the newest driver packge from Tevii and replace your old /lib/firmware/dvb-usb-s630.fw
with the extracted dvb-usb-s660.fw. However the driver will be searching for the old file so you need to rename dvb-usb-s660.fw to dvb-usb-s630.fw and then you're done.

I searched the net a lot and found out that the TeVii S660 is well supported under Linux. For a DVB-S device that is capable of receiving HD signals (S2, that is not full-HD), it's a rather expensive one, currently priced somewhere around 75,- €.
But having read all those comments, people seemed to have good experiences with it, so I decided to invest the money.

After plugging in the device, there was a good thing. The device id and product id were known. The bad thing was, the firmware was missing on my system yet.
So dmesg told me something like Hey, I've found a TeVii S660 but I can't find the firmware 'dvb-fe-ds3000.fw'.
And I thought "hey, I'm smart" and just downloaded the first file I had found from here. DO NOT DO THIS.
It's important you care about this because else your life will become horrible. Worse than those things that happen, if you don't forward a mass email.

After putting the driver to /lib/firmware/ and reconnecting the usb connection, the driver loaded successfully for one single time but then the device would never again be recognized as "TeVii S660".
What had happened was that the firmware that always resided on my device had been erased. Ever since the device was not being recognized as 'tevii s660' anymore but only its basic circuit board "EZ-USB":

[ 479.072622] usbtest 2-3:1.0: FX2 device
[ 479.072630] usbtest 2-3:1.0: high speed {control bulk-in bulk-out} tests (+alt)

Bus 002 Device 005: ID 04b4:8613 Cypress Semiconductor Corp. CY7C68013 EZ-USB FX2 USB 2.0 Development Kit

Great, a fresh new USB 2.0 Development Kit for 75,- €. After I had searched the world for a DVB-S device that would work out of the box on linux. Yes, I can see the irony myself. Go on laughing. I bet you're still reading this because you spoiled your device just the same way. And yes, I took the road and got it up running again, so just hang on.

First I was shocked and assumed that the device would not be recognized on Windows, too since the permanent firmware was not there anymore.
After booting up Windows my horrible assumption got confirmed. Yes, the EZ-USB board is not known to Windows, nor can an enforced driver installation of the TeVii S660 flash it with the needed firmware.
Then, stupid me, I saw that TeVii offered linux drivers for the device themselves. So I downloaded, compiled and installed those, hoping that they'd automatically clear any lack of my intelligence.
And there was at least one good thing to see. The driver package seems to contain the correct firmware dvb-usb-teviis660.fw which will automatically be installed to your firmware path. But the lack of intelligence remained. No automatic firmware upload to an unknown USB board.

Getting closer
After having sent an eMail to TeVii to find out if they could help me, I still googled a bit and found this very helpful link., which explains how one can upload firmware to these generic EZ-USB boards . Well, obviously I wasn't the only one trying to do exactly this. That's the great thing about Linux. You're not alone. That page describes how you can upload iHex files to your device using fxload. But I only had a binary firmware and I was not able to upload this one.
So, there was the new job. Convert a binary file to an ihex file. Once again I crawled half the world to find a tool that would do this. The first one I found was File In Hex for Windows and it worked well under Wine. But well, hex is not exactly iHex. Crawl on, Gilzad, crawl on.
Actually, after I had tried to find a tool that would convert Hex to iHex, Google must have noticed what I was actually searching for so I found this German site which exactly describes how to convert binary files to iHex. Awesome!
Luckily the tool that the page suggests for the conversion is a command line tool, avr-objcopy. And if you've just followed the link, you found out that it's available for linux, too. In Debian it's just called "objcopy".
Now we've got all the tools to upload the correct firmware to the cleared device memory. And will it work just like that? Yes, I've been there, here's the steps:

Reactivate TeVii S660
  1. Become root.
  2. Make sure you've got the tools fxload and objcopy installed.
    aptitude install fxload objcopy
  3. Convert the firmware 'dvb-usb-teviis660.fw' shipped with the TeVii driver package from binary to ihex, using objcopy:
    objcopy -O ihex -I binary dvb-usb-teviis660.fw dvb-usb-teviis660.hex
  4. Find out the current bus and device number of the USB card:
    Bus 002 Device 008: ID 04b4:8613 Cypress Semiconductor Corp. CY7C68013
    EZ-USB FX2 USB 2.0 Development Kit
  5. Upload the ihex version of the firmware to the device's address by
    using fxload:
    fxload -t fx2 -D /dev/bus/usb/002/008 -I dvb-usb-teviis660.hex -m 0666
    (note that 002 is the current bus and 008 the current device order)
  6. Check if the device has become the Tevii S660 again:
    Bus 002 Device 007: ID 9022:d660 TeVii Technology Ltd. DVB-S2 S660

Congratulations! Now we've got back what we paid 75,- € for in the beginning.
But wait, the device is still spoiled. The firmware is no longer burnt in its flash memory. We need to upload it each it we want to use the receiver.
Well, that R5000-page that tought us how to upload firmware to an EZ-USB board, also teaches us how to have proper udev rules, so the firmware can be uploaded, each time you boot or connect the device. Since R5000-for-Linux is an open source project, we can have a look at the file that shall contain the proper udev rules. Yet another good thing about Linux. Open.

So the conclusion is: We're not done yet.

Set up udev rules
  1. Become root
  2. Place your hex file dvb-usb-teviis660.hex to /lib/firmware/.
    cp dvb-usb-teviis660.hex /lib/firmware/
  3. List your files in /lib/udev/rules.d/
    ls /lib/udev/rules.d/

  4. Create a text file that contains the rules how to find the EZ-USB board and upload the proper firmware to it. The following two lines should be its content (yes, it's really just two lines once pasted in the editor):
    SUBSYSTEM=="usb", ACTION=="add", ENV{PRODUCT}=="4b4/8613/*", RUN+="/sbin/fxload -D %N -I /lib/firmware/dvb-usb-teviis660.hex -t fx2 -m 0666"
    SUBSYSTEM=="usb", ENV{PRODUCT}=="9022/d660/*", MODE="666"

    The first line basically finds the EZ-USB board by its device and product id 04b4:8613 and uploads the firmware from /lib/firmware/dvb-usb-teviis660.hex to it.
    The second line finds device that has now changed to TeVii S660, again by its device and product id 9022:d660 and sets read and write access rights to it.
  5. Save the text file with a significant name and a prefix that defines when it has to be executed. I have chosen 86-tevii-s660.rules.
    Considering step 3, this file will be loaded after 85-hwclock.rules. This way I can be sure, the most important system components are up before I attempt to upload the firmware to the receiver.
  6. Place the rules file to /lib/udev/rules.d/
    cp 86-tevii-s660.rules /lib/udev/rules.d/
  7. Reload the uddev rules:
    udevadm control --reload-rules
  8. Unplug and re-plug-in the receiver.
    The device's led's should flash blue shortly.
  9. Check if the baby is there:
    Bus 002 Device 007: ID 9022:d660 TeVii Technology Ltd. DVB-S2 S660
  10. Now the proper driver for your device should be dvb_usb_dw2102
    This one is usually already there in the v4l-package. Check if it is loaded:
    dvb_usb_dw2102 23441 0

Now we're done.

As I'm writing this, I got a bit tired, so let me write down the last instructions for the client applications without detailed steps:

Now you should use w_scan to create a channels.conf file for your client applications. Do not forget to write its stdout to a file (i.e. channels.conf) and to convert that file's character set to utf-8 (use gedit for example).
For actually using the receiver I suggest you to either use MeTV (me-tv in the Debian repos) or klear.
Though I don't like installing kde libraries on my gnome-system, I prefer klear. Its GUI is very simple, it's lightweight and it allows you to remove channels from your imported channels.conf (it actually overwrites this very file). You'll find this feature very useful as soon as you notice that many channels don't work or don't have the content you desire. I, for instance, only kept the pr0ne channels. ...well, at this point you simply expected a comment like that, didn't you? ;)

That's all for now. Good night and happy zapping :)

Trackback link:

Bitte aktiviere JavaScript in Deinem Browser, um eine Trackback URL generieren zu können.