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

In developer options, there is a setting to keep the device always awake on the onn boxes.
That's worked great for me for keeping it awake 100% of the time.

What I ended up doing was using your -S flag in my own config. Right now I'm testing this for a little bit faster tuning. So far it seems to hide the UI. I think the sleep 2 in the compatibility mode config is little unnecessary. At least for DTV.

{
    "name": "DirecTV",
    "author": "",
    "version": "0",
    "description": "Fast tuning for DirecTV, fresh starting the app every time.",
    "uuid": "3c7d5a19-6f2e-4b8a-9d3f-8e1c4b7a5f92",
    "global_options": {
        "wait_for_video_playback_detection": true,
        "use_fixed_delay": false,
        "fixed_delay_seconds": 0,
        "check_for_and_clear_whos_watching_prompts": false,
        "wait_after_post_playback_start_commands_seconds": 0
    },
    "pre_tune_commands": [
       "input keyevent KEYCODE_MEDIA_STOP"
    ],
    "tune_commands": [
        "am start -S -W -a android.intent.action.VIEW -d '||TARGET_URL_OR_IDENTIFIER||' '||TARGET_PACKAGE_NAME||'"
    ],
    "post_tune_commands": [
        "input keyevent KEYCODE_MEDIA_STOP",
        "input keyevent KEYCODE_MEDIA_PAUSE",
        "input keyevent KEYCODE_HOME"
    ]
}

I tested the command directly over ADB and it does definitely start the app fresh each time. And at least with this it takes it back to the home screen and there's no extra delay so it just starts the app fresh. And I seem to tune based on my testing in about 10 seconds. I tested a few times with a stopwatch and each time it was about 10 to 11 seconds to tune a channel.

Thank you so much for your help!

Awesome! I too timed with my phone, and got around 10-12 second tuning speed, last I checked. Pretty darn good.

One thing I remembered. With the Onn 4K Plus boxes (and the regular Onn 4K) I had to boost the audio gain +6 dB to get the audio close to what my Osprey's were doing. Setting in the LinkPi encoder. It may be fine on your setup.

I actually set the volume to fixed on mine and that seems to work really well. It's kind of buried in the settings for the remote. There's a setting for HDMI CEC control of the volume which makes it fixed rather than set on device. Then my AVR just kind of handles the volume without any interference from anything else.

I am having an issue when I hit the streaming limit on my YouTube TV account. When the streaming limit screen is displayed, I either need to use the remote to get the ONN TV Pro to exit the screen, or I remotely power cycle the device.

Could an option be added when clicking the In-Use - click to release lock button, to send a ADB command to exit this screen or go to the Home screen?

Thanks for the amazing work on this project!

1 Like

You can use compatibility mode. That will kill the app every time you tune.

Hey @spammedeeper I wanted to ping you on this one because I believe I found a solution to hot starting the DirecTV app while recovering from a bad deep link.

Starting it with "am start -W -n com.att.tv/com.clientapp.MainActivity" allows it to recover from that bad state. So using that in a config seems to be pretty reliable and it brings tuning time down to four to five seconds once the app has been started.

I wrote a config here dynamically adjusting to the package name and resolving the main activity dynamically. The idea being that if the package name changes unlikely or if the name of the main activity were to change it should resolve it rather than us having to change the config.

{
    "name": "DirecTV",
    "author": "David B.",
    "version": "1.0.0",
    "description": "Fast tuning for DirecTV.",
    "uuid": "3c7d5a19-6f2e-4b8a-9d3f-8e1c4b7a5f92",
    "global_options": {
        "wait_for_video_playback_detection": true,
        "use_fixed_delay": false,
        "fixed_delay_seconds": 0,
        "check_for_and_clear_whos_watching_prompts": false,
        "wait_after_post_playback_start_commands_seconds": 0
    },
    "pre_tune_commands": [
        "input keyevent KEYCODE_MEDIA_STOP",
         "am force-stop ||TARGET_PACKAGE_NAME||"
    ],
    "tune_commands": [
        "am start -W -n '||TARGET_PACKAGE_NAME||'/$(cmd package resolve-activity -a android.intent.action.MAIN '||TARGET_PACKAGE_NAME||' | awk -F= '/name=/{print $2; exit}') -a android.intent.action.VIEW -d '||TARGET_URL_OR_IDENTIFIER||'"
    ],
    "post_tune_commands": [
        "input keyevent KEYCODE_MEDIA_STOP",
        "input keyevent KEYCODE_MEDIA_PAUSE",
        "input keyevent KEYCODE_HOME",
         "am force-stop ||TARGET_PACKAGE_NAME||"
    ]
}

Regardless, I forced a bad deep link a couple of times and used the regular command to bring it into that bad state and then multiple times ran this command and it brought it right back. The only interesting thing is if you take the remote for Android box and back out of the show while it's streaming to Channels, the app is sort of in a weird broken state. But tuning and streaming a channel works perfectly and it's near instant.

I'm curious what you think and if you'd be interested in testing it out, letting me know if you think it's reliable.

Edit: 12/7/2025
With the current development build, this config can be used to suppress the 4 hour "are you still there" prompt.

