HDMI for Channels

Doh! I have directv.m3u hardcoded in one spot. Go ahead and use nano to change directv.m3u to dtvstream.m3u in the tuneChannel function in bmitune.sh. I'll fix it and push an update, but I want to be sure you don't find anything else first. It's in this section of the script:

tuneChannel() {
  channelName=$(awk -F, '/channel-id='"$channelID"'/ {print $2}' m3u/directv.m3u)
  channelName=$(echo $channelName | sed 's/^/"/;s/$/"/')

Ok the fix is in and we are back in business.
I see 104 105 106 4K on my appleTV and My FireTV Cube on my real TV.
Does not show on the FireStick attached to encoder its not at 4K.

Is your encoder 4K? And, if it is, is the stream set to "same as the input"?
screenshot-htpc6-2023.08.30-15_02_10

@gfhartzell

As far as dealing with sports blackouts (and the lack of audio to detect):

What if after tuning to a new channel, I run the active audio check again. And if no audio is detected, I'll mark the channel as "blacked-out". Then, when the stop script is run, I can bump the channel "up one" or "down one" (using the equivalent of the up or down arrow on the remote) and set the last_channel file to 0.

This should effectively break what would otherwise be a deadlock, as the DTV app always starts with the last channel used, and in this case that would be a channel with no audio. Bumping the channel to an adjacent channel on exit is fast, and would take care of pretty much any blackout-related issues.

How does that sound (no pun intended)?

testing : it is 4k and yes it is set to match I have it set to H.265 and it does play Top Gun ok
VLC says its at Video resolution: VLC 3840x2160 encoder says3840x2160@30 it drops the fps to 30 from 60
IF I drop the frame rate to 30 Video resolution:VLC 3840x2160 encoder says 3840x2160p@24
Still no 4K in DTVStream though interesting

1 Like

sounds like it should work punny

This could be an HDCP issue. I believe most of these encoders that have HDCP are at version 1.x. It's possible we need HDCP version 2.x for the DTV app to allow 4K streaming. This is a bit of a wild-ass-guess, but it might be the problem.

Do you have a way to check what HDCP level the devices you have connected to your Apple TV and FireTV cube support?

I know when I first ran Top Gun there was an Amazon popup that Said it needed 2.x and it was only 1.x
or somethiing like that for full 4k
Not in the Spec sheet but a TV review I have says:
HDCP 2.2 Yes

further testing I got a hang on search so I put the sleep back up to 4
seems to be ok now

Bingo, ADBTuner works great, DeepLinks to SlingTV work great, life is good.

1 Like

Convert hdcp 2.2 to 1.4, problem solved

https://www.monoprice.com/product?c_id=101&cp_id=10114&cs_id=1011414&p_id=15242

Hopefully. I have a similar SIIG product on order, which seemed like a better bet as it's USB powered rather than using a 15V power supply.

Have you tried one of these HDCP converters with an HDMI encoder?

Thanks to a great idea from @turtletank over in his ADB tuner thread I have added tesseract OCR support to the keep_alive.sh script. It will detect Who's watching? and Still there? questions and send a keypad down.

If you are using an app that asks similar questions please send over the text and I will add it to the detector.

1 Like

Has anyone tried the Bally Sports app?

It isn't a channel so it can't start automatically. Kinda like on demand.

1 Like

Would there be a way to do a down and center command to go live with a channel?

Remote control emulation is definitely one of the strengths of this extension. For example, down and then center would be:

adb shell input keyevent KEYCODE_DPAD_DOWN;
adb shell input keyevent KEYCODE_DPAD_CENTER

There's more involved, of course, to get up-and-running with a given streamer/app combo.

1 Like

@gfhartzell

It turns out the couple of differences we identified between our two setups -- that we thought might be related to which DTV service we're subscribed to, are in fact the result of an app update. My FireSticks must have updated, as I had to change the way I launch the package and had to add another KEYCODE_DPAD_DOWN after the channel search.

Our M3Us are still different, but our scripts have sync'd up -- save the one additional sleep second you added right after the search. Who knows, maybe I'll have to add that too. :slight_smile:

I've pushed an update to Docker Hub that should address the potential deadlock created by no audio being present on channels with sports event blackouts.

Pull bnhf/ah4c:test2 to try it out.

Bumping the channel up one or down one worked in my testing, but which way to bump varied based on the channel in question -- so here's the relevant section of code I'm using in bmitune.sh, if you need to make any adjustments or channel additions:

#Check for active audio stream with maxDuration, preTuneAudioCheck, sleepBeforeAudioCheck and sleepAfterAudioCheck as arguments
activeAudioCheck() {
  local startTime=$(date +%s)
  local maxDuration=$1
  local minimumLoudness=-50
  local sleepBeforeAudioCheck=$3
  local sleepAfterAudioCheck=$4
  local preTuneAudioCheck=$2
  
  while true; do
    sleep $sleepBeforeAudioCheck
    checkLoudness=$(ffmpeg -t 1 -i $encoderURL -filter:a ebur128 -map 0:a -f null -hide_banner - 2>&1 | awk '/I:        /{print $2}')

    if (( $(date +%s) - $startTime > $maxDuration )); then
      echo "Active audio stream not detected in $maxDuration seconds."
      if [ $preTuneAudioCheck = "false" ]; then
        echo "Active audio stream not detected after tuning completed"
        case "$specialID" in
          "212")
            echo "Possible sports event blackout on NFL Network, so bumping channel up"
            $adbTarget shell input keyevent KEYCODE_DPAD_LEFT
            echo 0 > "$streamerNoPort/last_channel"
            exit 1
            ;; 
          "213")
            echo "Possible sports event blackout on MLB Network, so bumping channel down"
            $adbTarget shell input keyevent KEYCODE_DPAD_RIGHT
            echo 0 > "$streamerNoPort/last_channel"
            exit 1
            ;; 
          *)
            echo "Possible sports event blackout, so bumping channel down"
            $adbTarget shell input keyevent KEYCODE_DPAD_RIGHT
            echo 0 > "$streamerNoPort/last_channel"
            exit 1
            ;;
        esac
      else
        exit 1
      fi
    fi

    if (( $(echo "$checkLoudness > $minimumLoudness" | bc -l) )); then
      echo "Active audio stream detected with $checkLoudness LUF."
      break
    fi

    echo "Active audio stream not yet detected -- loudness is $checkLoudness LUF. Continuing..."
    sleep $sleepAfterAudioCheck
  done
}

Please pull the new container, including updating scripts, when you have a moment to do some tests -- and let me know how it works. Hopefully there'll be a blacked out game in your area this month, so you can try it in a real world situation.

That is really intereresting. It has been working just fine with the current setup.
Just lost NFL and most of the sports via TVE glad the M3U included those.