Raspberry Pi + TVHat - sudden loss of adapter
Added by Phil Mordecai over 1 year ago
I've been running TVHeadend on a Pi3B+ with a TVHat for a good few years and while the system occasionally coughs and requires a reboot, it has generally caused me very few issues. It lives tucked away in a corner and I've generally left it to get on with doing its job.
There's nothing else other than TVHeadend running on the Pi (TVH v 4.2.8-34~g24a2f59e9) and I primarily use Kodi on an Android tablet to access and watch content from it - though I have also used the Android "TVH Client" app in the past.
Yesterday, all of a sudden, Kodi reported "No Signal" so I SSHd onto the Pi and rebooted it, swiftly moving on to other things as I only had a bit of TV playing on the tablet in the background and didn't use it again for the rest of the day. This morning when I tried to watch something else through Kodi the "No signal" message had changed to "No free adapter available". As it only has one tuner, I have previously seem this message when there was an active recording taking place. I had also seen this in the past after a soft reboot, so I SSHd back onto the device, ran sudo halt, powered off the Pi for 10 minutes and then turned it back on again. On those couple of occasions when it has happened in the past a power-cycle has resolved the matter. However, this time, the report "No free adapter available" in Kodi has persisted. When I log into the TVH web interface and go to Configuration -> DVB Inputs -> TV adapters, it shows no adapter present.
I'm guessing TVH isn't reporting an adapter because it isn't being detected - though there is a green LED lit on the HAT itself which would suggest some kind of life signs.
I have an older August DVB-T202 USB adapter which I used to test TVH prior to purchasing the TVHat (though the picture quality was never as good as that from the TVHat). I've just plugged back into the Pi and as soon as I did the TVH web interface refreshed and showed this adapter to be present which makes me wonder if the HAT has failed.
However, while I now have the USB adapter plugged in and it is showing as present in the TVH web interface ( ), I am seemingly still unable to access content from either the Kodi app installed on my tablet, or the TVH web interface. Kodi continues to report "No free adapter available" and if I try to play a stream via the web interface (which results in a download which I then play through VLC) it too fails to play ( )
Any assistance would be appreciated. I haven't need to do much by way of troubleshooting as TVH has previously worked without any real issue that hasn't been solved with a reboot.
Many thanks in advance.
-Phil.
Replies (9)
RE: Raspberry Pi + TVHat - sudden loss of adapter - Added by Phil Mordecai over 1 year ago
Apologies - I had tried to include a couple of screencast URLs with the images I spoke of, but they don't seem to have translated through to the post itself.
Web interface showing no adapters at all:
https://www.screencast.com/t/vb6zegaYWZw
Web interface showing USB adapter present, once connected:
https://www.screencast.com/t/JnVHEWbXdHaT
Error message in VLC when trying to stream content once the USB tuner has been connected and is recognised:-
https://www.screencast.com/t/tjYisFFxVoi
RE: Raspberry Pi + TVHat - sudden loss of adapter - Added by Jonas Lang over 1 year ago
Try removing the HAT from the RPI and remove the antenna too. Then reconnect the antenna and HAT again. Check that your antenna signal is strong and you’re not getting a short at the HAT from the antenna connection.
It may be that you have a short or an overheating issue. If all that shows no results you could start the hardware/software install process again to rule out any possible OS corruption.
RE: Raspberry Pi + TVHat - sudden loss of adapter - Added by Phil Mordecai over 1 year ago
Thank you - I will give that a try.
I can vouch for the signal as I tested it in a TV before connecting the Pi and it was nice and solid. I did notice the antenna connection was a little loose (the TVHat has an adapter that plugs into the board so that you can connect the antenna), but if that were at fault I would have expected a "No signal" rather than "No adapter" error from TVH.
I shut down the Pi and left it off for 1.5hrs, which should have given components enough time to cool and then powered back up again. TVH still doesn't see the TVHat adapter.
The secondary issue I have is that while it is able to see the USB DVB-T adapter that I've connected as a temporary measure and I've added and plugged the antenna into this device instead while this device is being detected by TVH when I try to view any content it still fails (Kodi continues to report "No adapter found" and the VLC error is the same as previously posted.
RE: Raspberry Pi + TVHat - sudden loss of adapter - Added by Jonas Lang over 1 year ago
The problem with your other DVBT adapter is probably down to firmware not loading properly. If you run the dmesg from the command line with the adapter plugged in you’ll probably see that.
RE: Raspberry Pi + TVHat - sudden loss of adapter - Added by Phil Mordecai over 1 year ago
Well, your suggestion appears to have worked
Took the lid off the case removed the TVHat from the GPIO connectors, re-seated everything and screwed the lid back on.
Powered the Pi on again and when I looked at the output of "sudo systemctl status tvheadened" I could see in the output indications that the TVHat was being detected again.
May 28 17:24:56 pi-tv.home.internal tvheadend485: START: HTS Tvheadend version 4.2.8-34~g24a2f59e9 started, running as PID:485 UID:109 GID:44, CWD:/ CNF:/home/hts/.hts/tvheadend
May 28 17:24:57 pi-tv.home.internal tvheadend485: avahi: Service 'Tvheadend' successfully established.
May 28 17:25:09 pi-tv.home.internal tvheadend485: mpegts: 482MHz in DVB-T Network - tuning on Sony CXD2880 #0 : DVB-T #0
May 28 17:25:09 pi-tv.home.internal tvheadend485: subscription: 0001: "epggrab" subscribing to mux "482MHz", weight: 4, adapter: "Sony CXD2880 #0 : DVB-T #0", network: "DVB-T Network", service: "Raw PID Subscription"
When I checked the TVHeadend web interface in Configuration -> DVB Inputs -> TV Adapters I could see the adapter was present. Connected the antenna again (I wanted to see if the adapter would be recognised without an antenna connected - in case there was some kind of short as you suggested) and, once again, I have a working TVHeadend system
In investigating this further I also worked out why TVH would recognise the USB DVB-T adapter but I couldn't get it to work was because (i) it wasn't enabled in TVH and (ii) I had to select DVB-T Network in the adapter preferences.
So, I've gone from having no working tuners to 2 (and I've tested two simultaneous streams with Status -> Subscriptions showing one using the Sony (TVHat) adapter and the other using the USB adapter).
Knowing the TVHat tuner is better quality than the USB one, am I correct in setting the Priority & Streaming Priority to 1 on this adapter, leaving the settings on the USB adapter at 0 to ensure it will have priority when used.
Many thanks for your help.
-Phil.
RE: Raspberry Pi + TVHat - sudden loss of adapter - Added by Phil Mordecai over 1 year ago
After 3 days of normal function again, it would appear I have a variation of the same problem, but with some subtle differences.
The Pi was not responsive on my network this morning and the Kodi client on my Android tablet could not connect, so I had no choice but to power off the Pi and turn it back on again. When I did, it appeared that all was well and when I checked the TVH web interface, the only oddity was that while TVH was still recognising the TVHat device and the USB DBV-T device I have since connected, both were reported as disabled. I also noticed that the priority setting I had changed on the USB adapter to ensure the TVHat had top priority (being a better quality tuner) had reverted back to default.
So I enabled both adapters in the Parameters screen (at which point both showed a green dot next to them instead of a red one) and set the priority for the USB adapter back to 1.
However, when I try to access any TV channels Kodi is still reporting "No free adapter available".
I have restarted the service using "sudo systemctl restart tvheadend" which has made no difference and neither has a full reboot.
ls -l /dev/dvb/adapter0
and
ls -l /dev/dvb/adapter1
both show results (this was something I discussed with another person when I had the original issue where the TVHat adapter was not being recognised by TVH at all and it turned out the ls -l /dev/dvb/adapter0 command did not work.
pi@pi-tv:~ $ ls l /dev/dvb/adapter0 1 root video 212, 0 May 31 08:28 demux0
total 0
crw-rw---
crw-rw---- 1 root video 212, 1 May 31 08:28 dvr0
crw-rw---- 1 root video 212, 3 May 31 08:28 frontend0
crw-rw---- 1 root video 212, 2 May 31 08:28 net0
pi@pi-tv:~ $ ls l /dev/dvb/adapter1 1 root video 212, 5 May 31 08:28 demux0
total 0
crw-rw---
crw-rw---- 1 root video 212, 6 May 31 08:28 dvr0
crw-rw---- 1 root video 212, 4 May 31 08:28 frontend0
sudo systemctl status tvheadend reports:-
pi@pi-tv:~ $ sudo systemctl status tvheadend
● tvheadend.service
Loaded: loaded (/etc/init.d/tvheadend; generated)
Active: active (running) since Wed 2023-05-31 08:28:32 BST; 7min ago
Docs: man:systemd-sysv-generator(8)
Process: 362 ExecStart=/etc/init.d/tvheadend start (code=exited, status=0/SUCCESS)
Tasks: 28 (limit: 2088)
CGroup: /system.slice/tvheadend.service
└─478 /usr/bin/tvheadend -f -u hts -g video
May 31 08:28:42 pi-tv.home.internal tvheadend478: epgdb: gzip format detected, inflating (ratio 21.6% deflated size 1873659)
May 31 08:28:42 pi-tv.home.internal tvheadend478: epgdb: parsing 8672311 bytes
May 31 08:28:42 pi-tv.home.internal tvheadend478: epgdb: loaded v2
May 31 08:28:42 pi-tv.home.internal tvheadend478: epgdb: config 1
May 31 08:28:42 pi-tv.home.internal tvheadend478: epgdb: brands 0
May 31 08:28:42 pi-tv.home.internal tvheadend478: epgdb: seasons 3726
May 31 08:28:42 pi-tv.home.internal tvheadend478: epgdb: episodes 8491
May 31 08:28:42 pi-tv.home.internal tvheadend478: epgdb: broadcasts 13414
May 31 08:28:43 pi-tv.home.internal tvheadend478: START: HTS Tvheadend version 4.2.8-34~g24a2f59e9 started, running as PID:478 UID:109 GID:44, CWD:/ CNF:/home/hts/.hts/tvheadend
May 31 08:28:44 pi-tv.home.internal tvheadend478: avahi: Service 'Tvheadend' successfully established.
The TVH web interface appears to show both tuners alive and well-
https://www.screencast.com/t/rAHpR7kztkz
EDIT
Fixed again. Though unsure why this happened.
Where earlier I reported that the reboot appeared to result in the adapters still being present in TVH, but not enabled, and the amended priority for the USB tuner had gone back to 0, I've since discovered even after re-enabling each adapters neither had a Network assigned and I had to re-assign "DVB-T Network" to each and now have a functioning system again.
RE: Raspberry Pi + TVHat - sudden loss of adapter - Added by Jonas Lang over 1 year ago
Your system is showing classic signs of overheating. Intermittent problem causing it to shutdown and restart but on restart the HAT is not available to TVH.
This doesn’t look like it’s a TVH problem but try removing the case and let your system run without the case and monitor its progress. Also check the CPU temperature. It will become obvious if that indeed is your problem.
Do a little more searching on the subject of RPI overheating for further suggestions and possible solutions.
RE: Raspberry Pi + TVHat - sudden loss of adapter - Added by Phil Mordecai over 1 year ago
Thanks for your feedback, Jonas.
It is a 3B+ which I know isn't immune to the heat, but isn't as prone to overheating as the Pi4 (all of my 4s have fans and I wouldn't run them without), but it does have a heatsink and the lid of the case is vented. The fact there is a TVHat connected to the GPIO pins does mean that cooling options are limited (as are case options with this being the only one which I know to exist that accommodates the TVHat - https://thepihut.com/products/tv-hat-case-for-raspberry-pi-4 - though it is described as being for a Pi4 mine is the previous version of the same for the Pi3 with different cut-outs for the ports on the side).
Curiously I have recently moved the unit from my loft (which would admittedly get very warm, especially in summer) to another room. That's not to say that it isn't overheating, but it is odd that it would do so after being moved to a location which is probably 10c cooler than where it was 5 days ago. I also appreciate that this is a TVH forum and not one for discussing RPi hardware.
However, are there known reasons why after this reboot, TVH itself would disable settings which have been stable for as long as the system has been running (about 2 years)?
I've rebooted the unit any number of times and never suffered any ill effects, but for this morning's reboot to result in both adapters needing to be manually re-enabled in the TVH web interface and for it to be necessary to re-assign the DVB-T Network to them as well is odd. That certainly hasn't happened before.
RE: Raspberry Pi + TVHat - sudden loss of adapter - Added by Jonas Lang over 1 year ago
As I mentioned it doesn’t appear to be a TVH issue. All I can suggest is checking the CPU temperature at shutdown/restart. If you find that when this happens, you leave the RPI/HAT unplugged for an hour then power it up again and all is well every time it’s safe to assume that’s your problem is heat related. Again checking with other forums might yield more answers.