Prof Y - HDHR does come in as an IP stream, but TVH sees it like any other DVB driver as there is some library that talks HDHR over the network and translates this into standard linux DVB api etc.. <- Note: just for info :)
Steve,
Stopping/Starting TVH could indeed allow problems in the driver to become "unstuck", because there are far more FDs open than just the one you're looking at. At the very least there will also be the frontend one and possibly (depending on version and setup) several demux ones as well. It may well be that the driver has gotten itself into a state that it cannot recover from until ALL device files are closed.
frontend0 - this is the frontend tuner control (it's where we get status info and send tuning commands etc... this will be open at most once within TVR)
dvr0 - this is where the raw PES is received for the subscribed services (and in later version, depending on config, the entire mux). This can be open at most once in TVH.
demux0 - this is where we receive table data that has been extracted from the raw mux stream based on requested filters. This will be open many times, once for each filter (some drivers do have limitations on the number you can open due to HW limits, since that's typically where the filtering takes place. This will not be the case with HDHR).
Messing about with these files, which are essentially the FS interface to your hardware, is a BAD idea and will no doubt result in undesirable behaviour ;)
It sounds to me like the problem you're having is that the HDHR drivers are getting in a mess. Something you could try:
Configuration->Adapters-> (for each HDHR tuner you have):
skip initial scan = on
idle scan = off
close device handle when idle = on
Note: there is a bug in 3.2 which means these settings don't properly take effect on startup, but it probably won't affect what you're about to do.
1. Start TVH with debugging enabled (-s or -d)
2. Start the recording (ensure that you have no other clients accessing TVH that might also subscribe to stuff - XBMC etc...)
3. Wait for recording to actually start (writing to disk)
a. sudo lsof -p $(cat /var/run/tvheadend.pid) | grep /dev/dvb
Note: the above should show you what devices are currently open during recording
4. When the recording stops writing data:
a. Stop the recording
b. sudo lsof -p $(cat /var/run/tvheadend.pid) | grep /dev/dvb
Note: at this point you should hopefully see that all DVB devices are closed (i.e. nothing is listed by the above)
5. Try to restart the recording (or simply use something to view the live stream)
See what happens when you do this, also capture the debug log (either from console or syslog, depending on which you did etc...)
Prof Y,
Can you maybe repeat some of the things Steve has tried to see if you are getting data into the dvb_adapter_input_dvr() routine (in src/dvb/dvb_adapter.c).
Adam