ADBTuner: Create Channels, Custom Config and CDVR Custom Channels for DirecTV

I mean, I'm getting Osprey boxes, that's my way of giving up. For now, I disabled animations on all of my Onn boxes. That really speeds things up.
Until the Ospreys come, I have a config I settled on that's pretty reliable, pretty fast, kills the app beforehand, is set to bring up a stream in about eight seconds. I'm just gonna post it here in case it helps someone. :slight_smile:

{
    "name": "DirecTV",
    "author": "David B.",
    "version": "7.0.0",
    "description": "Fast tuning for DirecTV. Prevent are you still there prompt from showing.",
    "uuid": "3c7d5a19-6f2e-4b8a-9d3f-8e1c4b7a5f92",
    "global_options": {
        "wait_for_video_playback_detection": false,
        "use_fixed_delay": true,
        "fixed_delay_seconds": 8,
        "check_for_and_clear_whos_watching_prompts": false,
        "wait_after_post_playback_start_commands_seconds": 0
    },
    "pre_tune_commands": [
        "input keyevent KEYCODE_MEDIA_STOP",
        "input keyevent KEYCODE_MEDIA_HOME",
        "am force-stop '||TARGET_PACKAGE_NAME||'"
    ],
    "tune_commands": [
        "am start -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_HOME"
    ],
    "timed_keep_active_commands": [
        {
            "run_every_minutes": 60,
            "commands": [
                "input keyevent KEYCODE_MEDIA_PLAY"
            ]
        }
    ]
}

I just tried your v6.0.0 config with my onn 4ks. I was getting consistent tuning in 10 seconds. I can't remember if I have animations disabled. Thanks for the reminder. I'll double check and try v7.0.0 this afternoon.

EDIT: Animations were enabled when I tested v6.0.0. They must have popped back on during a system update. I'll try v7.0.0 with animations disabled.

I tried v7.0 but it was showing the scren right as the channel launched on the app so went to 6.0 and it launches perfectly.
Video starts after is is going.

For me, with animations disabled, both @mackid1993 configs v6 and v7 are briefly showing the DTV app home page before tuning. Both are tuning in the range of 10-11 seconds.

look forward to your need for speed being applied to these and hopefully ah4c.
i'm sure you'll see the setup posts for them, detailing turning off animations for these too.

edit; this process in ah4c w/ osprey seems slow, but i've never made time to see if it could be faster.

1 Like
{
    "name": "DirecTV",
    "author": "David B.",
    "version": "7.0.1",
    "description": "Fast 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": [
        "settings put global window_animation_scale 0",
        "settings put global transition_animation_scale 0",
        "settings put global animator_duration_scale 0",
        "settings put global background_process_limit 2",
        "am kill-all"
    ],
    "tune_commands": [
        "[ \"$(cat /proc/$(pidof com.att.tv 2>/dev/null)/oom_score_adj 2>/dev/null || echo 999)\" -lt 900 ] && am start -W -n '||TARGET_PACKAGE_NAME||'/com.clientapp.MainActivity -a android.intent.action.VIEW -d '||TARGET_URL_OR_IDENTIFIER||' || am start -W -S -n '||TARGET_PACKAGE_NAME||'/com.clientapp.MainActivity -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_HOME"
    ],
    "timed_keep_active_commands": [
        {
            "run_every_minutes": 60,
            "commands": [
                "input keyevent KEYCODE_MEDIA_PLAY"
            ]
        }
    ]
}

I think this is the best thing. I combined what I did this morning. It's not going to handle a bad deep link, but when is that ever going to happen?

You have to literally type in a link incorrectly for it to fail. This gives you super fast tuning. But if the app gets into a weird state it will fresh start it. We also have commands to make sure animations are disabled and background processes are limited to two so it's as fast as possible.

Just updated my config and it looks good.
Thanks for disabling stuff and making things work so well.

I just tried v7.0.1. First tune was 15 seconds. Subsequent tunes 5 or 6 seconds...

I really hope it works well!
I spent like the last two days trying to hone this in and I think this is the combo that works.
I got a little caught up on handling bad deeplinks, but realized that the trade-off for handling those is just not worth it.

That's the point.
Also, if the app gets into a weird state, it should restart itself and tune in like 15 seconds.
The idea is subsequent tunes would be four, five, six seconds.

That must have been what I noticed on the first tune after I had been playing with other config files.

Bad deeplinks will only happen if I'm typing them in by hand, or make a mistake in copy/paste. (I have been there and done that many times) If I'm using Project One-Click to set things up, there is much less chance of operator error.

