ADBTuner: A "channel tuning" application for networked Google TV / Android TV devices

ADBTuner: A "channel tuning" application for Google TV / Android TV devices.


Inspired by "HDMI for Channels" (HDMI for Channels).

After spending many weeks researching and collaborating with everyone in the above thread (thank you, everyone) I decided to sit down and write a small web application to make the process easier to manage (for me), and hopefully others.


Project Goals

  • Fully containerized (Docker), no external dependencies
  • Fully configurable via a web interface
  • Intentionally limited scope, only networked Android devices and HTTP streaming sources, only supports Android TV applications which include support for deep linked content.
  • Import and export functionality for channel lists.

I intend to, and I hope others can assist in, building tools that can export "channel lists" from streaming providers that can be imported into ADBTuner (and possibly used with HDMI for Channels and Chrome Capture).

I don't anticipate this application being a fun playground for bleeding edge technology, but if you have basic needs I think it's worth a look!


Web Interface Demo


Documentation and Install Instructions

or:
https://hub.docker.com/r/turtletank99/adbtuner


Channels DVR Configuration
Add the ADBTuner M3U URL as a new "Custom Channels" source.


Example Channel Data
Save as adbtuner_export.json and import into your own ADBTuner instance for testing purposes.

[{
    "provider_name": "YouTube TV",
    "number": 9000,
    "name": "ESPN",
    "url": "https://tv.youtube.com/watch/k-KlMzmHTAo",
    "package_name": "com.google.android.youtube.tvunplugged",
    "alternate_package_name": "com.amazon.firetv.youtube.tv",
    "component": "com.google.android.apps.youtube.tvunplugged.activity.MainActivity",
    "compatibility_mode": false,
    "tvc_guide_stationid": "10179"
}, {
    "provider_name": "Hulu",
    "number": 9002,
    "name": "The Weather Channel",
    "url": "https://www.hulu.com/watch/the-weather-channel-f75ab9a3-c9bf-41e0-bde0-70fbf3165133",
    "package_name": "com.hulu.livingroomplus",
    "alternate_package_name": null,
    "component": ".WKFactivity",
    "compatibility_mode": false,
    "tvc_guide_stationid": "11187"
}, {
    "provider_name": "NBC App",
    "number": 15000,
    "name": "MSNBC",
    "url": "nbctve://live/msnbc",
    "package_name": "com.nbcuni.nbc.androidtv",
    "alternate_package_name": null,
    "component": "com.nbc.nbctvapp.ui.main.view.MainActivity",
    "compatibility_mode": true,
    "tvc_guide_stationid": "16300"
}]

I had fun building this and hopefully it provides value to others. It's been "in production" for about a week in one way or another and I feel it's definitely stable enough for regular use.

Have fun, let me know if you run into any issues.

9 Likes

Wow, this looks amazing. This should be a huge boon for people who want to try this, without getting too deep into the weeds. When you say it works with Android TV applications, which device(s) have you tried it with? I ask for two reasons — (1) in your example video, your channel tunes very quickly, and (2) I just learned that one of the commands on my Fire Cube was slightly different than the one on my WalMart onn device.

2 Likes

It's controlling a Chromecast with Google TV in that video. It's also been tested with the Walmart onn streamer and an old Fire Stick 4K. Works well with all of them.

I have found that devices that run Android 12 need to have the application specific "component" specified to launch the content properly. This includes the onn device and the Chromecast with Google TV.

The "component" field for each "channel" in the web interface of ADBTuner is for this purpose. ADBTuner checks the Android version prior to running a command and leaves that off for older devices.

By design, ADBTuner does not start the video stream until video playback starts on the Android device. I found this very effective in eliminating that quick disconnect bug when video modes change. It's also great for hiding splash screens and other nonsense. You get a blank screen for a few seconds and then just video.

Tuning speed is a huge challenge and varies quite a bit. When all things are ideal I can get a YouTube TV channel up in 2-3 seconds. But if the Android device was asleep or recently rebooted it could take 10+ seconds to tune. And sometimes the stream just loads slowly for no reason. Hulu is always a little bit slower than YouTube. The NBC app is way worse than both.

ADBTuner keeps all apps, excluding those in "compatibility mode," running on the device after tuning to minimize slowdowns.

Tuning benchmarks are included in the application logs for reference purposes.
INFO:root:Tuner: Tuning completed in 3.42 seconds. Display was on, application (com.google.android.youtube.tvunplugged) was running.

INFO:root:Tuner: Tuning completed in 11.29 seconds. Display was off, application (com.google.android.youtube.tvunplugged) was running.

