HDMI for Channels

False positive it was occasionally picking up TVE not through ah4c.

1 Like

I hate to bother you, but I just started to get a free moment to try and get Sling TV working, and I am not quite sure where to start. I currently only have the onn/youtube scripts. Where would I get / put scripts for tuning for Sling TV?

I saw no 'sling' related scripts in the repo here
GitHub - bnhf/ah4c: This is a fork of https://github.com/tmm1/androidhdmi-for-channels which aims to be a drop in replacement and provide for reliance on hdmi encoding via network or application tuners. Expanding support to docker and beyond!

The scripts can be found in the sullrich/ah4c repo. I've deleted my fork of his repo, as I'm building directly from his codebase again.

Though it's possible to create a "blended" set of scripts that would handle both of your providers, you may find it more convenient to use two containers, as described here:

If you go that route, when setting up the second container the Sling scripts will automatically be added to your persistent data directory.

The power was out here yesterday when I got back, so I'm just working on this today -- but here's where we're at:

Since the M3U for DTV and DTVStream subscribers is going to be different, I've setup separate scripts and m3u files moving forward. So the next time you download the bnhf/ah4c:test container, make sure your STREAMER_APP variable is set to scripts/firetv/dtvstream beforehand.

There's a typo in your M3U for NFL Red Zone, the URL should be:
http://{{ .IPADDRESS }}/play/tuner/211

I've pushed a new image that adds this new streamer/app combo, and also tweaks a couple of "moves" right after the channel is searched for. This is working for me (with the channel names set to match yours, i.e. without any "HD" at the end).

My proposed fix is fairly simple, which is that I'm adding one additional second after the search to allow for slightly slower Internet connections. After that, I'm moving down twice and left once before "selecting". That's worked for me with every channel I've tried, so give it a go yourself and we'll see if this does the trick.

I have a slightly more sophisticated approach in mind if this doesn't work -- so there's a Plan B if needed. Let me know how it goes.

EDIT: A somewhat tangential question, are you seeing the "special" DTV 4K channels in your guide? E.G. 104-108?

If I understand correctly, I just need some kind of 'if' in the scripts to perform different steps depending on the channel ID? I'm a bit concerned that if I split the containers I end up limiting the number of tuners and how they are distributed to the sources.

I plan on having multiple sources (HULU, etc...) so multiple containers doesn't seem like a long term solution...

