Giter Club home page Giter Club logo

androiddvbdriver's Introduction

App Icon

Android DVB-T Driver

This driver provides a simple TCP based API that allows controlling USB DVB-T/DVB-T2 tuners on Android. It gives other apps access to the raw DVB MPEG-2 TS stream.

The driver is a simplified user space port of a subset of the V4L2 Linux kernel drivers. Under the hood it uses Android USB Host API with a small helper library that allows fast kernel controlled USB bulk transfers.

Download

Usage

The driver has an Activity that demonstrates direct connection to hardware and allows dumping the raw DVB-T/T2 transport stream to a file.

A socket interface is built on top of that functionality to allow the driver to be used by third party apps over TCP. If you want to use the driver via the exposed TCP interface, you have to do the following steps from your own app:

  1. Launch an android intent
startActivityForResult(new Intent(Intent.ACTION_VIEW)
            .setData(new Uri.Builder().scheme("dtvdriver").build()), SOME_CODE);
  1. If the activity returns successfully, you will receive two TCP port numbers to bind to. One of them is the control port where you can send commands and receive responses. The other port will provide the raw TS stream.
  2. You can then start sending commands over the control port and process the TS stream.

For actual details on the protocol, take a look at the dvbservice module. There are no official docs provided, if you would like to volunteer to write one get in touch with me.

There is also a handy "debug" mode that allows the driver to play the pre-recorded TS dumps as if they are coming from a real device. This mode is extremely useful during development.

Note that this driver does not provide channel/programme scanning/playback capabilities or any transport stream processing. If you would like to write an app for DVB playback, you have to implement all of these yourself.

Auto start

The driver will emmit info.martinmarinov.dvbdriver.DVB_DEVICE_ATTACHED action when a compatible USB tuner has been connected to the Android device. You can use this intent to launch your application automatically.

Supported hardware

Currently:

  • RTL2832 with tuner chip R820t
  • RTL2832 with tuner chip E4000
  • RTL2832 with tuner chip R828D (DVB-T2 support for MN88473, MN88472, CXD2837ER & CXD2841ER devices)
  • RTL2832 with tuner chip FC0012
  • RTL2832 with tuner chip FC0013
  • MyGica T230
  • MyGica (Geniatech) T230C DVB-T/T2/C
  • MyGica Pad TV Tuner PT360
  • EVOLVEO XtraTV stick (Some unbranded Android DVB-T sticks)
  • PCTV AndroiDTV (78e)
  • Potentially other AF9035 dongles. If your dongle works let me know and I will add it to this list.

The driver is not limited to these devices only. If a device has a Linux kernel driver, then it probably could be ported. If you have ported a driver for a device, get in touch with me so we can add it to the main driver.

Apps that use the driver

If you would like your app to appear here, open a GitHub issue and I will be happy to add it!

Important advice

Google Play has very strict rules about apps that can be used to access any TV content. Make sure not to include any TV sceenshots or anything that looks like TV screenshots in your app listing. The description of your app should be very clear that your app does not bundle any content and content is provided by the end user.

Please keep in mind that even if you follow all of the above, your app may still get suspended. The above is just a friendly sugggestion from a developer that has already gone through the worst of this process. This is not official or legal advice.

androiddvbdriver's People

Contributors

dandelionsprout avatar dmgouriev avatar martinmarinov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

androiddvbdriver's Issues

Issue with my T230 usb dongle in DVB-T mode

Hello
  First i want to tel you that this drivers it’s a really good job !!

One comment
Line 421 in https://github.com/martinmarinov/AndroidDvbDriver/blob/master/drivers/src/main/java/info/martinmarinov/drivers/usb/silabs/Si2168.java

if (usbDevice instanceof MygicaT230C) {
        /* hook fe: need to resync the slave fifo when signal locks. /
        /
it need resync slave fifo when signal change from unlock to lock.*/
        if (!hasLockStatus && resultStatus.contains(FE_HAS_LOCK)) {
            ((CxUsbDvbDevice)usbDevice).cxusb_streaming_ctrl(true);             hasLockStatus = true;         }
    }

