It's really odd that that Frndly app doesn't support proper deep links, but instead accepts a string parameter to specify which content to load. It seems it would been easier for them to do it the correct way instead of this lol. Good find.
Thank you, I would really appreciate your input to ensure I made the config with the right parameters. It works but if it can be optimized in any way I'd love to hear your suggestions!!
Wow! Thank you for this!
I believe the Gracenote number for Hallmark channel is 66268
It might be an east coast west coast feed thing. That gracenote gave me the correct guide data for me.
It came up in Spanish, for me.
Oh strange, I'll have a look.
@mackid1993 , I haven't been able to test the Frndly channels through ADBT yet. I had my hands full testing another project yesterday. My brain is only capable of handling a single task at a time.
I spent probably a good 10-15 hours pulling every hair out of my head trying to get this reliable. But I believe I finally have a working config for Philo to always skip to live. It ended up being incredibly complex to get working every time. But from my testing this is reliably finding a pressing the Jump to live button regardless of whether its a regular of FAST channel with the button in position 1 or position 2.
{
"name": "Philo - Skip to Live",
"author": "David B",
"version": "2.0.0",
"description": "Load Philo channels via deep link and automatically skip to live playback instead of starting from the beginning of the current program.",
"uuid": "7c4e8f12-3a9d-4b6e-a1c5-2d8f9e0b7a3c",
"global_options": {
"wait_for_video_playback_detection": true,
"use_fixed_delay": false,
"fixed_delay_seconds": 0,
"check_for_and_clear_whos_watching_prompts": false,
"wait_after_post_playback_start_commands_seconds": 0
},
"pre_tune_commands": [
"input keyevent KEYCODE_MEDIA_STOP",
"am force-stop '||TARGET_PACKAGE_NAME||'"
],
"tune_commands": [
"am start -W -a android.intent.action.VIEW -d '||TARGET_URL_OR_IDENTIFIER||' '||TARGET_PACKAGE_NAME||'",
"sleep 2"
],
"post_playback_start_commands": [
"rm -f /sdcard/Documents/philo-ui.xml",
"sleep 5",
"while true; do input keyevent 19; input keyevent 19; sleep 2; done & BGPID=$!; input keyevent 19; sleep 0.2; input keyevent 19; sleep 0.5; for i in 1 2 3 4 5; do for c in 1 2; do uiautomator dump /sdcard/Documents/philo-ui.xml 2>/dev/null; if grep 'Jump to live button' /sdcard/Documents/philo-ui.xml | grep -q 'focused=\"true\"'; then kill -9 $BGPID 2>/dev/null; sleep 1; input keyevent 23; sleep 0.3; exit 0; fi; done; input keyevent 22; sleep 0.2; done; kill -9 $BGPID 2>/dev/null",
"rm -f /sdcard/Documents/philo-ui.xml"
],
"post_tune_commands": [
"am force-stop '||TARGET_PACKAGE_NAME||'",
"input keyevent KEYCODE_HOME"
]
}
I hope this saves someone else a headache!! uiautomator is no fun!
So all fixed now, one tuner stays live for the block?
an update from a bit back
yes
I thought wrong or got lost in changes without letting everything settle. actually I think it was from fighting with an inferior encoder and trying too many things to fix a hardware problem. linkpi ftw!
1 channel = 1 tuner if padding overlaps
finally looked through the log and verified the padding fixed.
is ah4c/bmitune managing this or is channels? I wonder if a few lines could be added to handle stop time=start time the same way padding is handled. all the error handling works as it should, but perhaps the retries and recording started late flags would only happen when back-to-back recordings are on different channels. then you'd know you might want another tuner.
Hey @spammedeeper I got sick of messing with Philo and decided to splurge on DTV. I noticed it tunes just fine with Deep Links - Compatibility Mode. Is there a reason for your config that has those specific key events and delay? I'm not running into any issues tuning with compatibility mode, although with the regular Deep Links mode where it didn't kill the app, I did have it fail to tune once so far.
Edit: Actually on my onn 4K Plus boxes I'm seeing tuning working just fine with no app kill. Just standard config, super fast tuning. 
Edit 1: Did some reading and can confirm, a bad deeplink will break the app. Compatibility mode to fresh start DTV is the way to go!
Mostly tuning to my network. I like to play with tuning that is as fast as possible, while hiding the automation from the stream. I settled on a 12 second delay in my custom config, which was enough to allow the app to finish loading. I also like my devices to sleep after tuning, which is the extra commands at the end. If the Compatibility Mode works for you, use it!
Some things I've learned. If you leave the app running, the next deep link is very fast, especially on the Onn 4K Plus. But as you found out, a bad or delayed link makes the app puke. This is why I add the -S to the AM Start, to force fresh start of app each time. Been pretty reliable as my backup source.
On the topic of deep links opening quickly if app running in background. This is why the Osprey is pretty quick. The DirecTV app is (essentially) the launcher, so it's always ready. Not saying rush out and buy an Osprey from eBay as it won't run apps well like the Onn, but when tasked with turning channels, they work really well.
The only notable challenge I had with the Onn boxes was one of them wanting to sleep all the time. I fixed it somehow, in one of these threads. Other than that, they are great little boxes for $30.
Keep testing, send questions my way, happy to help.
In developer options, there is a setting to keep the device always awake on the onn boxes.
That's worked great for me for keeping it awake 100% of the time.
What I ended up doing was using your -S flag in my own config. Right now I'm testing this for a little bit faster tuning. So far it seems to hide the UI. I think the sleep 2 in the compatibility mode config is little unnecessary. At least for DTV.
{
"name": "DirecTV",
"author": "",
"version": "0",
"description": "Fast tuning for DirecTV, fresh starting the app every time.",
"uuid": "3c7d5a19-6f2e-4b8a-9d3f-8e1c4b7a5f92",
"global_options": {
"wait_for_video_playback_detection": true,
"use_fixed_delay": false,
"fixed_delay_seconds": 0,
"check_for_and_clear_whos_watching_prompts": false,
"wait_after_post_playback_start_commands_seconds": 0
},
"pre_tune_commands": [
"input keyevent KEYCODE_MEDIA_STOP"
],
"tune_commands": [
"am start -S -W -a android.intent.action.VIEW -d '||TARGET_URL_OR_IDENTIFIER||' '||TARGET_PACKAGE_NAME||'"
],
"post_tune_commands": [
"input keyevent KEYCODE_MEDIA_STOP",
"input keyevent KEYCODE_MEDIA_PAUSE",
"input keyevent KEYCODE_HOME"
]
}
I tested the command directly over ADB and it does definitely start the app fresh each time. And at least with this it takes it back to the home screen and there's no extra delay so it just starts the app fresh. And I seem to tune based on my testing in about 10 seconds. I tested a few times with a stopwatch and each time it was about 10 to 11 seconds to tune a channel.
Thank you so much for your help!
Awesome! I too timed with my phone, and got around 10-12 second tuning speed, last I checked. Pretty darn good.
One thing I remembered. With the Onn 4K Plus boxes (and the regular Onn 4K) I had to boost the audio gain +6 dB to get the audio close to what my Osprey's were doing. Setting in the LinkPi encoder. It may be fine on your setup.
I actually set the volume to fixed on mine and that seems to work really well. It's kind of buried in the settings for the remote. There's a setting for HDMI CEC control of the volume which makes it fixed rather than set on device. Then my AVR just kind of handles the volume without any interference from anything else.
I am having an issue when I hit the streaming limit on my YouTube TV account. When the streaming limit screen is displayed, I either need to use the remote to get the ONN TV Pro to exit the screen, or I remotely power cycle the device.
Could an option be added when clicking the In-Use - click to release lock button, to send a ADB command to exit this screen or go to the Home screen?
Thanks for the amazing work on this project!
You can use compatibility mode. That will kill the app every time you tune.
Hey @spammedeeper I wanted to ping you on this one because I believe I found a solution to hot starting the DirecTV app while recovering from a bad deep link.
Starting it with "am start -W -n com.att.tv/com.clientapp.MainActivity" allows it to recover from that bad state. So using that in a config seems to be pretty reliable and it brings tuning time down to four to five seconds once the app has been started.
I wrote a config here dynamically adjusting to the package name and resolving the main activity dynamically. The idea being that if the package name changes unlikely or if the name of the main activity were to change it should resolve it rather than us having to change the config.
{
"name": "DirecTV",
"author": "David B.",
"version": "1.0.0",
"description": "Fast tuning for DirecTV.",
"uuid": "3c7d5a19-6f2e-4b8a-9d3f-8e1c4b7a5f92",
"global_options": {
"wait_for_video_playback_detection": true,
"use_fixed_delay": false,
"fixed_delay_seconds": 0,
"check_for_and_clear_whos_watching_prompts": false,
"wait_after_post_playback_start_commands_seconds": 0
},
"pre_tune_commands": [],
"tune_commands": [
"am start -W -n ||TARGET_PACKAGE_NAME||/$(cmd package resolve-activity -a android.intent.action.MAIN ||TARGET_PACKAGE_NAME|| | awk -F= '/name=/{print $2; exit}') -a android.intent.action.VIEW -d '||TARGET_URL_OR_IDENTIFIER||'"
],
"post_tune_commands": [
"input keyevent KEYCODE_MEDIA_STOP",
"input keyevent KEYCODE_MEDIA_PAUSE",
"input keyevent KEYCODE_HOME"
]
}
Regardless, I forced a bad deep link a couple of times and used the regular command to bring it into that bad state and then multiple times ran this command and it brought it right back. The only interesting thing is if you take the remote for Android box and back out of the show while it's streaming to Channels, the app is sort of in a weird broken state. But tuning and streaming a channel works perfectly and it's near instant.
I'm curious what you think and if you'd be interested in testing it out, letting me know if you think it's reliable.
Be happy to try. I have time tomorrow, I will throw it on my test setup and see what happens. You're using Onn 4K Plus, no?
Yes I have 4 of them.