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

@Fofer
Interesting thought. TiVo devices were designed to "always be recording." Whether it was recording a TiVo Suggestion or just filling a buffer all of the tuners were always working. There could be some value to keeping that philosophy with this.

There is no real logic to tuner selection in ADBTuner. It just goes through them in order and selects the first one that is not being used. In earlier versions I had some extra steps in place to try and keep it on one device, but that was removed to improve performance (faster to jump to an idle device then wait for the current tuner to be unlocked).

I don't have any plans for what you suggested, but it's an interesting idea.

1 Like

That’s right, I remember being intrigued by TiVo’s logic there. Hmm, it’s fun to think about though. Specifically when jumping back and forth between two live games. If ADBtuner could remember the last channel tuned on each tuner and then use that to tune, if still tunable, and if not, then go to the next tuner?

lol. That’s fun to type, too :laughing:

@Anvil_DVR

When I was replying to your earlier question I had a somewhat crazy idea for the profile screens and decided to give it a shot.

If you, or anyone, feel like testing something out, pull from turtletank99/adbtuner:experimental instead of latest and test out Fubo (new version) and Paramount.

What I did was grab a video frame from from the streaming endpoint (hdmi encoder), and then performed some OCR to look for the "who's watching" text inside of the image. So far, in my testing, it works well.

I have some concerns about this approach for containers running on a slower device (network attached storage, etc) so I'm hesitant to roll this out further until it's been better tested. However, it does look promising.

1 Like

This is beautiful! Insane of course, but BEAUTIFUL! I'll give it a go today.

First impressions are it works! Incredible job!

@turtletank are you using tesseract?

Yes. OpenCV and Tesseract.

1 Like

Sweet, I will try it.

Not working for me.
Wondering what I did wrong.