But i have found that with my T230 this patch is also need in DVBT mode.
Then i have modify like this:
if (usbDevice instanceof MygicaT230C || usbDevice instanceof MygicaT230) {
        /* hook fe: need to resync the slave fifo when signal locks. /
        /
it need resync slave fifo when signal change from unlock to lock.*/
        if (!hasLockStatus && resultStatus.contains(FE_HAS_LOCK)) {
            ((CxUsbDvbDevice)usbDevice).cxusb_streaming_ctrl(true);
            hasLockStatus = true;
        }
    }
Without this patch i can tune but i get no data ...

BR Olivier

HanfTek crash

Hello,
I had a problem with 15f4:0131 HanfTek. Tested on Xiaomi Mi8 and Xiaomi mibox S (android 8.1)
Looks like it is the problem with new hardware rev based on Sony CXD2837ER.
Please let me know if you need additional information.

 Stack trace and exception (DO NOT EDIT): Cannot send USB control message. Error code -1

info.martinmarinov.drivers.DvbException: Cannot send USB control message. Error code -1
	at info.martinmarinov.drivers.usb.rtl28xx.Rtl28xxDvbDevice.ctrlMsg(Rtl28xxDvbDevice.java:89)
	at info.martinmarinov.drivers.usb.rtl28xx.Rtl28xxTunerType$14.getSlave(Rtl28xxTunerType.java:155)
	at info.martinmarinov.drivers.usb.rtl28xx.Rtl28xxTunerType.detectSlave(Rtl28xxTunerType.java:198)
	at info.martinmarinov.drivers.usb.rtl28xx.Rtl2832DvbDevice$1.run(Rtl2832DvbDevice.java:94)
	at info.martinmarinov.drivers.tools.I2cAdapter$I2GateControl.runInOpenGate(I2cAdapter.java:107)
	at info.martinmarinov.drivers.usb.rtl28xx.Rtl2832DvbDevice.readConfig(Rtl2832DvbDevice.java:90)
	at info.martinmarinov.drivers.usb.DvbUsbDevice$1.run(DvbUsbDevice.java:106)
	at info.martinmarinov.drivers.tools.Retry$1.call(Retry.java:32)
	at info.martinmarinov.drivers.tools.Retry$1.call(Retry.java:29)
	at info.martinmarinov.drivers.tools.Retry.retry(Retry.java:42)
	at info.martinmarinov.drivers.tools.Retry.retry(Retry.java:29)
	at info.martinmarinov.drivers.usb.DvbUsbDevice.open(DvbUsbDevice.java:102)
	at info.martinmarinov.dvbdriver.DeviceController.run(DeviceController.java:67)

Last Device: No device open
Build.MANUFACTURER: Xiaomi
Build.MODEL: Mi 8
Build.PRODUCT: dipper
Build.VERSION.SDK_INT: 28
Build.VERSION.RELEASE: 9
Driver versionName: 1.36
Driver versionCode: 17
gvbusb
Looks like 2018 revision https://www.linuxtv.org/wiki/index.php/Astrometa_DVB-T2
Can be related: torvalds/linux#567

TechnoTrend CT2-4400

Hello,
Is it possible to support that TV-Stick?
It has the following components
Demodulator: Silicon Labs Si2168-B40
Tuner: Silicon Labs Si2158-20
Thx

Problem with Zolid Mini ITE 9135

Please give more information about the crash here. We can't promise to respond to every email but your input is very valuable to us and will help improve the driver!

Stack trace and exception (DO NOT EDIT): Cannot send USB control message. Error code -1

