AndroidHDMI for Channels (ah4c): A virtual channel tuner using HDMI Encoder(s) + streaming stick(s)

I'm getting a Failed to tune device is not available error. Below is the (long) log entry.

2026/08/30 10:25:39 Attempting network tune for device http://192.168.88.30:8089/devices/M3U-USBHDMI/channels.m3u?format=ts&codec=copy 192.168.88.113:5555 FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa

2026/08/30 10:25:39 [EXECUTE] Running [./scripts/firetv/dtvstreamdeeplinks/prebmitune.sh 192.168.88.113:5555 FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa]

2026/08/30 10:25:41 [EXECUTE] Stdout: 'already connected to 192.168.88.113:5555

prebmitune.sh is exiting for 192.168.88.113:5555 with exit code 0

'

2026/08/30 10:25:41 [EXECUTE] Stderr: '+ streamerIP=192.168.88.113:5555

+ streamerNoPort=192.168.88.113

+ adbTarget='adb -s 192.168.88.113:5555'

+ packageName=com.att.tv

+ mkdir -p 192.168.88.113

+ trap finish EXIT

+ main

+ adbConnect

+ adb connect 192.168.88.113:5555

+ local -i adbMaxRetries=2

+ local -i adbCounter=0

+ true

+ adb -s 192.168.88.113:5555 shell input keyevent KEYCODE_WAKEUP

+ local adbEventSuccess=0

+ [[ 0 -eq 0 ]]

+ break

+ forceStopApp

+ adb -s 192.168.88.113:5555 shell am force-stop com.att.tv

+ finish

+ echo 'prebmitune.sh is exiting for 192.168.88.113:5555 with exit code 0'

'

2026/08/30 10:25:41 [EXECUTE] Finished running ./scripts/firetv/dtvstreamdeeplinks/prebmitune.sh in 1.447927592s

2026/08/30 10:25:41 [EXECUTE] Running [./scripts/firetv/dtvstreamdeeplinks/bmitune.sh FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa 192.168.88.113:5555]

2026/08/30 10:25:41 [IOINFO] Successfully copied 262 bytes

2026/08/30 10:25:41 [IOINFO] Transfer speed: 4.3341066901568635 Mbits/second

2026/08/30 10:25:41 Performing Close() for 192.168.88.113:5555

2026/08/30 10:25:41 [EXECUTE] Running [./scripts/firetv/dtvstreamdeeplinks/stopbmitune.sh 192.168.88.113:5555 FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa]

2026/08/30 10:25:41 Tuner 0 is active - skipping

2026/08/30 10:25:41 [ERR] Failed to tune device(s) not available

2026/08/30 10:25:41 [GIN-debug] Request: 172.27.0.1 GET /play/tuner/FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa, latency: 177.05µs, status: 500

2026/08/30 10:25:41 [EXECUTE] Stdout: 'Current PID for this script is 221

Starting: Intent { act=android.intent.action.VIEW (has data) cmp=com.att.tv/com.clientapp.MainActivity }

bmitune.sh is exiting for 192.168.88.113:5555 with exit code 0

'

2026/08/30 10:25:41 [EXECUTE] Stderr: '++ echo FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa

++ awk -F~ '{print $2}'

+ channelID=5b2cc61c-32c8-42db-8c2e-ec527e55f1fa

++ echo FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa

++ awk -F~ '{print $1}'

+ channelName=FLARMY

+ streamerIP=192.168.88.113:5555

+ streamerNoPort=192.168.88.113

+ adbTarget='adb -s 192.168.88.113:5555'

+ packageName=com.att.tv

+ packageAction=com.clientapp.MainActivity

+ trap finish EXIT

+ main

+ updateReferenceFiles

+ mkdir -p 192.168.88.113

+ [[ -f 192.168.88.113/stream_stopped ]]

+ [[ -f 192.168.88.113/last_channel ]]

+ echo 221

+ echo 'Current PID for this script is 221'

+ tuneChannel

+ adb -s 192.168.88.113:5555 shell am start -n com.att.tv/com.clientapp.MainActivity dtvnow://deeplink.directvnow.com/play/channel/FLARMY/5b2cc61c-32c8-42db-8c2e-ec527e55f1fa

+ finish

+ echo 'bmitune.sh is exiting for 192.168.88.113:5555 with exit code 0'

'

2026/08/30 10:25:41 [EXECUTE] Finished running ./scripts/firetv/dtvstreamdeeplinks/bmitune.sh in 242.028225ms

2026/08/30 10:25:41 Tuner 0 is active - skipping

2026/08/30 10:25:41 [ERR] Failed to tune device(s) not available

2026/08/30 10:25:41 [GIN-debug] Request: 172.27.0.1 GET /play/tuner/FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa, latency: 88.255µs, status: 500

2026/08/30 10:25:41 Tuner 0 is active - skipping

2026/08/30 10:25:41 [ERR] Failed to tune device(s) not available

2026/08/30 10:25:41 [GIN-debug] Request: 172.27.0.1 GET /play/tuner/FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa, latency: 369.841µs, status: 500

2026/08/30 10:25:42 Tuner 0 is active - skipping

2026/08/30 10:25:42 [ERR] Failed to tune device(s) not available

2026/08/30 10:25:42 [GIN-debug] Request: 172.27.0.1 GET /play/tuner/FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa, latency: 443.024µs, status: 500

2026/08/30 10:25:43 Tuner 0 is active - skipping

2026/08/30 10:25:43 [ERR] Failed to tune device(s) not available

2026/08/30 10:25:43 [GIN-debug] Request: 172.27.0.1 GET /play/tuner/FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa, latency: 86.201µs, status: 500

2026/08/30 10:25:43 Tuner 0 is active - skipping

2026/08/30 10:25:43 [ERR] Failed to tune device(s) not available

2026/08/30 10:25:43 [GIN-debug] Request: 172.27.0.1 GET /play/tuner/FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa, latency: 98.821µs, status: 500

2026/08/30 10:25:44 Tuner 0 is active - skipping

2026/08/30 10:25:44 [ERR] Failed to tune device(s) not available

2026/08/30 10:25:44 [GIN-debug] Request: 172.27.0.1 GET /play/tuner/FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa, latency: 139.499µs, status: 500

2026/08/30 10:25:45 Tuner 0 is active - skipping

2026/08/30 10:25:45 [ERR] Failed to tune device(s) not available

2026/08/30 10:25:45 [GIN-debug] Request: 172.27.0.1 GET /play/tuner/FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa, latency: 178.054µs, status: 500

2026/08/30 10:25:45 Tuner 0 is active - skipping

2026/08/30 10:25:45 [ERR] Failed to tune device(s) not available

2026/08/30 10:25:45 [GIN-debug] Request: 172.27.0.1 GET /play/tuner/FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa, latency: 108.128µs, status: 500

2026/08/30 10:25:46 Tuner 0 is active - skipping

2026/08/30 10:25:46 [ERR] Failed to tune device(s) not available

2026/08/30 10:25:46 [GIN-debug] Request: 172.27.0.1 GET /play/tuner/FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa, latency: 98.533µs, status: 500

2026/08/30 10:25:51 [EXECUTE] Stdout: 'Streaming stopped for 192.168.88.113:5555

Sleep initiated for 192.168.88.113:5555

192.168.88.113/stream_stopped written with epoch stop time

'

2026/08/30 10:25:51 [EXECUTE] Stderr: '+ streamerIP=192.168.88.113:5555

+ streamerNoPort=192.168.88.113

+ adbTarget='adb -s 192.168.88.113:5555'

+ packageName=com.att.tv

+ main

+ bmituneDone

+ bmitunePID=192

+ ps -p 192

+ adbStop

+ stop='input keyevent KEYCODE_BACK; input keyevent KEYCODE_HOME'

+ adb -s 192.168.88.113:5555 shell input keyevent 'KEYCODE_BACK;' input keyevent KEYCODE_HOME

+ sleep 2

+ echo 'Streaming stopped for 192.168.88.113:5555'

+ adbSleep

+ sleep='input keyevent KEYCODE_SLEEP'

+ adb -s 192.168.88.113:5555 shell input keyevent KEYCODE_SLEEP

+ echo 'Sleep initiated for 192.168.88.113:5555'

+ date +%s

+ echo '192.168.88.113/stream_stopped written with epoch stop time'

'

