Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

DVB-T dongle running on Nexus 7

OP martintzvetomirov

19th August 2012, 02:25 PM   |  #1  
OP Senior Member
Flag Vratsa
Thanks Meter: 115
 
196 posts
Join Date:Joined: Dec 2008
Donate to Me
More


Ok guys, I am proud to announce that I was able to run a DVB-T tuner on my Nexus 7


If your kernel is 3.1.10-g52027f9 and your dongle is RTL2832U based

If you have a rooted Nexus 7 with kernel 3.1.10-g52027f9 and a RTL2832U based DVB-T dongle, then you can also have your dongle up and running in a matter of minutes. Here are the steps:
  1. Download http://dl.dropbox.com/u/24106229/NexusDvb.rar
  2. Install droidtv.apk from the rar (you can also find it at https://github.com/chrulri/droidtv)
  3. Get a Terminal emulator and cd to the folder where you have extracted the rar. Type in:
    • su
    • sh startdvb
  4. Make sure that all of the files and folders inside /dev/dvb have highest permissions.
  5. Start DroidTV and enjoy!!!


Different dongle, kernel 3.1.10-g52027f9

If you have the same kernel and a dongle that has its drivers built in the kernel according to http://www.linuxtv.org/wiki/index.php/DVB-T_USB_Devices , then you can download this rar file - http://dl.dropbox.com/u/24106229/all-modules.rar (Last updated 20 Aug 22:22 GMT). Those are all of the kernel modules I compiled. You may be able to find your usb driver there.

Compiling kernel modules

If you don't have the same kernel or a dongle is not supported, you will need to get the kernel source and compile the modules yourself. Here's how you do that.
  • Make sure you are running Linux and have make and git already installed
  • Download dvbn7comp and put it into a new directory. Make sure dvbn7comp is executable by running chmod +x dvbn7comp inside the folder
  • Invoke the script like this ./dvbn7comp <kernel_version>. For example if you want to have the modules compiled for 3.1.10-g05b777c, you would run ./dvbn7comp 3.1.10-g05b777c
  • Wait - it may take a while. Usually about 15 minutes depending on your network and CPU speed.
  • After the script finishes running, the .ko files would be put in a directory called output_3.1.10-g05b777c

That's it!

Note: The script will download the kernel source and the toolchain and it will attempt to find the commit that contains the required kernel version. Then it will configure the kernel for DVB-T support and will compile the modules and copy them to the output folder. If you run the script again and the sources are already present, it will not download them again, so any subsequent runs of the script would be faster!

Patching the precompiled binaries [NEW]

Quote:
Originally Posted by phamthanhnam

For those who have another kernel version, you don't need to recompile dvb modules. If your kernel version is not in git revisions, you will just fail with 'fatal: ambiguous argument '3.1.10-xxxxxxxx': unknown revision or path not in the working tree'. Fortunately, there's a much faster and much simpler way to get dvb modules for your kernel version. You don't need git, make, toolchain, kernel source...
Nearly every Android kernel for Nexus 7 is based on 3.1.10 linux kernel (because of nvidia's closed source driver for graphics card), so kernel version for your Nexus 7 will be always 3.1.10-xxxxxxxx.
You can get directly precompiled binary modules (aka *.ko files) at post #1 and patch them for your kernel version:

Code:
perl -pi -e 's/3.1.10-g52027f9/3.1.10-xxxxxxxx/g' *.ko
Alternaties: Get precompiled binary modules at post #80 (more complete than modules from post #1) and patch them:
Code:
perl -pi -e 's/3.1.10-g22b4fcd/3.1.10-xxxxxxxx/g' *.ko
Alternaties 2: Post #129, the same way:
Code:
perl -pi -e 's/3.1.10-g05b777c/3.1.10-xxxxxxxx/g' *.ko
Basically this command replaces 'magic version' in *.ko files. Version mismatch will prevent insmod with an 'exec format error'.
Replace xxxxxxxx by your kernel-version, for example if your kernel version is 3.1.10-g30c5396, use:
Code:
perl -pi -e 's/3.1.10-g52027f9/3.1.10-g30c5396/g' *.ko
That's it!
More info: This way works with Cyanogen Mod kernels/ROMs!!!

How to modify the startdvb script

Code:
echo "Starting DVB support"
insmod dvb-core.ko # core support for DVB
insmod dvb-pll.ko # I am not sure if this is even needed
insmod rc-core.ko # Support for remote control, some drivers won't load otherwise
insmod dvb-usb.ko # Support for usb tuners
insmod dvb-usb-***** # Add here your driver. If more than one needed, add another line
# if firmware is needed, make sure the firmware is in the right folder, it should be /lib/firmware, but I'm not 100% sure
# Also some devices won't need the steps below
echo "Waiting for device"
sleep 5
cd /
mkdir /dev/dvb
mkdir /dev/dvb/adapter0
cd /dev/dvb/adapter0
ln -s /dev/dvb0.frontend0 frontend0
ln -s /dev/dvb0.demux0 demux0
ln -s /dev/dvb0.dvr0 dvr0
ln -s /dev/dvb0.dvr0 dvr0.ts
chmod -R 777 /dev/dvb* # The original script doesn't have it, but try adding a -R before 777 might ease things a bit
echo "DONE!"
Troubleshooting

If any error message occurs, type in dmesg in the terminal. This will give more information why something failed.


How do I know if I'm successful

To check whether you have insmoded the kernels right and after connecting the device whether it has been discovered, use dmesg and look for message similar to "Found DVB device xxx in warm state".

I got it running!!!

If you got it running, please do share with us! It seems like there's a lot of fiddling for some devices to be done so any information will prove invaluable for somebody!!!

NOTE: I don't have the time to support this thread any more, sorry if I am not responding to it! All of the directions above are still valid and working! Browse the comments, you might find that someone has compiled the correct modules for your device/kernel or you might ask someone to do it for you! If you want any of the information above to be edited, please PM me!
Last edited by martintzvetomirov; 29th April 2014 at 01:58 PM.
The Following 32 Users Say Thank You to martintzvetomirov For This Useful Post: [ View ]
19th August 2012, 04:06 PM   |  #2  
Junior Member
Thanks Meter: 3
 
27 posts
Join Date:Joined: Apr 2010
Where to get the DVB tuner
Hi,
Thanks for posting. it is very interesting.
can you post where did you buy the tuner from and the price?
the only one i could find with RTL2832U is priced at 27$ from ebay.

How can i compile the kernel modules for a different device?

thanks.
19th August 2012, 06:36 PM   |  #3  
VonLaserface's Avatar
Senior Member
Flag Minneapolis, MN
Thanks Meter: 25
 
158 posts
Join Date:Joined: May 2010
More
Very cool!

Could a similar technique could be used for ATSC here in the U.S.?
19th August 2012, 07:28 PM   |  #4  
OP Senior Member
Flag Vratsa
Thanks Meter: 115
 
196 posts
Join Date:Joined: Dec 2008
Donate to Me
More
I actually have compiled all of the drivers that come with the Linux kernel as well

You can get them from here - http://dl.dropbox.com/u/24106229/all-modules.rar

If your device is listed as compatible somewhere here - http://www.linuxtv.org/wiki/index.php/DVB-T_USB_Devices then you may be lucky You just need to know which kernel module to load with insmod (see the startdvb script to see how to do it).

If it's not there or you have a different kernel version, you will need to follow https://source.android.com/source/building-kernels.html . Except for you only need to build the modules, and you need to fiddle around with the Makefiles in order to force some of the components (like the dvb-usb.ko) to be compiled as modules. Good luck!

As far as the tuner I am using, it's http://cgi.ebay.co.uk/ws/eBayISAPI.d...m=120958257586 this one. I actually got it for another purpose (http://sdr.osmocom.org/trac/wiki/rtl-sdr), which if I have the time I can try to build an app to bring it to the Android as well
Last edited by martintzvetomirov; 19th August 2012 at 07:35 PM.
The Following 5 Users Say Thank You to martintzvetomirov For This Useful Post: [ View ]
20th August 2012, 09:10 AM   |  #5  
Junior Member
Thanks Meter: 3
 
27 posts
Join Date:Joined: Apr 2010
another question
Thanks for the quick reply!

I couldn't find the right *.ko file in the modules you attached (it is supposed to be af9005 and af9015, and for my other dvb-t - IT9135)
Could i bother you to upload these, since i have no idea how to compile them.

I tried using af9013.ko that you attached but with no success, most likely because i had to use af9005 instead.

I added insmod af9013.ko to your script, attached is a screenshot from my emulator:


Thanks again. Your help is much appreciated!
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2012-08-20-09-53-10.jpg
Views:	6773
Size:	28.6 KB
ID:	1271133  
20th August 2012, 09:28 AM   |  #6  
Junior Member
Thanks Meter: 3
 
27 posts
Join Date:Joined: Apr 2010
another question
double post by mistake
Last edited by lionsh; 20th August 2012 at 09:34 AM.
20th August 2012, 10:37 AM   |  #7  
Senior Member
Thanks Meter: 25
 
456 posts
Join Date:Joined: Apr 2010
Hi, I was wondering about this a few weeks ago.. great to see it working.. do you know if the Sony Play TV tuner would work? I have one of those...

Cheers,
Mick

Quote:
Originally Posted by martintzvetomirov

I actually have compiled all of the drivers that come with the Linux kernel as well

You can get them from here - http://dl.dropbox.com/u/24106229/all-modules.rar

If your device is listed as compatible somewhere here - http://www.linuxtv.org/wiki/index.php/DVB-T_USB_Devices then you may be lucky You just need to know which kernel module to load with insmod (see the startdvb script to see how to do it).

If it's not there or you have a different kernel version, you will need to follow https://source.android.com/source/building-kernels.html . Except for you only need to build the modules, and you need to fiddle around with the Makefiles in order to force some of the components (like the dvb-usb.ko) to be compiled as modules. Good luck!

As far as the tuner I am using, it's http://cgi.ebay.co.uk/ws/eBayISAPI.d...m=120958257586 this one. I actually got it for another purpose (http://sdr.osmocom.org/trac/wiki/rtl-sdr), which if I have the time I can try to build an app to bring it to the Android as well



---------- Post added at 09:37 AM ---------- Previous post was at 08:49 AM ----------

Here is the driver i need... i assume i need to be able to produce a .ko file some way for it?

http://linuxtv.org/wiki/index.php/So..._DVB-T#Drivers
20th August 2012, 11:27 AM   |  #8  
Junior Member
Thanks Meter: 3
 
27 posts
Join Date:Joined: Apr 2010
aspletec this
Hi.

In the file Martin attached with all the modules there is a module for you DVB-T, it's called dib0070.ko
Try this one.



Quote:
Originally Posted by micks_address

Hi, I was wondering about this a few weeks ago.. great to see it working.. do you know if the Sony Play TV tuner would work? I have one of those...

Cheers,
Mick



---------- Post added at 09:37 AM ---------- Previous post was at 08:49 AM ----------

Here is the driver i need... i assume i need to be able to produce a .ko file some way for it?

20th August 2012, 11:39 AM   |  #9  
Senior Member
Thanks Meter: 25
 
456 posts
Join Date:Joined: Apr 2010
Thanks, once i copy it to the folder with the startdvb file.. what other steps do i need?

Quote:
Originally Posted by lionsh

Hi.



In the file Martin attached with all the modules there is a module for you DVB-T, it's called dib0070.ko
Try this one.

20th August 2012, 12:23 PM   |  #10  
Junior Member
Thanks Meter: 3
 
27 posts
Join Date:Joined: Apr 2010
you need to update the startdvb script to inclue ismode yourdriver.ko


Quote:
Originally Posted by micks_address

Thanks, once i copy it to the folder with the startdvb file.. what other steps do i need?


Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes