Mailing List archive

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

[vdr] Re: how to display information on channel change?



Luca Olivetti wrote:
> 
> I'm trying to write a plugin to drive a linear actuator (since it's what
> I have on my dish) through the parallel port.
> I've already written a kernel module that's more or less working (I
> haven't built the hardware yet, but it's setting the output pins,
> counting pulses and stopping when it has reached the target position).
> 
> For the plugin part, since I'm no c++ coder, I'm "borrowing" from the
> rotor plugin (its operation is quite similar to what I'm going to need).
> To move the dish it's using a status monitor: using ChannelSwitch, it
> checks if it's a different satellite, and if it is:
> 
> 1) it tells my device driver the target position (the dish will start
> moving)
> 2) it opens an osd (cOsdProvider::NewOsd)
> 3) it displays that the dish is moving (I'd also like to display the
> current position in the following loop, but I haven't managed to do that
> yet)
> 4) it waits until the position has been reached (or there was an error)
> or a key is pressed
> 5) it closes the osd
> 
> The problem is that is disrupts the normal osd shown on channel change
> and eventually it crashes vdr (the xine plugin says "xineDevice.c:801:
> void PluginXine::cXineDevice::OnFreeOsd(cOsd*): Assertion `osd ==
> m_currentOsd' failed.", I think that's been discussed recently in the
> thread "OSD: is it allowed to have multiple instances").

You're not supposed to open an OSD "just like that".
This will be enforced in VDR 1.3.11.

> I have many doubts here:
> 
> a) How can I display that the dish is moving and its position without
> disrupting the normal osd and without crashing xine?

Try displaying a text message with

  Skins.Message(mtInfo, "some text");

This should be displayed in the channel display (if open) or as a separate
message line.

> b) is there a better way to determine when it's time to move the dish or
> the status monitor is the correct hook?

That would be the right place.

> c) is it correct not to return from ChannelSwitch until the dish has
> reached the position (or a key has been pressed)? If it isn't, how can I
> accomplish a)?

You must return from the cStatus calls as soon as possible (which means: immediately)!
You may need to start a spearate thread that handles your actuator control.
Calling Skins.Message() is not thread safe, though. Maybe I need to do something
in that area...

> d) do you know of any free byte in the cmos ram whare I could store the
> current position? (ok, this one isn't strictly related to vdr and the
> osd, but the wizards that developed the cmos wake up program for vdr
> maybe know and are reading this list)

Why don't you just store that information as a setup parameter using
the plugin's setup mechanism? What's the point in storin this in the
CMOS RAM?

Klaus




Home | Main Index | Thread Index