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

No, I wasn't aware of vlc-brdige-pbs. I'll give it a look.

FYI, I can get the PBS app to launch by giving com.pbs.video/com.pbs.video.StartupActivity for the ADBTuner package name. (I realize that that's both a package name and an intent (or something), but it seems to work through some lucky accident.) I can also get the app launched similarly in adb:

$ adb shell am start com.pbs.video/com.pbs.video.StartupActivity
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.pbs.video/.StartupActivity }

That part is possible with any app -- the important question, with ADBTuner anyway, is does the app support deeplinks? If it doesn't, then you'd need to use the ah4c project where you can do remote control emulation via bash scripting.

If the vlc-bridge-pbs project gives you the stations you're looking for -- that's the easiest way. And if you get OliveTin up-and-running, all known channels-related extensions are easily installed -- both the container config, and the CDVR custom channels setup are done for you.

1 Like

Man, that was easy. Thanks for the pointer. I set up vlc-bridge-pbs individually, but I'll also have a look at the OliveTin stuff. Maybe I'm not watching enough TV.

1 Like

As @bnhf suggested, nobody ever tried this approach (ah4c or ADBTuner) because there is a better way.

To be thorough, I did just check and the PBS app does support deep links, but not for live TV. PBS being as awesome as they usually are have their deep link structure documented.
https://docs.pbs.org/space/RES/3965277/OTT+Deep+Link+Templates+and+Guidance

1 Like

I'm not sure what the real intersection is between the PBS livestream and deep linking. (I'm not trying to argue or disagree. I'm really saying I'm not sure.)

The web URL for the livesteam is a constant: https://player.pbs.org/ga-livestream-portalplayer/. There can be other goop tacked on the end, but it's not needed.

But if you just open that URL in incognito mode, it gives the expected error about not knowing what station interests you. I think they normally get that info from the browser referrer link and something from cookies, or if you go to pbs.org directly and login they know who you are. And, of course, we all know they apply geographic restrictions based on your source IP address.

I know I'm probably getting far afield from the "it just works" intent of ADBTuner. I'm just trying to be lucky. :slight_smile: vlc-bridge-pbs doesn't provide CC, which is a must-have in my house.

1 Like

The application itself has to know what to do with the URL. https://player.pbs.org is not a URL it is prepared to handle. Per the application manifest (AndroidManifest.xml) in the decompiled apk file it supports URLs such as:

www.pbs.org/video/
www.pbs.org/show/
www.pbs.org/launchApp
pbsvideo://video.pbs.org/video/
pbsvideo://video.pbs.org/profile_callback
...

These things match up to the documentation provided by PBS which states:
Note: Currently we do not support deep linking to the Live TV feed.

In other words there is no magic URL that will open the live stream in the Android TV app.

Unfortunately this makes it a bad candidate for ADBTuner. With ah4c you can open the app and then use remote commands to click the appropriate button in app to start the stream. That will be the best bet and the app should remember that you had captions on.

1 Like

Has anybody got this to work with Max to open a TNT hockey or basketball game?

@turtletank, thanks for providing this awesome app to the community. I have 2 HDMI video encoders and 2 GCCTV dongles working perfectly. It works well with Channels DVR and Windows Media center. Good work and thank you!

Yup, the deeplinks are event specific, but it does work. See my above posts on it.

I have a problem getting the latest :stable version working with 1 of 4 devices ; working = Nvidia Shield 2015 (non-pro), Onn TV 4K, Onn TV 4K Pro ; not working = Nvidia Shield 2019 - The NS19 exits a second after tuning the desired channel in YTTV - I've performed a factory reset and still have the same problem - (I've been moving equipment - using Onn TV boxes as clients and getting wired devices to use for the encoders) - any thoughts?

EDIT: nevermind - just noticed I forgot to put the port number 8090 into the LinkPi address - now it's working...

Got two questions. My system has been running perfectly, but it's been a while. Should I bother trying to update my docker-compose?
Second question, How do I go by converting my current running copy to a portainer copy without messing anything up? :slight_smile:

You can export your channel list into a file, create a new Portainer stack per the May 11 post by bhnf and then re-import the channel list - you will have to re-enter the encoder setup, but that is easy

ADBTuner has been working great for quite some time for me but lately I've been seeing recordings failed. It seemed intermittent but now I saw what was going on.