2023-09-03 16:13:31 INFO: Shutting down
2023-09-03 16:13:31 INFO: Waiting for application shutdown.
2023-09-03 16:13:31 INFO: Application shutdown complete.
2023-09-03 16:13:31 INFO: Finished server process [7]
2023-09-03 16:13:38 INFO [alembic.runtime.migration] Context impl SQLiteImpl.
2023-09-03 16:13:38 INFO [alembic.runtime.migration] Will assume non-transactional DDL.
2023-09-03 16:13:38 INFO: Started server process [7]
2023-09-03 16:13:38 INFO: Waiting for application startup.
2023-09-03 16:13:38 INFO: Application startup complete.
2023-09-03 16:13:38 2023-09-03 21:13:38.954 - server - ADBTuner setup complete.
2023-09-03 16:13:38 INFO: Uvicorn running on http://0.0.0.0:5592 (Press CTRL+C to quit)
2023-09-03 16:13:50 2023-09-03 21:13:50.700 - uvicorn.access - 172.17.0.1:49478 - "GET / HTTP/1.1" 200
2023-09-03 16:13:50 2023-09-03 21:13:50.727 - uvicorn.access - 172.17.0.1:49478 - "GET /css/style.css?t=1693775630 HTTP/1.1" 200
2023-09-03 16:13:50 2023-09-03 21:13:50.732 - uvicorn.access - 172.17.0.1:49478 - "GET /js/main.js?t=1693775630 HTTP/1.1" 200
2023-09-03 16:13:50 2023-09-03 21:13:50.854 - lib.adb - ADB: Connecting to device (attempt 1).
2023-09-03 16:13:50 2023-09-03 21:13:50.855 - lib.adb - ADB: Connecting to device (attempt 1).
2023-09-03 16:13:51 2023-09-03 21:13:51.044 - lib.adb - ADB: Connected.
2023-09-03 16:13:51 2023-09-03 21:13:51.044 - lib.adb - ADB: 192.168.1.41 - pm list packages -3
2023-09-03 16:13:51 2023-09-03 21:13:51.049 - lib.adb - ADB: Connected.
2023-09-03 16:13:51 2023-09-03 21:13:51.049 - lib.adb - ADB: 192.168.1.41 - dumpsys display
2023-09-03 16:13:51 2023-09-03 21:13:51.134 - lib.adb - ADB: 192.168.1.41 - getprop ro.build.version.release
2023-09-03 16:13:51 2023-09-03 21:13:51.148 - lib.adb - ADB: Connecting to device (attempt 1).
2023-09-03 16:13:51 2023-09-03 21:13:51.176 - lib.adb - ADB: Android Version: 12.0.
2023-09-03 16:13:51 2023-09-03 21:13:51.305 - httpx - HTTP Request: GET http://192.168.1.168/0.ts "HTTP/1.1 200 OK"
2023-09-03 16:13:51 2023-09-03 21:13:51.360 - lib.adb - ADB: Connecting to device (attempt 1).
2023-09-03 16:13:51 2023-09-03 21:13:51.424 - lib.adb - ADB: Connected.
2023-09-03 16:13:51 2023-09-03 21:13:51.424 - lib.adb - ADB: 192.168.1.42 - pm list packages -3
2023-09-03 16:13:51 2023-09-03 21:13:51.443 - lib.adb - ADB: Connected.
2023-09-03 16:13:51 2023-09-03 21:13:51.443 - lib.adb - ADB: 192.168.1.42 - dumpsys display
2023-09-03 16:13:51 2023-09-03 21:13:51.518 - lib.adb - ADB: 192.168.1.42 - getprop ro.build.version.release
2023-09-03 16:13:51 2023-09-03 21:13:51.528 - lib.adb - ADB: Connecting to device (attempt 1).
2023-09-03 16:13:51 2023-09-03 21:13:51.558 - lib.adb - ADB: Android Version: 12.0.
2023-09-03 16:13:51 2023-09-03 21:13:51.682 - httpx - HTTP Request: GET http://192.168.1.168/4.ts "HTTP/1.1 200 OK"
2023-09-03 16:13:51 2023-09-03 21:13:51.684 - lib.adb - ADB: Connecting to device (attempt 1).
2023-09-03 16:13:52 2023-09-03 21:13:52.269 - lib.adb - ADB: Connected.
2023-09-03 16:13:52 2023-09-03 21:13:52.269 - lib.adb - ADB: 192.168.1.43 - dumpsys display
2023-09-03 16:13:52 2023-09-03 21:13:52.270 - lib.adb - ADB: Connected.
2023-09-03 16:13:52 2023-09-03 21:13:52.270 - lib.adb - ADB: 192.168.1.43 - pm list packages -3
2023-09-03 16:13:52 2023-09-03 21:13:52.339 - lib.adb - ADB: 192.168.1.43 - getprop ro.build.version.release
2023-09-03 16:13:52 2023-09-03 21:13:52.358 - uvicorn.access - 172.17.0.1:49494 - "GET /admin/tuner/installed-packages?=1693775630758 HTTP/1.1" 200
2023-09-03 16:13:52 2023-09-03 21:13:52.375 - lib.adb - ADB: Android Version: 12.0.
2023-09-03 16:13:52 2023-09-03 21:13:52.502 - httpx - HTTP Request: GET http://192.168.1.168/8.ts "HTTP/1.1 200 OK"
2023-09-03 16:13:52 2023-09-03 21:13:52.564 - uvicorn.access - 172.17.0.1:49478 - "GET /admin/tuner/metadata?
=1693775630756 HTTP/1.1" 200
2023-09-03 16:14:02 2023-09-03 21:14:02.909 - server - Reserved tuner 1
2023-09-03 16:14:02 2023-09-03 21:14:02.909 - server - Using tuner id: 1
2023-09-03 16:14:02 2023-09-03 21:14:02.909 - uvicorn.access - 172.17.0.1:45946 - "GET /stream/26 HTTP/1.1" 307
2023-09-03 16:14:02 2023-09-03 21:14:02.915 - server - Tuner: Tuning to Bally Wisconsin on ChromeCast 1
2023-09-03 16:14:02 2023-09-03 21:14:02.916 - lib.adb - ADB: Connecting to device (attempt 1).
2023-09-03 16:14:03 2023-09-03 21:14:03.370 - lib.adb - ADB: Connected.
2023-09-03 16:14:03 2023-09-03 21:14:03.370 - lib.adb - ADB: 192.168.1.41 - dumpsys display
2023-09-03 16:14:03 2023-09-03 21:14:03.436 - lib.adb - ADB: 192.168.1.41 - getprop ro.build.version.release
2023-09-03 16:14:03 2023-09-03 21:14:03.475 - lib.adb - ADB: Android Version: 12.0.
2023-09-03 16:14:03 2023-09-03 21:14:03.475 - lib.adb - ADB: 192.168.1.41 - pm list packages -3
2023-09-03 16:14:03 2023-09-03 21:14:03.534 - lib.adb - ADB: 192.168.1.41 - pidof com.fubo.firetv.screen
2023-09-03 16:14:03 2023-09-03 21:14:03.585 - lib.adb - ADB: Stopping media playback.
2023-09-03 16:14:03 2023-09-03 21:14:03.585 - lib.adb - ADB: 192.168.1.41 - input keyevent KEYCODE_MEDIA_STOP
2023-09-03 16:14:03 2023-09-03 21:14:03.653 - lib.adb - ADB: 192.168.1.41 - am start -a android.intent.action.VIEW -d "https://link.fubo.tv/al1%3Fv%3D1%26a%3Dplay%26t%3Dchannel%26channel_id%3D16348" com.fubo.firetv.screen
2023-09-03 16:14:11 2023-09-03 21:14:11.231 - server - checking for profile screen
2023-09-03 16:14:13 2023-09-03 21:14:13.076 - server - Tuner: Compatibility Mode - Stream released after 10.16 seconds. Display was on, application (com.fubo.firetv.screen) was closed.
2023-09-03 16:14:13 2023-09-03 21:14:13.077 - lib.adb - ADB: Closing connection - 192.168.1.41
2023-09-03 16:14:13 2023-09-03 21:14:13.077 - uvicorn.access - 172.17.0.1:45946 - "GET /stream/1/26 HTTP/1.1" 200
2023-09-03 16:14:13 2023-09-03 21:14:13.085 - root - Tuner: Stream open (attempt 1).
2023-09-03 16:14:13 2023-09-03 21:14:13.203 - httpx - HTTP Request: GET http://192.168.1.168/0.ts "HTTP/1.1 200 OK"

