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

Along with ALL the other great improvements...I am very interested in the keep tuners alive for a short time part.

I am wondering if you could make this use a variable so we can SET the amount of time to keep the channel alive. I like to be able to jump back and forth between channels and don't want to have to tell channels to record the channels to keep them alive.
I currently keep my ah4c:appletv channels alive for 15 minutes using some custom scripts. I would love for this to work on my adbtuner/onn/philo channels also.

There is an environment variable (KNOWN_STREAM_DEFAULT_TIMEOUT) if you want to play around with that. The default (measured in seconds) is 3. Edit: There may be a hardcoded max of 40 seconds.

I actually just had the idea of using Tasker to simulate a play button press as that doesn't require any special permissions like enter does.
Just pressing play doesn't bring up anything in the UI, at least with DirecTV. But having it trigger every hour should hopefully make them think I'm still alive. I'm going to let a stream go for like five hours today and if I don't see anything come up I will be happy to share the XML config if anyone is interested in trying this. Tasker has been around a while and should be more durable than running random ADB commands.
The downside is it has to be sideloaded on Android TV. The developer makes the APK available and purchasing it on an Android phone entitles you to even the side-loaded version over Google Play services. It is also very difficult to navigate on Android TV, but importing a profile is not too bad. Creating one is very difficult though without a mouse.
This should also have the side effect of keeping the Android box always awake and ready to stream I would imagine.

Tested 2.0 Stable on my Onn 4K Plus and Osprey stacks. Both working as expected. Thanks again for all you do.

Looked at this some... took me a little while was not getting lastest build on repull...
Realized that I had my image set to ...image: turtletank99/adbtuner:latest
instead of image: turtletank99/adbtuner:stable
latest kept pulling an image from July... :man_shrugging: :slightly_smiling_face:

Then I wasn't sure if KNOWN_STREAM_DEFAULT_TIMEOUT was to go in the stack env variable or inside a custom configuration...

After trying both it looks like it should be a stack/compose env var...

Using
KNOWN_STREAM_DEFAULT_TIMEOUT=30 and/or
KNOWN_STREAM_DEFAULT_TIMEOUT=40

Realized when I started to test that one of my tuners had signed out of Philo at some point in the past...

So I have tried the defaults and a custom configuration and it seems like it might work the first time or two if I jump back and forth... but then it will shutdown one and then the other when switching and have to re-tune.

Almost looks like it is not reseting/restarting the timer if we go back into that tuner...So maybe the 3rd quick time of entering then leaving it reaches the total of 40sec and shuts it down...

After it shuts down a tuner it then goes into the shutting down the tuners EVERYTIME you switch between channels...

FWIW: I have been pulling the image adbtuner:beta so that I can help in testing new developmental versions/features. I'm currently running what I think is the latest version: 2.0-Beta-20251114-2

Reference to the :beta tag is made in this earlier post: ADBTuner: A "channel tuning" application for networked Google TV / Android TV devices - #2692 by turtletank

1 Like

Isn't the "play" button also "pause"?
I tested many of these button presses on the Roku version of DirecTV app. The only key presses I found which had no visible effect were "Enter" and "Backspace". As far as I know, the same may be true for Android. I just tested the Android app on my Onn 4k. On the physical remote, the Enter button works as a combo play/pause while viewing. It also brings up a shaded timeline/navigation overlay across the bottom of the screen.

So, keyevent 126 is "Play". The inverse of stop. There is also play/pause. I'm watching ADB and it does register.

Tasker doesn't work, but sending the key event using my shell script does. So I'm gonna watch On Patrol Live tonight and see if I get the prompt. That's a three hour show and I'm watching the pre-show before it.

{
    "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": [
        "pkill -9 -f DTVKEEPALIVE || true"
    ],
    "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": [
        "(trap '' HUP; exec -a DTVKEEPALIVE sh -c 'while true; do input keyevent 126; sleep 3600; done') </dev/null >/dev/null 2>&1 &"
    ],
    "post_tune_commands": [
        "pkill -9 -f DTVKEEPALIVE || true",
        "input keyevent KEYCODE_MEDIA_STOP",
        "input keyevent KEYCODE_HOME"
    ]
}

Try this one. It actually hits play, which is a media key, and should tell them we're alive, basically. That's what I'm thinking.

I can see it register in the command prompt.

Regardless, I just got cheap Osprey boxes on eBay instead of messing with this. Seems like they're just going to be way more reliable since they're purpose built. Hopefully this works for someone else though and I'll see in a few hours.

