Trouble

Compiling driver for DVB-C stick (TT CT2-4400) SOLVED

51 29431
maxwell  
Post Last Edited by maxwell at 2014-8-9 15:24

UPDATE *** UPDATE
Turns out missing headers and many other things were just the beginning. But post #21 marks the successful working of the driver, so no need to read everything all too carefully till then. To sum it up. That stick and probably some of the other new ones by Technotrend will work fine on the BPi.
UPDATE *** UPDATE

Hello everyone,
I am new to the BPi scene and enjoy every second of it. Used a RPi before for my webserver needs and so on. With the new power of the BPi I want to add a tv streaming service with DVB-C sticks based on tvheadend. So far so good. I got everything working with a Hauppauge 930-c one (no, not the HD one) but it is totally unreliable so I bought a new Technotrend CT2-4400 stick that I try to use now.

Problem is, drivers are not built in to the kernel, so I need to compile them myself. Technotrend delivers driver sources and some instructions for it, they tested for kernels 3.5.x onwards but I don't see a reason why they shouldnt compile with 3.4.90:
http://www.tt-downloads.de/Linux/media_build-bst-140417.tar.gz
http://www.tt-downloads.de/Linux ... 00ci_ct2-4650ci.pdf

On the make command I get error:
  1. Preparing to compile for kernel version 3.4.90
  2. File not found: /lib/modules/3.4.90/build/.config at ./scripts/make_kconfig.pl line 33, <IN> line 4.
  3. make[1]: *** No rule to make target `.myconfig', needed by `config-compat.h'.  Stop.
  4. make[1]: Leaving directory `/root/media_build-bst/v4l'
  5. make: *** [all] Error 2
Copy the Code
As my research tells me so far, I need kernel headers and whatnot. And I see that kernel sources are released now and there are some basic instructions in the wiki ( http://wiki.lemaker.org/index.php?title=Building_u-boot,_script.bin_and_linux-kernel ), but they are waaay too advanced for a noob like me (getting cross toolchain instructions fails on me and "You also can use the Linaro tool chain or Code Sourcery tool chain" doesn't help either).

QUESTION:
Does my driver compilation fail because of missing kernel headers?
Will adding the sources from github help?
If so, can someone please help me with the driver compilation (adding the sources, where tio put etc.)?

Any "copy and pasteable" shell instructions would be awesome. :-)

Oh, I use the 3.0 Lubuntu image on my BPi.

Best regards
Maxwell
Post Last Edited by sashijoseph at 2014-8-3 08:54

Reading the pdf suggests the drivers are for x86 machines,not ARM.

The V4L directory contains binaries for PC's,x86 and x64
hard luck...

maxwell  
Hello sashijoseph,
thanks for taking a look at my problem. I had the feeling that it didn't really matter which platform that thing is for. If you had a linux driver, one could compile it for any platform. Hmm....

When I take a look at this thread on the ODROID Forum, that guy is able to at least compile the driver on his ARM platform (other model, same driver), runs into other problems though:
http://forum.odroid.com/viewtopic.php?f=80&t=3991

I just hoped it would be as easy as my Hauppauge DVB-Stick, works on x86 x64 ARM and wherever.

Someone else able to clear things up a little more?

Thanks and cheers
Maxwell

maxwell  
Post Last Edited by maxwell at 2014-8-6 03:45

Post Last Edited by maxwell at 2014-8-4 16:09

*** OBSOLETE ***

ARM version for CT2-4400 and others: ftp://ftp.satelco.de/sit2-Cortex-A9.zip

maxwell  
Post Last Edited by maxwell at 2014-8-4 16:09

*** OBSOLETE ***

Post Last Edited by maxwell at 2014-8-3 16:36

Okay, putting the supposed compiled driver for that DVB-C stick into "/usr/lib" gives me at least some output on boot:  dmesg | grep usb

  1. [    4.186000] usb 3-1.4: New USB device found, idVendor=0b48, idProduct=3014
  2. [    4.199167] usb 3-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  3. [    4.210543] usb 3-1.4: Product: TechnoTrend USB-Stick
  4. [    4.219261] usb 3-1.4: Manufacturer: CityCom GmbH
  5. [    4.227283] usb 3-1.4: SerialNumber: 20131128
Copy the Code
Does that mean the BPi knows what this device is and has successfully loaded its driver?

My other Hauppauge 930c stick gives similar messages, it too, needed some more files in "/lib/firmware" for I don't really know. Those firmware files are extracted pretty easily, I've done that for the Technotrend as well, but don't get these other nice messages that seem to make the device REALLY available in the system:

  1. [   22.658352] DVB: registering new adapter (em28xx #0)
  2. [   22.664743] DVB: registering adapter 0 frontend 0 (DRXK DVB-C DVB-T)...
  3. [   22.689940] em28xx #0: Successfully loaded em28xx-dvb
  4. [   22.697366] Em28xx: Initialized (Em28xx dvb Extension) extension
Copy the Code
Seems the journey is progressing but there are still some things missing. I want "DVD: registering..." message for my Technotrend as well :-D

UPDATE: Yeahh, just the USB message isn't enough to make the device work, the other messages are totally needed. There must be a /dev/dvb/adapter0    at the end.

maxwell  
Post Last Edited by maxwell at 2014-8-4 19:53

Post Last Edited by maxwell at 2014-8-4 16:44

Post Last Edited by maxwell at 2014-8-4 16:42

So yes, after reading some more into "everything", sashijoseph was of course right, the provided modules by Technotrend were just the precompiled (the closed sourced parts) modules for x86 and x64! The link I posted two answers before seem to be the precompiled ARM modules.

I got a bit further in my journey, reading the wiki more carefully, I was able to put the linux kernel source into "/lib/modules/3.4.90/build" where "make" was looking for sources. And guess what, I don't get the errors from my first post anymore. But of course, I get new error messages now. Hopefully some of you are able to see what is wrong:

  1. Generating vicam/firmware.fw
  2. Generating ttusb-budget/dspbootcode.bin
  3. Generating cpia2/stv0672_vp4.bin
  4. Generating av7110/bootcode.bin
  5. make[2]: Leaving directory `/root/media_build-bst/v4l/firmware'
  6. Kernel build directory is /lib/modules/3.4.90/build
  7. make -C ../linux apply_patches
  8. make[2]: Entering directory `/root/media_build-bst/linux'
  9. Patches for 3.4.90 already applied.
  10. make[2]: Leaving directory `/root/media_build-bst/linux'
  11. make -C /lib/modules/3.4.90/build SUBDIRS=/root/media_build-bst/v4l  modules
  12. make[2]: Entering directory `/lib/modules/3.4.90/build'
  13.   CC [M]  /root/media_build-bst/v4l/altera-lpt.o
  14. scripts/basic/fixdep: 1: scripts/basic/fixdep: Syntax error: end of file unexpected (expecting ")")
  15. make[3]: *** [/root/media_build-bst/v4l/altera-lpt.o] Error 2
  16. make[2]: *** [_module_/root/media_build-bst/v4l] Error 2
  17. make[2]: Leaving directory `/lib/modules/3.4.90/build'
  18. make[1]: *** [default] Error 2
  19. make[1]: Leaving directory `/root/media_build-bst/v4l'
  20. make: *** [all] Error 2
Copy the Code
UPDATE
I did a "make menuconfig" and disabled that altera (pretty sure I don't need it) thing and the compiling went, till "flexcop". Seems I need to fight my way through and see when compilation finishes some time soon.....

UPDATE2
Errors kept coming and coming. Still trying to finish a cross compiling in a virtual mashine. The last "ARCH=arm DESTDIR=... make install" etc. gives me error on unrecognizable input file or something (too tired, just turned off the VM ;-) )
Pretty frustrating just trying to make a stupid DVB-C stick work. Maybe I just plug it into my Windows based HTPC... ;-)


Thanks and cheers
Maxwell

Hi Maxwell...
I'm no kernel Pro myself...just learning.

In the V4L folder there should be a ".myconfig" file which looks like a list of modules to be compiled.
Try changing ":= m " to " := n" for drivers which you don't need or if the build is failing on a particular module which hopefully is not for your device.
As a test,by changing all to "n" except two(2 Altera ones),I managed to cross complile and build the two Altera modules cleanly.

Hey,

I'm standing infront of the same problem like you.
  1. make[2]: Leaving directory `/home/bananapi/media_build/linux'
  2. ./scripts/make_kconfig.pl /lib/modules/3.4.90/build /lib/modules/3.4.90/build 1
  3. Preparing to compile for kernel version 3.4.90
  4. File not found: /lib/modules/3.4.90/build/.config at ./scripts/make_kconfig.pl line 33, <IN> line 4.
  5. make[1]: *** [allyesconfig] Error 2
  6. make[1]: Leaving directory `/home/bananapi/media_build/v4l'
  7. make: *** [allyesconfig] Error 2
  8. can't select all drivers at ./build line 490.
Copy the Code
But I can't find any ".myconfig" file in v4l. I've pulled the sources from git (http://git.linuxtv.org/cgit.cgi/media_build.git/). Any ideas?

maxwell  
Post Last Edited by maxwell at 2014-8-5 03:25

Hello sashijoseph,
thanks for the great tip! I managed to disable most of the modules with "make menuconfig", but going into ".myconfig" seems a lot faster and easier.

What frustaded me the most was that compiling the media_build directly on the pi threw me errors like the above on almost every *.o file. Crosscompiling on my Linux VM went pretty smooth, just some erros with how some functions are called. I blame that on the old kernel and I just changed the *.c files. The compiling went through.

So I am on the final step to do the "make install". I use this line to make it output the modules to another directory:

  1. ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- DESTDIR=/home/pi/output make install
Copy the Code
It starts clearing "obsolete" files from the output directory and starts placing the *.ko files in their corresponding subdirectories, but after some files I immediately get erros like this:

  1. strip: Unable to recognise the format of the input file `/home/pi/output/lib/modules/3.4.90/kernel/drivers/media/usb/em28xx/em28xx.ko'
  2. make[1]: *** [media-install] Error 1
  3. make[1]: Leaving directory '/home/pi/media_build-bst/v4l'
  4. make: *** [install] Error 2
