I wonder if it could be related to using a different activity (com.xfinity.common.view.LaunchActivity)?
Here's a full tuning cycle debug from ah4c:
[EXECUTE] Stdout: 'Current PID for this script is 7182
Not a special channel (exit nor reboot)
Starting: Intent { act=android.intent.action.VIEW dat=https://www.xfinity.com/... cmp=com.xfinity.cloudtvr.tenfoot/com.xfinity.common.view.LaunchActivity }
bmitune.sh is exiting for 192.168.1.201:5555 with exit code 0
'
[EXECUTE] Stderr: '+ dvr=utheater-pc:8089
+ channelNameID=HCHD-7889068523651137105
++ echo HCHD-7889068523651137105
++ awk -F- '{print $2}'
+ channelID=7889068523651137105
++ echo HCHD-7889068523651137105
++ awk -F- '{print $1}'
+ channelName=HCHD
+ specialID=HCHD
+ streamerIP=192.168.1.201:5555
+ streamerNoPort=192.168.1.201
+ adbTarget='adb -s 192.168.1.201:5555'
+ packageName=com.xfinity.cloudtvr.tenfoot
+ packageAction=com.xfinity.common.view.LaunchActivity
+ m3uName=xfinity.m3u
++ grep -B1 /play/tuner/HCHD-7889068523651137105 /opt/m3u/xfinity.m3u
++ awk -F 'channel-id="' 'NF>1 {split($2, a, "\""); print a[1]}'
+ m3uChannelID=1458
++ curl -s http://utheater-pc:8089/api/v1/channels
++ jq -r '.[] | select(.id == "1458") | .number'
+ channelNumber=1458
+ [[ false == '' ]]
+ speedMode=false
+ read -a autoCropChannels
+ trap finish EXIT
+ main
+ updateReferenceFiles
+ mkdir -p 192.168.1.201
+ [[ -f 192.168.1.201/stream_stopped ]]
+ [[ -f 192.168.1.201/last_channel ]]
+ echo 7182
+ echo 'Current PID for this script is 7182'
+ matchEncoderURL
+ case "$streamerIP" in
+ encoderURL=http://192.168.1.52:8090/stream2
+ encoderStreamNumber=stream2
+ encoderIP=192.168.1.52:8090/stream2
+ encoderIP=192.168.1.52
+ specialChannels
+ '[' HCHD = exit ']'
+ '[' HCHD = reboot ']'
+ [[ -f 192.168.1.201/adbCommunicationFail ]]
+ echo 'Not a special channel (exit nor reboot)'
+ tuneChannel
+ adb -s 192.168.1.201:5555 shell am start -n com.xfinity.cloudtvr.tenfoot/com.xfinity.common.view.LaunchActivity https://www.xfinity.com/stream/live/HCHD/7889068523651137105/HCHD
+ echo -e '#!/bin/bash\n\nwhile true; do sleep 4h; adb -s 192.168.1.201:5555 shell input keyevent KEYCODE_DPAD_DOWN; done'
+ chmod +x ./192.168.1.201/keep_watching.sh
+ [[ -n 4h ]]
+ nohup ./192.168.1.201/keep_watching.sh
+ printf '%s\n' 1810 1812 1841 1842 1846 1848 1852 1862
+ grep -qx 1458
+ :
+ finish
+ echo 'bmitune.sh is exiting for 192.168.1.201:5555 with exit code 0'
Terminated
'
[EXECUTE] Finished running ./scripts/firetv/xfinity/bmitune.sh in 14m24.250505231s
[EXECUTE] Stdout: 'Streaming stopped for 192.168.1.201:5555
Sleep initiated for 192.168.1.201:5555
192.168.1.201/stream_stopped written with epoch stop time
'
[EXECUTE] Stderr: '+ dvr=utheater-pc:8089
+ streamerIP=192.168.1.201:5555
+ streamerNoPort=192.168.1.201
+ channelNameID=HCHD-7889068523651137105
+ adbTarget='adb -s 192.168.1.201:5555'
+ packageName=com.xfinity.cloudtvr.tenfoot
+ m3uName=xfinity.m3u
++ grep -B1 /play/tuner/HCHD-7889068523651137105 /opt/m3u/xfinity.m3u
++ awk -F 'channel-id="' 'NF>1 {split($2, a, "\""); print a[1]}'
+ m3uChannelID=1458
++ curl -s http://utheater-pc:8089/api/v1/channels
++ jq -r '.[] | select(.id == "1458") | .number'
+ channelNumber=1458
+ [[ false == '' ]]
+ speedMode=false
+ read -a autoCropChannels
+ printf '%s\n' 1810 1812 1841 1842 1846 1848 1852 1862
+ grep -qx 1458
+ main
+ [[ -n croppedChannel ]]
+ matchEncoderURL
+ case "$streamerIP" in
+ encoderURL=http://192.168.1.52:8090/stream2
+ encoderStreamNumber=stream2
+ encoderIP=192.168.1.52:8090/stream2
+ encoderIP=192.168.1.52
+ bmituneDone
+ bmitunePID=7182
++ pgrep -f 192.168.1.201/keep_watching.sh
+ keepWatchingPID=7202
++ pgrep -P 7202
+ keepWatchingCPID=7204
+ [[ -n '' ]]
+ ps -p 7182
+ [[ -n 4h ]]
+ kill 7202 7204
+ rm ./192.168.1.201/keep_watching.sh
+ [[ -n '' ]]
+ rm ./192.168.1.52/stream2.sh
rm: cannot remove './192.168.1.52/stream2.sh': No such file or directory
p
+ [[ false == \t\r\u\e ]]
+ stop='am force-stop com.xfinity.cloudtvr.tenfoot'
+ adb -s 192.168.1.201:5555 shell am force-stop com.xfinity.cloudtvr.tenfoot
2
+ echo 'Streaming stopped for 192.168.1.201:5555'
+ adbSleep
+ sleep='input keyevent KEYCODE_SLEEP'
+ adb -s 192.168.1.201:5555 shell input keyevent KEYCODE_SLEEP
+ echo 'Sleep initiated for 192.168.1.201:5555'
+ date +%s
+ echo '192.168.1.201/stream_stopped written with epoch stop time'
'
[EXECUTE] Finished running ./scripts/firetv/xfinity/stopbmitune.sh in 3.933105448s
[GIN-debug] Request: 100.xxx.xxx.xxx GET /play/tuner/HCHD-7889068523651137105, latency: 14m30.59648036s, status: 200

