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

Yes, NBC requires compatabity mode. Hulu does not.Hulu is not working for me either. I only bring up NBC as most people would have access to it.

Is there a command I can send to my chromecast to get it to reboot without using the remote? It would be sent via MacMini.

Just got a new PC and got this loaded in Docker, but when I try to preview a stream (NBC channel) I get a 404 on the http request. The endpoint status shows good (and the log shows a good connect to my Uray HDMI device for the status), but it can't stream. I verified that the endpoint URL is correct in VLC (http://192.168.1.168/0.ts).

Relevant logs:

2023-07-18 16:20:30 2023-07-18 20:20:30.168 - lib.adb - ADB: Connected.
2023-07-18 16:20:30 2023-07-18 20:20:30.168 - lib.adb - ADB: 192.168.1.94 - dumpsys display
2023-07-18 16:20:30 2023-07-18 20:20:30.225 - lib.adb - ADB: 192.168.1.94 - getprop ro.build.version.release
2023-07-18 16:20:30 2023-07-18 20:20:30.270 - lib.adb - ADB: Android Version: 12.0.
2023-07-18 16:20:30 2023-07-18 20:20:30.363 - httpx - HTTP Request: GET http://192.168.1.168/0.ts "HTTP/1.1 200 OK"
2023-07-18 16:20:30 2023-07-18 20:20:30.365 - uvicorn.access - 172.17.0.1:54536 - "GET /admin/tuner/metadata?_=1689711472421 HTTP/1.1" 200
2023-07-18 16:20:58 2023-07-18 20:20:58.242 - server - Reserved tuner 1
2023-07-18 16:20:58 2023-07-18 20:20:58.242 - server - Using tuner id: 1
2023-07-18 16:20:58 2023-07-18 20:20:58.242 - uvicorn.access - 172.17.0.1:37938 - "GET /stream/1 HTTP/1.1" 307
2023-07-18 16:20:58 2023-07-18 20:20:58.252 - server - Tuner: Tuning to NBC on Onn 4k
2023-07-18 16:20:58 2023-07-18 20:20:58.255 - lib.adb - ADB: Connecting to device (attempt 1).
2023-07-18 16:20:58 2023-07-18 20:20:58.314 - lib.adb - ADB: Connected.
2023-07-18 16:20:58 2023-07-18 20:20:58.314 - lib.adb - ADB: 192.168.1.94 - dumpsys display
2023-07-18 16:20:58 2023-07-18 20:20:58.364 - lib.adb - ADB: 192.168.1.94 - getprop ro.build.version.release
2023-07-18 16:20:58 2023-07-18 20:20:58.411 - lib.adb - ADB: Android Version: 12.0.
2023-07-18 16:20:58 2023-07-18 20:20:58.479 - lib.adb - ADB: 192.168.1.94 - pidof com.nbcuni.nbc.androidtv
2023-07-18 16:20:58 2023-07-18 20:20:58.550 - lib.adb - ADB: Stopping media playback.
2023-07-18 16:20:58 2023-07-18 20:20:58.551 - lib.adb - ADB: 192.168.1.94 - input keyevent KEYCODE_MEDIA_STOP
2023-07-18 16:20:58 2023-07-18 20:20:58.633 - lib.adb - ADB: Force stopping com.nbcuni.nbc.androidtv.
2023-07-18 16:20:58 2023-07-18 20:20:58.633 - lib.adb - ADB: 192.168.1.94 - am force-stop com.nbcuni.nbc.androidtv
2023-07-18 16:20:58 2023-07-18 20:20:58.713 - lib.adb - ADB: 192.168.1.94 - am start -a android.intent.action.VIEW -d "nbctve://live/nbc" com.nbcuni.nbc.androidtv
2023-07-18 16:21:04 2023-07-18 20:21:04.310 - server - Tuner: Compatibility Mode - Tuner released after 6.06 seconds. Display was on, application (com.nbcuni.nbc.androidtv) was closed.
2023-07-18 16:21:04 2023-07-18 20:21:04.311 - lib.adb - ADB: Closing connection - 192.168.1.94
2023-07-18 16:21:04 2023-07-18 20:21:04.312 - uvicorn.access - 172.17.0.1:37938 - "GET /stream/1/1 HTTP/1.1" 200
2023-07-18 16:21:04 2023-07-18 20:21:04.335 - uvicorn.access - 172.17.0.1:47314 - "GET /0.ts HTTP/1.1" 404
2023-07-18 16:21:04 2023-07-18 20:21:04.339 - httpx - HTTP Request: GET http://192.168.1.168/0.ts "HTTP/1.1 404 Not Found"
2023-07-18 16:21:04 2023-07-18 20:21:04.341 - server - Tuner: Stream complete.
2023-07-18 16:21:04 2023-07-18 20:21:04.341 - server - Released tuner 1
2023-07-18 16:21:04 2023-07-18 20:21:04.345 - lib.adb - ADB: Connecting to device (attempt 1).
2023-07-18 16:21:04 2023-07-18 20:21:04.401 - lib.adb - ADB: Connected.
2023-07-18 16:21:04 2023-07-18 20:21:04.401 - lib.adb - ADB: Stopping media playback.
2023-07-18 16:21:04 2023-07-18 20:21:04.401 - lib.adb - ADB: 192.168.1.94 - input keyevent KEYCODE_MEDIA_STOP
2023-07-18 16:21:05 2023-07-18 20:21:05.214 - lib.adb - ADB: 192.168.1.94 - input keyevent KEYCODE_MEDIA_PAUSE
2023-07-18 16:21:05 2023-07-18 20:21:05.365 - lib.adb - ADB: Force stopping com.nbcuni.nbc.androidtv.
2023-07-18 16:21:05 2023-07-18 20:21:05.365 - lib.adb - ADB: 192.168.1.94 - am force-stop com.nbcuni.nbc.androidtv
2023-07-18 16:21:05 2023-07-18 20:21:05.539 - lib.adb - ADB: Closing connection - 192.168.1.94

