APITuner — ADB-free virtual tuner for Android TV / Google TV

When using apituner with directv for the first time after rebooting my google stream 4k boxes, it launches the directv app ok but it does not tune the channel. My guess is it needs a longer delay as it always works on the second tune.

@techpro2004 APITuner v0.1.24 is out (server only — no Agent APK update needed if you’re already current).

Your guess was close: after a reboot the DirecTV app was opening, but the first channel deeplink was getting dropped on the cold start, and we were treating the splash as “ready.” Second tune worked because the app was already warm.

What’s new: if playback never starts after a deeplink, we re-send the same channel intent once (default ~6s), and we keep waiting for real playback instead of accepting the splash. Needs Agent Notification access so we can see MediaSession playback.

docker pull ghcr.io/matthewfkoch/apituner:0.1.24

(or :latest), restart, then try the first tune after a Streamer reboot again. Options → Deeplink relaunch (s) if you want to bump the wait (0 turns it off).

Release: github.com/matthewfkoch/APITuner-releases/releases/tag/v0.1.24
Changelog: https://github.com/matthewfkoch/APITuner/blob/main/CHANGELOG.md

1 Like

no dice. it did not tune. I selected fox and got the yes game that I was watching last night in a preview window along with a bunch of other items to select to watch.

edit: I left it alone for a while and now the yes game is full screen.

1 Like

If you have some logs you can provide that would be great.

see below. I tried tuning nbc

v0.1.25 is out — please update both the server (ghcr.io/matthewfkoch/apituner:0.1.25) and the Agent APK on each Streamer (dashboard → Update Agent). Keep Notification access on.

The logs showed two stacked problems: after reboot / while DirecTV is already open, a leftover PLAYING session (continue-watching / YES) was treated as ready, so Channels opened HDMI on the wrong picture. And NEW_TASK alone often just foregrounded DirecTV without delivering the new channel URI.

0.1.25 sends deeplinks with CLEAR_TOP|SINGLE_TOP, ignores leftover PLAYING / mismatched titles (YES vs NBC), and relaunches once instead of locking onto the wrong session. Agent-only tuners still cannot force-stop the app, so this is the strongest ADB-free fix, not a guarantee on every DirecTV UI.

APK: github.com/matthewfkoch/APITuner-releases/releases/tag/v0.1.25

So it works on the first tuner but the second tuner keeps loosing connection. Also the second tuner has trouble tuning. Also the stream crashes every time I refresh the web page in firefox. see logs below:

v0.1.26

docker pull ghcr.io/matthewfkoch/apituner:0.1.26

(or :latest), restart.

The last logs showed DirecTV reporting show titles, not call signs. 0.1.25 treated Golden Girls as “not MeTV,” waited 30s, then killed the stream — that’s the second-tuner drop. This build accepts a title change from the leftover show and still rejects a leftover that never changes (YES while tuning NBC).

Please try:

  1. Two tuners at once (first one working, then a second channel) and leave both past ~30s
  2. Channels whose on-screen show name does not match the call sign (MeTV, PBS, GRIT, GREAT)
  3. Whether a Firefox refresh of the APITuner page still drops an in-progress stream

If anything still flakes, another diagnostics dump helps.

not tuning on first boot on those channels see below:

v0.1.27 — please update the server and the Agent APK on each Streamer (dashboard → Update Agent). Keep Notification access on.

The first-boot dump showed DirecTV opening continue-watching (Red Tomahawk / Roseanne) and only one relaunch, so the leftover show never moved. This build re-sends the channel deeplink up to twice, retries cold starts after 2s, and uses CLEAR_TASK so continue-watching is less likely to stick. Splash Unknown Title is not treated as ready (that’s how Cozi succeeded in a few seconds).

docker pull ghcr.io/matthewfkoch/apituner:0.1.27

After reboot, try MeTV / GRIT / GREAT / PBS again on a first tune. Agent-only still cannot force-stop DirecTV, so this is stronger, not a guarantee on every UI.

no dice. It just hangs on the splash screen then fails see below:

v0.1.28 — server only (docker pull ghcr.io/matthewfkoch/apituner:0.1.28 or :latest). Agent 0.1.27 is fine. Keep Notification access on.

The last dump showed 0.1.27 doing what it promised: two CLEAR_TASK relaunches on MeTV and Cozi. DirecTV stayed on the splash with no MediaSession, then the 30s timeout dropped the HDMI stream. That splash is ignoring the channel intent, not leftover YES/continue-watching.

This build sends HOME off the splash before the deeplink and before each retry, then keeps the already-open stream up another 45s so the splash can finish. After reboot, try MeTV / Cozi again on a first tune.

If it still sits on splash after that, the next step is pairing Keys / D-pad (Android TV Remote) so we can send OK. Agent-only still cannot force-stop DirecTV.

1 Like

no dice. I just get my android tv homescreen. I already granted adb permissions but I get an internal server error when doing it again as apituner does not see that it has access. see logs

https://pastebin.com/6dFkQZmL

Have you tried to connect the android remote service?

Just did. It tunes but it does not pick up on it it then restarts the app and does not tune. see below.

0.1.29 is out. This is the fix for tunes that land on the Android TV home screen.

If you saw HTTP verb {}POST unhandled in the diagnostics (MeTV / DirecTV on a Google TV Streamer), that was 0.1.28. It sends HOME before a relaunch, as POST /api/stop with a body of {}. Agent 0.1.27 never reads that body, so the next deeplink is parsed as the verb {}POST and never starts. HOME already ran, so the Streamer stays on the launcher until the tune times out.

Update the server to 0.1.29:

docker pull ghcr.io/matthewfkoch/apituner:0.1.29

Agent 0.1.27 is enough for this. You do not have to sideload a new APK to get the home-screen fix.

Also in 0.1.29:

  • A failed relaunch no longer sits on the launcher for an extra 45 seconds.
  • Grant permissions (ADB) is for Fire TV and Network ADB. It no longer shows on Google TV, where those permissions are granted in the Agent app. Clicking it again when overlay, usage, and notification are already granted no longer returns an internal server error.
  • On an Agent tuner, Send keys stays muted when Accessibility is off and the channel list does not need D-pad. Deeplink tunes do not need that permission. If you set Keys / D-pad to Android TV Remote, that badge follows whether the remote is paired.
  • The last tune error shows on the tuner card. Diagnostics downloads skip the flood of successful playback polls, and a timeout says what playback did and what to check.

Agent 0.1.29 is available if you want it: github.com/matthewfkoch/APITuner-releases/releases/tag/v0.1.29
It also drains unread POST bodies (401, 404, and /api/stop). Day-to-day tuning is still the Agent HTTP API. The remote is only for D-pad, App Play, and key macros.

After the server update, try MeTV again. You should leave the home screen and open DirecTV on the relaunch.

It tunes the first time but it does not realize it. Then on the relaunch I get a different program playing in the dtv splash screen. Also would be great if I did not get confirm apk install menu on my screen each time I updated the agent. logs below:

Any particular reason why I can't set the APK Accessibility setting to allow me to send keys? I click the toggle and it instantly switches to OFF. What am I missing?

One other note. I see that when I change the channel to say a HD Homerun channel, the Tuner is still playing Youtube TV in the background. Anyway to shutoff the Youtube TV steam once the channels changes if its not needed?

can you send me your logs?

All set I think. So far its working great.

This is a great solution to my finicky Chromecast w/Google TV devices. Much more stable.