@turtletank

This is what I got with Paramount

2023-09-03 16:36:29 INFO [alembic.runtime.migration] Context impl SQLiteImpl.
2023-09-03 16:36:29 INFO [alembic.runtime.migration] Will assume non-transactional DDL.
2023-09-03 16:36:30 INFO: Started server process [7]
2023-09-03 16:36:30 INFO: Waiting for application startup.
2023-09-03 16:36:30 INFO: Application startup complete.
2023-09-03 16:36:30 INFO: Uvicorn running on http://0.0.0.0:5592 (Press CTRL+C to quit)
2023-09-03 16:36:30 2023-09-03 21:36:30.269 - server - ADBTuner setup complete.
2023-09-03 16:37:05 2023-09-03 21:37:05.041 - server - Reserved tuner 1
2023-09-03 16:37:05 2023-09-03 21:37:05.041 - server - Using tuner id: 1
2023-09-03 16:37:05 2023-09-03 21:37:05.041 - uvicorn.access - 172.17.0.1:57378 - "GET /stream/47 HTTP/1.1" 307
2023-09-03 16:37:05 2023-09-03 21:37:05.047 - server - Tuner: Tuning to Showtime East on ChromeCast 1
2023-09-03 16:37:05 2023-09-03 21:37:05.049 - lib.adb - ADB: Connecting to device (attempt 1).
2023-09-03 16:37:05 2023-09-03 21:37:05.414 - lib.adb - ADB: Connected.
2023-09-03 16:37:05 2023-09-03 21:37:05.414 - lib.adb - ADB: 192.168.1.41 - dumpsys display
2023-09-03 16:37:05 2023-09-03 21:37:05.478 - lib.adb - ADB: 192.168.1.41 - getprop ro.build.version.release
2023-09-03 16:37:05 2023-09-03 21:37:05.516 - lib.adb - ADB: Android Version: 12.0.
2023-09-03 16:37:05 2023-09-03 21:37:05.516 - lib.adb - ADB: 192.168.1.41 - pm list packages -3
2023-09-03 16:37:05 2023-09-03 21:37:05.594 - lib.adb - ADB: 192.168.1.41 - pidof com.cbs.ott
2023-09-03 16:37:05 2023-09-03 21:37:05.658 - lib.adb - ADB: Stopping media playback.
2023-09-03 16:37:05 2023-09-03 21:37:05.658 - lib.adb - ADB: 192.168.1.41 - input keyevent KEYCODE_MEDIA_STOP
2023-09-03 16:37:05 2023-09-03 21:37:05.748 - lib.adb - ADB: 192.168.1.41 - am start -a android.intent.action.VIEW -d "https://www.paramountplus.com/live-tv/stream/showtime-east" com.cbs.ott
2023-09-03 16:37:13 2023-09-03 21:37:13.338 - server - checking for profile screen
2023-09-03 16:37:15 2023-09-03 21:37:15.111 - server - Tuner: Compatibility Mode - Stream released after 10.07 seconds. Display was on, application (com.cbs.ott) was closed.
2023-09-03 16:37:15 2023-09-03 21:37:15.111 - lib.adb - ADB: Closing connection - 192.168.1.41
2023-09-03 16:37:15 2023-09-03 21:37:15.112 - uvicorn.access - 172.17.0.1:57378 - "GET /stream/1/47 HTTP/1.1" 200
2023-09-03 16:37:15 2023-09-03 21:37:15.121 - root - Tuner: Stream open (attempt 1).
2023-09-03 16:37:15 2023-09-03 21:37:15.245 - httpx - HTTP Request: GET http://192.168.1.168/0.ts "HTTP/1.1 200 OK"

