HDMI for Channels

Got HDMI Box #1 installed last night. Pretty cool, thanks for the heads up about that eBay deal, @boukmandutty! So I factory reset it, see that it defaults to a 192.168.1.xxx address. I had to change my laptop's IP to connect directly and manually configure it for my network.

I also turned on HLS, under the "Access" menu, it was "closed" (?) by default:

The stream I'm using for this box is http://10.0.1.171:8080/hls/show.m3u8
Still learning as I go...

1 Like

I left my HLS off and used the MPEGTS stream. I think that would require less resources and complexity on the encoder, and should reduce latency.

In your screenshot I think that's listed as Main HTTP and available at http://10.0.1.171:8080/main`

2 Likes

How do you go about firing these commands/scripts? Instead of using terminal every time?

3 Likes

You would need to install golang (apt install go, brew install golang, or download from golang.org)

Then download the git repo for androidhdmi-for-channels

Run go build in that folder and it will make a androidhdmi-for-channels program you can run. That program acts as a proxy between the DVR and the ADB device, and runs the shell scripts for you when the DVR requests a specific channel or closes a stream.

4 Likes

OK, thanks for that, I changed HLS back to "closed," and then rebooted the box, and I've got it now streaming with http://10.0.1.171:8080/main instead, as my Custom Channel 99000. I also changed Stream Format, from HLS to MPEG-TS, to match.

Now to figure out the Mac server side of things, and adb commands to tune into NBCU channels via YTTV. I'll hopefully get to that in a few days.

I found my old hdhomerun app from my windows days on teh sagetv website. Opendct would be used to execute


adb.exe -s 192.168.1.215 shell am force-stop com.silicondust.view; monkey -p com.silicondust.view -c android.intent.category.LAUNCHER 1; sleep 5; input keyboard text %c%; input keyboard text 0; input keyevent KEYCODE_DEL; sleep 2; input keyevent 66;

As you know %c% is the channel number sagetv would put in so if you put an actual channel number in there it should tune if you test the command (provided the interface hasn’t changed since I last messed with it)

A tuning script might be something like:


@echo off
set "myvar2=%2"
set "myvar=%1"
if "%myvar%"=="" set /p "myvar=Enter Value: " || set "myvar=Default Value"
goto %myvar%

rem first device ip
:192.168.1.171
goto %myvar2%
goto end.

rem second device ip
:192.168.1.215
goto %myvar2%
goto end

:731
rem TBS
adb -s %myvar% shell (commands for button sequence to tune channel goes here)
exit

Should be easy to convert into a linux script if needed.

3 Likes

Here you go:
bmitune.sh:

#!/bin/bash
IPADD="192.168.1.171:5555"

#SYFY
if [ $1 = "752" ];then
adb -s $IPADD shell "am force-stop com.silicondust.view; sleep 1"
adb -s $IPADD shell "monkey -p com.silicondust.view -c android.intent.category.LAUNCHER 1; sleep 5"
adb -s $IPADD shell "input keyboard text 752 ; input keyboard text 0; input keyevent KEYCODE_DEL; sleep 2; input keyevent 66;"
fi

#USA
if [ $1 = "732" ];then
adb -s $IPADD shell "am force-stop com.silicondust.view; sleep 1"
adb -s $IPADD shell "monkey -p com.silicondust.view -c android.intent.category.LAUNCHER 1; sleep 5"
adb -s $IPADD shell "input keyboard text 732 ; input keyboard text 0; input keyevent KEYCODE_DEL; sleep 2; input keyevent 66;"
fi

I recall when testing this that I had to do the weird thing you will see where I put in a zero then delete it. It is because of how the app was set up and how the build in keyboard would behave when certain buttons were pressed while running it.

You will need a stop script similar to the one that we use to make sure it has stopped before tuning:
stopbmitune.sh


#!/bin/bash
IPADD:"192.168.1.171"

adb -s $IPADD shell "am force-stop com.silicondust.view; sleep 1"

If you dont do that it will keep running in the background after you are done. Your pre-tuning script will depend on your particular needs.

