Hi,
sometimes it is very useful to create and destroy cDevice based classes at runtime. Currently it is only possible to create such classes at any time but destroying causes inconsistency in the 'devices' array which leads to segmentation faults in various places.
The patch attached keeps the 'device' array consistent on destruction of any cDevice based class. Please add this patch to current 1.6/1.7 development versions.
The next thing to do is removing the MAXDEVICES constraint which should make it possible to add any number of cDevice based instances.
Just in case you are interested why I need this feature: I am working on a native VDR plugin for the NetCeiver hardware. With this box it is possible to have up to 6 DVB-S2 devices (or DVB-S/C/T) per NetCeiver. You can attach up to 5 NetCeivers to a gigabit network which makes 30 DVB devices available. Therefore it should be possible to create and destroy DVB devices at runtime.
Deti
uups: change the 'break' by 'return' otherwise you'll get a wrong error message ;-)
Deti
On 26.01.2009 22:25, Deti Fliegl wrote:
sometimes it is very useful to create and destroy cDevice based classes at runtime. Currently it is only possible to create such classes at any time but destroying causes inconsistency in the 'devices' array which leads to segmentation faults in various places.
Definitely something that is worth considering. The patch also brings us one step closer towards hotplug support, a feature that seems very obvious in times of USB DVB devices.
However this throws the question at which time and in which context it is safe to kill a device object without risking that any running process gets into trouble because its device is suddenly in bit heaven.
Cheers,
Udo
Udo Richter wrote:
Definitely something that is worth considering. The patch also brings us one step closer towards hotplug support, a feature that seems very obvious in times of USB DVB devices.
Yep you are right but IMHO there would be some more work to do:
VDR should compile also without direct Linux DVB kernel support. So we could get rid of any specific Linux dependency (and use VDR for BSD based systems like MacOS without patching). Therefore section filtering should make use of a virtual Read() method in the device class. There also needs to be an abstraction for signal information so that plugins like channelscan and femon are not depending on the direct DVB access. Maybe it makes sense to have a Linux DVB device plugin.
However this throws the question at which time and in which context it is safe to kill a device object without risking that any running process gets into trouble because its device is suddenly in bit heaven.
Well this is nifty but most of the proper device shutdown procedure can be done in the cDevice based class.
Deti
On 26.01.2009 23:01, Deti Fliegl wrote:
Udo Richter wrote:
Definitely something that is worth considering. The patch also brings us one step closer towards hotplug support, a feature that seems very obvious in times of USB DVB devices.
Yep you are right but IMHO there would be some more work to do:
VDR should compile also without direct Linux DVB kernel support. So we could get rid of any specific Linux dependency (and use VDR for BSD based systems like MacOS without patching). Therefore section filtering should make use of a virtual Read() method in the device class. There also needs to be an abstraction for signal information so that plugins like channelscan and femon are not depending on the direct DVB access. Maybe it makes sense to have a Linux DVB device plugin.
Putting cDvbDevice into a plugin is on my agenda, but TS recording and full HDTV support comes first. Don't even send a patch for this - I won't look into it at this time.
Klaus