Has anybody tried Bally Sports +?

@turtletank I tried the Bally Sports app. All I can seem to get open is the app only with ballysports:// . Would it be possible to add an down command and enter command into the Bally Sports app when you start to stream it?

@turtletank
It occurred to me early this morning that I had the encoder set to h.265 and that might be the issue.
I changed it to h.264 and its working.
Brilliantly I might add.

Thank you!

Update:
Looks like Fubo always works.
Paramount + sometimes get stuck. Works on the second go...
I think it may be because they sometimes display the Paramount animation prior to the Who is watching prompt. Would it be possible to take a second frame grab?
Just a thought.

2 Likes

What are y'all using for links for YouTube TV and Fubo TV? I am doing a free trial due to the fact Spectrum blacking out ESPN, etc. I have always had NBC channels working through the NBC app but can't seem to get YouTube TV to open to the app and go to said channel. Fubo opens the app but doesn't tune to a channel.

Fubo is:

https://link.fubo.tv/al1%3Fv%3D1%26a%3Dplay%26t%3Dchannel%26channel_id%3D[CHANNELID]

Channel ID is from the website.

Hope that helps!

It still just opens the app. And does nothing else. Which version of ADBTuner are you on?

Experimental (to get around the "who's watching" screen)

Hmm, Make sure you have compatibility mode on

That might be why it's not working. I just checked it on the current version I am on and getting the who is watching screen but if I click on my profile it tunes to it. So I am going to download the other version and try that. I wonder why the YouTube TV one isn't working for me.

1 Like

Search "json" for in this topic. Several people have shared their lineups for YoutubeTV.

Ahh yeah, that makes sense. That who's watching screen has been trouble!

1 Like