I had purchased some Osprey boxes, but returned them. I change providers often enough that I don't want to invest in provider specific hardware. The Onn 4k boxes for ADBTuner, and Roku 4k Streaming Sticks for the Roku Tuner Bridge, are multi-purpose hardware which hopefully will adapt as I go through different streaming services.

1 Like

Since I'm paying $140 a month for DirecTV, I want the best experience, so I just bought them.
I wasn't going to do it, but I ended up getting a great deal. It was like about $40 a box with sales tax. I couldn't pass the deal up because it's just gonna work and I don't have to tinker with anything.

1 Like

You can't go wrong for the price.
i went with my entertainment with hulu and HBO Max.
I have TVE plus 2 onn boxes for using channels. I use FRNDLY for the channels missing from directv Stream.

I'm just worried about long-term support, that's all.
It seems like they still sell them for satellite customers, so I would imagine they would still continue to update the firmware.

If I continued with DTV, then I would've gotten the Osprey Boxes but it's too rich for me and honestly I'd rather use ah4c and another HDMI encoder for that instead if I got it.

I'm moving on to Sling Blue + Disney bundle...

I've tried slong and it is missing way too much.
MyEntertainment with the bundled disneyplus and Hulu is a good buy for now.
I'm not a huge fan of hese bundles becuase they have stuff missing.
I want all my locals plus sports etc if i were to add any other genre packs might just as well get entertainment and or choice but MyEntertainment is a sweet spot with Directv.

I just basically said yolo, I work hard, I deserve to relax, and I went with the Ultimate package. The price is locked in for two years and then I can call and threaten to cancel and hopefully get it reduced after that. But I have unlimited streams in the home so I could add as many tuners as I want, theoretically. Overall compared to my YouTube TV and Philo combination this is way easier to deal with, way less overhead just works so much better. The difference in picture quality is also extremely noticeable. Is it expensive? Yes. Do you get what you pay for in life? I realized after many years of cutting corners. At least right now, it's worth it for me.:joy:

I'm starting to move in that direction. Dumped philo and left YTTV long ago.
Thanks for all the help with deep linking

1 Like

No problem. I'll know in 15 minutes if my latest config actually suppresses the are you still there prompt.

I've been using Osprey boxes, with AH4C, for over two years. They have updated many times. They sell a dongle "air" version that is pretty simiar. And yes, the Osprey hardware is used for satellite customers. No one knows for sure, but I don't seem the killing off connections any time soon.

In fact yes, done by your Internet IP address to determine home network. I put the unlimited to good use :slight_smile:


Some other small notes. Ospreys will stream a channel all day if you want it to, no time-out prompt. Also, Ospreys allow you to input DirecTV channel numbers, which was the basis for my AH4C Scripts. If Deep Links every stopped working, you can use the powerful and reliable AH4C. Channel numbers are unlikely to every change.

Ospreys boxes have proven an excellent match for my automation, but they have limitations. I'm eager to see how @mackid1993 setup goes. Maybe then we can share a setup guide.

I'll definitely update once my boxes come. I'm kind of excited for this, honestly.
It seems like a fun project!

1 Like

According to ADBTuner logs, my tuner has been locked for 253 minutes. I have not gotten any "are you still there" prompts. It appears that my custom config is indeed working.

I'm going to watch a few more hours and keep checking to make sure that the process is running. But for at least four hours, the process hasn't been killed by Android!

This is actually working so well I may not get the Osprey boxes. I think I can still cancel that order. If I can save 150 bucks with a shell script, I'd rather do that. :joy:

The worst case scenario is ADB Tuner crashes and the play button gets pressed once per hour in perpetuity until another channel is tuned, so it's not really the end of the world. The script itself is pretty harmless.

I hope this helps some other people in the end. :slightly_smiling_face:

{
    "name": "DirecTV",
    "author": "David B.",
    "version": "2.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": 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": [
        "pkill -9 -f DTVKEEPALIVE || true"
    ],
    "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": [
        "(trap '' HUP; exec -a DTVKEEPALIVE sh -c 'while true; do input keyevent 126; sleep 3600; done') </dev/null >/dev/null 2>&1 &"
    ],
    "post_tune_commands": [
        "pkill -9 -f DTVKEEPALIVE || true",
        "input keyevent KEYCODE_MEDIA_STOP",
        "input keyevent KEYCODE_HOME"
    ]
}