info.martinmarinov.drivers.DvbException: Cannot send USB control message. Error code -1
at info.martinmarinov.drivers.usb.af9035.Af9035DvbDevice.dvb_usb_generic_rw(Af9035DvbDevice.java:653)
at info.martinmarinov.drivers.usb.af9035.Af9035DvbDevice.ctrlMsg(Af9035DvbDevice.java:701)
at info.martinmarinov.drivers.usb.af9035.Af9035DvbDevice.rd_regs(Af9035DvbDevice.java:754)
at info.martinmarinov.drivers.usb.af9035.Af9035DvbDevice.identifyState(Af9035DvbDevice.java:147)
at info.martinmarinov.drivers.usb.af9035.Af9035DvbDevice.readConfig(Af9035DvbDevice.java:389)
at info.martinmarinov.drivers.usb.DvbUsbDevice$1.run(DvbUsbDevice.java:106)
at info.martinmarinov.drivers.tools.Retry$1.call(Retry.java:32)
at info.martinmarinov.drivers.tools.Retry$1.call(Retry.java:29)
at info.martinmarinov.drivers.tools.Retry.retry(Retry.java:42)
at info.martinmarinov.drivers.tools.Retry.retry(Retry.java:29)
at info.martinmarinov.drivers.usb.DvbUsbDevice.open(DvbUsbDevice.java:102)
at info.martinmarinov.dvbdriver.DeviceController.run(DeviceController.java:67)

Last Device: null
Build.MANUFACTURER: Google
Build.MODEL: Pixel 2
Build.PRODUCT: walleye
Build.VERSION.SDK_INT: 30
Build.VERSION.RELEASE: 11
Driver versionName: 1.36
Driver versionCode: 17


DVB-T2 - Which hardware?

Hello everyone.
Which USB TV Receiver should I buy for DVB-T2 support?
Thanks in advance for any help.

Any reason the driver and Aerial TV are not available in all countries?

Hi, I tried to install both the DVBT driver and Aerial TV from Google Play, and it told me about both that they are not available in my country (Israel). I'll be happy to give them a try if they will be made available. There are DVB-T transmissions here (in case you limit to countries with DVB-T broadcasting).

Thanks, Sivan Toledo

No stream with Mygica T230 DVB-T/T2/C

I successfully tested the library with a Astrometa DVB-T2:3-2 but I've got issues when testing with a Mygica T230 DVB-T/T2/C: the input stream returned by dvbDevice.getTransportStream() doesn't provide any data (the read() methods block endlessly).

Do you have any suggestion ?

Issue with Aerial TV

I did not know where to post this,

When Aerial TV is running on an RTL (right to left) device, the channel list is all messed up it displays a different Chanel then the one appeared to be selected.

2nd,
If you can add support for android TV (E.g xiaomi mi box 3) that would be awesome!

Thank you and keep up the great and outstanding work!

Edision Optimuss DVB-C/T/T2 USB Tuner Combo Stick

Hello,

I have been using this stick for DVB-C in Windows 10 and Enigma²:
https://edision.de/produkte/sonstige-receiver/optimuss-combo-dvb-c-t2-usb-tuner/
Seems to be the same as this one: http://www.dvbsky.net/Products_T330.html
I would really like to scan DVB-T2/h265 or DVB-C on my Android 7 based smartphone but unfortunately the stick has not been recognized at all.
Is there any chance to get this working ?

Thanks in advance for reading and greetings from Stuttgart/Germany.

driver august

hi everyone, could someone kindly help me how to insert the driver for august dvb-t202

Error building with Android SDK

Android studio 3.3, Gradle 4.10. Building APK Gets build error:
The project is using an unsupported version of Gradle.
Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)
Fix Gradle wrapper and re-import project
Gradle settings

Playback of TS from DVB Driver

Hello,

Is there any suggestion which player shall We use or how to use for TS playback ?

The problem is even I record TS to a file and ply by ExoPlayer, ijkPlayer, MediaPlayer frameworks the stream play only amount of data which I have setDataSource(xx). Even it record more in mean time. All the players stop working.

My question is about a tip how to write/record to a file and play it in same time.

Thanks

Consider letting the apps be installed on Android TVs

On google play I can't install any of the apps on my Android TV.