OR... Can I add all the tuners to each container? Will they report as being busy properly? (again, I'm not familiar with the internals of this).

Now that we know Sling TV supports deep links, and given your desire to use multiple different streaming services, it may make more sense for you to use the ADBTuner extension.

This project, which was actually the inspiration for ADBTuner, is the only choice if one wants to use a "set of actions" to control an Android app.

ADBTuner, on the other hand, is at its best when one is using exclusively deep links. It's all WebUI based, and allows for using multiple streaming services on the same set of virtual tuners.

2 Likes

still stuck at the end of select screen needs to go down one more time then select

1 Like

We're actually sending commands to move down twice, but your FireStick is missing those commands. This is likely a result of using WiFi (I use Ethernet) for the FireSticks and possibly slower Internet search results for whatever reason.

I've a added the text editor "nano" to the image, so you can exec into the container and try editing scripts/firetv/dtvstream/bmitune.sh yourself until we see the desired result. This is section you want to focus on:

directvTune="input keyevent KEYCODE_MEDIA_PLAY_PAUSE; sleep 4; \
        input keyevent KEYCODE_DPAD_DOWN; \
        input keyevent KEYCODE_DPAD_DOWN; \
        input keyevent KEYCODE_DPAD_LEFT; \
        input keyevent KEYCODE_DPAD_CENTER"

I'd suggest adding seconds to "sleep 4" until you see the subsequent keyevents actually do their thing. You can add sleep seconds after each keyevent too if needed, but I think the problem is that the search itself is taking longer on your setup -- resulting in lost keyevents.

In Portainer, under Quick Actions, there's a button that'll allow you to exec into the container. After that, nano scripts/firetv/dtvstream/bmitune.sh should open the script we want to edit. Ctrl-X followed by a Y and an enter will save the modified script.

Make sure you don't leave the DTV app in the middle of a search between tests, always finish tuning manually if your test is unsuccessful. Ultimately we want to get to the point where "tuning" never fails on your setup.

it appears to input the search ok then goes down to clear results , then down and sticks on all when I watch it. if i manually input down and select it continues. I mostly use the firetv app the server is in another room . if the channel is last used it does usually go right to it,
I will give it a go this afternoon and let you know. fwiw The FireStick is on Gigabit Ethernet &Fios Gigabit is provisioned.

That's the result of scripting -- the last channel is not tuned again if it's been less than four hours since it was last used (the DTV app always reloads itself after this interval if it hasn't been used).

That's about the same as my setup. Is your FireStick the 4K Max?

Success! And yes i do have a FireStick 4K Max
increasing the time did not work. On a whim I added annother line down since you provided nano

 directvTune="input keyevent KEYCODE_MEDIA_PLAY_PAUSE; sleep 3; \
        input keyevent KEYCODE_DPAD_DOWN; \
   	    input keyevent KEYCODE_DPAD_DOWN; \
        input keyevent KEYCODE_DPAD_DOWN; \
        input keyevent KEYCODE_DPAD_LEFT; \
        input keyevent KEYCODE_DPAD_CENTER"
1 Like

Interesting -- another difference between using the app with sat vs streaming credentials. So, it's good that we've setup separate scripts and M3Us.

Give as many channels as you can a try with these additions, I'm concerned that the one move to the left just before selecting isn't going to cover all scenarios. It'll be great if it does though. :slight_smile:

I'm using your M3U as the "master" for dtvstream, so let me know if you add or subtract any channels from it.

1 Like

I added Ovation since we lost it in TVE and changed a coupe of station ids that were wrong today

#EXTINF:-1 channel-id="3" tvc-guide-stationid="19611",CBS-KYW
http://{{ .IPADDRESS }}/play/tuner/3
#EXTINF:-1 channel-id="6" tvc-guide-stationid="19612",ABC-WPVI
http://{{ .IPADDRESS }}/play/tuner/6
#EXTINF:-1 channel-id="10" tvc-guide-stationid="19613",NBC-WCAU
http://{{ .IPADDRESS }}/play/tuner/10
#EXTINF:-1 channel-id="12" tvc-guide-stationid="24114",PBS-WHYY
http://{{ .IPADDRESS }}/play/tuner/12
#EXTINF:-1 channel-id="23" tvc-guide-stationid="43689",PBS-WNJS
http://{{ .IPADDRESS }}/play/tuner/23
#EXTINF:-1 channel-id="29" tvc-guide-stationid="19614",FOX-WTXF-TV
http://{{ .IPADDRESS }}/play/tuner/29
#EXTINF:-1 channel-id="39" tvc-guide-stationid="24783",PBS-WLVT
http://{{ .IPADDRESS }}/play/tuner/39
#EXTINF:-1 channel-id="57" tvc-guide-stationid="34628",CW-WPSG
http://{{ .IPADDRESS }}/play/tuner/57
#EXTINF:-1 channel-id="206" tvc-guide-stationid="32645",ESPN
http://{{ .IPADDRESS }}/play/tuner/206
#EXTINF:-1 channel-id="209" tvc-guide-stationid="45507",ESPN2
http://{{ .IPADDRESS }}/play/tuner/209
#EXTINF:-1 channel-id="211" tvc-guide-stationid="65025",NFL Red Zone
http://{{ .IPADDRESS }}/play/tuner/211
#EXTINF:-1 channel-id="212" tvc-guide-stationid="45399",NFL Network
http://{{ .IPADDRESS }}/play/tuner/212
#EXTINF:-1 channel-id="213" tvc-guide-stationid="62081",MLB Network
http://{{ .IPADDRESS }}/play/tuner/213
#EXTINF:-1 channel-id="216" tvc-guide-stationid="45526",NBA TV
http://{{ .IPADDRESS }}/play/tuner/216
#EXTINF:-1 channel-id="217" tvc-guide-stationid="60316",Tennis Channel HD
http://{{ .IPADDRESS }}/play/tuner/217
#EXTINF:-1 channel-id="218" tvc-guide-stationid="61854",Golf Channel
http://{{ .IPADDRESS }}/play/tuner/218
#EXTINF:-1 channel-id="219" tvc-guide-stationid="82547",FOX Sports 1
http://{{ .IPADDRESS }}/play/tuner/219
#EXTINF:-1 channel-id="241" tvc-guide-stationid="59186",Paramount TV
http://{{ .IPADDRESS }}/play/tuner/241
#EXTINF:-1 channel-id="242" tvc-guide-stationid="58452",USA Network
http://{{ .IPADDRESS }}/play/tuner/242
#EXTINF:-1 channel-id="244" tvc-guide-stationid="11097",Syfy
http://{{ .IPADDRESS }}/play/tuner/244
#EXTINF:-1 channel-id="256" tvc-guide-stationid="12852",TCM
http://{{ .IPADDRESS }}/play/tuner/256
#EXTINF:-1 channel-id="264" tvc-guide-stationid="18332",BBC America
http://{{ .IPADDRESS }}/play/tuner/264
#EXTINF:-1 channel-id="269" tvc-guide-stationid="14771",HISTORY
http://{{ .IPADDRESS }}/play/tuner/269
#EXTINF:-1 channel-id="274" tvc-guide-stationid="15807",Ovation HD
http://{{ .IPADDRESS }}/play/tuner/274
#EXTINF:-1 channel-id="281" tvc-guide-stationid="31046",MotorTrend
http://{{ .IPADDRESS }}/play/tuner/281
#EXTINF:-1 channel-id="501" tvc-guide-stationid="19548",HBO HD East
http://{{ .IPADDRESS }}/play/tuner/501
#EXTINF:-1 channel-id="502" tvc-guide-stationid="59368",HBO2 HD East
http://{{ .IPADDRESS }}/play/tuner/502
#EXTINF:-1 channel-id="503" tvc-guide-stationid="59363",HBO Signature HD East
http://{{ .IPADDRESS }}/play/tuner/503
#EXTINF:-1 channel-id="504" tvc-guide-stationid="19566",HBO West HD
http://{{ .IPADDRESS }}/play/tuner/504
#EXTINF:-1 channel-id="505" tvc-guide-stationid="59368",HBO2 West HD
http://{{ .IPADDRESS }}/play/tuner/505
#EXTINF:-1 channel-id="506" tvc-guide-stationid="59839",HBO Comedy HD
http://{{ .IPADDRESS }}/play/tuner/506
#EXTINF:-1 channel-id="507" tvc-guide-stationid="59357",HBO Family East HD
http://{{ .IPADDRESS }}/play/tuner/507
#EXTINF:-1 channel-id="509" tvc-guide-stationid="59845",HBO Zone HD
http://{{ .IPADDRESS }}/play/tuner/509
#EXTINF:-1 channel-id="618" tvc-guide-stationid="59305",FOX Sports 2
http://{{ .IPADDRESS }}/play/tuner/618
#EXTINF:-1 channel-id="exit" tvc-guide-stationid="",Exit DirecTV
http://{{ .IPADDRESS }}/play/tuner/exit
#EXTINF:-1 channel-id="reboot" tvc-guide-stationid="",Reboot FireTV
http://{{ .IPADDRESS }}/play/tuner/reboot

You have separate M3Us or just different? I have set mine not to update.

Separate. But I see I neglected to add it to the startup script, which moves scripts and m3us to your persistent directory if they either don't exist or you set UPDATE_SCRIPTS or UPDATE_M3US to true. Next build you should be able to update both scripts and m3us and they'll be the same as you're using now.

You'll also want to change your Custom Channels setup to reflect the new dtvstream.m3u, once it shows up in your data directory (I'll let you know when an updated image is ready to pull).

1 Like

OK, I've pushed the new bnhf/ah4c:test. Go ahead and update scripts and m3us, and change the source URL in Custom Channels to be sure we're all synchronized. Since I don't have DTVStream credentials, I'm hoping you'll continue to be the final tester for this set of scripts and unique m3u.

If things look good on your end, I'll build again to the :latest tag so both :test and :latest are the same.

Also, I'm still curious about whether you're seeing the special 4K channels in your DTV app guide. They're 104-108 I believe.

Update on channels: all tested out ok except MLB hung up at the Blackout Screen Due to the Phillies game and would not go away. When I closed it exited to Home ok but it stays on and blocked the next tune until I manualy changed the channel. known issue?
NFL Red zone was ok thanks to you and it did not hang the next tune.
I will give the new build a go. Thank you!

I think what's going on there is that I use the audio stream as a trigger to begin changing the channel. In other words, if you tune to a black screen with no audio, channel changing will never begin. I haven't had that happen myself, but a blacked out baseball game is certainly an example of where it could happen.

Since the DTV app always starts on some channel or another, the audio trick has been a good one to keep from beginning the channel search process too soon. Seems like we need some logic to deal with this, but what that might be is the question. I'll need to give that some thought.

something is not quite right it appears to be somehow tuning from your M3U?
even though it looks right in channels? USA Network HD is not found should be No :"HD"