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

The easiest path would be to spin-up a second ah4c container with a different container name, hostname and ports. I've had as many as three running at the same time, but each needs to be using a dedicated set of encoder ports and streaming sticks. I.E., you can't "share" a virtual tuning pair with more than one container.

It's technically possible to have an M3U and a set of scripts that would work with different apps, but it's a project that would take some time to develop, and I've never been motivated to do it for my personal needs.

1 Like

Yep, I run two instances as well because I have two different streaming sources. Way easier that way even if you have some script duplication, once you get it set up you don't really need to touch it after that.

2 Likes

Can i reset adb in a4hc? Suddenly a4hc has stoped tuning on tuner 2. I have already disable/enable rewoked adb on the tvbox but nothing helps. Any other ide what could be wrong?

EDIT hdmi encoder stuck. Fixed with reboot of encoder (not ah4c container). Sorry for the noise

Can you post the Portainer log from when a tuning attempt starts to when it completes on that tuner?

Be sure to use 3 backticks before and after the log text so that it ends up in a "code block" for better readability.

1 Like

Hi, I'm currently using ADBTuner (YTTV) without issues. I have given ahc4 a go and have everything setup but confused on the prebmitune.sh, bmitune.sh and stopbmitune.sh. Not sure where to put them. I am on Windows 11. Any help would be appreciated.

The location of the scripts on your Docker/Portainer host, is based on a couple of the values you specified. If someone has already created scripts for your combination of streaming stick and Android app you'll find them in this directory (and if you're creating something from scratch this is where they would be placed):

$HOST_DIR/ah4c/$STREAMER_APP

So, for example, in my case this would be:

/data/ah4c/scripts/firetv/dtvdeeplinks

If no one has created scripts for your combination, you can look in:

$HOST_DIR/ah4c/scripts/firetv/directv

for a set of examples. Other examples can be found in the GitHub repo for this project. If you're comfortable with Bash scripting using functions, you should find that many/most are reusable with minor modifications.

TY @bnhf. This helped me alot.

Hi, I have set my host directory like this, but the folders/directories are not created at C:\cdvr.

volumes:
- ${HOST_DIR}C:\cdvr\ah4c\scripts:/opt/scripts # pre/stop/bmitune.sh scripts will be stored in this bound host directory under streamer/app
- ${HOST_DIR}C:\cdvr\ah4c\m3u:/opt/m3u # m3u files will be stored here and hosted at http://:7654/m3u for use in Channels DVR - Custom Channels settings
- ${HOST_DIR}C:\cdvr\ah4c\adb:/root/.android # Persistent data directory for adb keys

I also tried using ubuntu on my linux laptop and Windows WSL but get errors at step 3 (Install Portainer: $ sudo docker run -d -p 8000:8000 -p 9000:9000 -p 9443:9443 --name portainer
--restart=always
-v /var/run/docker.sock:/var/run/docker.sock
-v portainer_data:/data
cr.portainer.io/portainer/portainer-ce:latest)

error...
Create and run a new container from an image
--restart=always: command not found
-v: command not found
-v: command not found
-bash: cr.portainer.io/portainer/portainer-ce:latest: No such file or directory

This is what I'm getting.

@dabox
Could you post your portainer stack and environment variables files.
Really what to see what Volumes section looks like in Stack and what you specifically have "HOST_DIR=" set to in your environment variables.

Here you go. Let me know if this is not the correct info.


I am at a point now where I can select a channel in Channels DVR and it will not tune to a channel, just connects to the Chromecast home screen.

STREAMER_APP needs to be set to scripts/chromecast/youtubetv. Not sure if there are functioning scripts for that combo, but that's what you should use for a value.

Thanks, I updated that but still did not tune to a channel. Keep seeing this failure.

Are you using your own scripts? Looking at the repo, there are some in scripts/onn/youtubetv you could try. Nothing specifically for Chromecast yet though.

EDIT: Most people using YouTubeTV with deeplinks are running ADBTuner. Do you have a specific requirement that suits ah4c better?

Yes, I currently use ADBTuner. I thought I'd give ah4c a try since ADBTuner takes me about 6-7 seconds to change a channel.

FYI...I am using a linux docker/portainer setup so don't know windows as well for docker... I see in your volumes you are using both / and \ in the picture above.

C:\MSI/ah4c/...

I know it shouldn't matter, but who knows.

Here are my entries for the stack volumes and my host variable...

 volumes:
      - ${HOST_DIR}/ah4c/scripts:/opt/scripts # pre/stop/bmitune.sh scripts will be stored in this bound host directory under streamer/app
      - ${HOST_DIR}/ah4c/m3u:/opt/m3u # m3u files will be stored here and hosted at http://<hostname or ip>:7654/m3u for use in Channels DVR - Custom Channels settings
      - ${HOST_DIR}/ah4c/adb:/root/.android # Persistent data directory for adb keys
HOST_DIR=/srv/5ab84941-c842-42b9-9bce-80979edd927d/Pool/_AppData/androidtuner

Also if you manually navigate to the script directory are the prebmitune.sh, bmitune.sh and stopbmitune.sh files REALLY there?
In your case...

C:\MSI\ah4c\scripts\chromecast\youtubetv\

In ADBTuner are you running the youtube channels in compatability mode?
This shuts the app down completely everytime you leave a channel...so HAS to reload app every time.
If youtubetv doesn't require this you could turn off compatability mode that could gain some time after the first channel is tuned.

Thanks, the files are there. I tried linux but kept getting errors installing it.