As far as a subscription to DTV goes, I'm sticking with my base Genre package of MyEntertainment ($35/mo) with the MyCinema add-on($10/mo). That adds up to half of what I was paying for YTTV.

Through the holiday season, I can have four of my local networks for watching parades and holiday specials, by adding the MyNews base package (a ripoff at $40/mo). BUT, at least that can be added or deleted as I desire. I can mostly live without it.

It stinks that there is no financially reasonable way to get local channels in areas with poor OTA reception.

Yeah, like, if it's sort of in like a weird idle state, where it's like running but half dead basically, it won't tune correctly, so this should restart it.

I'm getting my Osprey boxes on Friday, so I'm kind of excited to see how those perform. It'll be a fun weekend project.

I actually forced a bad deep link and it recovered.

1 Like

Nice! There have been times in the past when the only thing I could do to save it from a bad tuning crash was to remotely power cycle the device, or run upstairs and reset things manually. This will save me some frantic runs up the staircase. :laughing: I appreciate all the work you have put into this project.

I look forward to hearing about your experience with the Osprey devices. Have fun with them!

I wouldn't intentionally break it because I have played with it and broken it and got it to really break, so I definitely would try to keep your links correct. Other than absolutely mangled deeplinks, I think this works.

Thanks, I'm looking forward to it. I do care about speed. lol

I had a box sit overnight and with that last config I posted the OOM state was 900 for com.att.tv. That triggered the app to force close and restart. Which is good because that gets around the whole, the app sits around for four hours, goes into an idle state, and starts up really weird. After I exited the stream, the OOM state was 700, so it did not get killed and tuned to the next channel quickly, like it's supposed to.

So the idea is flipping between channels should be very fast and a cold start after leaving the box alone for a couple of hours should be 10 to 15 seconds. I'm curious if some others have similar experience, but it's looking like this might have gotten around the problem of having to always force close the app for reliable tuning on Android....

1 Like

I got bored and decided to just basically have Claude deploy dozens of sub-agents and scour the codebase of the DirectTV APK. I dumped the APK and just let it have at it. What I came up with is if there's no process running, so it's in some sort of semi half dead state where it's not going to tune correctly, kill it and let it restart. If the app is running in the background and warm, just tune. So far, it seems to be working reliably, and based on what Claude found in the codebase, it did find some sort of bug. Not surprising. It seems like this will reliably work, but it does require some testing, if anyone is interested.

This should allow for faster tuning because we should be able to use ADB Tuner to keep the app always warm and hopefully avoid those situations where we do have to force stop, but it should cover the edge cases too. There's no PID, it's not running or it's been dozed and in a weird state, so we restart the app.

It's literally saying, if there is a PID, start the app and just tune. If there's no PID, force stop it and tune.

{
    "name": "DirecTV",
    "author": "David B.",
    "version": "8.0.0",
    "description": "Fast tuning with task removal for clean intent state.",
    "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": [
        "pidof ||TARGET_PACKAGE_NAME|| > /dev/null 2>&1 && am start-activity -a android.intent.action.VIEW -n '||TARGET_PACKAGE_NAME||/com.clientapp.MainActivity' -d '||TARGET_URL_OR_IDENTIFIER||' || am start-activity -a android.intent.action.VIEW -n '||TARGET_PACKAGE_NAME||/com.clientapp.MainActivity' -d '||TARGET_URL_OR_IDENTIFIER||' --activity-clear-task"
    ],
    "post_playback_start_commands": [],
    "post_tune_commands": [
        "input keyevent KEYCODE_MEDIA_STOP",
        "input keyevent KEYCODE_HOME"
    ],
    "timed_keep_active_commands": [
        {
            "run_every_minutes": 60,
            "commands": [
                "input keyevent KEYCODE_MEDIA_PLAY"
            ]
        }
    ]
}

I'll give it a try. Do I need to change all of my DTV channels to this config for it to work properly? Or, can I apply it to a few of them just for testing?

Is there an easy way to change the config on all of my DTV channels at once? I suppose that I could run the Project One-click action again. But, I kinda hate having to pull the curl command channel list every time I want to swap configs...

You can export and do a find and replace on the UUID. Notepad can do this.

I didn't change the UUID though so if you swap it out it'll work.

I'm hoping this one is fast most of the time and stable. I get my Ospreys tomorrow so I'm looking forward to testing those out.

When i first tested the config, it took a while becuase the app propbably needed to be relaunched.
I clsed the stream and fired it up and it was nice and fast due to the app being warm and open.