Here is my configuration:
2 Mecool devices
1 Chromecast
1 Onn
Provider is YTTV

I thought my second Mecool device was the source of the problem so I used the excellent feature of setting the tuner priority to that device to 4 so that it would pick that tuner last. That seemed to fix this issue at least until I had to record 4 channels at the same time (something I don't think I've ever done IRL). Well, I had a failed recording but this time on the Chromecast device.

After trying recording on each device individually while watching the tuning happening by viewing the video output of the encoder, I noticed that Channels gave up on the channel tuning if the ADB device took too long to tune. In the failed recording case, the YTTV app displayed two different YTTV logo screens before it successfully tuned to the selected channel. This delay in tuning caused Channels to give up waiting for a stream and responds with:

In a normal working tuning case I do not see those two YTTV logo screens before the video streams starts. The extra delay of the YTTV app displaying those logos is causing Channles to abort the tuning.

ADBTuner has been a game changer now that TVE has gone the way is has. Any ideas of how to get around this issue?

EDIT: I now see that long tuning with the two YTTV logos before streaming starts (but Channels tuning timeout) happens the first tuning after a device reboot. Then every other tuning on that device is fast and Channels does not timeout.

Any chance you can get me the docker logs from when this happens? That would provide some more insight.

I have found that it's helpful to disable automatic app updates and to configure the device so it never sleeps.

1 Like

I think I know how to disable sleep if that is the same as setting the display to not sleep. Could you give me a hint of where to find the disable automatic updates? I can't seem to find it.

Here is a container log for a case where the device was rebooted and the first tune attempt failed.

Summary
2024-06-10 17:44:43.159 - server - Available Tuners:
2024-06-10 17:44:43.159 - server - Name: Port2-YTTV Priority: 1
2024-06-10 17:44:43.159 - server - Name: Port1-YTTV Priority: 2
2024-06-10 17:44:43.159 - server - Name: Port3-YTTV Priority: 2
2024-06-10 17:44:43.159 - server - Name: Port4-YTTV Priority: 2
2024-06-10 17:44:43.159 - server - Using first available tuner (by priority).
2024-06-10 17:44:43.160 - server - Reserved Tuner: Name: Port2-YTTV Priority: 1
2024-06-10 17:44:43.160 - server - Using tuner id: 3 for stream.
2024-06-10 17:44:43.160 - uvicorn.access - 192.168.0.11:35518 - "GET /stream/129 HTTP/1.1" 307
2024-06-10 17:44:43.163 - server - Tuner: Tuning to MSNBC on Port2-YTTV
2024-06-10 17:44:43.165 - lib.adb - ADB: Connecting to device (attempt 1).
2024-06-10 17:44:43.283 - lib.adb - ADB: Connected.
2024-06-10 17:44:43.283 - lib.adb - ADB: 192.168.0.29 - dumpsys display
2024-06-10 17:44:43.517 - lib.adb - ADB: 192.168.0.29 - getprop ro.build.version.release
2024-06-10 17:44:43.665 - lib.adb - ADB: Android Version: 11.0.
2024-06-10 17:44:43.666 - lib.adb - ADB: 192.168.0.29 - pm list packages -3
2024-06-10 17:44:44.045 - lib.adb - ADB: 192.168.0.29 - pidof com.google.android.youtube.tvunplugged
2024-06-10 17:44:44.367 - lib.adb - ADB: Stopping media playback.
2024-06-10 17:44:44.367 - lib.adb - ADB: 192.168.0.29 - input keyevent KEYCODE_MEDIA_STOP
2024-06-10 17:44:48.854 - root - Using https://tv.youtube.com/watch/q6bWEVqhP8o to load channel.
2024-06-10 17:44:48.854 - lib.adb - ADB: 192.168.0.29 - am start -a android.intent.action.VIEW -d "https://tv.youtube.com/watch/q6bWEVqhP8o" com.google.android.youtube.tvunplugged
2024-06-10 17:44:53.956 - server - Tuner: Waiting for playback start. Status: unknown
2024-06-10 17:44:59.215 - lib.adb - Checking for profile screen
2024-06-10 17:45:01.497 - lib.adb - On screen text: "batt wa".
2024-06-10 17:45:03.286 - lib.adb - Checking for profile screen
2024-06-10 17:45:06.014 - lib.adb - Checking for profile screen
2024-06-10 17:45:10.031 - lib.adb - Checking for profile screen
2024-06-10 17:45:11.249 - lib.adb - Failed to get status from media_session.
2024-06-10 17:45:12.646 - lib.adb - Checking for profile screen
2024-06-10 17:45:13.878 - lib.adb - Failed to get status from media_session.
2024-06-10 17:45:17.040 - lib.adb - Detected 100.0% black pixels. Assuming HDCP is active and video is playing.
2024-06-10 17:45:17.040 - server - Tuner: Tuning completed in 33.88 seconds. Display was on, application (com.google.android.youtube.tvunplugged) was closed.
2024-06-10 17:45:17.040 - lib.adb - ADB: Closing connection - 192.168.0.29
2024-06-10 17:45:17.041 - server - http disconnect
2024-06-10 17:45:17.044 - lib.adb - ADB: Connecting to device (attempt 1).
2024-06-10 17:45:17.103 - root - Tuner: Stream open (attempt 1).
2024-06-10 17:45:17.118 - lib.adb - ADB: Connected.
2024-06-10 17:45:17.118 - lib.adb - ADB: Stopping media playback.
2024-06-10 17:45:17.118 - lib.adb - ADB: 192.168.0.29 - input keyevent KEYCODE_MEDIA_STOP
2024-06-10 17:45:17.160 - httpx - HTTP Request: GET http://192.168.0.168/4.ts "HTTP/1.1 200 OK"
2024-06-10 17:45:19.299 - lib.adb - ADB: 192.168.0.29 - input keyevent KEYCODE_MEDIA_PAUSE
2024-06-10 17:45:20.569 - lib.adb - ADB: Closing connection - 192.168.0.29
2024-06-10 17:45:20.570 - server - Released tuner ID: 3
2024-06-10 17:45:20.570 - server - Tuner: Cleanup complete. Port2-YTTV (MSNBC)

