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

So the orange light on my router supposedly means the speed is slower. I have a white light for the ethernet port my computer is hooked into on the router, but for the LinkPi and onn device, the lights end up being orange. Now granted, yes, the onn device does work on its own if I stream something, but here's what's interesting...stuff was definitely running slower and buffering when using ethernet, but when I had it connected through WiFi everything was nice and smooth. That doesn't seem right at all. Fastest should be when plugged in via ethernet.

Who knows what is ultimately causing this problem, but bottom line is, my router is definitely an older one...dates back to like 2013 when it was manufactured, so it's older technology and WiFi 5. I think just in general it would be better to have something more recent, so I found a good deal on a Netgear Nighthawk AX5400. It stinks I'm gonna have to put in all these custom settings again that I have for my network (static IP addresses for various devices, port forwarding, etc.) but in the end it's probably best to be on the latest technology and WiFi 6, and if I'm still getting the problem, then I definitely know there's no way it's the router.

Unplug and replug the cable sometimes works if one of the devices is not negotiated properly.
Also try another cable if plugging doesn't work, could be a wire may have come loose in one of the connecters.

Ok orange light. That is probably indicating 100Mbit which is normal as the onn device does not have a gigabit nic. Wifi is faster because the link speed is higher. Dont worry about that now.

But... the fact that you are saying that the onn device is doing that tells me that you are not connecting it to the switch. You should have it set up like this. Cable from switch to router. Cable from switch to pc, cable from switch to onn, cable from switch to linkpi. Old or not, your router is not in play right now except when the onn device is streaming from the internet. Ignore the buffering etc, we dont care about that atm. It is not indicitive of any greater issue. Once this is resolved ill tell you what usb hub with ethernet to buy and you cam get the higher link speed. In the mean time hook everyhting up like i described and lets see what happens.

Ok I guess I'm a little confused now. My router has multiple jacks to plug into for an ethernet connection. When you were asking if my router had a switch, that's what I thought you were referring to...having multiple jacks to plug into on one router. I have my PC plugged into one jack on the router, then the linkPi on another jack, and then finally I plugged the onn 4k pro into a third jack. But when I research switches, it seems that is actually a separate device that offers multiple jacks, and then you're feeding that all into the router with one cable...like a splitter. Is this actually what I would want to do? Wouldn't things run faster if they are all plugged directly into the router? Sorry, I'm no expert on this stuff, but I'm all about learning and researching so appreciate your input!

Yeah for troubleshooting. This will isolate your gear and rule the router out.

A switch can add latency but we are talking nanoseconds. In your case the traffic between linkpi, your computer, and the onn device will not even travel upstream to the switch. The goal is to isolate the traffic. The onn device's internet traffc will go upstream to the router but you dont care about that right now. You just need to see if your router is the issue as it pertains to the adbtuner operation.

Something like this will do the trick.
NETGEAR 5-Port Gigabit Ethernet Unmanaged Switch (GS305) - Home Network Hub, Office Ethernet Splitter, Plug-and-Play, Silent Operation, Desktop or Wall Mount https://a.co/d/6orsgzM

Ok, well I guess I'll get one of these cheap switches then and see what happens. Would this one be good too? https://www.bestbuy.com/site/tp-link-5-port-10-100-1000-mbps-unmanaged-switch-black/6537994.p?skuId=6537994

yeah. basically same thing

Need Help---
I am having difficulty setting up ADBTuner on a Linux box. I have gone through AI assisting with troubleshooting, but I must be missing something. I mapped 8080 on the router, docker seems to be running appropriately but everytime I try to access ADBTuner through the web browser it either says site cant be reached or internal server error. According to AI evaluation of my log it appears the ADBTuner container is running, but itā€™s encountering a database connection error. Then further evaluation it told me the persistent issue is with the SQLite database file, which the application is unable to open or create. I am a complete noob when it comes to Linux and I am using AI to help me through this I thought it was helping but I know I must be missing something that I cant figure out.
http://localhost:8080 = Site canā€™t be reached
http://localhost:5592 = Internal Server Error

