Yeah I’ve always done it through threadfin.
Would like to have one less link in the chain though and do it through ah4c.
Yeah I’ve always done it through threadfin.
Would like to have one less link in the chain though and do it through ah4c.
I plan on using 3 Fire TVs for 3 different (permanent) channels, on 3 different apps. My plan is to keep them streaming all the time and just jump on that stream when hitting "Watch" or when recording.
Does ah4c check to see if the stream is already alive before closing/opening the app and launching the stream? Thanks.
You don't actually need ah4c to do this. Just set up a Custom Channels source M3U using the streams from your encoder ports as the URLs.
ah4c and ADBTuner are all about creating virtual tuners that can change channels. With no channel changing required, you can go direct.
Yes, but sometimes the stream just stops (connection issues, timeouts, etc.). I was hoping ah4c could make sure the stream is live and restart if needed...
ah4c could definitely do that. You'd need to put your own Bash scripts together, but if you have any aptitude for this kind of thing, I don't think you'd find it too difficult.
In addition, along the way, I've already written every function you'd need I believe. So, it'll mostly be a question of grabbing the pieces required and fitting them together.
Finally got around to setting up ah4c on my primary server (Synology NAS). I had already nuked my test server ah4c container that was set up thru Container Manager. That container was using emulation and not deeplinks. Now, everything is on one machine.
Installed Portainer without issues. Decided to install OliveTin thinking it would be the easiest way to deploy ah4c but was having issues spinning it up. Tried quite a few things until I gave up. Installed ah4c working thru a few errors. Got it running using the dtvstream m3u but was unable to get it working with deeplinks. In the end, I regressed to the emulation method with all working as before.
Got up this am and pointed everything back to deeplinks and it worked immediately. Channel open time is about 10-11 secs- quite an improvement from the 1-1/2 minutes using emulation.
Didn’t do anything different from last night so it must have been operator input error.
Will test the "keep watching" today. Want to see how long it works before I let the wife know.
Future Plans:
Thanks for the past guidance and future guidance I will probably need with OliveTin.
Testing results for the "Are you watching" screen.
Test #1: (Yesterday)
Had variable set to 4h. The "AYW" screen came up at around 4 hrs.
Test #2: (Yesterday)
Set variable to 3h. At 3 hrs, saw a glitch on screen, then confirmed in log the resending of the deeplinks. At 4 hr, the "AYW" screen came up.
Test #3: (Today)
Variable set to 3h. At about 2 hrs into the program, I used the Amazon remote for the encoder stick and pressed the Up button. This brings up the recent channels at the bottom of the screen. Once they came up, I pressed the Up button again to clear the recent channels menu (not sure if I really need have that 2nd button push). Now I'm at 5+ hrs without seeing the "AYW" screen.
11:00 am — pressed the Up button, recent channels menu came up. It stays up for 1 minute then disappears. So it looks like you need 2 button pushes to limit the extra screen display.
Will now observe and report results later without any or interaction from myself.
I don't use DTV or DTVStream myself anymore, but what you're saying about resending deeplinks not working any longer to keep the "Are you watching" screen from coming up sounds familiar. If you've found a key sequence that works, would you be willing to try an easy modification to scripts/firetv/dtvdeeplinks/bmitune.sh?
The function in question looks like this atm:
#Tuning is based on channel name values from dtvdeeplinks.m3u.
tuneChannel() {
#$adbTarget shell am start -a android.intent.action.VIEW -d dtvnow://deeplink.directvnow.com/play/channel/$channelName/$channelID
$adbTarget shell am start -n $packageName/$packageAction dtvnow://deeplink.directvnow.com/play/channel/$channelName/$channelID
echo -e "#!/bin/bash\n\nwhile true; do sleep $KEEP_WATCHING; $adbTarget shell am start -n $packageName/$packageAction dtvnow://deeplink.directvnow.com/play/channel/$channelName/$channelID; done" > ./$streamerNoPort/keep_watching.sh && chmod +x ./$streamerNoPort/keep_watching.sh
[[ $KEEP_WATCHING ]] && nohup ./$streamerNoPort/keep_watching.sh &
}
You could modify the echo command that creates the keep_watching.sh script (on-the-fly) to send a couple of up arrows, instead of the deeplink, like this:
echo -e "#!/bin/bash\n\nwhile true; do sleep $KEEP_WATCHING; $adbTarget shell input keyevent KEYCODE_DPAD_UP; $adbTarget shell input keyevent KEYCODE_DPAD_UP; done" > ./$streamerNoPort/keep_watching.sh && chmod +x ./$streamerNoPort/keep_watching.sh
This change would only work until the next time the container is restarted. But once you've confirmed it works, I'll push an updated container.
Hopefully I did this correctly.
Steps:
Copied to test folder on Synology. Downloaded to Win 10 machine. Opened with Notepad and edited. Transferred back to Synology then copied to deeplinks folders allowing rewrite. So we will find out in a few hours. I did not shut down the container while doing the edit.
I’m not sure if there is a way to edit while on Synology. This was the easiest for me.
I'll be out for a couple hours but will check when I get back.
This could be an issue. Notepad may have changed your line endings to <CR><LF>, instead of just <LF>. If either bmitune.sh or keep_watching.sh fails to run, that's probably why. Using WinSCP or Synology's File Station (assuming it has a built-in editor) would be better.
No problem. I found Synology's text editor and installed. If I don’t think it’s working later today, I'll stop container then spin it up again and make the edits in Synology.
We should know in about 4 hrs if I was successful this time.
I got the "AYW" screen at about 4 hours after my last remote pushes. Checked the bmitune file and it didn’t look correct. It didn’t have what we edited and the original piece was gone. Had trouble trying to edit(permissions issue) so I nuked everything and started over. Still had the permission issue but I copied to a test directory and used the Synology text editor then copied file back to correct folder. Picked a channel and initiated viewing. After about 15 minutes, I checked the bmitune file by copying to a test directory and opening it- all of our edits were there. I’ve got it set for 3 hrs so hopefully we’ll see the recent channels menu come up.
The permissions issue baffles me. When I try and edit the permissions, it tells me I already have permission.
I dl'd WinScp but I need to read up a little before using.
I'm not sure if I need those 2 dots I put in- was trying to align
2025-05-12T22:11:45.268144849Z [ERR] Failed to run start script: exit status 127
2025-05-12T22:11:45.268118025Z [EXECUTE] Finished running ./scripts/firetv/dtvstreamdeeplinks/bmitune.sh in 226.664023ms
2025-05-12T22:11:45.268096583Z '
2025-05-12T22:11:45.268069853Z + echo 'bmitune.sh is exiting for 10.0.1.74:5555 with exit code 127'
2025-05-12T22:11:45.268047366Z + finish
2025-05-12T22:11:45.268018207Z ./scripts/firetv/dtvstreamdeeplinks/bmitune.sh: line 235: ..echo: command not found
2025-05-12T22:11:45.267977125Z + ..echo -e '#!/bin/bash\n\nwhile true; do sleep ; adb -s 10.0.1.74:5555 shell input keyevent KEYCODE_DPAD_UP; adb -s 10.0.1.74:5555 shell input keyevent KEYCODE_DPAD_UP; done'
2025-05-12T22:11:45.267943021Z Warning: Activity not started, intent has been delivered to currently running top-most instance.
2025-05-12T22:11:45.267909879Z + adb -s 10.0.1.74:5555 shell am start -n com.att.tv/com.clientapp.MainActivity dtvnow://deeplink.directvnow.com/play/channel/NEWSMXH/533f3fad-e91d-5cbf-6f80-82db799e4953
2025-05-12T22:11:45.267887086Z + tuneChannel
2025-05-12T22:11:45.267864200Z + echo NEWSMXH
Here's that portion of the bmitune file.
Not sure if I got that 3 dots thing correct
#Tuning is based on channel name values from dtvdeeplinks.m3u.
tuneChannel() {
#$adbTarget shell am start -a android.intent.action.VIEW -d dtvnow://deeplink.directvnow.com/play/channel/$channelName/$channelID
$adbTarget shell am start -n $packageName/$packageAction dtvnow://deeplink.directvnow.com/play/channel/$channelName/$channelID
..echo -e "#!/bin/bash\n\nwhile true; do sleep $KEEP_WATCHING; $adbTarget shell input keyevent KEYCODE_DPAD_UP; $adbTarget shell input keyevent KEYCODE_DPAD_UP; done" > ./$streamerNoPort/keep_watching.sh && chmod +x ./$streamerNoPort/keep_watching.sh
}
Spaces are what you'd use for alignment. Replace the dots with spaces, and you should be good.
Made that change. It didn’t error this time
2025-05-12T22:11:45.268144849Z [ERR] Failed to run start script: exit status 127
2025-05-12T22:11:45.268118025Z [EXECUTE] Finished running ./scripts/firetv/dtvstreamdeeplinks/bmitune.sh in 226.664023ms
2025-05-12T22:11:45.268096583Z '
2025-05-12T22:11:45.268069853Z + echo 'bmitune.sh is exiting for 10.0.1.74:5555 with exit code 127'
2025-05-12T22:11:45.268047366Z + finish
2025-05-12T22:11:45.268018207Z ./scripts/firetv/dtvstreamdeeplinks/bmitune.sh: line 235: ..echo: command not found
2025-05-12T22:11:45.267977125Z + ..echo -e '#!/bin/bash\n\nwhile true; do sleep ; adb -s 10.0.1.74:5555 shell input keyevent KEYCODE_DPAD_UP; adb -s 10.0.1.74:5555 shell input keyevent KEYCODE_DPAD_UP; done'
2025-05-12T22:11:45.267943021Z Warning: Activity not started, intent has been delivered to currently running top-most instance.
2025-05-12T22:11:45.267909879Z + adb -s 10.0.1.74:5555 shell am start -n com.att.tv/com.clientapp.MainActivity dtvnow://deeplink.directvnow.com/play/channel/NEWSMXH/533f3fad-e91d-5cbf-6f80-82db799e4953
2025-05-12T22:11:45.267887086Z + tuneChannel
2025-05-12T22:11:45.267864200Z + echo NEWSMXH
2025-05-12T23:13:30.207251166Z [EXECUTE] Finished running ./scripts/firetv/dtvstreamdeeplinks/bmitune.sh in 181.477816ms
2025-05-12T23:13:30.207228551Z '
2025-05-12T23:13:30.207200887Z + echo 'bmitune.sh is exiting for 10.0.1.74:5555 with exit code 0'
2025-05-12T23:13:30.207176811Z + finish
2025-05-12T23:13:30.207148837Z + chmod +x ./10.0.1.74/keep_watching.sh
2025-05-12T23:13:30.207112214Z + echo -e '#!/bin/bash\n\nwhile true; do sleep ; adb -s 10.0.1.74:5555 shell input keyevent KEYCODE_DPAD_UP; adb -s 10.0.1.74:5555 shell input keyevent KEYCODE_DPAD_UP; done'
2025-05-12T23:13:30.207079418Z Warning: Activity not started, intent has been delivered to currently running top-most instance.
2025-05-12T23:13:30.207047745Z + adb -s 10.0.1.74:5555 shell am start -n com.att.tv/com.clientapp.MainActivity dtvnow://deeplink.directvnow.com/play/channel/NEWSMXH/533f3fad-e91d-5cbf-6f80-82db799e4953
2025-05-12T23:13:30.207023763Z + tuneChannel
2025-05-12T23:13:30.206973537Z + rm 10.0.1.74/adbAppRunning
2025-05-12T23:13:30.206999892Z + echo NEWSMXH
2025-05-12T23:13:30.206949407Z + (( 9 < 14400 ))
2025-05-12T23:13:30.206922108Z + '[' -f 10.0.1.74/adbAppRunning ']'
2025-05-12T23:13:30.206790424Z + lastChannel=NEWSMXH
2025-05-12T23:13:30.206730179Z + local timeElapsed
2025-05-12T23:13:30.206765397Z + local maxTime=14400
2025-05-12T23:13:30.206813036Z + lastAwake=1747091601
2025-05-12T23:13:30.206851047Z ++ date +%s
2025-05-12T23:13:30.206898378Z + timeElapsed=9
2025-05-12T23:13:30.206875195Z + timeNow=1747091610
2025-05-12T23:13:30.206681101Z + local lastAwake
2025-05-12T23:13:30.206584607Z + [[ -f 10.0.1.74/adbCommunicationFail ]]
2025-05-12T23:13:30.206608553Z + echo 'Not a special channel (exit nor reboot)'
2025-05-12T23:13:30.206657286Z + local lastChannel
2025-05-12T23:13:30.206633753Z + launchDelay
2025-05-12T23:13:30.206705499Z + local timeNow
2025-05-12T23:13:30.206512770Z + specialChannels
2025-05-12T23:13:30.206536959Z + '[' NEWSMXH = exit ']'
2025-05-12T23:13:30.206559743Z + '[' NEWSMXH = reboot ']'
2025-05-12T23:13:30.206476921Z + encoderURL=http://10.0.1.70/0.ts
2025-05-12T23:13:30.206451884Z + case "$streamerIP" in
2025-05-12T23:13:30.206428161Z + matchEncoderURL
2025-05-12T23:13:30.206396193Z + echo 'Current PID for this script is 139'
2025-05-12T23:13:30.206277102Z + updateReferenceFiles
2025-05-12T23:13:30.206301360Z + mkdir -p 10.0.1.74
2025-05-12T23:13:30.206325493Z + [[ -f 10.0.1.74/stream_stopped ]]
2025-05-12T23:13:30.206374281Z + echo 139
2025-05-12T23:13:30.206349858Z + [[ -f 10.0.1.74/last_channel ]]
2025-05-12T23:13:30.206230642Z + trap finish EXIT
2025-05-12T23:13:30.206255161Z + main
2025-05-12T23:13:30.206136653Z + packageName=com.att.tv
2025-05-12T23:13:30.206159988Z + packageAction=com.clientapp.MainActivity
2025-05-12T23:13:30.206206256Z + speedMode=true
2025-05-12T23:13:30.206185188Z + [[ '' == '' ]]
Is there a list as to what’s needed to use the Osprey boxes? I have 5 of them, but don’t know how many will be used, or how many inputs I will need on the encoder or what kind to even buy?
A list? What do you mean?
Do you have an HDMI encoder with at least 5 inputs? Do you have a DTV sub or a DTV Stream sub?
I don’t have an encoder yet, but have everything else. That’s why I said I don’t know what encoder or how many inputs because I didn’t know if all Osprey’s were needed, etc. Is there a specific brand? That’s why I asked if there was some type of list.
Use as many as you need. Are you recording often? How often will you need to use 5 Osprey boxes at once?
Get a 6-tuner LinkPi honestly if you're using that much tuners.
My wife records an ungodly amount of shows with multiple things recording at once, plus whatever I record. I think with the 5 of them and TVE it would probably work.