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

yup did beta4, look fwd to the m3u improvements, and remembered another unposted request i've had for a long time.
it sure would be handy to have a log scroll toggle. :slight_smile:

what is it called when a log scrolls for every new line?

This is called <mark>log tailing</mark> or following a log.

When you use a command or a tool to view a log file in real-time, the screen automatically scrolls downward and outputs new text whenever a new event or line is appended to the file.

## Common Commands and Tools

* `tail -f filename.log`: The standard Linux/Unix command used for this purpose (the `-f` stands for "follow").
* `Get-Content filename.log -Wait`: The Windows PowerShell equivalent.
* Auto-Scroll / Scroll Lock: The toggle feature in graphical log viewers (like Kibana, CloudWatch, or IDE consoles) that enables or disables this scrolling behavior.

Can you be more specific about the log scroll toggle?
Oh, I see what you mean. If you want to view more logging, you can just go into wherever your Docker manager is or wherever Docker is running, I assume WSL, and just run docker logs ah4c. To keep the browser from slowing down, I specifically limited the logging to about 500 lines, so the last little bit. At least I believe it was 500 lines that I said. I could be wrong.

Maybe in a later pass I can make that configurable.

@bnhf I'm breaking out PR42. I'm working on some improvements to the M3U editor, and I don't want it to be too huge and unreadable, so I'm splitting them out into two PRs. So there's going to be, hopefully by morning, two PRs to review. I just have to test and make sure that it's actually functional.

This is just some more user friendliness stuff I happened to pick up on. I happened to notice it as I was creating a duplicate channel. It was really not fun.

i'll bet not lol
I noticed, but did not mention that editing my custom channel in the gui wiped all but what was visible in the gui.

i updated details about scroll toggle

I mean now that you mention it a link to this page in portainer would be handy too, but I'm just looking to quickly pause the scroll so I can actually try and read the log. CC is pretty chatty in there.

Docker logs will do that.

but you can't hyperlink to the log in docker can you? same log via portainer could be hyperlinked no?

It's strictly like a command run in Docker.

I think that's outside the scope of the application. What I probably could do is maybe add the ability to view more lines, but if you really want to view the logs, you view them in Docker.

ok, i think we may still have a couple wires crossed. the gui lets us see the log. I cannot read the log when the lines keep moving. if they can't be paused then anymore than 20 or 30 lines is kinda useless.

edit ok that's an exaggeration.. currently I try to quickly select it all and copy to clipboard before another line loads and paste it into notepad to see if what i need is visable. if not then I have to go to docker/portainer for more of the log.

Saying, if you go to the command line and type docker logs ah4c you can easily view the logs.

if I rdp into my server. I try to avoid that with the limited resources of n100. lol, no it's really not bad, but still think it's bad practice to always have a remote desktop minimized on my laptop.

You can actually SSH into a Windows box now.

:person_shrugging:

I haven't used ssh since college 25yrs ago and even then it was only a few times.
old dog new tricks.

a link like this would be helpful
http://10.0.0.7:9000/#!/1/docker/containers/79998fa0fdcb7690a503499d15ddd96ae1f0083742b6b6be9d32fe1d0be910ab/logs

@Shaggylive Portainer is very good for viewing logs as well. You can choose how many lines back you want to view (I usually choose 10,000), and then you can turn Auto-refresh off. There's Search, Download, and Copy. As a Portainer user, you should definitely go there for a deeper dive on ah4c logs.

Today's Test of the Day: Uploading m3u's thru webui

Copied my Osprey Deeplinks to my test m3u folder on Synology NAS. Renamed as as dtvstreamdeeplinks.m3u. On iPad, went to webui and selected Choose folder. There was no option to select a network folder. Jumped on Mac and the option was there. (This is probably just a limitation of the iPad). Uploaded m3u from Synology without issue. Checked m3u thru editor and it looked correct. Went to Channels DVR Sources, reload m3u, then did a delete and recreate database. After guide refreshed, some channels (locals) were not shown in their proper place. Checked guide on client and those spots were still populated with your locals but no guide data.
Deleted source from Channels and went back to ah4c webui. The m3u listed was still green showing it on Channels. Refreshed browser and still green. Selected the add to Channels DVR and it added it’s expected. Channels now showing correctly.

Observation:
I'm puzzled why your locals did not 100% disappear when I reloaded the m3u. They did go away when I deleted the source in Channels and reloaded thru ah4c.
We have an add to Channels DVR for the source. When you delete the source, ah4c still has it green and loaded. Maybe we need a delete source from the webui(??)

