AndroidHDMI-for-Channels (ah4c) - FireTV LiveTV capture

Thanks, I will some more investigating when I am able.

The lines are in Docker Compose the way you show.
The directories may not actually exist though.
This is the log after restarting Docker Desktop.
Everything works as long as I do not restart Docker Desktop.

127.0.0.1 localhost

::1 localhost ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

172.19.0.2 ah4c2

  • daemon not running; starting now at tcp:5037

  • daemon started successfully

List of devices attached

failed to authenticate to 192.168.1.51:5555

failed to authenticate to 192.168.1.52:5555

No existing ./scripts/onn/youtubetv/prebmitune.sh found or UPDATE_SCRIPTS set to true

No existing ./scripts/firetv/livetv/prebmitune.sh found or UPDATE_SCRIPTS set to true

No existing ./scripts/onn/youtubetv/bmitune.sh found or UPDATE_SCRIPTS set to true

No existing ./scripts/firetv/livetv/bmitune.sh found or UPDATE_SCRIPTS set to true

No existing ./scripts/onn/youtubetv/stopbmitune.sh found or UPDATE_SCRIPTS set to true

No existing ./scripts/firetv/livetv/stopbmitune.sh found or UPDATE_SCRIPTS set to true

No existing ./scripts/firetv/livetv/createm3u.sh found or UPDATE_SCRIPTS set to true

No existing directv.m3u found or UPDATE_M3US set to true

No existing foo-fighters.m3u found or UPDATE_M3US set to true

No existing hulu.m3u found or UPDATE_M3US set to true

No existing youtubetv.m3u found or UPDATE_M3US set to true

No existing sling.m3u found or UPDATE_M3US set to true

No existing fubo.m3u found or UPDATE_M3US set to true

No existing dtvstream.m3u found or UPDATE_M3US set to true

No existing livetv.m3u found or UPDATE_M3US set to true

adb: device unauthorized.

This adb server's $ADB_VENDOR_KEYS is not set

Try 'adb kill-server' if that seems wrong.

Otherwise check for a confirmation dialog on your device.

adb: device unauthorized.

This adb server's $ADB_VENDOR_KEYS is not set

Try 'adb kill-server' if that seems wrong.

Otherwise check for a confirmation dialog on your device.

Waking 192.168.1.51...

adb: device unauthorized.

This adb server's $ADB_VENDOR_KEYS is not set

Try 'adb kill-server' if that seems wrong.

Otherwise check for a confirmation dialog on your device.

adb: device unauthorized.

This adb server's $ADB_VENDOR_KEYS is not set

Try 'adb kill-server' if that seems wrong.

Otherwise check for a confirmation dialog on your device.

  • waiting for device -

I think I have this figured out now.
Like I said earlier, this is all new to me.
I will create the Volumes and edit the compose to point to them.

Thanks!

Keep in mind that UPDATE_SCRIPTS and UPDATE_M3US will force an overwrite of your persistent scripts and m3us when set to true -- once you have things setup correctly.

This is desirable when there are known script or m3u updates you want, but otherwise are best set to false. Or, you can set scripts to true and m3us to false, if you want any script updates but want your customized m3u left alone.

@bnhf
One odd thing.
The volumes say they are unused, but it survives a restart now.

What specific volume mappings are you using, and what OS is your Docker host running?

Docker Desktop with Portainer Extension on Windows 11 for workstations.

You're mixing up two things there. The location you're using is where a special thing called "Docker Volumes" are stored. We're not doing that, we're using directory bindings. Directory bindings "bind" or "map" a particular directory on the Docker host to a directory inside the container.

Are you using the WSL2 backend with Docker Desktop? If not you want to be, and you'll want to have a distro installed as well. Either Debian or Ubuntu.

yes, wsl2 and ubuntu

Not sure if it will help as I am a novice at portainer but in testing this I changed the following:

      - hdmi4channels:/data/ah4c/scripts:/opt/scripts # pre/stop/bmitune.sh scripts will be stored in this bound host directory under streamer/app
      - hdmi4channels:/data/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
      - hdmi4channels:/data/ah4c/adb:/root/.android # Persistent data directory for adb keys
    restart: unless-stopped
volumes:
  hdmi4channels:

Using Windows Terminal, what do you see when you connect to your Ubuntu instance and:

cd /data
ls -la

This is mine on my Windows host, where I run Debian. I have only one container on this system with a directory binding called organizr. Do you see an ah4c directory?:

pete@Anvil:~$ cd /data
-bash: cd: /data: No such file or directory
pete@Anvil:~$

doh, didn't have it integrated.......

Do I need to create this directory?

No, Docker/Portainer will create any bound directories that don't exist.

Using Windows Terminal with PowerShell, check and make sure Ubuntu is your default distro:

So I just spun this up on a Windows host, using Docker Desktop with wsl2 (Debian) as the backend, and after the first time through which required authorizing on the FireStick, everything worked as expected:

127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
ff00::0	ip6-mcastprefix
ff02::1	ip6-allnodes
ff02::2	ip6-allrouters
172.21.0.2	ah4c3
192.168.110.116 firestick-desk1
192.168.110.49 encoder_23393
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
connected to firestick-desk1:5555
Existing ./scripts/onn/youtubetv/prebmitune.sh found, and will be preserved
Existing ./scripts/firetv/livetv/prebmitune.sh found, and will be preserved
Existing ./scripts/onn/youtubetv/bmitune.sh found, and will be preserved
Existing ./scripts/firetv/livetv/bmitune.sh found, and will be preserved
Existing ./scripts/onn/youtubetv/stopbmitune.sh found, and will be preserved
Existing ./scripts/firetv/livetv/stopbmitune.sh found, and will be preserved
Existing ./scripts/firetv/livetv/createm3u.sh found, and will be preserved
Existing directv.m3u found, and will be preserved
Existing foo-fighters.m3u found, and will be preserved
Existing hulu.m3u found, and will be preserved
Existing youtubetv.m3u found, and will be preserved
Existing sling.m3u found, and will be preserved
Existing fubo.m3u found, and will be preserved
Existing dtvstream.m3u found, and will be preserved
Existing livetv.m3u found, and will be preserved
[START] ah4c is starting
[ENV] Not loading env
[ENV] IPADDRESS                  nuc12-pc:7674
[ENV] ALERT_SMTP_SERVER          
[ENV] ALERT_AUTH_SERVER          
[ENV] ALERT_EMAIL_FROM           
[ENV] ALERT_EMAIL_PASS           
[ENV] ALERT_EMAIL_TO             
[ENV] ALERT_WEBHOOK_URL          
[ENV] ALLOW_DEBUG_VIDEO_PREVIEW  
[ENV] Creating tuner             1
[ENV] ENCODER1_URL               http://encoder_23393/0.ts
[ENV] TUNER1_IP                  firestick-desk1:5555
[ENV] CMD1                       
[ENV] TEECMD1                    
[ENV] PRE SCRIPT                 ./scripts/firetv/livetv/prebmitune.sh
[ENV] START SCRIPT               ./scripts/firetv/livetv/bmitune.sh
[ENV] STOP SCRIPT                ./scripts/firetv/livetv/stopbmitune.sh
[ENV] REBOOT SCRIPT              ./scripts/firetv/livetv/reboot.sh
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:	export GIN_MODE=release
 - using code:	gin.SetMode(gin.ReleaseMode)
[GIN-debug] GET    /favicon.ico              --> github.com/gin-gonic/gin.(*RouterGroup).StaticFile.func1 (2 handlers)
[GIN-debug] HEAD   /favicon.ico              --> github.com/gin-gonic/gin.(*RouterGroup).StaticFile.func1 (2 handlers)
[GIN-debug] Loaded HTML Templates (11): 
	- index.html

	- m3us.html
	- routes.html
	- status_and_logs.html
	- status.html
	- stream.html
	- 
	- config.html

	- edit.html
	- editm3u.html

	- logs.html