Did you set the NBC channel in compatibility mode?

Yes, but the issue is with the stream connect not the adb control.

Hulu is working for me and I updated to the newest release. Only issue I am having is that Hulu likes to pick up where I left off, either that or VICE is WAY off with the schedule.

Try this link. nbctve://live/usa
for west nbctve://live/usa/usa_west
EDIT: Make sure Enable Capatabilty is checked.
Make sure ts is enabled
image

@GTFan :arrow_up:

Somebody posted this and I've been using it to reboot my devices remotely. Create a file called reboot-adb-device.sh. Then put these two lines in that file.

adb connect $1
adb -s $1:5555 reboot

Then run that script in terminal, passing in the ip for your device.

./reboot-adb-device.sh 192.168.0.27
1 Like

Thank you!

Not sure if this is the case for you here, but if you have Hulu setup to record a show to their "DVR" it won't start at live when launched with an ADB command.

Good to know! I will go in and remove the record.

Thanks, I already have this working with the original HDMI capture for Android, I'm just trying to get it working with ADB tuner on the new PC. So I know it works. I have everything set as it should be from the examples here, I guess he just needs to look at the logs and see what I'm doing wrong.

What's weird is that it only tries to run the NBC app for 6 seconds in the log then quits. I can see the NBC app started and running through a VLC connection to the encoder (0.ts), but ADB tuner gives up before NBC finishes starting the video stream. It's almost like ADB tuner's not waiting long enough for the video to start, or it thinks that there's something wrong after it starts running.

It looks like ADBTuner failed to connect to http://192.168.1.168/0.ts and then closed the NBC app as it would during a normal disconnect. I apologize if this is a dumb question, but are you sure that is the correct IP for the device? Does it show up as "endpoint connection successful" in the tuners section at the top of the ADBTuner web interface?

In "compatibility mode" (needed for the NBC app) ADBTuner doesn't try to detect video playback. It just waits a fixed amount of time and then provides the stream as is.

Yes if you reread my post with the logs you'll see that it is successful, so I don't understand why it can't later connect. I can connect multiple instances of VLC to it and I've never seen a 404 from the device.

If you look at the entries at 20:20:58.713 and 20:21:04, it looks like the tuner app closes the NBC app after 6 seconds because it doesn't like something before it tries to connect to the encoder, but maybe I'm reading that wrong.

What I see in VLC connected to 0.ts during that period is the NBC app starting up and then it's force quit by the ADB app.

I'm having the same issue.
I'm going ao far as to factory reset everything. Starts the app, then quits.

Sorry about that. Doing 100 things at once and missed that you had a verified connection.

That's normal. It runs the force close command before launching the app just to make sure its closed because it's unknown if the app will respond well to tuning another channel while still being open.

I will have to look into this disconnection issue.

Is this still the Hulu app? Have you updated the container today?
Can you provide some docker logs?

I haven't updated today.
I'm trying to get NBC working first.