You have to click refresh m3u in Channels.

I did a couple of times. It's probably a Channels issue (artifact) as it only affected the replaced ABC, Fox, & NBC channels. They didn’t show in the channels web guide, only on the client. It would have probably cleared up in the next 24 hours anyway but my channels may have stayed out of order from the m3u.

Should be out soon with a test container that allows you to sort all of your channels in an M3U file and also renumber them quite nicely. I'm just working out a couple of bugs.

@bnhf I have two pull requests open related to this. I just broke them out because I wanted you to be able to read them easily. The only thing is, I'm just working out some bugs that I picked up on, so I just want to keep them in draft mode for now until we get some feedback.

I figured while I'm on the settings pass, I might as well make some things easier along the way. I feel like the goal, besides just settings, is just user friendliness. So, if we can make renumbering channels super easy for people, that would be awesome.

Hey everyone, the M3U editor is working freaking great. You should be able to sort channels by A through Z, renumber fairly easily while maintaining order, undo changes, preview them before you actually hit save, and push them directly to channels without having to refresh anything. I'm just quite pleased with this. So, if anyone wants to try it and try to find bugs or break it, please let me know. You can try my test build. mackid1993/ah4c either latest or beta both point at the same digest.

Edit: just making one more pass over these with Opus 5.5 since it just came out. I actually found a couple of minor nits that need to be fixed, very minor things.

Update: I actually found a bug relating to like when DirecTV has those 4,000 channels, the free ones. Renumbering those is kind of an issue when they're out of order.

So I'm looking into the best way to handle those. Trying to make the tool a bit more flexible.

Update 2: I believe I corrected this. If anyone wants to try, you should be able to edit channel numbers freeform now, and it'll warn you if there's a conflict.

For those dealing with the Cox Spectrum merger, I ported over my PyATV scripts and M3Us yesterday to use the Spectrum Apple TV app instead of the Cox Contour app. They actually are a lot simpler using deep links, which the contour app did not support.

Thank you @ChannelSam for the scripts , but I put in some minor tweaks to make clearer

bmitune:

#!/bin/bash
# Channels DVR invocation contract: bmitune.sh <channelId> <atvHost>
#   $1 = channelId (Gracenote/TMS station ID, from tvc-guide-stationid in M3U)
#   $2 = atvHost    (IP of the Apple TV assigned as this tuner)
channelId="$1"
atvHost="$2"

/usr/local/bin/atvremote --storage-filename /root/.android/.pyatv.conf \
  -s "$atvHost" launch_app="spectrumTV://watch.spectrum.net/livetv/${channelId}"

I had to add force quit logic to the stopbmitune to accommodate multiple tuners and avoid streaming limit errors from spectrum.

stopbmitine:

#!/bin/bash
set -e

# Channels DVR invocation contract: stopbmitune.sh <atvHost> <channelId>
#   $1 = atvHost    (IP of the Apple TV assigned as this tuner)
#   $2 = channelId  (Gracenote/TMS station ID, from tvc-guide-stationid in M3U)
# NOTE: argument order is REVERSED from bmitune.sh - this is the Channels DVR
# pre/stop contract, not a bug. Do not "align" this with bmitune.sh's order.
atvHost="$1"
channelId="$2"

pyatvCredentials="/root/.android/.pyatv.conf"
ATV_CMD="/usr/local/bin/atvremote --storage-filename ${pyatvCredentials} -s ${atvHost}"

# Tunable delays - measure per-ATV, don't assume Cox's timing applies here.
FC_SHORT_DELAY=0.6
SWIPE_PASSES=3   # start smaller than Cox's 5; raise only if one pass isn't enough

echo "πŸ“Ί Force Quit Spectrum App on ${atvHost} (was tuned to ${channelId})"

echo "πŸ” Opening app switcher..."
eval "$ATV_CMD home home" >/dev/null 2>&1 || true
sleep "$FC_SHORT_DELAY"

# NOTE: no "left" press here - Spectrum should already be the frontmost,
# focused card since it's the most-recently-used app on this ATV. If testing
# shows the wrong app gets swiped, that's the signal to add navigation back.

i=1
while [ "$i" -le "$SWIPE_PASSES" ]; do
  echo "🧹 Swiping up to force-quit the app... (Pass $i)"
  eval "$ATV_CMD up up" >/dev/null 2>&1 || true
  sleep "$FC_SHORT_DELAY"
  i=$((i + 1))