[GIN-debug] GET    /static/*filepath         --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (2 handlers)
[GIN-debug] HEAD   /static/*filepath         --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (2 handlers)
[GIN-debug] GET    /                         --> main.run.func1 (2 handlers)
[GIN-debug] GET    /routes                   --> main.run.func2 (2 handlers)
[GIN-debug] GET    /play/tuner:tuner/:channel --> main.run.func3 (2 handlers)
[GIN-debug] GET    /m3u/:channel             --> main.run.func4 (2 handlers)
[GIN-debug] GET    /env                      --> main.run.func5 (2 handlers)
[GIN-debug] GET    /logs/text                --> main.run.func6 (2 handlers)
[GIN-debug] GET    /logs                     --> main.run.func7 (2 handlers)
[GIN-debug] GET    /status/andlogs           --> main.run.func8 (2 handlers)
[GIN-debug] GET    /logs/json                --> main.run.func9 (2 handlers)
[GIN-debug] GET    /video                    --> main.run.func10 (2 handlers)
[GIN-debug] GET    /status                   --> main.statusPageHandler (2 handlers)
[GIN-debug] GET    /api/status               --> main.apiStatusHandler (2 handlers)
[GIN-debug] GET    /stream                   --> main.run.func11 (2 handlers)
[GIN-debug] GET    /test/webhook             --> main.run.func12 (2 handlers)
[GIN-debug] GET    /test/email               --> main.run.func13 (2 handlers)
[GIN-debug] GET    /status/channelsactivity  --> main.run.func14 (2 handlers)
[GIN-debug] GET    /edit                     --> main.run.func15 (2 handlers)
[GIN-debug] POST   /save                     --> main.run.func16 (2 handlers)
[GIN-debug] POST   /m3usave/:file            --> main.run.func17 (2 handlers)
[GIN-debug] GET    /m3us                     --> main.run.func18 (2 handlers)
[GIN-debug] GET    /editm3u/:file            --> main.run.func19 (2 handlers)
[GIN-debug] GET    /config                   --> main.run.func20 (2 handlers)
[GIN-debug] POST   /configsave               --> main.run.func21 (2 handlers)
[START] ah4c is ready
[GIN-debug] Listening and serving HTTP on :7654
> ws-scrcpy@0.8.1-dev start
> node ./index.js
Listening on:
	http://ah4c3:8000 http://localhost:8000
	http://127.0.0.1:8000 http://172.21.0.2:8000
slayer@NUC12-PC:~$ cd /data
slayer@NUC12-PC:/data$ ls -la
total 16
drwxr-xr-x  4 root root   4096 Oct  9 09:58 .
drwxr-xr-x 20 root root   4096 Oct  9 06:39 ..
drwxr-xr-x  5 root root   4096 Oct  9 09:58 ah4c
drwxr-xr-x  7  911 docker 4096 Feb  4  2023 organizr
slayer@NUC12-PC:/data$ cd ah4c
slayer@NUC12-PC:/data/ah4c$ ls
adb  m3u  scripts

Persistent directories survived stopping and restarting the stack, as per usual.

Could you post the complete docker-compose you're using and the environment variables please?

version: '3.9'
services:
ah4c:
image: bnhf/ah4c:prime
container_name: ah4c2
hostname: ah4c2
dns_search: localdomain # Specify the name of your LAN's domain, usually local or localdomain
ports:
#- 5037:5037 # Port used by adb-server
- 7654:7654 # Port used by this androidhdmi-for-channels proxy
- 7665:8000 # Port used by ws-scrcpy
environment:
- IPADDRESS=${IPADDRESS} # Hostname or IP address of this androidhdmi-for-channels extension to be used in M3U file (also add port number if not in M3U)
- NUMBER_TUNERS=${NUMBER_TUNERS} # Number of tuners you'd like defined 1, 2, 3 or 4 supported
- TUNER1_IP=${TUNER1_IP} # Streaming device #1 with adb port in the form hostname:port or ip:port
- TUNER2_IP=${TUNER2_IP} # Streaming device #2 with adb port in the form hostname:port or ip:port
- TUNER3_IP=${TUNER3_IP} # Streaming device #3 with adb port in the form hostname:port or ip:port
- TUNER4_IP=${TUNER4_IP} # Streaming device #4 with adb port in the form hostname:port or ip:port
- ENCODER1_URL=${ENCODER1_URL} # Full URL for tuner #1 in the form http://hostname/stream or http://ip/stream
- ENCODER2_URL=${ENCODER2_URL} # Full URL for tuner #2 in the form http://hostname/stream or http://ip/stream
- ENCODER3_URL=${ENCODER3_URL} # Full URL for tuner #3 in the form http://hostname/stream or http://ip/stream
- ENCODER4_URL=${ENCODER4_URL} # Full URL for tuner #4 in the form http://hostname/stream or http://ip/stream
- STREAMER_APP=${STREAMER_APP} # Streaming device name and streaming app you're using in the form scripts/streamer/app (use lowercase with slashes between as shown)
- CHANNELSIP=${CHANNELSIP} # Hostname or IP address of the Channels DVR server itself
#- ALERT_SMTP_SERVER="smtp.gmail.com:587"
#- ALERT_AUTH_SERVER="smtp.gmail.com"
#- ALERT_EMAIL_FROM=""
#- ALERT_EMAIL_PASS=""
#- ALERT_EMAIL_TO=""
#- ALERT_WEBHOOK_URL=""
- LIVETV_ATTEMPTS=${LIVETV_ATTEMPTS} # For FireTV Live Guide tuning only, set maximum number of attempts at finding the desired channel
- CREATE_M3US=${CREATE_M3US} # Set to true to create device-specific M3Us for use with Amazon FireTV LiveTV channels -- requires a FireTV device
- TZ=${TZ} # Your local timezone in Linux "tz" format
- UPDATE_SCRIPTS=${UPDATE_SCRIPTS}
volumes:
- /data/ah4c/scripts:/opt/scripts # pre/stop/bmitune.sh scripts will be stored in this bound host directory under streamer/app
- /data/ah4c/m3u:/opt/m3u # m3u files will be stored here and hosted at http://:7654/m3u for use in Channels DVR - Custom Channels settings
- /data/ah4c/adb:/root/.android # Persistent data directory for adb keys
restart: unless-stopped

Is this the integration you're talking about?

And if so, are you good now using the above docker-compose and environment variables?