I'm guessing the Fire Cube should be faster since it's a much faster device?

6 Likes

You have me tempted to try this, despite all the time I spent getting my setup working with no coding experience at all. :slight_smile:

1 Like

This looks cool.
Thank you.

I'm going to have to try this.

3 Likes

:+1: Fantastic work! :+1:

I've been following the HDMI for Channels thread but just as a viewer for now.

Next step for me: buy a network HDMI capture device to try all this.

This application will make it so much easier to get set up in no time. Well done and thank you!

I also extend my thank you to all the individuals who contributed in the other thread.

1 Like

Out of curiosity, does this work with SlingTV? If SlingTV was able to handle more TVE, I would go that route originally as it has the channels I want that aren't OTA and I don't have to pay for OTA via service (which you do in YTTTV, HULU Llive, etc). If this has that functionality, that could be a game changer for me.

3 Likes

Unfortunately, it looks like a no-go on Sling for now.

It works well from the standpoint of opening the app and launching content, but it appears that there aren't any direct links to "channels" in Sling TV. All of the links in the guide are for specific programs in the schedule and when that program is over the link no longer works.

2 Likes

Philo works reasonably well. Though I guess most Philo content is available via TVE.

This is such a cool project. Thanks @turtletank for the effort you put into this. I was able to get this running pretty quickly on a Fire stick.
Quick question. I have a mix of hardware types on several tuners. The hardware requires different package_name and component strings in order to tune. Since the those strings are tied to a specific channel definition, I'm not sure how to handle a multi-tuner setup with various hardware types. Is there a way to configure ADBTuner to so Channels is able to tune to a channel on whatever tuner is available even though the hardware is different?
I hope I'm explaining this clearly enough :wink:

1 Like

Interesting. Can you provide specifics?
The actual package name is different between devices?

Sure.
For my mecool and Chromecast boxes I use: com.google.android.youtube.tvunplugged
For the Firetv I use: com.amazon.firetv.youtube.tv
Could be there is a way to use the same package name for both?

3 Likes

Interesting. Which Fire TV? I totally have com.google.android.youtube.tvunplugged running on a Fire Stick.

EDIT: Maybe not. I will look into this.

Which FireTV model specifically (model / year)? I'm looking for the Android version (it could be 5.1, 7.1, or 9).

I don't anticipate doing anything that would link specific "channels" to specific "tuners." I was hoping the ability to import and export channel lists would become a useful tool and linking things that way would make a mess out of that feature.

3 Likes

Thanks for doing this - I remoted into home and installed and it's almost working, except I don't have the remote to authorize - apparently, even though this is running on the same machine as my HDMI encoder implementation, it may look like a unique connection to the Onn box (I think)? One question - are you automatically figuring out the station ID to populate the guide? (for example in my hdmi.m3u file I have tvc-guide-stationid="19627",NBC for NBC) - I am not getting the guide right now for some reason...

1 Like

Correct. ADBTuner is self-contained and generates its own ADB key files on first startup and will appear as a new device.

You could, in theory, copy the ADB key files from your host machine ~/.android/ into the adbtuner_config docker volume if you wish to reuse them, but in most cases it's easier to just accept the connection when you have access to the remote control.

I didn't do anything for station IDs. I can add that as a field on each channel if that would be helpful. I've just been mapping the m3u channels to guide data in the Channels DVR web interface.

3 Likes

I didn't realize that it was possible to select the guide data in the interface - Would station IDs be needed if the channel being added is not in the guide? - for example BBC News has no TVE stream for YTTV, therefore, I don't think it would show up as a choice (or would it?)

1 Like

I totally agree, The ability to share channels lists is a pretty great feature. The devices are cheap, I'd just get android devices that were all compatible.

Here is the FireTV stick info.

1 Like

Yes, it's in the list of choices. :slight_smile:

image

2 Likes

I've struck out trying to get this running, mostly because I'm too dense to understand Docker's documentation to get things going on a Mac. I got as far as having this appear in both my Containers and Images tabs on Docker Desktop for Mac, but when I go to the IP address for the web interface for ADBTuner (192.168.7.180:5592) I get a "page not found".

Like I said, this is mostly due to my lack of ability to follow the Docker learning center instructions. My tinkering with Channels has taught me that programmers speak a different language than I do and presume a certain level of background that I don't have. :slight_smile: For example, the learning center instructions say, "Open the sample application in your IDE and then open the Dockerfile to explore its contents" with no further explanation. I don't know what an "IDE" is, and, while I presume I click on the name of the sample to "open the Dockerfile", I'm not even sure about that.

1 Like