in the logs it is giving me the following error
sqlite3.OperationalError: unable to open database file
and this error
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file
can anyone with more experience with Linux help me out?

How do you have this docker container configured? If the SQLite DB is missing it's likely you don't have a docker volume attached to the container.

A command line example for launching an ADBTuner container and an Docker Compose file are available here:
https://hub.docker.com/r/turtletank99/adbtuner

I made an attempt to read some of this thread BUT its massive
Just a few questions before i think about investing in this option as I use Optimum for my TVE source now.

  1. Will this ADB tuner fix /improve my NBC channels that CC4C uses now??
  2. Will i be able to tune any of the Paramount stations ??
  3. When Disney goes dark soon can i tune those stations using this ADB
  4. Is there a mater list of Channels to import or do I add all channels 1 at a time?

Thank you so much that worked!!!

  1. Will this ADB tuner fix /improve my NBC channels that CC4C uses now??

Yes, I use adb to run the NBC app.

  1. Will i be able to tune any of the Paramount stations ??

If you're talking about P+, no. But see next question.

  1. When Disney goes dark soon can i tune those stations using this ADB

Yes if you can get an Optimum stream box AND enable developer options (it's an Android TV device), you can then tune any of your channels via adb. But you will probably need to use ah4c for that (search for it here).

  1. Is there a master list of Channels to import or do I add all channels 1 at a time?

There's not a master list, any channels you want have to be added manually.

Alrighty so I got a switch and have it connected to the router (still my original nighthawk r7000, not the new one i mentioned getting) then pc, linkpi, and onn 4k pro all connected to switch. I get a normal white light on the router for the one port where the switch is plugged in so that is good. Internet seems to run just fine like before and speeds are fast.

So when trying to tune to a channel that is set up with ADBTuner, there does seem to be a little improvementā€¦Iā€™d say more successes getting the channel to play rather than those timeout/tuner unreachable/link not found error messages, but I still do get the errors on occasion. Even getting the channel to play successfully sometimes takes a couple tries. And, even on a successful first try, it might take close to 30 seconds to loadā€¦like youā€™re sitting there watching the spinning wheel on the screen and just holding your breath hoping itā€™s gonna playā€¦LOL!

I have 3 other containers running on Docker Desktop that feed channels into ā€œChannelsā€, Pluto, Plex, and Tubi, and these all tune just fine on a dime. So I am starting to get the feeling this does have something to do with the computer/adbtuner relationship as you were sort of thinking before. But this is just so frustrating because it seems like there has to be some good reason for why this is happening, yet we just canā€™t figure it out. Iā€™ve even gone as far as completely removing the adbtuner container and all its volumes and images and re-installing and still same results. It just seems like thereā€™s times where something doesnā€™t want to talk to something else when getting these tuner unreachable and timeout messages.

I should also add that there are times where I go to load the ADBTuner UI in a web browser and it might take like close to 1 minute to finally load. I can go to my pluto, plex, and tubi UIs instantly.

FYI this is not an indication whether the connection is good or bad etc. This is link speed. If the device is 100Mbit then you will get a yellow light, if it is white then it is a gigabit link. If the device you are connecting is only capable of 100Mbit then there is no issue if it is yellow.

[quote="Accustiver, post:1514, topic:36822"]

Can you post some logs from docker when this happens and also a snip from the channels server logs for the same time period?

I cant explain this. You may need to do a wireshark capture to see what is going on from a networking standpoint

@slampman

I don't run this setup but is this a possible conflict?

What is a Streaming Endpoint? Is it a device or virtual IP? I have Channels DVR and ADBTuner running on Docker. I can connect ADBTuner to a FireStick, but I canā€™t figure out what to put into the Streaming Endpoint box on the dockerIP:5592 page. Do I just make up an IP and add /stream? Is that IP/stream what I add as a source to CDVR?

That is your linkpi url for the specific HDMI port

You can but it will not work lol

Here is how I am configured for reference
ADBTuner:
(10.100.12.23 & 24) are my Onn Devices
192.168.12.16 is my Linkpi

My Channels Config (192.168.12.17 is ADBTuner)

It shouldn't, thats how it was originally designed with bridge networking. I've got mine running on a macvlan but either should work ok

Thanks! I was missing that another hardware device is needed. Time to go down another rabbit hole.

Ok so it seems this problem generally occurs if I haven't been tuning to any channels for awhile that are coming from ADBTuner. I'll explain a scenario here:

This afternoon I came home from running errands...hadn't touched Channels/ADBTuner for a couple hours. I went to play a channel and naturally the endless spinning wheel and then eventually the tuner unreachable error message saying to hit play again...hit play again...and then get the link not found 404 error message. Here's a look at the logs from both ADBTuner and Channels:

ADBTuner Log:
2024-09-03 15:05:03 2024-09-03 19:05:02.761 - server - No tuners available.
2024-09-03 15:05:17 2024-09-03 19:05:17.943 - server - No tuners available.
2024-09-03 15:05:18 2024-09-03 19:05:17.990 - uvicorn.access - 172.17.0.1:32990 - "GET /stream/29 HTTP/1.1" 404
2024-09-03 15:05:40 2024-09-03 19:05:40.914 - server - No tuners available.
2024-09-03 15:05:40 2024-09-03 19:05:40.916 - uvicorn.access - 172.17.0.1:44768 - "GET /stream/29 HTTP/1.1" 404
2024-09-03 15:06:15 2024-09-03 19:06:15.181 - server - No tuners available.
2024-09-03 15:06:15 2024-09-03 19:06:15.183 - uvicorn.access - 172.17.0.1:48286 - "GET /stream/29 HTTP/1.1" 404

Channels Log:
2024/09/03 15:04:57.009263 [ERR] Could not start stream for M3U-ADBTuner ch60 NICK: M3U: 901 Tuner Unreachable: Timeout after 20.01s connecting to: http://192.168.1.6:5592/stream/29
2024/09/03 15:05:18.494622 [ERR] Could not start stream for M3U-ADBTuner ch60 NICK: M3U: GET: http://192.168.1.6:5592/stream/29: 404 Not Found
2024/09/03 15:05:40.919025 [ERR] Could not start stream for M3U-ADBTuner ch60 NICK: M3U: GET: http://192.168.1.6:5592/stream/29: 404 Not Found
2024/09/03 15:06:15.185707 [ERR] Could not start stream for M3U-ADBTuner ch60 NICK: M3U: GET: http://192.168.1.6:5592/stream/29: 404 Not Found

Now, I open up my ADBTuner UI and come to find that ADBTuner is still locked in on a channel that I selected a couple hours ago, however that channel is no longer playing on the onn 4k pro device. That third little box far right next to the endpoint connection status and Android version will be blue indicating the old channel, and if I click it, it will release the lock. Now, I go back to trying to play a channel again in "Channels" and all of a sudden, it will play just fine. I'll close it, and see that it was released as well on the ADBTuner UI. I'll select another channel, and it once again tunes fine and then gets released fine. Here's an example of that log:

ADBTuner Log:
2024-09-03 15:31:51 2024-09-03 19:31:49.466 - server - Available Tuners:
2024-09-03 15:31:51 2024-09-03 19:31:49.777 - server - Name: Google TV Priority:
2024-09-03 15:31:51 2024-09-03 19:31:49.777 - server - Selecting random tuner
2024-09-03 15:31:51 2024-09-03 19:31:49.889 - server - Reserved Tuner: Name: Google TV Priority:
2024-09-03 15:31:51 2024-09-03 19:31:49.914 - server - Using tuner id: 1 for stream.
2024-09-03 15:31:51 2024-09-03 19:31:49.965 - uvicorn.access - 172.17.0.1:37062 - "GET /stream/30 HTTP/1.1" 307
2024-09-03 15:31:51 2024-09-03 19:31:50.929 - server - Tuner: Tuning to NICK Jr on Google TV
2024-09-03 15:31:52 2024-09-03 19:31:52.804 - lib.adb - ADB: Connecting to device (attempt 1).
2024-09-03 15:31:53 2024-09-03 19:31:53.414 - lib.adb - ADB: Connected.
2024-09-03 15:31:53 2024-09-03 19:31:53.508 - lib.adb - ADB: 192.168.1.32 - settings list global
2024-09-03 15:31:53 2024-09-03 19:31:53.707 - root - adb_allowed_connection_time=0, adb_enabled=1, adb_wifi_enabled=0
2024-09-03 15:31:53 2024-09-03 19:31:53.707 - lib.adb - ADB: 192.168.1.32 - dumpsys display
2024-09-03 15:31:53 2024-09-03 19:31:53.834 - lib.adb - ADB: 192.168.1.32 - getprop ro.build.version.release
2024-09-03 15:31:53 2024-09-03 19:31:53.898 - lib.adb - ADB: Android Version: 12.0.
2024-09-03 15:31:53 2024-09-03 19:31:53.932 - lib.adb - ADB: 192.168.1.32 - pm list packages -3
2024-09-03 15:31:54 2024-09-03 19:31:54.007 - lib.adb - ADB: 192.168.1.32 - pidof com.philo.philo.google
2024-09-03 15:31:54 2024-09-03 19:31:54.053 - lib.adb - ADB: Stopping media playback.
2024-09-03 15:31:54 2024-09-03 19:31:54.053 - lib.adb - ADB: 192.168.1.32 - input keyevent KEYCODE_MEDIA_STOP
2024-09-03 15:31:54 2024-09-03 19:31:54.265 - root - Using Nick Jr. to load channel.
2024-09-03 15:31:54 2024-09-03 19:31:54.265 - lib.adb - ADB: 192.168.1.32 - am start -a android.intent.action.VIEW -d "Nick Jr." com.philo.philo.google
2024-09-03 15:31:58 2024-09-03 19:31:58.897 - lib.adb - Checking for profile screen
2024-09-03 15:32:16 2024-09-03 19:32:16.783 - lib.adb - On screen text: "ay 4".
2024-09-03 15:32:17 2024-09-03 19:32:17.786 - server - Tuner: Compatibility Mode - Stream released after 27.23 seconds. Display was on, application (com.philo.philo.google) was closed.
2024-09-03 15:32:17 2024-09-03 19:32:17.786 - lib.adb - ADB: Closing connection - 192.168.1.32
2024-09-03 15:32:18 2024-09-03 19:32:18.198 - server - http disconnect
2024-09-03 15:32:18 2024-09-03 19:32:18.405 - lib.adb - ADB: Connecting to device (attempt 1).
2024-09-03 15:32:18 2024-09-03 19:32:18.588 - lib.adb - ADB: Connected.
2024-09-03 15:32:18 2024-09-03 19:32:18.588 - lib.adb - ADB: 192.168.1.32 - settings list global
2024-09-03 15:32:18 2024-09-03 19:32:18.653 - root - adb_allowed_connection_time=0, adb_enabled=1, adb_wifi_enabled=0
2024-09-03 15:32:18 2024-09-03 19:32:18.654 - lib.adb - ADB: Stopping media playback.
2024-09-03 15:32:18 2024-09-03 19:32:18.654 - lib.adb - ADB: 192.168.1.32 - input keyevent KEYCODE_MEDIA_STOP
2024-09-03 15:32:18 2024-09-03 19:32:18.746 - lib.adb - ADB: 192.168.1.32 - input keyevent KEYCODE_MEDIA_PAUSE
2024-09-03 15:32:18 2024-09-03 19:32:18.932 - lib.adb - ADB: Force stopping com.philo.philo.google.
2024-09-03 15:32:18 2024-09-03 19:32:18.932 - lib.adb - ADB: 192.168.1.32 - am force-stop com.philo.philo.google
2024-09-03 15:32:19 2024-09-03 19:32:19.121 - lib.adb - ADB: Closing connection - 192.168.1.32
2024-09-03 15:32:19 2024-09-03 19:32:19.137 - server - Released tuner ID: 1
2024-09-03 15:32:19 2024-09-03 19:32:19.138 - server - Tuner: Cleanup complete. Google TV (NICK Jr)
2024-09-03 15:32:19 2024-09-03 19:32:19.715 - server - Available Tuners:
2024-09-03 15:32:19 2024-09-03 19:32:19.715 - server - Name: Google TV Priority:
2024-09-03 15:32:19 2024-09-03 19:32:19.715 - server - Selecting random tuner
2024-09-03 15:32:19 2024-09-03 19:32:19.716 - server - Reserved Tuner: Name: Google TV Priority:
2024-09-03 15:32:19 2024-09-03 19:32:19.716 - server - Using tuner id: 1 for stream.
2024-09-03 15:32:19 2024-09-03 19:32:19.717 - uvicorn.access - 172.17.0.1:55136 - "GET /stream/30 HTTP/1.1" 307
2024-09-03 15:32:19 2024-09-03 19:32:19.731 - server - Tuner: Tuning to NICK Jr on Google TV
2024-09-03 15:32:19 2024-09-03 19:32:19.771 - lib.adb - ADB: Connecting to device (attempt 1).
2024-09-03 15:32:20 2024-09-03 19:32:20.040 - lib.adb - ADB: Connected.
2024-09-03 15:32:20 2024-09-03 19:32:20.041 - lib.adb - ADB: 192.168.1.32 - settings list global
2024-09-03 15:32:20 2024-09-03 19:32:20.178 - root - adb_allowed_connection_time=0, adb_enabled=1, adb_wifi_enabled=0
2024-09-03 15:32:20 2024-09-03 19:32:20.179 - lib.adb - ADB: 192.168.1.32 - dumpsys display
2024-09-03 15:32:20 2024-09-03 19:32:20.267 - root - Tuner: Stream open (attempt 1).
2024-09-03 15:32:20 2024-09-03 19:32:20.449 - lib.adb - ADB: 192.168.1.32 - getprop ro.build.version.release
2024-09-03 15:32:20 2024-09-03 19:32:20.560 - lib.adb - ADB: Android Version: 12.0.
2024-09-03 15:32:20 2024-09-03 19:32:20.568 - lib.adb - ADB: 192.168.1.32 - pm list packages -3
2024-09-03 15:32:20 2024-09-03 19:32:20.738 - lib.adb - ADB: 192.168.1.32 - pidof com.philo.philo.google
2024-09-03 15:32:20 2024-09-03 19:32:20.834 - lib.adb - ADB: Stopping media playback.
2024-09-03 15:32:20 2024-09-03 19:32:20.834 - lib.adb - ADB: 192.168.1.32 - input keyevent KEYCODE_MEDIA_STOP
2024-09-03 15:32:20 2024-09-03 19:32:20.961 - root - Using Nick Jr. to load channel.
2024-09-03 15:32:20 2024-09-03 19:32:20.961 - lib.adb - ADB: 192.168.1.32 - am start -a android.intent.action.VIEW -d "Nick Jr." com.philo.philo.google
2024-09-03 15:32:21 2024-09-03 19:32:21.220 - httpx - HTTP Request: GET http://192.168.1.26:8090/stream0 "HTTP/1.0 200 OK"
2024-09-03 15:32:25 2024-09-03 19:32:25.616 - lib.adb - Checking for profile screen
2024-09-03 15:32:31 2024-09-03 19:32:31.485 - lib.adb - On screen text: "paw patrol |".
2024-09-03 15:32:32 2024-09-03 19:32:32.490 - lib.adb - Checking for profile screen
2024-09-03 15:32:36 2024-09-03 19:32:36.023 - server - Tuner: Compatibility Mode - Stream released after 16.3 seconds. Display was on, application (com.philo.philo.google) was closed.
2024-09-03 15:32:36 2024-09-03 19:32:36.023 - lib.adb - ADB: Closing connection - 192.168.1.32
2024-09-03 15:32:36 2024-09-03 19:32:36.025 - uvicorn.access - 172.17.0.1:55136 - "GET /stream/1/30 HTTP/1.1" 200
2024-09-03 15:32:36 2024-09-03 19:32:36.250 - root - Tuner: Stream open (attempt 1).
2024-09-03 15:32:36 2024-09-03 19:32:36.255 - httpx - HTTP Request: GET http://192.168.1.26:8090/stream0 "HTTP/1.0 200 OK"
2024-09-03 15:34:08 2024-09-03 19:34:08.660 - server - http disconnect
2024-09-03 15:34:08 2024-09-03 19:34:08.745 - lib.adb - ADB: Connecting to device (attempt 1).
2024-09-03 15:34:08 2024-09-03 19:34:08.790 - lib.adb - ADB: Connected.
2024-09-03 15:34:08 2024-09-03 19:34:08.790 - lib.adb - ADB: 192.168.1.32 - settings list global
2024-09-03 15:34:08 2024-09-03 19:34:08.846 - root - adb_allowed_connection_time=0, adb_enabled=1, adb_wifi_enabled=0
2024-09-03 15:34:08 2024-09-03 19:34:08.846 - lib.adb - ADB: Stopping media playback.
2024-09-03 15:34:08 2024-09-03 19:34:08.846 - lib.adb - ADB: 192.168.1.32 - input keyevent KEYCODE_MEDIA_STOP
2024-09-03 15:34:08 2024-09-03 19:34:08.927 - lib.adb - ADB: 192.168.1.32 - input keyevent KEYCODE_MEDIA_PAUSE
2024-09-03 15:34:09 2024-09-03 19:34:09.072 - lib.adb - ADB: Force stopping com.philo.philo.google.
2024-09-03 15:34:09 2024-09-03 19:34:09.072 - lib.adb - ADB: 192.168.1.32 - am force-stop com.philo.philo.google
2024-09-03 15:34:09 2024-09-03 19:34:09.189 - lib.adb - ADB: Closing connection - 192.168.1.32
2024-09-03 15:34:09 2024-09-03 19:34:09.189 - server - Released tuner ID: 1
2024-09-03 15:34:09 2024-09-03 19:34:09.189 - server - Tuner: Cleanup complete. Google TV (NICK Jr)

Channels Log:
2024/09/03 15:32:10.423924 [ERR] Could not start stream for M3U-ADBTuner ch61 NICK Jr: M3U: 901 Tuner Unreachable: Timeout after 31.41s connecting to: http://192.168.1.6:5592/stream/30
2024/09/03 15:32:36.067140 [TNR] Opened connection to M3U-ADBTuner for ch61 NICK Jr
2024/09/03 15:34:08.633637 [SNR] Buffer statistics for 192.168.1.30 (SAMSUNG-SM-G900V) for ch61 NICK Jr: buf=0% drop=0%
2024/09/03 15:34:08.634147 [TNR] Closed connection to M3U-ADBTuner for ch61 NICK Jr

So this is really weird, but it seems like in general the problem occurs if you haven't tuned to something for a while, and then also perhaps ADBTuner is getting stuck locked on a channel after it's been closed. It's almost like ADBTuner has to be woken up or something. Again as I mentioned a while back, I have every setting that I can think of set to keep devices awake, not go to sleep, etc. whether it's my PC or the onn 4k pro device.