2026/08/30 10:25:51 [EXECUTE] Finished running ./scripts/firetv/dtvstreamdeeplinks/stopbmitune.sh in 9.914786001s

2026/08/30 10:25:51 [GIN-debug] Request: 172.27.0.1 GET /play/tuner/FLARMY~5b2cc61c-32c8-42db-8c2e-ec527e55f1fa, latency: 11.368837041s, status: 200

Not available because ah4c says it's in use. Have you had any successful tunes? With a single tuner in this setup, are you waiting for the tuner to show as released before trying to tune to another channel?

More info please! :slight_smile:

With the whiz-bang new WebUI, you should be able to monitor what's happening.

1 Like

Nope, no successful tunes yet. There is a green dot in the Device Control dashboard, so I'm assuming it's released.

One thing I noticed is that in the dashboard, it shows Tuner 1, but in the log it's referenced as Tuner 0. Does that make a difference?

What are you seeing when you visually monitor the tuning process? Does the stick wake-up? Does the DTV app launch?

I believe that's just a label in the dashboard, meant to match-up with the env var numbering. But the internals of ah4c still start with tuner 0. Probably something we should get fully lined-up, but I don't think that makes a difference here.

The stick doesn't go to sleep at all, so it was on the homescreen. When I try to tune a channel, the screen goes black, but the DTV app doesn't start at all.

Sorry, I didn't realize you were using a Fire TV. I would say this is probably due to just using one tuner. Based on the logging I'm seeing, at least, it looks like the tuner's tied up.

He's using a FireStick with a USB Capture Card, so this is all very experimental with ah4c. The Capture Card + the Channels DVR transcoder creates a virtual encoder of sorts.

That virtual encoder can be used with ah4c (theoretically), with ah4c handling the channel changes and tuner management. From there, it should be just like any other streaming stick and encoder combo.

Why do I feel like there's another project out there that's purpose built for this?

I gather you haven't been following the posts about this. @daldana7296 has used the other project, and is now wanting to compare it to ah4c, using this same virtual encoder source. I'm curious if it'll work myself.

1 Like

Oh, sorry. You know, I've been so busy. I missed that. I apologize.

Another interesting thing is that when I'm on the tuner control page there is no display, but I can interact with the stick (seeing it through vnc in the Windows setting page for camera) using the buttons on that page.

I'm trying this myself now, I'll get back to you shortly (hopefully). :slight_smile:

Wait, so you're saying the tuner control menu that I built actually works outside of what it was intended for? If that's the case, that's awesome.

@daldana7296 So it definitely works -- I'm watching the NFL Network using this setup right now. My best guess is that you have something wrong in your configuration.

Can you post your settings screens for both the "second source", i.e. the CDVR Custom Channels Source you're actually using for viewing -- and the "first source", i.e. the CDVR Custom Channels Source you're using to create the virtual encoder.

It's definitely awesome that it works, though I think it would be fair to say that this is no different than any other setup. You have an Android-based streaming stick ip:port and an encoder URL.

The main difference is that the virtualized hardware encoder requires a bit of setup outside of ah4c. Also, I'm not sure yet if this virtual encoder can accept multiple simultaneous connections. I'm testing that next.

No problem, so "View & control" and monitoring via VLC while streaming work fine. Another tool in the box!

EDIT: Video quality is only fair, nowhere near what we get off the LinkPi encoders. But what can one expect from a $10 capture card? Looking at what's available on Amazon, the quality capture cards are nearly the same price as the encoders (or more), and then re-encoding is still required.

That's what I was thinking when I built it, just in case you needed another way of accessing things.

Like sometimes I mix up HDMI cables, so I want to know that I have the right encoder port linked up to the right box.

2 Likes

Here you go.


The first thing that jumps out at me, is the URL in your USB_HDMI M3U. You can't have spaces in something like that, it needs to be URL encoded. Mine looks like this:

capture://dshow/USB%20Video/Digital%20Audio%20Interface%20%28USB%20Digital%20Audio%29/?framerate=60

EDIT: Also, you should be able to view the stream right from the "first source" in something like VLC -- to confirm your virtual encoder is functioning. Mine looks like this:

http://convertible-pc3:8089/devices/M3U-Capture/channels/9550/stream.mpg?format=ts&codec=copy