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

@tmm1 would there be any way to have Channels DVR retry once after a connection timeout/failure?

I'm encouraged to hear that your first test went well, and am looking forward to seeing how things went overnight. I also have noticed the low bitrate at the startup of the initial recording following a sleep event.

Okay so the DTV App does respond overnight, but fails. First tune fails, second tune works.

Since leaving the app open, I’m going to check a few things. First, does my nightly wireless refresh cause the issue. Second, is the DTV background app running also impacted by the four hour “are you still watching” time out.

I’m going to work on an ADB series to check device idle and if more than a few hours, close, open the DTv app, then sleep Onn box to see if that keeps it happy.

1 Like

This is also true for my setup, without making any of the adb changes you are experimenting with. Which custom config are you using to test the tuning? I have tried both @turtletank 's DTV: Wait for last channel load and your DirecTV App - Onn 4K configs. For the time being, both configs seem to do fine after failing the first tune. I'll try to verify this by testing some more later today...

I’m testing with a custom config similar to my Onn 4K one you mentioned. Correct, it will tune eventually so not a major issue. Just fun tracking down why. :wink:

Is anyone doing any kind of regression testing of these development version updates against a basic YTTV / LinkPi configuration with either FireTV or Onn TV boxes? That's my setup - I had been updating frequently and everything was working - then, today I edited the name of one of my tuners and afterwards ADBTuner stopped working - I had to revert to the "stable" version to get it to work. I was running, I believe, either a 9/1 or 9/2 version when this happened. Updating to today's version made no difference either. Sorry, I didn't capture any log files - just trying to keep the system working for now.

Sorry about that.

I tried, but was unable to duplicate this. I didn't see any issues in my testing before releasing these updates, but bugs do happen and there have been more changes lately than in the past. We use it almost every day with YTTV and haven't had any issues, but to that end, we didn't try to rename a tuner so perhaps that needs more testing.

The tuner name itself is only used for display purposes so changing it shouldn't have broken anything. Saving tuner configuration changes does update the cached list of installed apps so perhaps there was an issue there? A restart of the container should have fixed that though if that was the case. I will keep checking to see if I can duplicate what you ran into, but if you see it again and can provide some logs that would be great.


On a side note, since switching to the new "development" tag, I have kept all of the different development versions available so if someone runs into an issue they can go right back to the last version they were using instead of "stable" which is pretty old at this point. All of the tagged versions are listed here: https://hub.docker.com/r/turtletank99/adbtuner/tags


I don't have any plans to make any major changes in the near future, so the focus is on stability leading up to a new "stable" version in a month or two. Sorry again that you ran into some problems, I'm doing my best in the free time I have to spend on this project.

No apologies necessary - everyone here appreciates your efforts to develop ADBTuner - I probably won't have the chance to test this further/get some logs for a couple of weeks but will try when I get back

1 Like

Possibly some exciting news. Three out my four tuners sat idle all day, for sure more than four hours. First one I tested, yup, dumped right to the home screen.

I then wondered if the app itself was just needing a refresh before tuning, without having to close and open. As you know, adding a close to refresh causes delayed turning.

In the pre-tune, I added the command to open the app, main activity. This seems to refresh the app enough to respond to the deep link. I got a fresh tune on one of the long idle tuners.

Here is what the config looks like:

"global_options": {
    "wait_for_video_playback_detection": true,
    "use_fixed_delay": false,
    "fixed_delay_seconds": 0,
    "check_for_and_clear_whos_watching_prompts": false
},
"pre_tune_commands": [
    "input keyevent 3",
    "am start -n '||TARGET_PACKAGE_NAME||/com.clientapp.MainActivity'",
    "sleep 2"
],
"tune_commands": [
    "am start -W -a android.intent.action.VIEW -d '||TARGET_URL_OR_IDENTIFIER||' '||TARGET_PACKAGE_NAME||'"
],
"post_tune_commands": [
    "input keyevent 3",
    "input keyevent 26"
]

That AM Start in Pre_Tune is the only change. In theory, this does three things.

  • Allows my Onn Boxes can go to sleep when needed.

  • From deep idle it refreshes the app so it can take a deep link.

  • Avoids closing and opening the app to speed up tuning time and, as you noticed, go right to the higher bit rate for streaming.

I'm encouraged, but this silly app has burned me before. Another overnight test seems to be the only way to know for sure. Having whitelisted the DTV App from Doze in a previous step, I'm wondering how goofy the app will get when left open for long periods (i.e. memory leak). I'm exploring scheduled automation to give the app a daily, late night restart to get it ready for next day. It may be suitable to just reboot all the boxes everyday at 3AM.

I'll keep you posted, let me know if you have any questions. Of course, you may need to adapt slightly for your 2023 Onn 4K boxes. And thanks again to @turtletank for the idea of launching the main activity twice, genius!

I took a break from fighting with my ONN 4k boxes to brawl all day with my Roku devices.

This sounds like progress to me! I am hoping for a good result after your devices sleep overnight. I look forward to the results.

I added a new custom config called DirecTV Wake from Deep Sleep
I ran it on a few channels on all of the tuners this evening. Now we'll see what happens in the morning.

This is the full json, of course, credited to you @spammedeeper: I appreciate all of your efforts!

