Tuner not always detected/initialised correctly
Added by m j over 10 years ago
- Recording scheduled fail with "Time Missed"
- Attempting to tune to a channel in XBMC will give the error "No Hardware Present".
- The Status page of the Web UI shows 0% signal
Invariably, the problem can be solved by running sudo service tvheadend restart
.
- Ubuntu 12.04 LTS
- Tvheadend 3.4.27~gfbda802~precise
- PCTV Nanostick T2 (shows on Tvheadend Status page as Sony CXD2820R).
Does anyone have any ideas of how I can stop this happening, or failing that, how to detect if it's happened after boot and restart tvheadend from a script?
Cheers
Mark
Replies (8)
RE: Tuner not always detected/initialised correctly - Added by Prof Yaffle over 10 years ago
Repeating what I said in another recent post... does this happen on a restart of the machine, by any chance? Linux tends to move USB devices around, which is fine if it's a keyboard but not so much use if you're expecting to find a tuner in a given place. You can tell because the adapter location will be blank, but a new adapter (with no services/channels) will appear on a different location (e.g. /dev/dvb1).
Post a screenshot of your adapter config page if you like, let's see if there's anything obvious. Check the drop-down to see if you have multiple tuners while you're there, and see what the config looks like for the others if you do.
RE: Tuner not always detected/initialised correctly - Added by m j over 10 years ago
It happens "sometimes" on boot, rather than on restart specifically. I thought it might be something like that. Currently (it happened on this boot, but I've since restarted tvheadend), the device path is /dev/dvb/adapter0, which is what I'd expect. There's only one tuner in the drop-down on the config page. I've attached a screenshot in case there's anything useful there, I can do it again next time it happens before I restart tvheadend if that helps.
RE: Tuner not always detected/initialised correctly - Added by Prof Yaffle over 10 years ago
Please - grab that screen and check the dropdown before you restart.
Have a shufti at this thread as well, it might give you something to play with:
https://tvheadend.org/boards/4/topics/7109
Looking back, I'm still left confused by what driver this stick uses, but if it's your only one then you should find it easily enough with lsmod - you can try the adapter_nr trick then. It's probably quicker to reboot your machine half-a-dozen times than it is to crack the udev route, sadly...!
RE: Tuner not always detected/initialised correctly - Added by m j over 10 years ago
Ok, here's a screenshot when it's not working, before I restart tvheadend.
However, the tuner is still at /dev/dvb/adapter0, as expected:
mark@homestar:~$ ls -lR /dev/dvb/ /dev/dvb/: total 0 drwxr-xr-x 2 root root 120 May 7 17:47 adapter0 /dev/dvb/adapter0: total 0 crw-rw----+ 1 root video 212, 1 May 7 17:47 demux0 crw-rw----+ 1 root video 212, 2 May 7 17:47 dvr0 crw-rw----+ 1 root video 212, 0 May 7 17:47 frontend0 crw-rw----+ 1 root video 212, 3 May 7 17:47 net0
It's as though the tuner's being set up correctly by the OS, but not until after tvheadend has started. Does that make sense?
RE: Tuner not always detected/initialised correctly - Added by m j over 10 years ago
Oh, and the dropdown on the config page only shows the one tuner.
RE: Tuner not always detected/initialised correctly - Added by Prof Yaffle over 10 years ago
I guess that's possible... it wouldn't explain why the tuner goes walkies during use, though, if that's what's happening. If that isn't what's happening, though, that's perfectly plausible.
I guess the test for your hypothesis would be simply to always restart tvheadend after a reboot, or add a delay - either a sleep in the start script, or perhaps re-order the upstart jobs so the tvheadend one runs later?
Can w_scan lock onto the tuner when it's in this state? That'd also help isolate things.
<pause>
Found this on a quick search if it's useful:
RE: Tuner not always detected/initialised correctly - Added by m j over 10 years ago
I've not noticed the tuner disappearing while watching/recording.
I've tried adding a delay using the TVH_DELAY setting in /etc/default/tvheadend, and it seems to be working. Thanks for your help.
RE: Tuner not always detected/initialised correctly - Added by Prof Yaffle over 10 years ago
Ah, yes - I thought I'd seen that, but couldn't find it in my file so assumed I'd imagined it. D'oh.