{
    "name": "DirecTV",
    "author": "David B.",
    "version": "3.0.0",
    "description": "Reliable tuning for DirecTV. Prevent are you still there prompt from showing.",
    "uuid": "3c7d5a19-6f2e-4b8a-9d3f-8e1c4b7a5f92",
    "global_options": {
        "wait_for_video_playback_detection": true,
        "use_fixed_delay": false,
        "fixed_delay_seconds": 0,
        "check_for_and_clear_whos_watching_prompts": false,
        "wait_after_post_playback_start_commands_seconds": 0
    },
    "pre_tune_commands": [
        "input keyevent KEYCODE_MEDIA_STOP",
        "am force-stop ||TARGET_PACKAGE_NAME||"
    ],
    "tune_commands": [
        "am start -W -n '||TARGET_PACKAGE_NAME||'/$(cmd package resolve-activity -a android.intent.action.MAIN '||TARGET_PACKAGE_NAME||' | awk -F= '/name=/{print $2; exit}') -a android.intent.action.VIEW -d '||TARGET_URL_OR_IDENTIFIER||'"
    ],
    "post_playback_start_commands": [],
    "post_tune_commands": [
        "input keyevent KEYCODE_MEDIA_STOP",
        "input keyevent KEYCODE_MEDIA_PAUSE",
        "input keyevent KEYCODE_HOME",
        "am force-stop ||TARGET_PACKAGE_NAME||"
    ],
    "timed_keep_active_commands": [
        {
            "run_every_minutes": 60,
            "commands": [
                "input keyevent KEYCODE_MEDIA_PLAY"
            ]
        }
    ]
}

Be happy to try. I have time tomorrow, I will throw it on my test setup and see what happens. You're using Onn 4K Plus, no?

Yes I have 4 of them. I also forgot some quotes and just fixed them this morning.

I have added this to my ever expanding list of ADBT configurations. Is this an improvement over your previously posted version "0"? I'd like to try testing this and prefer to not test an older, less effective version.

The intent is this will allow you to tune without having to force close the app. That should allow tuning to complete in 4-5 seconds instead of 10-12. The difference is how the deep link is passed to the app. It seems to allow it to recover from an incorrect deep link where the app would normally need to be forced to recover. I'd like some people to actually test this though in different environments before I actually say it works 100%, although from my initial testing it does seem to work.

I'll give it a try today. My tuners are the older onn 4k boxes. (not plus or pro) We have really struggled to find a way to get them to handle DTV tuning properly.

Is there any point to testing your version "0" config? That version looks to have some syntax issues somewhere.

No, there's really absolutely no point.
I think compatibility mode would basically do the same thing as the version 0 config in terms of tuning time. Although it worked for me, so I may have pasted something wrong, but you can just ignore that. Maybe try the new one and see if it's reliable for you.

If you have the app open in the background, it should tune pretty quickly.

It was me. I missed the closing bracket when copying...

1 Like

I just added the new Directv script posted and it seems to work really well.
my ONN 4k seems to be handing it with no problem.
Directv seems like a great solid solution.

1 Like

Yeah, I just added @mackid1993 's config to a few channels and tested. It works for me too! Compared to my Roku Bridge Tuner app which was tuning in about 10 seconds, ADBT is tuning the same DTV channels in closer to 6 seconds. :clap::tada: It looks like I may have to pull the extra onn 4k's back out of storage and put them back into the LinkPi side of my system.

EDIT: Now, the question of the day is: Will we come up against the dreaded "Are you still watching?" prompt when recording back to back programs over several hours?:thinking: That was one of the main reasons I had jumped over to the Roku tuners...we needed to send a "keep alive" command every so often.

1 Like

IIRC, the "still watching" prompts are default to 4 hours in the DirecTV app for Android. For comparison, the Osprey boxes don't have this "feature".

Yup. I edited my previous celebratory comment regarding this concern. On the Roku Tuner we are sending a keypress "Enter" just short of every 4 hours. I don't think that we ever managed to get around this on ADBTuner.

I don't think there's a way to execute a script in perpetuity in ADBTuner. It'll eventually time out.
Maybe @turtletank can add a feature to execute commands on like a cron or something in the custom configurations. And we can specify a crontab to run a command.

Edit:

So I'm never gonna run into this issue with this four hour prompt, it's something just that probably won't happen to me.

I wonder if you could just push a bash script to /sdcard. Have the script run a loop that presses the Enter key. When we exit the stream and the post-tune commands run, run a command to kill the shell script.

I asked my buddy Claude and something like this might work.

#!/system/bin/sh

while true; do
    input keyevent 66
    sleep 600
done

And just have ADBTuner kick that off in the config. Every 10 minutes it will hit the enter key and in the config in the post tune commands just write a command to kill it. This might work, but someone who knows Android a little better than me might have a better idea. That way it kind of runs asynchronously from ADB Tuner and is just executed by it and killed by it.

I'll give it a try by adding this config to one of my DTV channels and scheduling some back to back recordings which exceed 4 hours total...

Yeah, it's not worth it. I'm playing around with it and it's not even going to the home screen when I put in that key code. I'm testing to see if I can get some sort of script to run asynchronously and I'll let you know if I succeed.