done

echo "🏑 Returning to Home Screen..."
eval "$ATV_CMD home" >/dev/null 2>&1 || true
sleep "$FC_SHORT_DELAY"

echo "βœ… Spectrum app force-quit, ATV in idle state"

Heres a sample M3U:

#EXTM3U


#EXTINF:-1 channel-id="56905" channel-number="3024" tvg-name="DSCHD" tvc-guide-stationid="56905",Discovery
http://{{ .IPADDRESS }}/play/tuner/56905

#EXTINF:-1 channel-id="59337" channel-number="3025" tvg-name="AMCHD" tvc-guide-stationid="59337",AMC
http://{{ .IPADDRESS }}/play/tuner/59337

#EXTINF:-1 channel-id="59186" channel-number="3026" tvg-name="PARHD" tvc-guide-stationid="59186",Paramount
http://{{ .IPADDRESS }}/play/tuner/59186

#EXTINF:-1 channel-id="58623" channel-number="3032" tvg-name="SYFYHD" tvc-guide-stationid="58623",SYFY
http://{{ .IPADDRESS }}/play/tuner/58623

#EXTINF:-1 channel-id="57708" channel-number="3041" tvg-name="HSTRYHD" tvc-guide-stationid="57708",History
http://{{ .IPADDRESS }}/play/tuner/57708

#EXTINF:-1 channel-id="49788" channel-number="3044" tvg-name="HGTVD" tvc-guide-stationid="49788",HGTV
http://{{ .IPADDRESS }}/play/tuner/49788

#EXTINF:-1 channel-id="60179" channel-number="3046" tvg-name="FNCHD" tvc-guide-stationid="60179",Fox_News
http://{{ .IPADDRESS }}/play/tuner/60179

#EXTINF:-1 channel-id="64241" channel-number="3047" tvg-name="MSNBC" tvc-guide-stationid="16300",MSNOW
http://{{ .IPADDRESS }}/play/tuner/64241

#EXTINF:-1 channel-id="58646" channel-number="3049" tvg-name="CNNHD" tvc-guide-stationid="58646",CNN
http://{{ .IPADDRESS }}/play/tuner/58646

#EXTINF:-1 channel-id="58812" channel-number="3051" tvg-name="WEATHHD" tvc-guide-stationid="58812",The_Weather_Channel
http://{{ .IPADDRESS }}/play/tuner/58812

#EXTINF:-1 channel-id="58574" channel-number="3053" tvg-name="FXHD" tvc-guide-stationid="58574",FX
http://{{ .IPADDRESS }}/play/tuner/58574

#EXTINF:-1 channel-id="62420" channel-number="3058" tvg-name="CCHD" tvc-guide-stationid="62420",Comedy_Central
http://{{ .IPADDRESS }}/play/tuner/62420

#EXTINF:-1 channel-id="68344" channel-number="3076" tvg-name="CSPANHD" tvc-guide-stationid="68344",C-SPAN
http://{{ .IPADDRESS }}/play/tuner/68344

#EXTINF:-1 channel-id="49438" channel-number="3083" tvg-name="NGCHD" tvc-guide-stationid="49438",National_Geographic
http://{{ .IPADDRESS }}/play/tuner/49438

#EXTINF:-1 channel-id="66268" channel-number="3090" tvg-name="HALLHD" tvc-guide-stationid="66268",HALLMARK
http://{{ .IPADDRESS }}/play/tuner/66268

#EXTINF:-1 channel-id="46710" channel-number="3091" tvg-name="HMMHD" tvc-guide-stationid="46710",Hallmark_Movies_Mysteries
http://{{ .IPADDRESS }}/play/tuner/46710

#EXTINF:-1 channel-id="57390" channel-number="3100" tvg-name="SCIHD" tvc-guide-stationid="57390",Science
http://{{ .IPADDRESS }}/play/tuner/57390

#EXTINF:-1 channel-id="64492" channel-number="3158" tvg-name="BBCAHD" tvc-guide-stationid="64492",BBC_America
http://{{ .IPADDRESS }}/play/tuner/64492

@bnhf just flagging you in case you want to add these tweaks for these scripts into the latest repo.

Im going to built a completely new container from scratch and test the appletv pairing and script deployment using fastchannels , etc within a day or two, Can we push these latest scripts into the repo? Then Ill test everything with a totally new host directory and keep my old "production" tuner suspended while I test all the new changes.