Trying To Compile Custom V4L


mcobit

Advanced Member
Joined
Jul 28, 2008
Messages
6,909
Hello,
I try to compile a driver for a dvb-t stick.
But when I do make I get the following error:

Code:
make -C /media/PANDORA_SD2/v4l-dvb-1da5fed5c8b2/v4l 
make[1]: Entering directory `/media/PANDORA_SD2/v4l-dvb-1da5fed5c8b2/v4l'
Updating/Creating .config
Preparing to compile for kernel version 2.6.27
File not found: /lib/modules/2.6.27.46-omap1/build/.config at ./scripts/make_kconfig.pl line 32, <IN> line 4.
make[1]: *** No rule to make target `.myconfig', needed by `config-compat.h'.  Stop.
make[1]: Leaving directory `/media/PANDORA_SD2/v4l-dvb-1da5fed5c8b2/v4l'
make: *** [all] Error 2

First thing I thought is that I need to install the kernel-headers. But I don't know how in angstrom.

Already tried "opkg install kernel-headers" and "opkg install kernel-headers-$(uname -r)"

Both don't work.

Can anyone help?
 
as root :
Code:
mkdir -p /lib/modules/2.6.27.46-omap1/build
zcat /proc/config.gz >/lib/modules/2.6.27.46-omap1/build/.config
:)
 
OK, thank you very much. It goes on. Now I get the following:

Code:
make -C /media/PANDORA_SD2/v4l-dvb-1da5fed5c8b2/v4l 
make[1]: Entering directory `/media/PANDORA_SD2/v4l-dvb-1da5fed5c8b2/v4l'
perl scripts/make_config_compat.pl /lib/modules/2.6.27.46-omap1/build ./.myconfig ./config-compat.h
File not found: /lib/modules/2.6.27.46-omap1/build/include/linux/netdevice.h at scripts/make_config_compat.pl line 15.
make[1]: *** [config-compat.h] Error 2
make[1]: Leaving directory `/media/PANDORA_SD2/v4l-dvb-1da5fed5c8b2/v4l'
make: *** [all] Error 2

It seems there is more needed. The headers for the kernel of the pandora are not in the repositories. Is there an ipk file for them so I can install them easily, or has someone an idea what to do next?
 
So now I copied the header files from git to /include and it doesn't complain anymore.
Now I get the next error:

Code:
firmware'
  CC  ihex2fw
Generating vicam/firmware.fw
Generating dabusb/firmware.fw
Generating dabusb/bitstream.bin
Generating ttusb-budget/dspbootcode.bin
Generating cpia2/stv0672_vp4.bin
Generating av7110/bootcode.bin
make[2]: Leaving directory `/var/volatile/tmp/homeExtend/digivox/v4l-dvb/v4l/firmware'
Kernel build directory is /lib/modules/2.6.27.46-omap1/build
make -C /lib/modules/2.6.27.46-omap1/build SUBDIRS=/var/volatile/tmp/homeExtend/digivox/v4l-dvb/v4l  modules
make[2]: Entering directory `/lib/modules/2.6.27.46-omap1/build'
make[2]: *** No rule to make target `modules'.  Stop.
make[2]: Leaving directory `/lib/modules/2.6.27.46-omap1/build'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/var/volatile/tmp/homeExtend/digivox/v4l-dvb/v4l'
make: *** [all] Error 2

From google I got the Impression I need the complete kernel-source. Is this true or has someone another idea?
Or would it be possible, that someone with a working kernel-dev-environment could compile the module for me?
I just need the driver for the RTL2832U.

It is downloadable here:
Driver

And I am following this tutorial:

Tutorial

Or would it be easier to wait that the new kernel is implemented into the firmware?

Thanks!
 
I will write on, as I progress, for people like Pleng, that had similar problems.

I Downloaded the complete Kernel-Source from git now and was able to compile with some errors.
After the Install the modules could't be loaded because of a "no symbol version for struct module" error.

Now I'm off to compile the kernel-sources to get all the Information and files, that this drivers need to build.

I hope something useful will come out of this.

Edit: A question: How long do you think will it take to compile the pandora-kernel on the Pandora? Running for an Hour now.

Edit2: If this works I will write a tutorial for those who want to compile their kernelmodules themselves. But it would be cool to have downloadable kernel-sources and headers with the next kernel-release.

Edit3: Ah yes, and this topic should got to "Software" maybe...
 
mcobit said:
Edit: A question: How long do you think will it take to compile the pandora-kernel on the Pandora? Running for an Hour now.
It takes about 15 minutes on my 2.4Ghz quad core if I remember correctly. I would expect it to take between 4 and 8 hours to compile on the Pandora, assuming it can at all. Compiling something as complex as the kernel takes a lot of memory and you may actually run out before it's finished. One of the cases where swap may come in handy.
You may be able to cut that time approximately in half if you overclock to 1Ghz.
 
Last edited by a moderator:
It took 3 Hours.
Remember that the Pandora kernel is an embedded linux kernel and the source is only about 270 MB. There is not everything in it, that is in the mailine kernel. After make the directory is approx. 1 GB.

Edit: I overclocked to 800mhz and no memoryproblems at all.
 
Success!

The driver is compiled and I was able to scan for TV-Stations with the dvb-apps package.
I can view TV with the VLC-Player, that Sebt3 packaged up.

Video and detailed description will follow here soon.
 
mcobit said:
Success!

The driver is compiled and I was able to scan for TV-Stations with the dvb-apps package.
I can view TV with the VLC-Player, that Sebt3 packaged up.

Video and detailed description will follow here soon.
Congrats !!!
 
Last edited by a moderator:
So, I will give some detailed information about the process:

I am using a MSI Digi Vox Mini Air adapter. It was the smallest I could find an it is only 24.95 € at "Saturn". (For the germans, that would like to buy it too).

Digi Vox Mini Air

It has no drivers in the current kernel and as I didn't have a kernel-developement-setup, the only chance is to compile the driver myself.


The chipset used in this product is the Realtek rtl2832u.

The driver is on the Internet in a package with a very handy installer script. For this adapter version 1.4.2 is the only working one.

rtl2832u Driver


Now for the compiling:

I used a dev-extend and a 2GB home-extend from Stuckies extends.
Mounted both and opened a shell. Then I did the following.

Now I went to my UBUNTU Box and installed git.

With the command:
Code:
git clone git://git.openpandora.org/pandora-kernel.git kernel

I could download the kernel-source of the pandora-kernel.

When this finished, I copied the folder to my sd-card (approx. 270MB).

Now back to the Pandora:

Here I copied the source to the home extend:

Code:
cp -r /path/to/your/SD/kernel /var/volatile/tmp/homeExtend/

Went to the home-extend and into the copied folder:

Code:
cd /var/volatile/tmp/homeExtend/kernel

Now it is time to compile (not install!) the kernel.
For that i had to create some symlinks in the /usr/bin folder because the compiler looks for different filenames:

Code:
sudo ln -s /usr/bin/arm-angstrom-linux-gnueabi-ar /usr/bin/arm-linux-ar
sudo ln -s /usr/bin/arm-angstrom-linux-gnueabi-nm /usr/bin/arm-linux-nm
sudo ln -s /usr/bin/arm-angstrom-linux-gnueabi-ld /usr/bin/arm-linux-ld
sudo ln -s /usr/bin/arm-angstrom-linux-gnueabi-gcc /usr/bin/arm-linux-gcc
sudo ln -s /usr/bin/arm-angstrom-linux-gnueabi-objcopy /usr/bin/arm-linux-objcopy
sudo ln -s /usr/bin/arm-angstrom-linux-gnueabi-objdump /usr/bin/arm-linux-objdump

Now I did:

Code:
make oldconfig
make prepare scripts

Then I copied back the original .config file from /proc/config.gz (thanks sebt3)

Code:
mkdir -p /lib/modules/2.6.27.46-omap1/build
zcat /proc/config.gz >/lib/modules/2.6.27.46-omap1/build/.config

Now I did
Code:
make

This compiles the kernel! Takes about 3 Hours at 800mhz.
There are some warnings but I ignored them for now.

The kernel needed to be compiled because there are some files, that are only there after compilation, that the driver needed to compile.

Whe this finished I did:

Code:
make modules

I don't know if it is necessary but It doesn't hurt, I think.


Now that I had a compiled version of the kernel-source, I could link it to where the drivers expect it:

Code:
mkdir /lib/modules/2.6.27.46-omap1/build
ln -s /var/volatile/tmp/homeExtend/kernel/* /lib/modules/2.6.27.46-omap1/build/

Now I downloaded and extracted the driver package:
Code:
 cd /var/volatile/tmp/homeExtend/
wget http://www.turnovfree.net/~stybla/linux/v4l-dvb/lv5tdlx/091207_RTL2832U_LINUX_Ver1.4.2.rar

As there is no rar in the pandora-image, I converted the package with some online unpacker like WobZIP.
I downloaded the onlinecreated zipfile and unzipped it:

Code:
unzip archive.zip

Then went into the folder and ran the install.sh script. That had to be done as root, because it includes the make install command.

Code:
cd archive/091207_RTL2832U_LINUX*/
sudo sh install.sh

The rest did the script.

Now I had the drivers installed in the dev-extend.

After a reboot and mounting of the dev-extend I was able to scan for channels using the dvb-apps:

Code:
opkg install dvb-apps dvb-scan tvb-tzap
scan -o zap /usr/share/dvb/dvb-t/de-Hessen >~/channels.conf

This scans the transponder for channels and saves this information in a file called channels.conf in your home directory.

Then I started VLC (the packaged one by sebt3, not from the repros, as there seems to be no dvb support in it).

To watch the stream I had to open the file channels.conf with the open file-menu in VLC.

Then you can open view -> Playlist to see al the channels.

Note: It is pretty necessary to overclock for this. With 900 Mhz everyting is fluid. With 800 Mhz the picture will stutter sometimes, because the cortex can't keep up with rendering the picture.
Some dsp-action would be required here to do it at stock-speed.

20101006140302389.jpg


After the first tests, I copied the modules in /lib/modules/ over to the nand (I just copied the whole folder, because I didn't know which modules were necessary), so that I don't have to mount the dev-extend everytime.

Maybe someone could help me to package the modules up for the others to use.

Edit: I typed this mainly from memory! If anyone finds some mistakes, please write them here that I can correct them in the post.
 
Very Nice! I will try to make the Modules for http://www.linuxtv.org/wiki/index.php/Afatech_AF9015 because I have MSI DIGI VOX Mini II V3.0.

Hmm I hope I am not to stupid for it :)











Ps: most likely I am way to stupid for it, so if anyone is faster, please tell and provide the modules :)
 
Holliefant said:
Very Nice! I will try to make the Modules for http://www.linuxtv.org/wiki/index.php/Afatech_AF9015 because I have MSI DIGI VOX Mini II V3.0.

Hmm I hope I am not to stupid for it :)











Ps: most likely I am way to stupid for it, so if anyone is faster, please tell and provide the modules :)

This Stick has the same Chip (multiple versions of Chips in the same Product). But maybe it will hang with this driver. You need Version 1.1.
I can compile it for you, if you like. Or I can give you a copy of this modules to test if it works with this.
 
Last edited by a moderator:
If you could provide me with modules, that would be really wonderful :)

Hmm if we get ever video acceleration the Pandora would surely become the best tool ever :)
 
Holliefant said:
If you could provide me with modules, that would be really wonderful :)

Hmm if we get ever video acceleration the Pandora would surely become the best tool ever :)

Here you go! And everybody else who wants to try.
Please note: This is experimental! I'm not responsible if you mess up somethig!
Download

This is the complete modules folder from my nand.
I compiled for my dvb-t stick.

dmesg should say something like this if they work:
Code:
[ 3105.048400] usb 1-2: New USB device found, idVendor=1d19, idProduct=1102
[ 3105.055206] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3105.062438] usb 1-2: Product: Rtl2832UDVB
[ 3105.066497] usb 1-2: Manufacturer: Realtek
[ 3105.070617] usb 1-2: SerialNumber: 1
[ 3105.735839] dvb-usb: found a 'DK mini DVBT DONGLE' in warm state.
[ 3105.742095] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[ 3105.753570] DVB: registering new adapter (DK mini DVBT DONGLE)
[ 3105.763977] DVB: registering adapter 0 frontend 0 (Realtek RTL2832 DVB-T  RTL2836 DTMB)...
[ 3105.772552] dvb-usb: DK mini DVBT DONGLE successfully initialized and connected.
[ 3105.780090] dvb-usb: found a 'DK mini DVBT DONGLE' in warm state.
[ 3105.786285] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[ 3105.949859] DVB: registering new adapter (DK mini DVBT DONGLE)
[ 3105.960296] DVB: registering adapter 1 frontend 0 (Realtek RTL2832 DVB-T  RTL2836 DTMB)...
[ 3105.968841] dvb-usb: DK mini DVBT DONGLE successfully initialized and connected.
[ 3105.976440] usbcore: registered new interface driver dvb_usb_rtl2832u

Edit: it is possible, that you have to set the folder attributes to 775 or something after copyin.
 
Last edited by a moderator:
I can´t scan at the moment because I don´t have any reception here, but it seems that it is working.
 
Holliefant said:
I can´t scan at the moment because I don´t have any reception here, but it seems that it is working.

Great! What does dmesg say?
 
Last edited by a moderator:
[110046.814178] usb 1-2: new high speed USB device using ehci-omap and address 6
[110046.983856] usb 1-2: configuration #1 chosen from 1 choice
[110047.081207] dvb-usb: found a 'Afatech AF9015 DVB-T USB2.0 stick' in cold state, will try to load a firmware
[110047.091156] firmware: requesting dvb-usb-af9015.fw
[110047.159637] dvb-usb: downloading firmware from file 'dvb-usb-af9015.fw'
[110047.249481] dvb-usb: found a 'Afatech AF9015 DVB-T USB2.0 stick' in warm state.
[110047.257568] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[110047.285552] DVB: registering new adapter (Afatech AF9015 DVB-T USB2.0 stick)
[110047.838470] af9013: firmware version:4.95.0
[110047.847076] DVB: registering adapter 0 frontend 0 (Afatech AF9013 DVB-T)...
[110047.855102] tda18271 4-00c0: creating new instance
[110047.915832] TDA18271HD/C2 detected @ 4-00c0
[110048.225708] dvb-usb: Afatech AF9015 DVB-T USB2.0 stick successfully initialized and connected.
[110048.329711] Afatech DVB-T 2: Fixing fullspeed to highspeed interval: 16 -> 8
[110048.346405] input: Afatech DVB-T 2 as /devices/platform/ehci-omap.0/usb1/1-2/1-2:1.1/input/input12
[110048.400390] input: USB HID v1.01 Keyboard [Afatech DVB-T 2] on usb-ehci-omap.0-2
[110048.408660] usb 1-2: New USB device found, idVendor=15a4, idProduct=9016
[110048.415496] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[110048.422790] usb 1-2: Product: DVB-T 2
[110048.426605] usb 1-2: Manufacturer: Afatech
[110048.430816] usb 1-2: SerialNumber: 010101010600001


I had to put the firmware in /lib/firmware but thats normal :)
 
Oh, yes. Firmware was not necessary for my stick. Hope you can watch now. Looks as if it was successfully initialized. In the v4l package were a lot of drivers so this could work with a lot of adapters.
 
Back
Top