Copy the Code
And then it stops. What does that tell me?

An idea. The modules are normally nicely organized in sub directories like "driver/media/video..." . That's what make install does, right? Can't I just copy all the *.ko files from the V4L directory and put them in "driver/media" without the sudirectories manually, without using the error prone "make install"? Shouldn't that work?

Of course I tested that but my DVB-C stick still does not get recognized. ;-) Just checking if this is a useable option and I could look for another reason.

Thanks again for your helpful replies!

Cheers
Maxwell

maxwell  
Post Last Edited by maxwell at 2014-8-5 08:09

Post Last Edited by maxwell at 2014-8-5 06:02

Hey Ligachamp,
sorry, missed your reply ;-)

You don't only need to pull the git for media_build but as well need the bananapi kernel-sources first. Please follow the instructions here on topic "Building the kernel":
http://wiki.lemaker.org/index.php?title=Building_u-boot,_script.bin_and_linux-kernel

That helped me a lot. I tried to do that directly on the BPi but if your read my previous replies, it gave me a lot of headaches. Best is to do it by cross compiling (saves a lot of time, too). For that follow "Get a cross toolchain" in the same wiki page.

I assume you will be using the cross compiler option, then you can "try" the make command in media_build like this:

  1. ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- DIR=/path/where/you/downloaed/the/kernel/sources/before/ make release
  2. ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- make -j5
Copy the Code
On BPi directly just try "make". Maybe you get further than me and can post your result.

This will get you a lot further. Hope this helped a little.

UPDATE
Compiling the media_build right on the Raspberry Pi right now with all modules and it is running super smoothly right now. Let's see how it finishes. Kernel on Banan Pi just too old?

UPDATE
Ok, I give up for now. Compiling on RPi went quite good with some resolvable error but didn't make the final goal, making that one DVB-C stick work. Starting fresh with a new x32 Lubuntu VM and go cross compiling only. I post results.

Cheers Maxwell

You have to log in before you can reply Login | Sign Up

Points Rules