Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Is this legal/safe to open a demuxer before opening the frontend ?



Gerd Knorr wrote:
> Johannes Stezenbach <js@convergence.de> writes:
> 
> > It should be legal, but it cannot be made failsafe for some hardware :-(
> > 
> > (av7110 may crash if you have a frontend which outputs noise when
> > not tuned to signal; this is probably a bug in the RTSL or in the
> > firmware error handling. Anyway, the host should not crash when the
> > av7110 crashes, this is a bug in the av7110 drivers error handling.
> > Note that most newer frontends mute their TS output when they cannot
> > sync to a signal).
> 
> Shouldn't the driver be able to deal with that?  Re-setup the filters
> after the arm crashed?  Maybe delay that until the frontend is locked
> to avoid the arm crash instantly again?

Well, error handling in case of av7110 crashes is far from perfect,
it's just that no one seems to want to touch it... AFAIK many
vdr users work around it by using a script that reloads the drivers
after an ARM crash.

The drivers do what is possible to prevent the crash from happening:
If the frontend does not have the FE_CAN_MUTE_TS flag, whenever
the dvb_frontend_thread() notices that the signal is gone, it
calls the dvb_call_frontend_notifiers() to disable the filters
in the demux. (Hm, I just checked, and it seems that FE_CAN_MUTE_TS
is no longer used and this is done unconditionally; IIRC that fixed
something with stale data in a software-demux buffer after tuning).
Also, it is possible that only the audio/video PID filters are
problematic in the av7110).

Anyway, there is always the possibility that the dvb_frontend_thread()
notices the absence of a signal too late and the av7110 has already
crashed. The crash shouldn't happen in the first place, but I don't
know how to fix it in the firmware.

> > To be safe you should 1. tune, 2. wait for FE_GET_EVENT to return
> > success, 3. set filters. Before tuning, stop all filters.
> 
> I really don't like that.  It's simply impossible to do if frontend
> tuning and filtering is done by different applications.
> 
> If you want a real-life example for that have a look at the mtt
> teletext browser of current xawtv 4.x snapshots.  It doesn't touch the
> frontend, it simply opens the demux, sets up some filters and looks
> out for teletext streams.  Works fine in parallel to some TV
> application running.  If you tune some station on another transponder
> with your TV app mtt will notice (because the PAT changes) and adapt
> automagically.

Hmm. How does mtt know what service from you want the teletext from?
And what happens if the teletext PID you are currently filtering
collides with the audio dor video PID of the new service?


Johannes




Home | Main Index | Thread Index