{
    "name": "DirecTV Wake from Deep Sleep",
    "author": "spammedeeper",
    "version": "0",
    "description": "AM Start in Pre_Tune, Onn Boxes can go to sleep, From deep idle it refreshes the app, Avoids closing and opening the app to speed up tuning time",
    "uuid": "5356db80-9cb4-4f1a-acc7-118754dbba98",
    "global_options": {
        "wait_for_video_playback_detection": true,
        "use_fixed_delay": false,
        "fixed_delay_seconds": 0,
        "check_for_and_clear_whos_watching_prompts": false
    },
    "pre_tune_commands": [
        "input keyevent 3",
        "am start -n '||TARGET_PACKAGE_NAME||/com.clientapp.MainActivity'"
    ],
    "tune_commands": [
        "am start -W -a android.intent.action.VIEW -d '||TARGET_URL_OR_IDENTIFIER||' '||TARGET_PACKAGE_NAME||'"
    ],
    "post_tune_commands": [
        "input keyevent 3",
        "input keyevent 26"
    ]
}
1 Like

Glad to contribute. Will see what the morning brings. Fingers crossed.

@turtletank, seems some or all (3) of my tuners are accessed when tuning to a channel (same channel all 3) when using the stable release. Once this happens it does tune to the channel but my other 2 are then locked and must be unlocked manually. If I use the development release this does not happen, instead it tunes to the channel but after a few minutes of playing it exits and goes back to the youtube tv page. I have tried the commands to remove the containers and images (docker stop adbtuner, docker rm adbtuner, docker run -d --init -p 5592:5592 --name adbtuner -v adbtuner_config:/app/.config turtletank99/adbtuner:stable) but still does the same thing. I have 2 Google chromecast (version 14), 1 Tivo 4k (version 10) dongles, 1 uray, 1 exvist and 1 Linkpi encoders. This started to happen when I decided to install and use the features in the stable and development versions. Is the original version still available, the version before stable and development?

Never mind, I ran (docker run -d --init -p 5592:5592 --name adbtuner -v adbtuner_config:/app/.config turtletank99/adbtuner) and now the channels are tuning without accessing all the tuners. I will stick with this version.

Does anyone know if this still valid or do we have to recreate the links? Probably too early to tell, but would like to have this setup as a backup to EPlusTV for this season. Thanks.

Did you try it first?

Okay so my DTV over night testing did work, app launched and plays Channel but, not always the correct channel. It really seems leaving the DTV app open for long periods is (sadly) not feasible. I set dev option to not keep activities so the DTV app always closes. Will report back.

My next testing with ADTuner is seeing if I can tune against com.att.tv.openvideo, which is a system app on my Osprey boxes. So far ADBT does not like that app as a package name.

I am also going to test deep links in AH4C. From my manual testing, this is very fast. I will share my findings in appropriate threads.

Let me know how it goes in the ah4c thread. I believe everybody using the DTV app with ah4c has been working with FireSticks thus far, so the only STREAMER_APP value that'll give you some relevant starter scripts is scripts/firetv/dtvstreamdeeplinks. Those will probably need some minor tweaks for ONN.

I will for sure share! Just with manual ADB shell, I can wake and tune an Osprey to channel with deep link in a just a few seconds. Fastest I’ve ever tuned, eager to automate.

Mine was a bit funky, too. First startup tune of the day for two of three tuners crashed. I got them all going, and as long as they stayed in use, tuning was fine. I did see a couple tunes to the wrong channel, as you did.

You may have noticed me commenting on the Roku Tuner Bridge conversation thread. I'm using Roku Streaming Stick 4k's. These Roku's ROCK the DirecTV app and deeplinks. No tuning problems so far. I'll follow up over on that thread as I continue testing these alternative devices and protocols.

In other news, Peacock channels work very well in ADBTuner using @turtletank 's "Deep Links - Compatibility Mode - Show Tuning Process" configuration.

I'm still fiddling around with ADBT and Paramount Plus...

I'll be joining you and @bnhf over in the AH4C thread. I was wondering if that protocol would work with the DirecTv Android app and the onn 4k boxes. I probably won't be buying osprey boxes, as I just blew my budget on a couple Roku sticks. My old one I was testing with took a :poop:.

Sat down tonight to play around with settings. Having a second ADBTuner docker already setup for testing, decided to try some DirecTV Osprey boxes. My last tests were not productive. Tonight, success. Didn't plan on spending a few hours testing, but here I am (again).

Last I tested, ADBTuner would fail on Osprey tune as there is no installed DirecTV app. The Osprey DTV app is a modified launcher of sort to make the device an all-the-time DTV machine. Putting in the package name for system app com.att.tv.openvideo caused ADBT to fail when attempt to reserve tuner. The openvideo app was not cutting it.

I then decided to just put another app in package name. For fun, tried the NBC app as it was installed from previous tests. This allowed ADBT to start running my configuration commands. From there it was pretty simple. I just created a custom config, hard coding the package name to com.att.tv.openvideo into the tuning command. Tuning works!

Right now I have a very simple config. Pre Tune a power up. Tune with a the Deep Link. Send a sleep command when done. Since the DTV app is always ready by design of the box, no messing with application states. Tuning takes from 5-8 seconds. The dependable Osprey video quality is back too. So nice to see a smooth CNN or ESPN news scroll at bottom of screen.

I will continue to test, including the always interesting "What will Doze do overnight?" challenge. I'll also test some other dummy apps to see which work best as (fake) installed packages.

Cheers.

UPDATE: Seemed to work from sleep. 10-13 second tuning speed. Will test more this weekend.

2 Likes