It does have USB slots though - it could be useful to add more tuners to it, the software that handles the built-in one is pretty limited (for instance it doesn't even take advantage of multiplexing, in the same as older set top boxes like the topfield did, which let you watch one channel and record another)

How to read TS stream?

I successfully managed to pick device, set frequency and pids, and receive TS stream data. However I can't find any way to read that data.

Here's what I tried (and failed):

  • write stream data to a *.ts file and open it with VLC
  • open "http://localhost:<transferPort>" URL in VLC on the device

Do you have any input/suggestion on how to read the stream content?

Please add support for new Astrometa dongles

15844818419723679070056948097233
These new dongles , have the sony 2837er chip that is currently not compatible with the dvb t driver , everytime i want to tune to a dvb t2 frequency the software returns me that error, in Aerial TV the error is 'not enough otg power' but i have also a powered otg cable and..whatever the error is the same, so please add support for that new chip that comes with astrometa white dongles!! pleeease

Dvb-t device connection problem

I got the following error connecting a dvb-t to my Android phone. While it was working properly last week. Thanks @AShDvbt

Please give more information about the crash here. We can't promise to respond to every email but your input is very valuable to us and will help improve the driver!

Stack trace and exception (DO NOT EDIT): No devices found

info.martinmarinov.drivers.DvbException: No devices found
at info.martinmarinov.dvbdriver.DeviceController.run(DeviceController.java:64)

Last Device: null
Build.MANUFACTURER: Xiaomi
Build.MODEL: M2010J19CI
Build.PRODUCT: citrus_in
Build.VERSION.SDK_INT: 29
Bui---------یه

Please add support for AndroidTV as well

I am using Nougat on my Odroid XU4 and it is working great with an AndroidTV Image, though this package is not available in the TV version. Could you please add it for that too?

Suggestion Signal strength actual number

Hello
My tablet is a Teclast P98 with a RTL2832U-R820T
I use it all the time it work perfect.
I use it many time to check antennas with my tablet or phone
so
it will be nice to have the actual number of
"Signal strength"
"Quality"

It will be perfect to have and in the "Airial TV" UI

Thnx in advance Alex

android.permission.ACCESS_NETWORK_STATE android.permission.FOREGROUND_SERVICE android.permission.INTERNET android.permission.POST_NOTIFICATIONS android.permission.READ_EXTERNAL_STORAGE android.permission.READ_MEDIA_AUDIO android.permission.READ_MEDIA_IMAGES android.permission.READ_MEDIA_VIDEO android.permission.RECEIVE_BOOT_COMPLETED android.permission.WAKE_LOCK android.permission.WRITE_EXTERNAL_STORAGE com.android.vending.BILLING com.google.android.c2dm.permission.RECEIVE com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE

[email protected]

startActivityForResult(newIntent(Intent.ACTION_VIEW).setData(newUri.Build) er.scheme("dtvdriver").build()), SOME_CODE

Try use for CXD28XX modulator with USB 2.0 interface

Hi, Martin
It's Android STB with Amlogic S905X2 with Android AOSP 9.0 (Kerner 4.9.13) and USB Multi-Standart Sony tuner + demodulator CXD287X with USB 2.0 interface.

Try use for APK - don't identification, maybe have adaptive ?

Best regards,
Ravshan

Antenna amplifier

Hi!
Software is very necessary for android devices, but it has one significant drawback. The use of DVB-T2 dongle is more necessary not on tablets and smartphones, but on android car stereos. In such devices, it is possible to include an amplifier signal to improve the reception of analog FM radio signal, which is activated when you turn on the regular radio.
My suggestion: add a code that would turn on the power supply to the antenna amplifier when you download the driver (or when you load the digital TV player), this would allow you to receive digital TV more confidently on the road outside the city.
I would be very happy for that. Unfortunately, I do not know Java programming.
Thanks.

T230C Support

Hello,

I forked your driver and added support for the MyGica T230C tuner. https://github.com/dmgouriev/AndroidDvbDriver To do this, I had to port source code from the project https://github.com/crazycat69/linux_media to Java. Before porting, I compiled the sources under Ubuntu 16.04 and made sure that everything works ok in VLС. But now I'm faced with a problem that can not be solved for a long time: there is no transport stream. Perhaps you know the specific places in the project that are responsible for issuing the transport stream, or could help with the solution?

Now I get all parametrs FE_HAS_SIGNAL, FE_HAS_CARRIER, FE_HAS_VITERBI, FE_HAS_SYNC, FE_HAS_LOCK is checked and getting value for Signal strength and Quality? but it is no Bitrate value =(
While debug I get, that method IsoRequest.getReadyRequestId allways returns -1.

http://i98.fastpic.ru/big/2017/1117/0d/c68debb4d8d970e3be67f286c6c70d0d.png

Best regards,
Dmitry G.

Aerial TV Video Freezes frequently

Hello. Frequently (each 5 minutes aprox) I have to change channel or restart application because video freezes and audio continues. Could the app or the driver detect this situation and recover video automatically?

DVB-T2 not working, SDR works

Hello everyone.
I bought a USB DVB-T2 Stick, which is actually detected, but I get an error telling I need an empowered OTG cable.
I tried plugging the stick with a USB HUB (one with its own power source), but still getting that error.
SDR Touch works perfectly by the way.
Unfortunately, I don't know my device' manufacturer or model, and neither its chipset, but it gets detected well, so I guess it's not that my issue.

Edit: Here is my purchase: https://www.wish.com/product/5d560916e2e4b625b34ebfac
According to Device Info HW App it's a Astrometa

Thanks for any help.

Remote Network Access

Hi
I am new to Android programming.
To help learn I am going to write a TV program front end to your driver.
I would like my application to be on another device so will need to use the socket interface.
Can I connect to the "dtvdriver" activity remotely?
If my app runs on the same machine it works fine.
I would prefer to not modify your source code to use something like "Network Service Discovery (NSD)".
Any help much appreciated.

Thanks
Ian

Suggestion - add-on for kodi

It would be awesome an add-on for kodi to play DVB directly from the driver.

Even if would be only available to the paid version of airview.

Thanks.

Can you help on how to play tv on android?

I need to develop an app to play the channels provided by a sdb-t tunner in an Android device.
Could you point where I could find some code with examples on how to do it?

The problem is that the examples and open sources I have found, an even the Android examples, all uses streams and no tuner channels.

Thanks for your kind help.

Gradle version too low

Can someone update this app's gradle to at least 3.2.1? There are a lot of parts that needs to be fixed to work on Android Studio 3.0 and above.

Android TV support?

Just saw a post about this on another forum. Would it be possible to include Android TV support? Thank you

Green Pixelated Image, Audio perfect (RTL2832U R820T2)

Hi,

Thanks for the handy driver and app you have written
However im having issues getting it to work correctly.
I have an RTL2832U R820T2 Dongle which works fine on a PC
But with your driver and Aerial TV app, it will scan and is able to pickup some channels, but on viewing there is nothing but
a completely green pixelated image, but the audio is working fine.

Is there anything i am doing wrong?
I have tried installing the latest pre-compiled APK "app-release.apk", version 1.36 off here, but i have the same result.
Reception is not an issue either as im connecting it to the same antenna that works fine on the PC

I see its been a few years since you have done any work on this, and possible my phone a Pixel 3, running android 11 is just not compatible anymore?

Your help would be much appreciated!

Thanks Martin

Fail to get channel

Hello
My tablette is a Nexus10 under Android 5.1.1 with a Pad TV tuner PT360
I have get the last version of the DVB-T driver.
I have install the Aerial TV application
I have configure the application for France
The tuner never tune and scan finish with no channel.
I use an external fix antenna .
I have make the same try with PadTV HD and i get all the french channel.
let me know if you need more information

Olivier

Suggestion: add SAT>IP server

Hi,

To circumvent the limitation from Google, can be intereting if the driver implements a SAT>IP "server". Some SAT>IP "clients" Apps are published in the Google Play. Then, if the driver uses this "API" (=Protocol) any LiveTV App can communicate with it.

Some examples of opensource SAT>IP servers are minisatip (in C) and satPI (in C++). I don't know about one project using Java. However, I feel using JNI will be possible to port some of these projects.

What you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.