1 Like

Good morning all! I have been using ADBTuner on 3 encoders with great success for a while now. I see a recurring issue with the Firesticks wanting to reauthenticate ADB before they will go back to the home screen. I have set them to remember ADB authorization when it pops up but some weeks later both Firesticks and one Tivo will ask for authorization again. Is it something I did or just something to live with?

I am running 2 Onn 4K sticks currently and see the same thing...Mine will also just bring the authenticate screen back up sometimes even when I reclick remember and OK...So when I get a chance anymore I just hit cancel instead and they still tune fine.

I believe mine will still tune when called on even with this screen up...but I just cleared them the other day so it has not popped back up the authentication yet. I will verify that they do tune when showing this next time I see it. I only clear this screen if I am on the system doing something else because it annoys me...lol

I am trying to get multiple Onn 4k devices setup with a LinkPi ENC5-v2 encoder, but I've been struggling with getting the devices to work correctly. It "works" but the video on the second device is dim, however, this is only the case when I launch the NBC app streams via ADB.

I'm using the following command:
adb shell am start -a android.intent.action.VIEW -d "nbctve://live/msnbc" com.nbcuni.nbc.androidtv

The only post I could find that mentioned dimming in the forums spoke of it being dim every other time, which is not the case for me. Its always dim on the second device, and the first device is always good. I have also tried playing with every YpCbCr8-bit setting and HDR disabling I could find to no avail.

Note, the same problem occurs even if its launched from ADBTuner (which makes sense since its sending the exact same ADB command). If I launch the channel manually from the NBC App Guide via the remote, it looks correct.

I have tried multiple ports on the linkpi and even directly connecting the device to the TV. None of these have helped. The second device is dim and the first device looks good.

I have gone setting by setting through every menu of the decides and they are configured identically.
I have also reset the second device back to factory settings more times than I can count.
I have also tried an old Tivo Stream device and it was also dim for the NBC app only when tuned via ADB. I had the same problem on a FireTV, which is why I bought the second Onn device. I think its something in the NBC app itself though, but I can't for the life of me figure out what it is.

I would appreciate any suggestions.

To confirm you are running 1080P right?

Yes, 1080p60, and it happens whether i'm connected to the LinkPi or Directly to the TV.

The NBC Logo at the top of the screen is nice and bright, even when the rest of the picture is dim, and when I tune with the remote, it looks good.

I purchased a third Onn 4k device and it is also dim. So, 1 good setup and 2 dim.