1 Like

Still waiting for someone to get this to work with the Spectrum TV app. I can get rid of my over the WAN setup if this works out.

The problem you’re going to run into is the Spectrum app is not supported on Android TV. You could try sideloading the mobile version, which might actually work in this case because you wouldn’t need to use a remote to control it

Curious… What does the Spectrum TV app run on?

1 Like

I’m using the Spectrum App on Apple TV, recording through the encoder.

Oh snap. I had no idea since I don’t own any android TV boxes.

1 Like

You’re using the Spectrum app on Apple TV with the HDMI box and recording on Channels DVR? If so how are you changing channels?

That could get costly with four Apple TVs though.

For at the moment. I have for instance I record Monday Night RAW. I made a custom channel with attached USA network to it with the ip address of my encoder. So it automatically starts recording with my pass. The kick is that I have to make sure USA network is tuned in already so that it's not just recording whatever is on the screen. Unfortunately, at the moment that part is all manual but I just set a reminder on my iPhone 15 mins before hand and tune into it. I can also do it remotely using the Switchbot Hub Mini. If I'm not mistaken the USA network app or NBC app should be on android and you then could setup the script to open said app. I just haven't wrapped my brain around doing all of that at the moment. Just wanted to get the proof of concept. Before this was using OBS and now I like this option better where it automatically starts recording. And with that it saves and extra step so I just have to tune to it. I also have other ideas for instance using the Peacock app to record PPV's from WWE or other streaming services the possibilities are endless. Which are going to be great for time shifting and not having to watch up to live.

I’m planning to do the same for the Xfinity Stream app on Apple TV. You can launch Siri Shortcuts from macOS to tune channel on Apple TV.

I don't know if this would work or not. I'm still waiting for my encoder to test out with Cable Box using IR Blaster method.

bmitune.sh

#!/bin/bash

#ESPN
if [ $1 = "90001" ];then
shortcuts://run-shortcut?name=PlayESPN
fi

#FS1
if [ $1 = "90002" ];then
shortcuts://run-shortcut?name=PlayFS1
fi

#EXTM3U

#EXTINF:-1 channel-id="ESPN" channel-number="90001"
http://IP:7654/play/tuner/90001

#EXTINF:-1 channel-id="FS1" channel-number="90002"
http://IP:7654/play/tuner/90002

That’s a great idea! I guess Spectrum App doesn’t support Siri Shortcuts only Xfinity app does,

1 Like

As far as TV devices, I believe Apple TV, Roku, Xbox, and Samsung TV. It also is available for iPhones/iPads and Android phones/tablets.

This might come in handy for anyone who wants to use a Roku as the device they plug into the encoder. It could be a good option for Spectrum. I’ve never used it, so YMMV GitHub - jcarbaugh/python-roku: Screw remotes. Control your Roku with Python.

1 Like

I spent some time on this today and feel that I'm pretty close! I've got all the hardware in place, I am able to tune into and record from the HDMI. The output displays fine using this custom channel:

#EXTINF:-1 channel-id="HDMI" channel-number="100.1" tvc-guide-placeholders="86400",HDMI
http://10.0.1.171:80/main

Now I'm trying with the androidhdmi-for-channels program to get it to change channels on the AndroidTV dongle automatically. I followed the instructions to install on my Mac mini server, the same one with Channels DVR installed. I'm using this Custom Channel format which I gleaned from above:

#EXTINF:-1 channel-id="msnbc" channel-number="100.1" tvc-guide-placeholders="86400", MSNBC
http://10.0.1.171:7654/play/tuner/msnbc

...but I'm getting this error when I try to tune in:

SCR-20230518-thwg

I do have Developer Options and USB debugging enabled on the Android TV dongle too. I also installed add on the Mac with the brew command. Is there anything else I need to do in order to get adb working and connected from this Mac?

I thought it might be a macOS Ventura / permissions thing but I made sure this was allowed.

Any feedback or suggestions to try are appreciated!

Use the IP of the Mac in your M3U not the encoder