2023-07-18 17:17:57 2023-07-18 22:17:57.090 - server - Reserved tuner 1
2023-07-18 17:17:57 2023-07-18 22:17:57.090 - server - Using tuner id: 1
2023-07-18 17:17:57 2023-07-18 22:17:57.090 - uvicorn.access - 172.17.0.1:47538 - "GET /stream/3 HTTP/1.1" 307
2023-07-18 17:17:57 2023-07-18 22:17:57.095 - server - Tuner: Tuning to NBC Now on ChromeCast 1
2023-07-18 17:17:57 2023-07-18 22:17:57.096 - lib.adb - ADB: Connecting to device (attempt 1).
2023-07-18 17:17:57 2023-07-18 22:17:57.139 - lib.adb - ADB: Connected.
2023-07-18 17:17:57 2023-07-18 22:17:57.139 - lib.adb - ADB: 192.168.1.41 - dumpsys display
2023-07-18 17:17:57 2023-07-18 22:17:57.227 - lib.adb - ADB: 192.168.1.41 - getprop ro.build.version.release
2023-07-18 17:17:57 2023-07-18 22:17:57.266 - lib.adb - ADB: Android Version: 12.0.
2023-07-18 17:17:57 2023-07-18 22:17:57.334 - lib.adb - ADB: 192.168.1.41 - pidof com.nbcuni.nbc.androidtv
2023-07-18 17:17:57 2023-07-18 22:17:57.395 - lib.adb - ADB: Stopping media playback.
2023-07-18 17:17:57 2023-07-18 22:17:57.395 - lib.adb - ADB: 192.168.1.41 - input keyevent KEYCODE_MEDIA_STOP
2023-07-18 17:17:57 2023-07-18 22:17:57.469 - lib.adb - ADB: Force stopping com.nbcuni.nbc.androidtv.
2023-07-18 17:17:57 2023-07-18 22:17:57.469 - lib.adb - ADB: 192.168.1.41 - am force-stop com.nbcuni.nbc.androidtv
2023-07-18 17:17:57 2023-07-18 22:17:57.533 - lib.adb - ADB: 192.168.1.41 - am start -a android.intent.action.VIEW -d "nbctve://live/nbcnews" com.nbcuni.nbc.androidtv
2023-07-18 17:18:03 2023-07-18 22:18:03.124 - server - Tuner: Compatibility Mode - Tuner released after 6.03 seconds. Display was on, application (com.nbcuni.nbc.androidtv) was closed.
2023-07-18 17:18:03 2023-07-18 22:18:03.124 - lib.adb - ADB: Closing connection - 192.168.1.41
2023-07-18 17:18:03 2023-07-18 22:18:03.124 - uvicorn.access - 172.17.0.1:47538 - "GET /stream/1/3 HTTP/1.1" 200
2023-07-18 17:18:03 2023-07-18 22:18:03.140 - uvicorn.access - 172.17.0.1:40110 - "GET /0.ts HTTP/1.1" 404
2023-07-18 17:18:03 2023-07-18 22:18:03.142 - httpx - HTTP Request: GET http://192.168.1.168/0.ts "HTTP/1.1 404 Not Found"
2023-07-18 17:18:03 2023-07-18 22:18:03.143 - server - Tuner: Stream complete.
2023-07-18 17:18:03 2023-07-18 22:18:03.143 - server - Released tuner 1
2023-07-18 17:18:03 2023-07-18 22:18:03.144 - lib.adb - ADB: Connecting to device (attempt 1).
2023-07-18 17:18:03 2023-07-18 22:18:03.227 - lib.adb - ADB: Connected.
2023-07-18 17:18:03 2023-07-18 22:18:03.227 - lib.adb - ADB: Stopping media playback.
2023-07-18 17:18:03 2023-07-18 22:18:03.227 - lib.adb - ADB: 192.168.1.41 - input keyevent KEYCODE_MEDIA_STOP
2023-07-18 17:18:03 2023-07-18 22:18:03.405 - lib.adb - ADB: 192.168.1.41 - input keyevent KEYCODE_MEDIA_PAUSE
2023-07-18 17:18:04 2023-07-18 22:18:04.726 - lib.adb - ADB: Force stopping com.nbcuni.nbc.androidtv.
2023-07-18 17:18:04 2023-07-18 22:18:04.726 - lib.adb - ADB: 192.168.1.41 - am force-stop com.nbcuni.nbc.androidtv
2023-07-18 17:18:04 2023-07-18 22:18:04.891 - lib.adb - ADB: Closing connection - 192.168.1.41

When i tune in a channel with my on box after tune-in, it stays shown as In-use.
I click the link and move it back to available.
When turning into Philo, I have to use compatibility mode.
Hulu doesn't require compatibility mode but I notice it goes back to a home screen and then launches the next channel.
I think I will know more once I get my HDMI encoder. I'm been applying the updates as they come out.