[vdr] OSD and subtitles trouble

Marko Mäkelä marko.makela at iki.fi
Sat Nov 9 00:57:37 CET 2013


I did some more hacking and got softdevice to a useable state on VDR 
2.0.4. My patch against softdevice cvs is attached.

The TL;DR version is that I suspect 2 bugs in VDR 2.0.4:

(1) The bottom 1% lines of the OSD are not being cleared when the OSD 
extends that low. (I can choose up to 99% height and 0% vertical 
offset.)

(2) Changes in DVB subtitles will flash the OSD layer (make it empty for 
a very short time) if an OSD is active. I suppose that DVB subtitles 
should not be displayed at all when OSD layer is active.

On Mon, Nov 04, 2013 at 10:30:14PM +1000, Torgeir Veimo wrote:
>Softdevice had transparency 'dithering' for when there's only 1-bit 
>transparency, did you look at that option?

I am a bit unsure if it really is using 1-bit transparency. The 
background inside the LCARS main menu is darker (but still translucent) 
than the area outside the menu borders. Everything else in the OSD layer 
is opaque.

With "perf top" I noticed that Softdevice was spending a lot of time, 
scaling the OSD layer down from 1920×1080 to 720×576 that is my video 
output resolution. So, I hardcoded the OSD size back to 720×576. OSD 
updates became snappy (fewer pixels to copy to the 
cSoftOsd::OSD_Bitmap[], and from there it would be a straight memcpy to 
the video memory). The following problem was unaffected by this fix.

If I set the OSD size to 100% height, then VDR will never clear the very 
bottom lines at the screen. If I set it to 99% height, everything will 
be erased properly when I leave the main menu, or the program info at 
the bottom of the screen is cleared. If I set it to 99% height and 1% 
vertical offset, the garbage will appear again. My current understanding 
is that it is VDR 2.0.4 that fails to post a proper draw request to 
clear the bottom of the screen.

The next problem was related to my patch. It turned out that 
cSoftOsd::Flush() has to check cOsd::IsTrueColor() and render pixmaps or 
bitmaps accordingly. This would also explain why I previously never saw 
any output from the Classic VDR OSD (it is the only non-TrueColor 
built-in theme).

The garbage-at-bottom problem also affects DVB subtitles. If I move the 
"Setup.DVB$Subtitle offset" too low, the pixels from the last 4 or so of 
the 576 lines will never be cleared (only drawn when there is some "y" 
or "p" or "q" character that extends to to the "garbage area").

A small (old) problem with the Softdevice OSD/subtitles remains. When 
the OSD is active while the current stream is showing DVB subtitles, the 
OSD layer will be cleared, but no subtitles will be displayed.  
Eventually, parts of the OSD will be repainted. It turns out that this 
problem was emphasized by the cSoftOsd::dirty_lines[] array. If I commit 
out the dirty_lines[] checks, the OSD will be properly repainted, but 
the entire OSD layer will be cleared for a few frames whenever the 
subtitles are about to display. (No subtitles will be actually 
displayed, because the OSD layer is active.) How to avoid this short OSD 
flash? I tried commenting out all cSoftOsd::Clear() calls, but that did 
not help (other than leaving DVB subtitles garbage on the screen when 
the OSD layer was not active).

Note: I understand that the non-truecolor DVB subtitles are not being 
alpha-blended to the truecolor OSD layer. It is OK for me not to see 
subtitles when the OSD is active. But it is not OK that the active OSD 
layer gets cleared whenever subtitles are attempting to display or clear 
themselves.

Best regards,

	Marko
-------------- next part --------------
A non-text attachment was scrubbed...
Name: softdevice-vdr2.0.4-3u.patch
Type: text/x-diff
Size: 17526 bytes
Desc: not available
URL: <http://www.linuxtv.org/pipermail/vdr/attachments/20131109/87139717/attachment.patch>


More information about the vdr mailing list