Extreme lag while scanning OTA EPG, services & channels not working
Added by bbaovanc b about 1 year ago
When I first start Tvheadend, it tries to scan all the OTA EPGs, but when it does that, the entire program lags horribly (web UI takes minutes to load/change tabs/do anything). During the lag, I'm getting this spammed in the logs:
2023-10-01 00:54:53.463 [WARNING]:mpegts: too much queued table input data (over 2MB) for LG Electronics LGDT3306A VSB/QAM Frontend #2 : ATSC-T #0, discarding new
I am able to view all services by downloading and playing through mpv, but if I use the built-in Live TV Player on the web UI, then some/most channels don't load, and I see in the logs:
2023-10-01 00:06:47.275 [ NOTICE] subscription: 0007: No input source available for subscription "HTTP" to channel "KPTS-HD"
2023-10-01 00:06:47.275 [WARNING] webui: Couldn't start streaming /stream/channel/ae77a0972817b2c214e0868a3e5885f1?profile=pass, No assigned adapters
Once it starts getting finished and is no longer using all 4 tuners, it starts to lag less. CPU usage is <1% on all cores and there's 58 GB ram free, so I don't think it's my PC being too slow.
Version: 4.3-2155~gfe4df311d
OS: Debian host, Docker using linuxserver/tvheadend
Tuner: Hauppauge WinTV-quadHD
I observed the same behavior in a Debian VM with Tvheadend running on it directly using the Cloudsmith package, so I don't think it's Docker/linuxserver related.
Replies (12)
RE: Extreme lag while scanning OTA EPG - Added by Jonas Lang about 1 year ago
Disable scan on startup.
RE: Extreme lag while scanning OTA EPG - Added by bbaovanc b about 1 year ago
I guess that works, but I thought it was a sign of an underlying issue. It still lags when the OTA EPG runs automatically due to schedule, or even when just scanning muxes. No CPU usage still.
But even when not scanning it looks like I still have the issue of not being able to play video. It says the same:
2023-10-01 15:22:13.169 [ NOTICE] subscription: 0015: No input source available for subscription "HTTP" to channel "KSNW-DT"
2023-10-01 15:22:13.169 [WARNING] webui: Couldn't start streaming /stream/channel/118122b7c4a39de5ed01c18e2e80421d?profile=webtv-vp8-vorbis-webm, No assigned adapters
2023-10-01 15:22:13.169 [ INFO] subscription: 0015: "HTTP" unsubscribing from "KSNW-DT", hostname="172.21.0.1", username="bbaovanc", client="Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0"
Originally I said it played fine through MPV but now it doesn't even play through MPV anymore, or record through DVR. None of my 4 tuners are tuned to anything, and if I look at the Subscriptions tab, it shows a blank under "Service".
RE: Extreme lag while scanning OTA EPG - Added by Jonas Lang about 1 year ago
I don’t use TVH in Docker or VM so can’t really help there. What hardware do you have it installed on. Try searching the forum to see if others have it installed on Docker or VM that may be able to help you. A lot of USB devices struggle in Docker. This is just a generic example of this problem
https://www.homeautomationguy.io/blog/docker-tips/accessing-usb-devices-from-docker-containers
RE: Extreme lag while scanning OTA EPG - Added by bbaovanc b about 1 year ago
This a PCIe device, not USB. With VM, I had the entire PCIe slot passed through, and with Docker I have mounted the /dev/dvb devices using --device.
Also, I just now tried setting up using the wizard instead of adding the network manually, and it works for a few of the channels (but not all); they get mapped properly and can play. I noticed the channels that don't map say ignored if I try to map manually, and also don't show up under services when Hide is set to Parent disabled. If I press the little (i) icon, it shows only a single row under service details saying "PMT", but the channels that did work show multiple things: PCR, PMT, MPEG2VIDEO (sometimes multiple), and AC3.
I will try installing Tvheadend directly on host and see if it makes a difference.
RE: Extreme lag while scanning OTA EPG, services & channels not working - Added by bbaovanc b about 1 year ago
I am getting the exact same behavior with the package installed bare-metal on Debian using the official Cloudsmith repo. Also forgot to mention what the log output is when I try to play one of the services that doesn't work through MPV:
Oct 01 17:58:10 srv02 tvheadend[9165]: http: 172.31.255.3: using ticket c504b65b6a1e779df32844858f000fdc2c8e6d0d for /stream/service/648b6ea5b20504e51fe0510c967c2541
Oct 01 17:58:12 srv02 tvheadend[9165]: subscription: 003E: No input source available for subscription "HTTP" to service "ATSC-T Network/195.028MHz/{PMT:0}" in mux "195.028MHz in ATSC-T Network"
Oct 01 17:58:12 srv02 tvheadend[9165]: webui: Couldn't start streaming /stream/service/648b6ea5b20504e51fe0510c967c2541?ticket=c504b65b6a1e779df32844858f000fdc2c8e6d0d, No service enabled
Oct 01 17:58:12 srv02 tvheadend[9165]: subscription: 003E: "HTTP" unsubscribing, hostname="172.31.255.3", client="libmpv"
I can't test what the log output is now using the Live TV player on the web UI because it won't let me map the other broken services, it's just "ignored".
Edit: I decided to check dmesg and I see some log lines saying there's missing firmware. Although LinuxTV wiki said the quadHD ATSC shouldn't need any firmware and I couldn't even find the files it's asking for, could this cause a problem?
[ 59.737164] si2157 35-0062: found a 'Silicon Labs Si2157-A30 ROM 0x50'
[ 59.737197] si2157 35-0062: firmware: failed to load dvb_driver_si2157_rom50.fw (-2)
[ 59.737203] firmware_class: See https://wiki.debian.org/Firmware for information about missing firmware
[ 59.737219] si2157 35-0062: firmware: failed to load dvb_driver_si2157_rom50.fw (-2)
[ 59.737235] si2157 35-0062: firmware: failed to load dvb-tuner-si2157-a30-01.fw (-2)
[ 59.737251] si2157 35-0062: firmware: failed to load dvb-tuner-si2157-a30-01.fw (-2)
[ 59.737256] si2157 35-0062: Using ROM firmware.
[ 59.786583] si2157 35-0062: firmware version: 3.0.5
[ 59.791781] em28xx 5-2:1.0: DVB: adapter 3 frontend 0 frequency 0 out of range (54000000..858000000)
[ 59.841240] si2157 34-0060: found a 'Silicon Labs Si2157-A30 ROM 0x50'
[ 59.841259] si2157 34-0060: firmware: failed to load dvb_driver_si2157_rom50.fw (-2)
[ 59.841268] si2157 34-0060: firmware: failed to load dvb_driver_si2157_rom50.fw (-2)
[ 59.841279] si2157 34-0060: firmware: failed to load dvb-tuner-si2157-a30-01.fw (-2)
[ 59.841288] si2157 34-0060: firmware: failed to load dvb-tuner-si2157-a30-01.fw (-2)
[ 59.841292] si2157 34-0060: Using ROM firmware.
[ 59.892085] si2157 34-0060: firmware version: 3.0.5
[ 59.897748] em28xx 5-2:1.0: DVB: adapter 2 frontend 0 frequency 0 out of range (54000000..858000000)
[ 59.949440] si2157 33-0062: found a 'Silicon Labs Si2157-A30 ROM 0x50'
[ 59.949458] si2157 33-0062: firmware: failed to load dvb_driver_si2157_rom50.fw (-2)
[ 59.949468] si2157 33-0062: firmware: failed to load dvb_driver_si2157_rom50.fw (-2)
[ 59.949478] si2157 33-0062: firmware: failed to load dvb-tuner-si2157-a30-01.fw (-2)
[ 59.949487] si2157 33-0062: firmware: failed to load dvb-tuner-si2157-a30-01.fw (-2)
[ 59.949491] si2157 33-0062: Using ROM firmware.
[ 59.998853] si2157 33-0062: firmware version: 3.0.5
[ 60.004351] em28xx 5-1:1.0: DVB: adapter 1 frontend 0 frequency 0 out of range (54000000..858000000)
[ 60.056978] si2157 32-0060: found a 'Silicon Labs Si2157-A30 ROM 0x50'
[ 60.056994] si2157 32-0060: firmware: failed to load dvb_driver_si2157_rom50.fw (-2)
[ 60.057001] si2157 32-0060: firmware: failed to load dvb_driver_si2157_rom50.fw (-2)
[ 60.057010] si2157 32-0060: firmware: failed to load dvb-tuner-si2157-a30-01.fw (-2)
[ 60.057016] si2157 32-0060: firmware: failed to load dvb-tuner-si2157-a30-01.fw (-2)
[ 60.057018] si2157 32-0060: Using ROM firmware.
[ 60.106466] si2157 32-0060: firmware version: 3.0.5
[ 60.111980] em28xx 5-1:1.0: DVB: adapter 0 frontend 0 frequency 0 out of range (54000000..858000000)
RE: Extreme lag while scanning OTA EPG, services & channels not working - Added by Jonas Lang about 1 year ago
You never mentioned what hardware you were using. It really does help to know that.
What Hauppauge Quad model are you using. What flavour of Linux will you use.
I don’t imagine you’ll have any difficulty getting things to work by directly installing TVH on your server. The Wizard should look after all your configuration needs.
RE: Extreme lag while scanning OTA EPG, services & channels not working - Added by bbaovanc b about 1 year ago
I was not aware that there are multiple quadHD's. I am using the American version, model 1609: https://www.hauppauge.com/pages/products/data_quadhd.html. I did mention that I am using Debian (12, Bookworm).
lspci -v
:
06:00.0 USB controller: ASMedia Technology Inc. ASM2142/ASM3142 USB 3.1 Host Controller (prog-if 30 [XHCI])
Subsystem: ASMedia Technology Inc. ASM2142/ASM3142 USB 3.1 Host Controller
Flags: bus master, fast devsel, latency 0, IRQ 16, IOMMU group 18
Memory at df100000 (64-bit, non-prefetchable) [size=32K]
Capabilities: [50] MSI: Enable- Count=1/8 Maskable- 64bit+
Capabilities: [68] MSI-X: Enable+ Count=8 Masked-
Capabilities: [78] Power Management version 3
Capabilities: [80] Express Legacy Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [200] Secondary PCI Express
Capabilities: [300] Latency Tolerance Reporting
Capabilities: [400] L1 PM Substates
Kernel driver in use: xhci_hcd
Kernel modules: xhci_pci
Not sure why the lspci output shows a USB, but this is definitely the card because passing it through to the VM gave access to all 4 tuners.
Attached is an excerpt of dmesg, everything it says about the Hauppauge tuner card (I deleted the stuff before and after that's just other video/network drivers and setup). It shows up as a dualHD for some reason, not sure why. There are definitely four tuners showing up in Tvheadend.
In Tvheadend itself, it shows up as LG Electronics LGDT3306A VSB/QAM Frontend #3 : ATSC-T #0
, where #3 is number 0-3.
I forgot to mention before, but the wizard only gives me the option of 2/4 of my ATSC-T tuners to set up (the others are two IPTV sources, and two ATSC-C sources, both on the same tuner as the two ATSC-T it gave me. That's why I tried setting up manually, it made me think the wizard was bugged out. When setting up manually, I was adding my network to all 4 tuners. I have just tried going through the wizard again on bare-metal instead of manually setting it up, and it works fine with the two tuners that the wizard set up. No lag either, until I add back the other 2 tuners that the wizard skipped. Then an EPG scan on all 4 tuners starts lagging the entire thing.
If I set it up manually, and only add the network to the two that the wizard picks, it seems to also work fine. So now I'm really confused. Why is the wizard only picking tuners #2 and #3, and skipping #0 and #1? Is there some hardware issue with my tuner and somehow Tvheadend sees that the first two tuners don't work right?
Keep in mind I have done all of this testing just now on bare-metal TVH.
RE: Extreme lag while scanning OTA EPG, services & channels not working - Added by Jonas Lang about 1 year ago
I’m based in Europe so can’t do any testing to verify your issue. It does sound like there’s an issue with firmware. Try searching around the web to ensure you have the correct firmware for you card installed.
RE: Extreme lag while scanning OTA EPG, services & channels not working - Added by bbaovanc b about 1 year ago
I could only find one of the firmware files it complained about: dvb-tuner-si2157-a30-01.fw
, which I got from the CoreELEC repo: https://github.com/CoreELEC/dvb-firmware/blob/master/firmware/dvb-tuner-si2157-a30-01.fw
It's not really lagging too much anymore, but I'm not sure if it was because of the firmware or just because I scanned the ATSC network enough times that it populated all the basic information or something.
RE: Extreme lag while scanning OTA EPG, services & channels not working - Added by saen acro about 1 year ago
Simple installation official Hauppague PPA
https://launchpad.net/~b-rad/+archive/ubuntu/kernel+mediatree+hauppauge
and install firmware from there can sole problem.
RE: Extreme lag while scanning OTA EPG, services & channels not working - Added by bbaovanc b about 1 year ago
I'm not using Ubuntu but maybe I can reverse engineer it to find where the firmware is and get them manually.
RE: Extreme lag while scanning OTA EPG, services & channels not working - Added by saen acro about 1 year ago
Get firmware deb extract it use it
https://launchpad.net/~b-rad/+archive/ubuntu/kernel+mediatree+hauppauge/+files/linux-firmware-hauppauge_0.2.1+xenial_all.deb
on this TAR file inside folder 0
https://launchpad.net/~b-rad/+archive/ubuntu/kernel+mediatree+hauppauge/+sourcefiles/linux-firmware-hauppauge/0.2.1+xenial/linux-firmware-hauppauge_0.2.1+xenial.tar.gz
put them in
/lib/firmware