PDA

View Full Version : Series2 OSD



dah31
04-14-2004, 11:38 PM
Introduction

This is libosd 0.1, a library containing on-screen display (OSD)
routines for Series1 and Series2 TiVo units, tested on a Philips
DSR7000 running 4.0.

The API is intended to be more or less backwards compatible with the
one(s) used in tivovbi, elseed, yac, and newtext2osd, with
enhancements for slanted and coloured text. (I have successfully
ported elseed, yac, and newtext2osd to Series2 with this library.)
See the example for usage.

The Series2 code came from disassembling /tvbin/osdwriter from 4.0.
Some of the variable and function names refer to addresses in
osdwriter (which I have also reconstructed source for).


Notes:

Series2 colours are 32-bit unsigned quantities of the form 0xAARRGGBB.

I have hard-coded an offset of 6 pixels into the bSurfacePosition()
routine in brcm.c to compensate for the `ghost' image noted at
<URL:http://www.dealdatabase.com/forum/showpost.php?p=124086&postcount=1>.
On Live TV and TiVo Central, anyway; Now Playing doesn't have the
offset.

You can forget the return value of setupBrcmDisplay() (0 for failure)
unless you want to call the bSurface* routines yourself.

Due to that `ghost' image, the opacity values don't work linearly:
there are effectively two copies of the image overlaid.

I haven't actually been able to test elseed yet, as the phone hasn't
rung for several days!


Todo^H^H^H^HExercises for the reader:

o test Series1 support. I'm pretty sure it doesn't work just
now....

o fix bugs

o colour name to value mapping, something like X's rgb.txt?

o changeable fonts

o certainly, a font encoded for (say) Latin-1, rather than MS-DOS
codepage 437.

o FreeType would probably work well for those last two.

alldeadhomiez
04-15-2004, 12:39 AM
I have hard-coded an offset of 6 pixels into the bSurfacePosition()
routine in brcm.c to compensate for the `ghost' image noted at
<URL:http://www.dealdatabase.com/forum/showpost.php?p=124086&postcount=1>.
On Live TV and TiVo Central, anyway; Now Playing doesn't have the
offset.

Nice work. A separate library is just what we needed to bring the S1/S2 codebases together.

In my trials, I was able to use (0,0) in bSurfacePosition() as long as I killed off the calls to bSurfaceShow() and bcmGfxSetAntiFlutFilter(). I have no idea why that worked though.

Since the cat is out of the bag now, we may as well combine efforts and fill in any gaps in our knowledge/implementations. I'm attaching the patch I made against newtext2osd 1.4.

Edit 2005/02/02:
I have added Series2.5 OSD support to my tivovbi fork: link (http://www.dealdatabase.com/forum/showthread.php?t=41313)

dah31
04-18-2004, 03:54 PM
In my trials, I was able to use (0,0) in bSurfacePosition() as long as I killed off the calls to bSurfaceShow() and bcmGfxSetAntiFlutFilter(). I have no idea why that worked though.

It seems that bSurfaceShow() shows the `main' image: not calling it leaves only the `ghost' image, which is not movable with bSurfacePosition().

All this is because we're sharing TiVo's surface. The joke's on us, it seems, for assuming TiVo knew what they were doing when they wrote osdwriter. ;-)


Since the cat is out of the bag now, we may as well combine efforts and fill in any gaps in our knowledge/implementations. I'm attaching the patch I made against newtext2osd 1.4.

Yes, looks mildly familiar. :-D

(I delayed release as well because of the legal issues. But then I decided
that TiVo didn't exactly make osdwriter hard to follow, so it's not like they
were trying to keep us out. Not to detract from Xybyre's work with fly &c.,
but that does seem a bit klugey when we're sitting on basically the same
code TiVo are using.)

I've made a few changes to my code based on my latest experiments. Like
thusly:

Don't Get a SharedSurface; Create your own and don't Share it.

Now you have a Surface all of your very own to play with. It won't
interfere with the TiVo menus or on-screen displays (even the Play
bar), *and* the Zordering works! (It appears TiVo displays its
displays somewhere around zorder 4 or 5. 4, I reckon, based on the
DirecTV banners (e.g., channel 88), which are apparently redisplayed
every few seconds, appearing in front of our surface at zorder 4.) So
I've changed the surface acquisition code in setupBrcmDisplay() to
call only bSurfaceCreate() and removed the +6 from bSurfacePosition().

Now, there is presumably only a limited number of surfaces available,
so I've still got the bSurfaceGetSharedSurface() in there as a
fallback.

I've refrained from memset()ing the new surface's buffer to 0s in example1.c
in order to show up the zordering better.

I've also added example2.c, the code I used to test my OSD code the night I
got it working.

tivomaster
04-18-2004, 05:52 PM
Thanks dah31 this is a breakthough. We S2 folks can run a lot of S1 apps that were missing the osd stuff.......

Is the future newtext2osd going to support the normal S1 style color codes?

I see where you say:

"Series2 colours are 32-bit unsigned quantities of the form 0xAARRGGBB"

I take it the RRGGBB are Red,Green,and Blue but what is the AA?

dah31
04-18-2004, 08:27 PM
This is libosd 0.2, a library containing on-screen display (OSD)
routines for Series1 and Series2 TiVo units, tested on a Philips
DSR7000 running 4.0.

The API is intended to be more or less backwards compatible with the
one(s) used in tivovbi, elseed, yac, and newtext2osd, with
enhancements for slanted and coloured text. (I have successfully
ported elseed, yac, and newtext2osd to Series2 with this library.)
See the example for usage.

The Series2 code came from disassembling /tvbin/osdwriter from 4.0.
Some of the variable and function names refer to addresses in
osdwriter (which I have also reconstructed source for).


Notes:

Series2 colours are 32-bit unsigned quantities of the form 0xAARRGGBB.

The hard-coded offset of 6 pixels into the bSurfacePosition() routine
in brcm.c to compensate for the `ghost' image noted at
<URL:http://alt.org/forum/index.php?t=msg&goto=603&rid=0&S=bde84a3d652c00fb6d423c709f9773b7>
has now been removed. It's not needed if you have your own surface.
It's still in setupBrcmDisplay() if you have to share a surface,
though, and the (ick) global got_own_surface says whether you got your
own surface or not, so you can correct your own bSurfacePosition()
calls and opacity values.

You can forget the return value of setupBrcmDisplay() (0 for failure)
unless you want to call the bSurface* routines yourself.

When sharing TiVo's surface, due to that `ghost' image, the opacity
values don't work linearly: there are effectively two copies of the
image overlaid.

I haven't actually been able to test elseed yet, as the phone hasn't
rung for several days!


TodoExercises for the reader:

o test Series1 support. I'm pretty sure it doesn't work just
now....

o fix bugs

o colour name to value mapping, something like X's rgb.txt?

o changeable fonts

o certainly, a font encoded for (say) Latin-1, rather than MS-DOS
codepage 437.

o FreeType would probably work well for those last two.

Please note that the attached files are not ZIP archives.

dah31
04-18-2004, 10:58 PM
Is the future newtext2osd going to support the normal S1 style color codes?

Mine doesn't, but alldeadhomiez's does. They wouldn't be very difficult to add; it's just that the most transparent way seems somewhat inelegant:



#ifdef __TIVO_S2__
if (colour < 0x100) colour = s1_to_s2_colours_table[colour];
#endif /* __TIVO_S2__ */


Ah, that's not so bad. Look for it in 0.3.


I see where you say:

"Series2 colours are 32-bit unsigned quantities of the form 0xAARRGGBB"

I take it the RRGGBB are Red,Green,and Blue but what is the AA?

opAAcity :-)

Okay, so it's `alpha', but `opacity' keeps me from confusing it with transparency. AA runs from 0x00 (for totally transparent) to 0xff (for totally opaque).

tivomaster
04-19-2004, 08:16 AM
This is libosd 0.2, a library containing on-screen display (OSD)
routines for Series1 and Series2 TiVo units, tested on a Philips
DSR7000 running 4.0.


I tried the new version on my HDVR2 (3.1.0) and it works like a champ.

RKone
04-27-2004, 12:25 PM
This patch will allow osdwriter to properly display grey and palettized images with alpha channels on S2 tivos.

dgi
04-28-2004, 12:45 AM
I am currently extending tivovbi to handle the full closed-captioning protocol. I would be willing to work with someone that has a Series2 to broaden the source so that it could run on those machines as well. Right now the biggest holdup is the lack of a complete Latin-1 font instead of the MS-DOS codepage 437. I would welcome help with at least five things that comprise a wishlist for my current unreleased version:

1) to complete my partial Latin-1 font that I produced by rearranging the existing MS-DOS codepage 437 font
2) to make flashing text produce some kind of visual feedback in OSD mode
3) to make sure the Text Restart command is handled properly (I have not encountered this command in a captioning stream)
4) to fix the OSD bug that occurs when a preamble code specifies a different row in roll-up mode
5) to handle the Delete to End of Row command

TheWickedPriest
04-28-2004, 10:49 AM
1) to complete my partial Latin-1 font that I produced by rearranging the existing MS-DOS codepage 437 font
I might be able to help there. What format is the font?



2) to make flashing text produce some kind of visual feedback in OSD mode
How about a different color?

dgi
04-28-2004, 11:15 AM
I might be able to help there. What format is the font?The original font.h file was identical to the font.h in newtext2osd. It is a bitmap in the form of an array of bytes where each character is represented on a grid of 16x26 bits. I don't know whether interlacing is taken into account.
How about a different color?I already use seven colors to represent color captions. Flashing is an attribute on top of color, e.g. text may be yellow and blinking.

d7o
05-03-2004, 03:11 PM
I did a quick test of the yac port and the libosd examples.

When I ran yac, the screen looked garbled like it was displaying a random buffer (with random alpha channels, you could sort of make out the background).

When I ran the examples, they appeared to start out with the same random buffer and then they drew their respective texts/graphics. If I then ran yac again, I would see the exact same screen as it was after running the libosd example.

It would appear that the overlay buffer is never being reset. It starts out as a random buffer. After writes occur, those areas look clean but the rest of the screen still shows the random buffer. Subsequent execution of the utilities don't appear to reset the overlay buffer.

Is it a bug or is it just something weird with my machine (hdvr2)?

d7o

erhan
05-03-2004, 08:59 PM
I think it's a bug. I've played with elseed and compiled several variations and it seems like the OSD is not initialized until the first time it is actually used. So, on startup it just displays some garbled stuff. As soon as a call comes in, the screen clears.

I also tried a ClearOSD() call as soon as elseed starts and that also seemed to do the trick.

EDIT: Forgot to mention, this happens only when you start yac/elseed the first time after a reboot. Once the OSD is "cleared", subsequent restarts are fine.

Erhan

JohnSorTivo
05-04-2004, 07:03 PM
Interesting. I encountered the same issue. After attempting to start the YAC listener upon startup my screen would freeze with a bunch of snow / garble, never to recover, and after some testing, I realized that as long as something was first written to the screen, then YAC launched, it would start up without a problem.

As such, to work around this, I modified my rc.sysinit.author file by adding the following at the very end:

#Start YAC Caller ID listener
/var/hack/osd/newtext2osd -s 5 -t "Launching YAC Listener"
sleep 5
/var/hack/osd/yac -t 10 &

This way, by simply first writing to the screen that I am launching YAC, and then launching it, it prevents the problem referenced above.

erhan
05-04-2004, 07:31 PM
FWIW, here is an elseed binary compiled with a "elseed starting.." message to eliminate that issue. It also has a couple of additions of my own, for example formatting the log file better and additional debugging. Nothing too different from the original.

alldeadhomiez
05-04-2004, 08:06 PM
FWIW, here is an elseed binary compiled with a "elseed starting.." message to eliminate that issue. It also has a couple of additions of my own, for example formatting the log file better and additional debugging. Nothing too different from the original.

Please post a diff - this is a development forum. Thanks.

erhan
05-04-2004, 09:57 PM
Apologies. The attached diff is against dah31's port using his libosd.

dah31
05-05-2004, 12:41 AM
I am currently extending tivovbi to handle the full closed-captioning protocol. I would be willing to work with someone that has a Series2 to broaden the source so that it could run on those machines as well. Right now the biggest holdup is the lack of a complete Latin-1 font instead of the MS-DOS codepage 437. I would welcome help with at least five things that comprise a wishlist for my current unreleased version:

Spookily enough, porting tivovbi to Series2 was the carrot that originally motivated me to grab the axe and split open /tvbin/osdwriter ....

The next biggest holdup for Series2 will be figuring out how to get at the caption data (though I've got one idea towards that).


1) to complete my partial Latin-1 font that I produced by rearranging the existing MS-DOS codepage 437 font

I've spent altogether too much time looking for something suitable. In that size, there aren't a lot of bitmap fonts apart from `novelty' type ones. I found a 16x26 font for X, but it only does 7-bit ASCII. There's also an 8x13 that comes with X, but that's not a great solution either.

Then there's the wider issue of a font that actually looks nice on screen. I personally rather like the one used in EEG decoder chips (their own decoders and some television sets), apart from the (lack of) descenders.

FreeType support will widen the choices somewhat. :-D

2) to make flashing text produce some kind of visual feedback in OSD mode

This has never been a high priority for me. I've only actually seen flashing used once, thankfully (in an episode of Laverne and Shirley).

As for implementation, I reckon something along the lines of rendering the text into two separate buffers (`flash on' and `flash off', as Mr. Miyagi might say) and use some sort of timer to memcpy(3) them into the buffer. That'd probably work okay for pop-on mode, but roll-up would be a particular pain, particularly once smooth scrolling is implemented (see 47 CFR 119(f)(1)(iii)).


3) to make sure the Text Restart command is handled properly (I have not encountered this command in a captioning stream)
4) to fix the OSD bug that occurs when a preamble code specifies a different row in roll-up mode

I noticed this one a couple of weeks ago on a programme on a PBS channel and recorded some of it for that very reason. :-B


5) to handle the Delete to End of Row command

That one seems straightforward enough.

You might like to look at my hacks on tivovbi at <URL:http://www.dah31.org/tivo/tivovbi-1.04.tar.bz2>.

--
dah31

dah31
05-05-2004, 01:37 AM
I think it's a bug.

No, it's a feature. ;-)


I've played with elseed and compiled several variations and it seems like the OSD is not initialized until the first time it is actually used. So, on startup it just displays some garbled stuff. As soon as a call comes in, the screen clears.

I also tried a ClearOSD() call as soon as elseed starts and that also seemed to do the trick.

EDIT: Forgot to mention, this happens only when you start yac/elseed the first time after a reboot. Once the OSD is "cleared", subsequent restarts are fine.

Erhan

Here's what I think happened: I took the ClearOSD() (or memset(tivbuffer, 0, 720*480*4)) call out of SetupTextOSD() to get a better idea of the zordering in example1, but I neglected to test the other programs between recompiling and releasing. Sorry.

(I actually ran that elseed on my mother's DVR39, and she called me to ask why Dick van Dyke was looking through frosted glass...! I added the ClearOSD() call and kept fiddling with FreeType.)

--
dah31

dgi
05-05-2004, 11:12 AM
Spookily enough, porting tivovbi to Series2 was the carrot that originally motivated me to grab the axe and split open /tvbin/osdwriter ....

The next biggest holdup for Series2 will be figuring out how to get at the caption data (though I've got one idea towards that).IMHO, getting mbm to release his source to his kernel modules tvbi-test.o and the like would take care of the bulk of that.
I've spent altogether too much time looking for something suitable. In that size, there aren't a lot of bitmap fonts apart from `novelty' type ones. I found a 16x26 font for X, but it only does 7-bit ASCII. There's also an 8x13 that comes with X, but that's not a great solution either.

Then there's the wider issue of a font that actually looks nice on screen. I personally rather like the one used in EEG decoder chips (their own decoders and some television sets), apart from the (lack of) descenders.

FreeType support will widen the choices somewhat. :-DHave you actually tried scaling the 8x13 font? It might be sufficient, as long as it uses the ISO Latin-1 codepage.
This has never been a high priority for me. I've only actually seen flashing used once, thankfully (in an episode of Laverne and Shirley).

As for implementation, I reckon something along the lines of rendering the text into two separate buffers (`flash on' and `flash off', as Mr. Miyagi might say) and use some sort of timer to memcpy(3) them into the buffer. That'd probably work okay for pop-on mode, but roll-up would be a particular pain, particularly once smooth scrolling is implemented (see 47 CFR 119(f)(1)(iii)).If you would like to add that to my as-yet unreleased version, please do!
I noticed this one a couple of weeks ago on a programme on a PBS channel and recorded some of it for that very reason. :-BWhich one? The Text Restart command, or the OSD bug? Any ideas on how to fix the OSD bug?
That one seems straightforward enough.

You might like to look at my hacks on tivovbi at http://www.dah31.org/tivo/tivovbi-1.04.tar.bz2.

--
dah31I tried to download that, but your webserver won't let me because of a lack of read permissions. I would love to make a diff to 1.03 and incorporate your changes into my as-yet unreleased version.

alldeadhomiez
05-05-2004, 12:04 PM
IMHO, getting mbm to release his source to his kernel modules tvbi-test.o and the like would take care of the bulk of that.

That will not help in this case. mbm's modules locate and export the caption1Tail and caption1Buffer symbols in the CS22 driver, pxmpegdecode.o. Since we have no pxmpegdecode kernel module (or CS22 chip, for that matter) on a Series 2, we will need to find the equivalent functionality in brcmdrv-rb.o. Then we can find a way to snag the buffer contents out of kernel memory (as tivovbi does), or intercept the syscalls that transmit caption data to the Broadcom driver.

I can think of three simple approaches:

1) Figure out which ioctl is used to set caption data on a Series 1, locate the appropriate section of code in tivoapp, then find the corresponding function on a Series 2 tivoapp.

2) Log all ioctls coming from myworld, try to dereference anything that looks like it might be a pointer, and see if any caption data turns up.

3) See if the S1 and the S2 happen to use the same ioctl.

What would be slick is to write a kernel module that sniffs the caption data coming from userland, and then puts it in our own buffer (called, of course, caption1Buffer and caption1Tail). If done properly, we probably won't even need special S2 support in tivovbi for straight logging.

dah31
05-05-2004, 03:50 PM
This is libosd 0.3, a library containing on-screen display (OSD)
routines for Series1 and Series2 TiVo units, tested on a Philips
DSR7000 running 4.0.

The API is intended to be more or less backwards compatible with the
one(s) used in tivovbi, elseed, yac, and newtext2osd, with
enhancements for slanted and coloured text. (I have successfully
ported elseed, yac, and newtext2osd to Series2 with this library.)
See the example for usage.

The Series2 code came from disassembling /tvbin/osdwriter from 4.0.
Some of the variable and function names refer to addresses in
osdwriter (which I have also reconstructed source for).


Notes:

We now have TrueType font support, thanks to FreeType <URL:http://www.freetype.org/>

All the OSD globals have been encapsulated into a structure (struct osd_info) (except got_own_surface (missed that one)). That should be a big step towards having multiple surfaces in one program. Likewise with struct ft_info for FreeType.

Also: newtext2osd's find_colors() is in osd.c (access to S1 colours by name), as is get_colour() (convert colours <0x100 to S2 equivalents).

setupBrcmDisplay() and SetupTextOSD() have a new argument, dont_clear_buffer. Set it if you don't want the display buffer cleared; 0 will clear it.


TodoExercises for the reader:

o test Series1 support. I'm pretty sure it doesn't work just
now....

o fix bugs

o colour name to value mapping, something like X's rgb.txt?


o changeable fonts

Done.


o certainly, a font encoded for (say) Latin-1, rather than MS-DOS
codepage 437.

Done.


o FreeType would probably work well for those last two.

Yes, it does.

o Fix spelling inconsistencies (functions, variables, and types should use `colour'; #define `color' equivalents)

o Put got_own_surface in the osd_info structure.


Please note that the attached files are not ZIP archives.

I've included a copy of the FreeType library (put it in a directory in your LD_LIBRARY_PATH), but you'll need to grab the sources to compile anything.

Oh, and there's an environment variable FONT_PATH, which you set to a colon-separated list of directories to search for fonts. openfont_ex() (and openfont()) searches the exact path given, then the FONT_PATH, then the current directory.

--
dah31

dgi
05-05-2004, 04:00 PM
certainly, a font encoded for (say) Latin-1, rather than MS-DOS
codepage 437.



Done.
Ooooo, lemme see!

EDIT: Oh, it uses a freetype lib. So much for adapting tivovbi to use a different font.

dgi
05-05-2004, 06:07 PM
dah31: I have incorporated your 1.04 changes to tivovbi for the most part. Here is a preliminary snapshot of my version with your changes. Hopefully we can start extending it together from here. It is NOT a zip file.
EDIT: I have removed the snapshot as it is no longer current.

PS-Also, I got mbm's final cvs snapshot before he abandoned it. It's broken, but it's really rewritten, and doesn't use tvbi-test.o anymore. E-mail me for details.

dah31
05-05-2004, 11:27 PM
Have you actually tried scaling the 8x13 font? It might be sufficient, as long as it uses the ISO Latin-1 codepage.

Here's a screenshot I put together with netpbm.


Which one? The Text Restart command, or the OSD bug? Any ideas on how to fix the OSD bug?

The OSD roll-up bug. I haven't looked at it yet, but I don't see it being too difficult (famous last words!).

--
dah31

dgi
05-05-2004, 11:36 PM
That screenshot looks good.

Integrating your OSD changes (skewed italics) seems to have introduced another bug. Whenever the captions go all the way to the right edge (column 32), the last character gets only half-drawn. If it's italic, it's hardly visible.

pcl
05-08-2004, 10:04 PM
I just tried out the libosd 0.3 and the patched elseed 0.6 binary, and ended up with a rebooting Tivo, and seemingly no log output.

I put the contents of libosd-0.3/lib into /var/hack/lib, put /var/hack/lib in my LD_LIBRARY_PATH, and executed './elseed -c conf/elseed.conf'. Things loaded as expected, and then I dialed my number. This caused the system to reboot.

I attempted to capture stdout and stderr, but no output was generated.

I had previously installed the vanilla elseed 0.6.0 and configured it to broadcast call info to my Mac. That worked, but no display on the TV. When running the patched elseed, my Mac did not receive any call notification.

I briefly tried to do some debugging (first, by compiling a helloworld binary), but was foiled by not having <tivo/osd/osd.h> available on my cross-compiling machine. At that point, I threw up my hands and typed up this post.

I'm quite new to Tivo compiling. I do have a cross-compiler up and running on a Linux box, and have written one little hello world program that seems to run, but have not been indoctrinated in the ways of the Tivo just yet. Any help (including appropriate, and hopefully content-rich, flames) would be much appreciated. I'm looking to get elseed working (or rather, to get caller id info on my TV), so help to that end is what I'm really looking for, but obviously, this is a developer forum, so info about what headers etc. I need for cross-compiling with the new OSD stuff or any other relevant info is probably what I'm looking for.

System info: Freshly-hacked S2 standalone running 4.0.1b with a single 160-gig drive, with no LBA hack.

-Patrick

erhan
05-09-2004, 01:07 PM
I briefly tried to do some debugging (first, by compiling a helloworld binary), but was foiled by not having <tivo/osd/osd.h> available on my cross-compiling machine. At that point, I threw up my hands and typed up this post.

You need to "make" libosd first and "make install' to get the include files and the library to the right place. Don't forget to modify the Makefile to point to your cross compiler directory for both libosd and elseed Makefiles.

dah31
05-15-2004, 08:27 PM
I just tried out the libosd 0.3 and the patched elseed 0.6 binary, and ended up with a rebooting Tivo, and seemingly no log output.


I finally managed to borrow a portable telephone and figure this one out. The problem was that I changed the parameters for osdit() and didn't prototype it:



[elseed.h:]
void osdit ();

[elseed.c:]
int main(int argc, char *argv[]) {
[...]
osdit();
[...]
}

[...]

void osdit(struct osd_info *osd, struct ft_info *ft) {
[...]
}


Moral: use prototypes!

--
dah31

alldeadhomiez
06-01-2004, 09:16 PM
Here is a fake "pxmpegdecode" module for the Series 2 platform which emulates the circular CC/XDS buffers from the Series 1 CS22 driver. Source and a MIPS 2.4.18/4.0 binary module are included. CC tests with tivovbi 1.03 in text mode were successful; XDS might work but is untested. There's a chance it will work on the Series 1 as well if you rename the stock pxmpegdecode.o and adjust the startup scripts accordingly.

Building tivovbi for MIPS required #include's for time.h and errno.h. dgi's tivovbi sources from post #24 worked after I took the additional step of turning off parity checking.

Due to the growing number of schemes in which freely available TiVo hacks are being sold for profit, this code and any derivative work is for personal use only and any redistribution is prohibited. Exceptions: you may post compiled binaries in this thread if you include any source changes, you may post patches in this thread, and the license will revert to GPL on December 31st, 2005.

Edit: I have pulled the original attachment and posted version 20040601a. There were bugs in my kernel module which caused the parity issue alluded to earlier. dgi's version now runs correctly, unmodified, with the fixed module.

Edit: New version - 20040602 fixes XDS handling.

Edit: New version - 20040602a cleans up the intercept.

Edit 2005/02/02: s2vbi and tivovbi development has moved to this thread (http://www.dealdatabase.com/forum/showthread.php?t=41313)

dgi
06-01-2004, 09:56 PM
I put in the parity code because there is no way to be truly faithful to the CC protocol without it. Can you please go back and check where to get the parity bit on a S2? TIA (Makes me wish I had a S2 just for testing.)

alldeadhomiez
06-02-2004, 02:01 PM
I have patched the modified tivovbi sources previously found in post #24 for compatibility with the Series2 OSD hardware, and attached the new version to this post.

This was a quick hack so I used my original "0x403" patch. As a result, this code does not support the improvements/refinements posted in this thread. At some point this code should probably be patched to use libosd instead.

To test: insmod pxmpegdecode.o ; ./tivovbi.mips -t -o -x -c1
Building/debugging: make ARCH=mips ; insmod pxmpegdecode.o debug=1 ; ...

The PPC binary is untested.

Edit 2005/02/02: s2vbi and tivovbi development has moved to this thread (http://www.dealdatabase.com/forum/showthread.php?t=41313)

dgi
06-02-2004, 03:51 PM
Correction: in testing, you can't use -t with -o or -x with -c1! But you knew that. I have updated the zipfile to the current sources, and put dah31's ancillary files back in. I have disabled stripping in the makefile for now. Incidentally, my powerpc-TiVo-linux-gcc doesn't like the makefile, so I manually recompiled with /var/tivo/bin/gcc. The mips binary is unchanged because my cross-compile setup isn't working (I use the tivo native compiler). Recompile and repost. TIA

Edit: Here is the current version for mips and ppc. The mips binary is untested, but should work.

dgi
06-02-2004, 04:23 PM
I took a quick skim over bcmosd.c, and the colors[] array leaped out at me. These are not S1-compatible colors! For one thing, red1 should be blue, and red2 should be olive. The different transparent settings should have differing alpha values. The different whites should have differing brightnesses. And what happens when my code tries to use magenta? Probably a segfault. Maybe you can find the S1 palette in tivoapp?

alldeadhomiez
06-02-2004, 05:23 PM
Correction: in testing, you can't use -t with -o or -x with -c1!

Why not?


I took a quick skim over bcmosd.c, and the colors[] array leaped out at me. These are not S1-compatible colors! For one thing, red1 should be blue, and red2 should be olive. The different transparent settings should have differing alpha values. The different whites should have differing brightnesses. And what happens when my code tries to use magenta? Probably a segfault. Maybe you can find the S1 palette in tivoapp?

Doubt it will segfault unless the bounds check is wrong. (is it?)

My S1 is in pieces on the floor so I can't check the palette. When you get it all sorted out, post a diff.

dah31
06-08-2004, 04:12 PM
My S1 is in pieces on the floor so I can't check the palette. When you get it all sorted out, post a diff.

Here's a dump of the TiVo Central and Live TV palettes from my DSR6000 running 3.1.0b . You know the drill---not a ZIP archive and all that.

Herewith the README:

-----
decode-palette-output is based on the CT_OSD_LIVETV_256[] array is
libosd.h from the jpegwriter-1.1 distribution.

results is based on kernel.log, which came from me pressing the TiVo
button from Live TV, and a minute or so later pressing the Live TV
button from TiVo Central with s1-palette-snoop.o insmodded.

decode-palette is the piece of Perl I used to convert the YUV values
the Series1 colour table uses into RGB values for Series2. The colour
table to YUV extraction code comes from build_color_table_entry() in
osd.c from the jpegwriter-1.1 distribution; the YUV->RGB coefficients
are from
<URL:http://groups.google.com/groups?q=yuv+rgb&hl=xx-bork&lr=&ie=UTF-8&selm=327ac7c2.97499726%40news.mv.net&rnum=3>.

tivo-palettes is my reckoning of the Series1 colours, taken last
October (the concert mentioned was on television at the time :-) .
-----

--
dah31

edskee
07-11-2004, 07:18 PM
Is there a way to change the display font using the newtext2osd with the libosd support? I see it uses the freetype library... but how can I change the font? When using elseed with it, the number is ALWAYS chopped off the edge of the screen, I want to use a smaller font...

edskee
07-11-2004, 10:40 PM
Ok, found a bug in elseed.c - There are 2 :'s next to each other in the options reading code in elseed.c, right after the 'F' for picking a font, making choosing a font unusable (always reads it as (null))

Anyway, that being said, using libosd, how do you define the size of the background around the text? Using the default font I have a nice sized box around the text, using Lucida Console (so I can resize it and make it fit my screen) the background is cropped VERY close to the edges of the actual text.

Is there a way to configure that?

dah31
07-12-2004, 01:28 AM
Ok, found a bug in elseed.c - There are 2 :'s next to each other in the options reading code in elseed.c, right after the 'F' for picking a font, making choosing a font unusable (always reads it as (null))


Double colon in a getopt string is supposed to mean the argument is optional. At least one of `-Ffontname', `-F fontname', or `-F=fontname' should work.



Anyway, that being said, using libosd, how do you define the size of the background around the text? Using the default font I have a nice sized box around the text, using Lucida Console (so I can resize it and make it fit my screen) the background is cropped VERY close to the edges of the actual text.

Is there a way to configure that?

After you call SetupTextOSD() and osd_setupaspect(), you can poke at osd->pad.legibility_pad_top and _bottom (which are set to 1 in osd_setupaspect()). (_left and _right are set to the lesser of {half the font's nominal width} and 8.) examples/example1.c is probably the most convenient place to play around with those.

As for the bigger problem of making sure everything fits on the screen, I've implemented a configuration system for libosd. You put something like


safe-title-left 55
safe-title-top 22
safe-title-right 35
safe-title-bottom 25
safe-action-left 50
safe-action-top 13
safe-action-right 26
safe-action-bottom 16

in /etc/osd.conf . You get the numbers by experimentation with examples/safetitle ; safe-title is the largest rectangle that is completely visible, and safe-action is the smallest rectangle that completely surrounds the screen. (Anything rendered into the safe-title area is then guaranteed to be visible, while you can completely cover the screen by covering the safe-action area.)

Now, I had to make some last-minute changes to the code, so this code isn't completely tested yet....

--
dah31

dah31
08-12-2004, 03:10 PM
If you've found that the configuration in /etc/osd.conf doesn't have any effect, it's probably because you're using the built-in bitmap font. The code that renders text with that font doesn't (currently) heed those settings: I'll see about changing that.

Meanwhile, you can use the FreeType option, which does recognise the settings in /etc/osd.conf . (Set the environment variable FONT_PATH to a colon-separated list of directories containing TrueType fonts, and give the -F[fontname] option to elseed.)

--
dah31

Cheezmo
08-12-2004, 03:39 PM
When I do that, the phone number draws a little lower than the name. (With a funny little black "dash" over the first number that would line up with where the top of the name would be. Is one using safe action and the other using safe title for the top or something?


If you've found that the configuration in /etc/osd.conf doesn't have any effect, it's probably because you're using the built-in bitmap font. The code that renders text with that font doesn't (currently) heed those settings: I'll see about changing that.

Meanwhile, you can use the FreeType option, which does recognise the settings in /etc/osd.conf . (Set the environment variable FONT_PATH to a colon-separated list of directories containing TrueType fonts, and give the -F[fontname] option to elseed.)

--
dah31

Juppers
08-16-2004, 12:28 PM
Been playing with this stuff yesterday and today. Works great on my HDVR2 and DSR7000 running 4.x, but doesn't work on my SD-H400 running 5.1.1b. It gives the error "Couldn't find or create shared front buffer" for newtext2osd and yac. Is this particular to this hardware or is it something with 5.x software? Anyone tried it on a Pioneer running 5.2?

dah31
08-17-2004, 02:06 AM
Been playing with this stuff yesterday and today. Works great on my HDVR2 and DSR7000 running 4.x, but doesn't work on my SD-H400 running 5.1.1b. It gives the error "Couldn't find or create shared front buffer" for newtext2osd and yac. Is this particular to this hardware or is it something with 5.x software? Anyone tried it on a Pioneer running 5.2?

It appears something's changed between 4.0 and 5.1.1b, probably either this hardware or the 5.x software. 3-)

It could be something as simple as a different magic number or a new ioctl to call. (I have a possibly related issue on 4.0.1b on my shiny new refurbished TCD240040: I can't seem to create my own surface and have to settle for a shared one. (The easiest way to see this is to look for the `ghost image' in example1 .) That means everything I draw interferes with the menus and so on, and vice versa. (And verce visa.))

I'll have to have a look at osdwriter from 5.x to figure that one out. It might take a while to figure out, though, unless anyone wants to give me a 5.x machine.... ;-)

--
dah31

alldeadhomiez
08-17-2004, 07:31 AM
It could be something as simple as a different magic number or a new ioctl to call. (I have a possibly related issue on 4.0.1b on my shiny new refurbished TCD240040: I can't seem to create my own surface and have to settle for a shared one. (The easiest way to see this is to look for the `ghost image' in example1 .) That means everything I draw interferes with the menus and so on, and vice versa. (And verce visa.))

I ran into the same problem with tivovbi on a SA at 4.0, which I thought was odd because it didn't happen on a DTiVo at 4.0. I was forced to use the DEFAULT_SHAREDSURFACE instead of (DEFAULT_SHAREDSURFACE + 1) for the on-screen captions (VBI_SURFACE) in bcmosd.c.

dgi
08-17-2004, 01:48 PM
I ran into the same problem with tivovbi on a SA at 4.0, which I thought was odd because it didn't happen on a DTiVo at 4.0. I was forced to use the DEFAULT_SHAREDSURFACE instead of (DEFAULT_SHAREDSURFACE + 1) for the on-screen captions (VBI_SURFACE) in bcmosd.c.I am almost ready to post another snapshot release of tivovbi. Quite a few bugs have been fixed in the protocol. I will replace the attachment to post #33. Can you send me a diff of the current bcmosd.c in preparation? TIA

bma
08-21-2004, 06:38 PM
Hi,

Unfortunately elseed doens't include x/y options on which coordinate to display the number, so it was:

a) cutting off the last digit, looks like the calculations are off by one (MAX_CHARX-strlen(cid.nmbr)+1 should probably just be MAX_CHARX-strlen(cid.nmbr))

b) Because I have a Sony widescreen TV, when it is in Wide Zoom mode it cuts the number off even more.

So I moved the x coordinate back by 5 characters (instead of +1, use -4).
I also fixed the makefile so it compiles cleanly against libosd.a and
the usr.local.mips-tivo.tar.bz2 archive found on tivofiles.sf.net. A complete diff and compiled binary are attached. It works on my hacked HDVR2 running 4.0.1-01. It's obviously not a .zip file.

dah31
08-23-2004, 01:52 AM
Hi,

Unfortunately elseed doens't include x/y options on which coordinate to display the number, so it was:

a) cutting off the last digit, looks like the calculations are off by one (MAX_CHARX-strlen(cid.nmbr)+1 should probably just be MAX_CHARX-strlen(cid.nmbr))

Yes. Here's a diff and a current set of (naked) binaries.


b) Because I have a Sony widescreen TV, when it is in Wide Zoom mode it cuts the number off even more.

So I moved the x coordinate back by 5 characters (instead of +1, use -4).


I intend to make both strings' positions configurable in non-FreeType mode (something along the lines of -x0,-0 -y1,1 (the minus sign would indicate counting from the other side of the screen)). For now, I recommend using FreeType mode (-F).


I also fixed the makefile so it compiles cleanly against libosd.a and
the usr.local.mips-tivo.tar.bz2 archive found on tivofiles.sf.net. A complete diff and compiled binary are attached. It works on my hacked HDVR2 running 4.0.1-01. It's obviously not a .zip file.

If you do `make install' in the libosd directory, you should then be able to use `-losd', as for any other installed library.

--
dah31

dah31
08-23-2004, 01:17 PM
When I do that, the phone number draws a little lower than the name. (With a funny little black "dash" over the first number that would line up with where the top of the name would be. Is one using safe action and the other using safe title for the top or something?

This turned out to be a bug in libosd's FreeType code: I had the sign of the size of the bounding box below the baseline wrong. Or something.

The ``dash'' was incongruous padding code in drawstring_direct.c:ft_draw_string_by_pixels().

Herewith libosd 0.4.1 . (See the previous message for a current elseed .)

--
dah31

dgi
08-24-2004, 06:22 AM
I have now posted a snapshot of the current tivovbi for both S1 and S2 in post #33. Please test, and provide a diff for 4.0/DTivo compatibility. TIA

jlc
09-26-2004, 10:12 AM
Hi,

I have a Caller ID project at http://ncid.sourceforge.net that usually runs the server on Linux, but includes a client for a Series1 TiVo. The client uses out2osd to display output using the original osd routines. Libosd is a great replacement and it is now used in out2osd. The complete Called ID package should now run on a Series2.

Attached is a patch for libosd-0.4.1 so it will compile using the cross compilers at http://tivoutils.sourceforge.net. The changes remove the variable declarations in the for loops since the ppc cross compiler does not support gnu99. The makefile changes allow SERIES to also be defined as x1 and x2 to set up the environment for the above cross compilers.

Vegas
10-04-2004, 10:12 PM
I have been working with newtext2osd from post #22 in this thread.
When ever I display text or a file using -e (don't clear the display) the display clears after a fraction of a second. Trying to get this to work with tcs but can't get the display to stay up.

If I use -s 10 it will stay for 10 seconds. Is -e working for anyone?
Tivo is Dtivo hdvr2

Thanks

Vegas

grossman
10-17-2004, 07:07 PM
I solved the problem of text imm being cleared this morning...
I noticed that after a reboot text from "text2osd" and elseed stay on the
screen but when I tried just 10 min later it didn't. I then realized I enabled
the clock in the bottom right via SPS9S. So, I did another SPS9S (which
disables the clock) and low and behold...text now stays on the screen
for the full time specified in the -s option.

PS I also wrote my own tivoweb+ module that takes text typed in a text
box (in a form) and displays via running app newtext2osd.

Hope this helps everyone.

PS I'm not a developer so I realy shouldn't be posting here BUT I thought
it would help enough people.

deadhead
10-22-2004, 01:10 PM
I am seeing the same thing cheezemo reports.

Tried the "naked binary" above (the one incorrectly named *bz2.zip)

It runs... but when a call comes in I see no display on the screen yet it does contact my YAC clients and reports to the screen that the call was logged... (something I used to see in the elseed.log file).

LIke this
bash-2.02# Modem: RING
--Call Logged--
Date: 1022
Time: 1153
Name: SOME CALLER
Number: (XXX)XXX-XXXX


Then it dumps with a "Bus error"

For now I am back to the "misjustified and number a little lower" version


Hi,

I have a Caller ID project at http://ncid.sourceforge.net that usually runs the server on Linux, but includes a client for a Series1 TiVo. The client uses out2osd to display output using the original osd routines. Libosd is a great replacement and it is now used in out2osd. The complete Called ID package should now run on a Series2.

Attached is a patch for libosd-0.4.1 so it will compile using the cross compilers at http://tivoutils.sourceforge.net. The changes remove the variable declarations in the for loops since the ppc cross compiler does not support gnu99. The makefile changes allow SERIES to also be defined as x1 and x2 to set up the environment for the above cross compilers.

JohnSorTivo
11-01-2004, 03:59 PM
For those of you using OSD, coupled with the YAC server running on a Windows machine, you might be interested in this little utility (http://www.dealdatabase.com/forum/showthread.php?t=38975) that I wrote, which monitors changes to the yac-log.txt file, and sends an email notification and/or text message to your cell phone with the applicable caller ID data, enabling you to know when you have received a call, and who it was from, while away from home.

John

dah31
01-01-2005, 12:13 AM
Happy new year, all!



[...]
Attached is a patch for libosd-0.4.1 so it will compile using the cross compilers at http://tivoutils.sourceforge.net. The changes remove the variable declarations in the for loops since the ppc cross compiler does not support gnu99.

It does if you build a fresh compiler. ;-) It took some fiddling, but I built some slightly more recent cross compilers back in May (according to the files' timestamps) with Dan Kegel's crosstool (http://www.kegel.com/crosstool/) script package.

Google and Google Groups (né Deja News) (http://www.dejanews.com/) are your friends when you get errors.

To wit:

dah31@kinkle:~$ /usr/local/ppc-tivo/powerpc-403-linux-gnu/bin/gcc --version
gcc (GCC) 3.4.0
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


To woo:

dah31@kinkle:~$ /usr/local/mips-tivo-3.2/mips-unknown-linux-gnu/bin/gcc --version
gcc (GCC) 3.2.3
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


(I believe I had some problems with gcc 3.3 on Mips, hence 3.2.)

Figuring out what to do about gcc 3.x requiring a version of glibc that doesn't work on S1 TiVos is an exercise for the reader. :-)

--
dah31

Msan
10-04-2005, 02:35 PM
I was just wondering if anyone is working on getting out2osd to work under 7.2 yet? When running out2osd under 7.2 it gives the following message:
"Couldn't find or create shared front buffer"

shutterfriend
10-27-2005, 07:42 PM
Haven't heard anything in a while so I played around a bit more. The
text2osd in the /tvbin directory works but it's hard to clear it afterwards and sometimes messes up the menus for a few minutes.

Smee
11-02-2005, 02:11 AM
On another note, it isn't quite clear here and I had a devil of a time figuring this out, but if your using the YAC binary found in this thread along with the FreeType libraries, you can use a true type font just like you can with elseed by setting FONT_PATH in your RC.INIT.AUTHOR and then using the -Ffontname.ttf and -s size switches with YAC. The switches are not mentioned in the YAC archive found here, at least not that I saw, but are documented with elseed. You will not see it documented if you do a --help on YAC either. Figured I would give it a whirl and it worked for me.

yac -f 0xffffff00 -b 0xff000000 -Fyac.ttf -s 28 &

Smee

shutterfriend
11-02-2005, 10:41 PM
Smee,

What version of TiVo are you running?

Thanks.

Smee
11-20-2005, 03:30 AM
Smee,

What version of TiVo are you running?

Thanks.

I am using a DTivo with 4.x.

Smee

EvilJack
02-16-2006, 10:27 AM
Does anyone have a suggestion / solution for running some sort of
OSD server / Listener so that you could have an external machine send
a message to your tivo and have it display it using an OSD type
program?

I haven't decided if I want my Tivo to run a caller id program like
ncidd ( my tivo isn't connected to the phone line right now... I
don't really want it dialing out ) or if I want to run the caller id
software somewhere else and just notify tivo when a call comes
in.

Besides the New Call: message that I might want to send tivo,
I can see other usefull messages that I might want to receive...
new mail, transfer complete, UPS is going down, etc. I can call
out2osd directly and pop up a message on the screen, but how
could I do that from a remote application and have tivo listen
for it and run out2osd as needed?

I know I can write a program to listen for an incoming
message on a port and fire off a program that will display
the results, but I'd prefer to find something that is alreay
in place that I might use.

jack

Narf54321
02-16-2006, 06:28 PM
I used ncidd from my main tivo connected to the phoneline and my other tivos running tivoncid to receive the caller-ID messages. Whatever television in the house, I can see the incoming call info. Plus, I don't need to dedicate a PC and modem as the CID server. I have standalone units with network dongles, so the modems aren't being used anyway (except for the main unit as the CID server -- It doesn't dial out, as it uses the 'Net to pull guide info).

I'm assuming you have a DirecTivo and are hesitant to hook up the line. I've read messages about rigging up a telephone terminal box with a capacitor so that incoming signals are received but it can't dial out.

As for listening, the tivoncid client has the limitation of listening only to a specific IP address (the notifying server). But with the source available, you might be able to come up with a generic message listening client.

eastwind
02-16-2006, 08:31 PM
Might also want to send a different message. Like "Have you finished your homework yet?" or "Who was at the door?" if you're in a different room or maybe the basement. :)

ew

jlc
02-19-2006, 07:37 PM
Jack,

The ncid client will display a line that begins with "MSG: ". Keep the message short and it should display OK. All you need is a server to send the line. You could probably use netcat. A NCID TODO is to add the message feature you want, by having the server listen on a second port for message to send to its clients.

EvilJack
02-20-2006, 10:15 AM
Jack,

The ncid client will display a line that begins with "MSG: ". Keep the message short and it should display OK. All you need is a server to send the line. You could probably use netcat. A NCID TODO is to add the message feature you want, by having the server listen on a second port for message to send to its clients.

How would that work exactly.... does the tivocid 'client' start up a listener
and wait for a connect or does it connect to a 'server' and wait for the
server to send it data?

If the tivocid client starts up a listener and waits for a connection... then
I can see how you'd connect and send it a MSG: some message txt....
what is the default port for the client to... and what's the purpose of
the remote ip address when you start the client?

If it connects to a ncidd server... then I'd have to run the ncidd server
on one machine... start up tivocid and point at that server.... then... how
woud I have the Server send the MSG: some message txt message?

jack

mrpenguin
02-20-2006, 11:51 AM
I just use the displaytext module with twp. works just fine. I know it took a bit of trial and error to get it to work right away on my toshiba sd-h400, but that and elseed work fine on the tivo.

EvilJack
02-20-2006, 12:01 PM
I just use the displaytext module with twp. works just fine. I know it took a bit of trial and error to get it to work right away on my toshiba sd-h400, but that and elseed work fine on the tivo.

I'm not familar with the tpw's 'displaytxt module'... do you have to manually
acccess the twp screen from a web browser and send the text message or
can you access it remotely via a script? I'm looking to have one computer
run some sort of application ( mail server for instance ) and when some
event happens, it is able to send a message to the tivo and have the tivo
use an OSD to display a message... like 'you've got mail!'. I want the
tivo to 'listen' for the messages and have the remote machine be able to
send them from a script / application. Do you know if you can do something
like that with twp's 'displaytext module'?


Thanks - jack

mrpenguin
02-24-2006, 04:52 PM
yeah, that you would have to use web interface, but if you look at the code for displaytext, all it does is execute a command on the tivo, so you can use that to make a cron job to run at certain times, or maybe set up something to use it in a web page parameter format so you can type a command & send it to twp instead of twp creating via the interface.

jlc
03-09-2006, 12:26 AM
Originally Posted by Eviljack

How would that work exactly.... does the tivocid 'client' start up a listener
and wait for a connect or does it connect to a 'server' and wait for the
server to send it data?

If the tivocid client starts up a listener and waits for a connection... then
I can see how you'd connect and send it a MSG: some message txt....
what is the default port for the client to... and what's the purpose of
the remote ip address when you start the client?

If it connects to a ncidd server... then I'd have to run the ncidd server
on one machine... start up tivocid and point at that server.... then... how
woud I have the Server send the MSG: some message txt message?


The ncidd server starts up a listner and waits for connections from its clients. If you want to use TiVoCID to display messages, you need to replace the server. You can use netcat as the server. Included with the source to NCID is a test directory that contains a simple shell script that uses netcat to become a test server for TiVoCID. I believe netcat is also available for Windows. It is probably best to use a different port than the NCID server. It uses port 3333.

jlc
04-15-2006, 09:08 PM
NCID 0.63 was released. It now supports messages. Any client can send a message to all connected clients. You can also use netcat to send a message, as an example, here is a 10 minute food timer:


sleep 600; echo "Check food ready" | nc localhost 3333

jlc
04-26-2006, 10:42 PM
Has anyone looked into patching libosd so that it will work with 7.2? If not, is there something else that could be used in its place?

hpb
06-02-2006, 07:35 PM
The ZIP files attached in this thread for YAC S2 appear to be corrupted. Neither Winzip or Winrar can open them.

Would someone reply and reattach a working ZIP.

Thanks

cheer
06-02-2006, 08:29 PM
The ZIP files attached in this thread for YAC S2 appear to be corrupted. Neither Winzip or Winrar can open them.

Would someone reply and reattach a working ZIP.

Thanks
Works fine for me -- just tried it. I used Winace. Note that if I try to open the file directly it doesn't work, but if I download the file to my PC and then use winace, it spits out a .bz2 file. If I then extract that with winace, I get all the files just fine.

hpb
06-03-2006, 09:15 AM
I finally got the file open.

WinAce didn't work either. I opened the file with a text editor and looked at the header and it's not a ZIP file. It is really a BZH file. So I renamed the file from yac-0.15-tivo-s2.tar.bz2.zip to yac-0.15-tivo-s2.tar.bzh and WinAce opened it just fine.

Very strange.

Edit --

I should have read the Line right above the attached files.


Please note that the attached files are not ZIP archives

Jamie
07-03-2006, 10:47 PM
Has anyone looked into patching libosd so that it will work with 7.2? If not, is there something else that could be used in its place?I posted a libosd patch over here (http://www.dealdatabase.com/forum/showthread.php?p=259207#post259207).

Throg
07-04-2006, 09:35 AM
I posted a libosd patch over here (http://www.dealdatabase.com/forum/showthread.php?p=259207#post259207).
I haven't used OSD stuff since 4.0.1b came out. 2 questions ..

1. What are we doing with OSD on S2s?
2. What libosd file is this patch designed for?

Jamie
07-04-2006, 10:01 AM
1. What are we doing with OSD on S2s?Caller-id, VBI data. Anytime you want to draw something on screen.

2. What libosd file is this patch designed for?libosd-0.4.1 (http://www.dealdatabase.com/forum/showthread.php?p=180776#post180776).

Morden
07-04-2006, 07:34 PM
Ok, hope someone is willing to help me out.

I am trying to compile a YAC that can work on 7.2.2 using Jamie's patched libosd and am not having a lot of luck.

I am somewhat familiar with Linux, but have never done any compiling of apps on it before. I set up a cross compiler in Cygwin, and compiled a small "hello world" application to verify it is working.

Once that was done, I tried getting the system set up to compile YAC, libosd, and out2osd without a lot of success as to be honest, I have no idea what I'm doing.

Anyone willing to give me some tips?

thx
Morden.

Jamie
07-04-2006, 08:28 PM
Anyone willing to give me some tips?I use the toolchain built from the scripts here (http://www.dealdatabase.com/forum/showthread.php?t=46361). It worked for me for both libosd and out2osd. I haven't tried YAC. The toolchain build script builds gcc 3.3.4 and, IIRC, gcc 3.3.4 likes libosd better than gcc 3.0 did. Last time I checked, that toochain build worked well on both linux (Fedora Core) and cygwin.

Morden
07-04-2006, 08:45 PM
OK, thanks!

I got newtext2osd and YAC to compile, but still have some issues:

1. When the text gets displayed on the screen, the text and all tivo UI elements (guide, infobar, etc) become ghosted. This remains for a couple of minutes then fixes itself.

2. If text is displayed while the tivo menus are opened, the menu items vanish. While the text is displayed the tivo does not respond to the remote, but once the text is gone up/down make the menu items reappear.

3. After displaying text (while stuff is still ghosted), it seems like the tivo menus transition differently. It almost looks like the the menu is already there, then tries to slide in from the right. Before displaying text the menu smoothly slides in from the right.

As a side note, to get libosd to compile I commented out "#include <png.h>" from setupBrcmDisplay.c. I didn't have the header and it seems to compile fine without it.

Anyone know if this stuff is expected on 7.2.2b-oth or might I have done something wrong?

Morden.

EDIT - Just noticed that sometimes when the tivo menu vanishes and the text is still displayed I can move around on the menu with up/down. Other times it seems like I cant.

EDIT2 - Updated with additional observations and to correct some things I was just plain wrong about.

Morden
07-05-2006, 01:26 PM
Sorry to double post but it seems libosd works a bit differently on 7.2.2.

In setupBrcmDisplay() got_own_surface gets set to 1, but the surface is shifted 6 pixels to the left (similar to the observations earlier in the thread).

As a quick test, I changed the line bSurfacePosition(osd->surf, horiz_offset, vert_offset) to bSurfacePosition(osd->surf, horiz_offset + 6, vert_offset) and this made the text and UI elements display properly (they are no longer ghosted).

This change made the issues in the menu significantly worse though. First off the text displayed by YAC and newtext2osd is now ghosted 6 pixels the OTHER way. In addition the menu text still vanishes, and when it comes back, it is now ghosted as well! Switching to live TV and back seems to clear this up.

I don't really understand the code, but it seems that the surface libosd is writing to in 7.2.2 is a shared surface (even if got_own_surface says it is not) causing display issues for the tivo UI. It also seems that the shared surface it's using needs to be shifted 6 pixels on "Live TV" but not when in Tivo Central or Now Playing.

EDIT - Some other info:
bSurfaceCreate fails with return value 3 so shared surface 1 is used. Because of this got_own_surface is set to 1. Since this is a shared surface, shouldn't this be 0?

Jamie
07-05-2006, 03:11 PM
Sorry to double post but it seems libosd works a bit differently on 7.2.2.
I purposely disabled the 6 pixel horizontal offset if the shared surface that we get is 1. I did this because otherwise I get the ghosted tivo menus. It's disabled by setting got_own_surface to 1 -- admittedly, the variable name is no longer descriptive. I tested on 7.3 and 7.2.2b on 240 and 264 hardware and things were definitely much better for me without the 6 pixel shift.

You might look at AllDeadHomiez tivovbi (http://www.dealdatabase.com/forum/showthread.php?t=41313&highlight=tivovbi)work (bcmosd.c, in particular) and see how he worked around the problem. This (http://www.dealdatabase.com/forum/showthread.php?p=161062#post161062) post might also be instructive.

Morden
07-05-2006, 04:18 PM
Tivovbi has the exact same problems with the ghosted text when using translucent captions. You have to tell it to use tranlucent captions as it uses opaque by default.

The problem is not nearly as bad when using opaque text. With opaque text the UI elements still get doubled up, but fix themselves once the text goes away. The Tivo menus still vanish, but do not get ghosted. Since the text is opaque, you can't see the ghost image that I assume is still hidden behind it.

I guess for the time being I will just set YAC up to display using opaque captions and deal with the doubled up UI.

I just think it's strange that using the same surface behaves differently between "Live TV" (ghosted) and "Tivo Central" (not ghosted).

Anyway, hope this can be figured out, but at this point I don't have the knowledge to do so.

Morden.

Jamie
07-05-2006, 04:42 PM
I'll play around with it to see if I can figure anything out. I'm new to osd too, so no guarantees.

Morden
07-11-2006, 02:52 PM
Ok, I have some more information:

First, Tivovbi does display correctly, even with transparent text. The doubling of it's output I was seeing was due to me running elseed at the same time and it was elseed causing the issue. Tivovbi by itself is fine. I am currently looking at tivovbi to see if I can track down what is different. Perhaps ADH can give us a hint?

Now, as to what I have discovered so far:
most applications use something similar to the following to display and clear text:

//Draw the text
DrawOSD();

//Clear the OSD buffer and redraw the screen
ClearOSD();
DrawOSD();

Or worse yet:

//Draw the text and redraw periodically
for (loop for some amount of time)
{
DrawOSD();
Sleep(1000);
}

//Clear the OSD buffer and redraw the screen
ClearOSD();
DrawOSD();

The ghosted text and/or tivo UI is caused by the second call to DrawOSD(). Prior to the second call the UI is fine. Once DrawOSD() is called again the UI is doubled, and you must go to "Tivo Central" and back to fix it.

In the case where the app is looping and redrawing the buffer, the text and Tivo UI become ghosted as soon as the second call is made.

Commenting out the second DrawOSD call makes the issue go away. I assume that just writing to the shared surface is enough, there is no need to call DrawOSD a second time to clear the display. Also, the text is persistant until removed by calling ClearOSD().

The strangest part is that if the second call to DrawOSD() is removed, this solves the problem, even if after a little while more text needs to be displayed (say another phone call comes in for elseed). In this case you are calling DrawOSD a second time, but it's not causing the ghost issue. I have no idea why!

Other things I noticed is that the text dlisplayed by the first and subsequent calls to DrawOSD() are slightly different, even though nothing should have changed. For the first time, you will see the text you displayed, and the first "character" (it's padding, or whitespace) is fully transparent, instead of translucent, with two translucent horizontal lines at the top and bottom of the whitespace. On the second draw, that whitespace is completely translucent as it should be. Also, though for some reason the text appears to be ghosted and off by several pixels, the area on the screen where the text is drawn appears to be identical. I tested this by marking the start and stop positions for a block of text displayed both ways and the "ghosted" text is no longer, though I would have expected it extend an additional 6 pixels beyond the end of the unghosted text.

Anyway, thats what I got for ya right now!

Oh and a question, setting the ZOrder... Is that just for your app, or does it set the ZOrder for the whole surface?

Morden.

jlc
07-12-2006, 09:34 AM
Now, as to what I have discovered so far:
most applications use something similar to the following to display and clear text:

//Draw the text
DrawOSD();

//Clear the OSD buffer and redraw the screen
ClearOSD();
DrawOSD();

Or worse yet:

//Draw the text and redraw periodically
for (loop for some amount of time)
{
DrawOSD();
Sleep(1000);
}

//Clear the OSD buffer and redraw the screen
ClearOSD();
DrawOSD();

Commenting out the second DrawOSD call makes the issue go away. I assume that just writing to the shared surface is enough, there is no need to call DrawOSD a second time to clear the display. Also, the text is persistant until removed by calling ClearOSD().



The text display applications that use the above code were developed on a series 1 TiVo using the original osd routines from tivovbi-1.03. If I remember correctly, I think the redraw text was needed to keep it displayed over menus. When the series 2 came out and libosd was developed, the applications just replaced the osd code and added the additional calls needed. Since the applications worked with the new library, the structure did not change. It was bad to assume what was needed for the series 1 was also needed for the series 2, even if it did function.

Great work finding these problems problems in the code. I am making changes to out2osd to eliminate the additional DrawOSD calls if it is not a series 1.

Morden
07-17-2006, 01:33 PM
I have tracked down the source of the mysterious black lines on the leading edge of the first character of a string.

The code in the OSD lib checks if the text needs a legibility pad by looking to see if the area just before the text is 0 (I assume on S1 this would be unused and transparent. On the first draw in S2, this area is NOT 0 (I have not yet checked to see what it is) and on subsequent draws it is.

Because of this, the left legibility padding was being skipped on the first draw. To work around this I added a param to DrawChar to force the left padding, and updated DrawString to set the param to TRUE if it is drawing the first character of the string. This is kinda a kludge, but seems to work.

I am now looking into adding a function to clear only portions of the screen using the line number or a rectangle. This is needed because once done displaying all the programs call ClearOSD, causing all OSD elements on the screen to be cleared. This is why the Tivo Central and/or guide gets cleared when an app is done displaying it's text even if they were not overwritten by the text.

I am also trying to find a way to make the text persistant like it is with S1, where if something like the guide overwrites it, it will get redrawn.

Once I have made some headway I will post patches to the library and probably Elseed for these changes.

Morden.

RYSmith315
08-07-2006, 12:50 AM
I started adding some extra "drawing" type commands to libosd and realized that there doesn't seem to be a good single place to get the latest updated code.

Any chance someone who knows where all the bits and pieces are hidden could start a sourcefourge page?

--------
One a side note, the app I've been working on parses the log file from NCID and displays it in a box w/beveled edges and TrueType fonts on the screen. The caller id display is activated by hitting the "window" key on your remote (routerplus needed for this to work). I'm working on the ability to scroll up/down the list, as only 20 lines are displayed at a time.

---------

After writing this app I can see a clear need to clean up libosd's interfaces and some standard drawing functions. Using libosd and routerplus together the sky is the limit on what we can do. Remember the old Tivo Control Station (TCS)? No reason not to revive all that functionality to enhance the features available. I know I would like to be able to pull up a current weather map for my area or a stock ticker on demand.

jonheese
11-13-2006, 03:08 PM
Not sure if this is the right place to post this, but I didn't see a "TivoVBI Support" thread, so this seems to be the closest thing to it...

I'm having some sporadic trouble with TivoVBI on one of my three DSR704's (running 6.2). The other two (virtually identical) units have had no problems with TivoVBI, but the third one has been randomly locking up when the captions are turned on or off.

When this happens, whatever was playing continues to play, but it's usually accompanied by a killer annoying high-pitched squeal and the unit becomes dead to the world (remote, front buttons are useless) until the power is pulled and the unit is restarted. Once it comes back up, everything is fine, but it's making me gun-shy to use the closed-captioning on that unit due to the ordeal involved if it decides to hang. This happens maybe once for every three or four times I "provoke" it. Sometimes it will hang right as I'm turning the CC on or off (using the "clear-clear-clear" remote method), and sometimes it will just hang on its own, but it's always when the TivoVBI stuff is turned on.

I looked at the logs last time it happened and found this:


00:53:43 (none) kernel: Illegal write at 2b6f4000
Nov 10 00:53:43 (none) kernel: do_page_fault #2: sending signal 11 to tivovbi(333)
Nov 10 00:53:43 (none) kernel: $0 : 00000000 10003454 00409528 000001e4 00000000 10003454 2b6f4000 000b8efc
Nov 10 00:53:43 (none) kernel: $8 : 2ace8180 00409344 ff000000 00000001 80151b78 0000333f 0000199f 80184020
Nov 10 00:53:43 (none) kernel: $16: 10003454 00000040 00000054 0000004f 00000000 00004f54 c01b1b04 00000001
Nov 10 00:53:43 (none) kernel: $24: ba2e8ba3 00407b00 1000b600 7fff7900 ffffffff 004028d0
Nov 10 00:53:43 (none) kernel: Hi : 00001620
Nov 10 00:53:43 (none) kernel: Lo : 97031b50
Nov 10 00:53:43 (none) kernel: epc : 00407b5c Not tainted
Nov 10 00:53:43 (none) kernel: Status: 8001fc13
Nov 10 00:53:43 (none) kernel: Cause : 0000000c
Nov 10 00:53:43 (none) kernel: 8001e9fc 8001eac0 80022bb4 80022d74 80024f3c 00407b5c
Nov 10 00:53:43 (none) kernel: 00407b5c 004028d0 00403284 0040593c 004065b4 (Bad trace)

Also, I can telnet to the box while it is "hung", but I haven't figured out anything productive from that yet.

Any ideas?

Regards,
Jon Heese

arob
12-07-2006, 12:28 PM
I have tracked down the source of the mysterious black lines on the leading edge of the first character of a string.

The code in the OSD lib checks if the text needs a legibility pad by looking to see if the area just before the text is 0 (I assume on S1 this would be unused and transparent. On the first draw in S2, this area is NOT 0 (I have not yet checked to see what it is) and on subsequent draws it is.

Because of this, the left legibility padding was being skipped on the first draw. To work around this I added a param to DrawChar to force the left padding, and updated DrawString to set the param to TRUE if it is drawing the first character of the string. This is kinda a kludge, but seems to work.

I am now looking into adding a function to clear only portions of the screen using the line number or a rectangle. This is needed because once done displaying all the programs call ClearOSD, causing all OSD elements on the screen to be cleared. This is why the Tivo Central and/or guide gets cleared when an app is done displaying it's text even if they were not overwritten by the text.

I am also trying to find a way to make the text persistant like it is with S1, where if something like the guide overwrites it, it will get redrawn.

Once I have made some headway I will post patches to the library and probably Elseed for these changes.

Morden.

Morden,

Did you ever have any luck with this? I've been trying to get YAC working on 7.2.2 and having the same problems you've described..

jkozee
12-21-2006, 12:44 PM
Has anyone had any luck with any OSD apps running 7.2.2 on a Series2.5. I've been trying to get libosd running, but it I get a Segmentation Fault whenever I touch the buffer. ADH's updated tivovbi is supposed to run on a S2.5, but I've had no joy with it either (on 7.2.2b OS at least).

jkozee
12-23-2006, 01:04 PM
I've had a chance to play with ADH's tivovbi fork, and have made some progress. To be honest I'm not sure I understand half of whats going on in this code (I'm just a noob hacker), but I'm not afraid to make changes, recompile, and see what happens.

After looking at an strace of osdwriter and of tivovbi, I notice the following:

osdwriter:
old_mmap(NULL, 1384448, PROT_READ|PROT_WRITE, MAP_SHARED, 10, 0x1bc4000) = 0x2ac9c000

tivovbi:
old_mmap(NULL, 1382400, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0x1bc4800) = -1 EINVAL (Invalid argument)

So, I'm assuming that the buffer is not being mapped correctly or is misaligned. Looking at the source, ADH uses and offset for S2, but not for S2.5. I haven't figure out how ADH determined the offset value yet, but being fearless, I changed:
surf->bufptr = mmap(NULL, surf->xbytes * surf->ysize, PROT_READ | PROT_WRITE, MAP_SHARED, bcmfd, (int)surf->bufptr);
To:
surf->bufptr = mmap(NULL, surf->xbytes * surf->ysize, PROT_READ | PROT_WRITE, MAP_SHARED, bcmfd, (int)surf->bufptr - 0x800);

This has fixed the segmentation fault error and the sample is now running. It is not correct, because when I write to the screen it the text starts about 1/3 the way over and wraps back to the left and I cannot write all the way to the bottom. It is worth noting that using text2osd and osdwriter on my s2.5 corrupts other screen objects. After I run either command I must go into TivoCentral twice to fix the screen. Using tivovbi, I do not see the same ghosting effects, so this code is the way to go!

Once the tivovbi has been fixed, it doesn't look like it will be too difficult to apply the updates to libosd, so we should be able to get most of the tools running on all platforms.

So, if anyone that understands this stuff better than me gets some time to look over this and offer some education, I will give it a try on my development unit and maybe we can get this stuff ported to the S2.5.

Thanks everyone for this great site and Happy Holidays.

PortlandPaw
01-12-2008, 06:15 PM
This thread, though old, may still be of interest to people trying to get caller ID on their TVs. It is to me, anyway.

I have two questions:

1) Has there been any progress in getting YAC to work on a Series 2 beyond what is reported in this thread and

2) This is a very complex and convoluted thread. Could someone explain just what files go where and what commands, exports, paths, etc. need to be set to make YAC work as described?

As always, in advance, I appreciate your help.

djl
01-12-2008, 09:06 PM
Hi David -
There's a stable version of elseed at http://www.bah.org/tivo/
and of yac at http://sunflowerhead.com/software/yac/.
I believe that the only requirement for either is that you have libfreetype.so.6 in /lib.
For OSD, there's text2osd (which should already be in /tvbin), newtext2osd (http://www.dealdatabase.com/forum/showpost.php?p=248188&postcount=19) and out2osd, which comes with ncid. I've been researching these as I finish up a replacement for "Displaytext" for TWP. I'm also hoping to bring together all of the elseed patches into one superpatched version.


This thread, though old, may still be of interest to people trying to get caller ID on their TVs. It is to me, anyway.

I have two questions:

1) Has there been any progress in getting YAC to work on a Series 2 beyond what is reported in this thread and

2) This is a very complex and convoluted thread. Could someone explain just what files go where and what commands, exports, paths, etc. need to be set to make YAC work as described?

As always, in advance, I appreciate your help.

PortlandPaw
01-13-2008, 09:37 AM
Thanks, dj, that gets me closer. But (despite information to the contrary on the sunflowerhead website) I believe this YAC version is ppc only; it throws the cannot execute binary file error.

So I went back to the YAC here (http://www.dealdatabase.com/forum/showpost.php?p=164461&postcount=22) and it loads OK, but returns a Segmentation fault error when it's called by an incoming phone call.

Any suggestions gladly accepted!

djl
01-13-2008, 11:09 AM
Oddly enough, I think I'm using the version in the earlier post (http://www.dealdatabase.com/forum/showpost.php?p=161697&postcount=5). Make sure you have LD_LIBRARY_PATH set. What are you using as your CID server? I have elseed on one Tivo broadcasting to my other Tivo, which uses the YAC listener to output to screen. Works well.



Thanks, dj, that gets me closer. But (despite information to the contrary on the sunflowerhead website) I believe this YAC version is ppc only; it throws the cannot execute binary file error.

So I went back to the YAC here (http://www.dealdatabase.com/forum/showpost.php?p=164461&postcount=22) and it loads OK, but returns a Segmentation fault error when it's called by an incoming phone call.

Any suggestions gladly accepted!

PortlandPaw
01-14-2008, 09:25 AM
I gave up and went to tivocid (http://ncid.sourceforge.net/tivocid/tivocid.html) instead. Works fine, but I do have to have a phone line connected, which shouldn't be a problem given the workarounds to avoid updates.

Interestingly, the package includes yac2ncid which should pick up the YAC messages coming in over the network from my computer, but I couldn't get it to work. It requires nc (netcat) which I got from AlphaWolf, but still no go.

If anybody has gotten yac2ncid to work, I'm curious how to make it happen.

Hichhiker
01-14-2008, 01:47 PM
Interestingly, the package includes yac2ncid which should pick up the YAC messages coming in over the network from my computer, but I couldn't get it to work. It requires nc (netcat) which I got from AlphaWolf, but still no go.

If anybody has gotten yac2ncid to work, I'm curious how to make it happen.

Any particular error or problem you are getting with yac2ncid?

It does work on my S2 Dtivo and was reported to work elsewhere. Remember that YAC (unlike NCID) uses a "server push" model, so you need to configure your YAC server with IP of the box where yac2ncid is running

-HH

PortlandPaw
01-14-2008, 05:27 PM
I'm getting a "file not found" error on load. The YAC server on my computer has the target S2 Dtivo IP among the listeners, but I don't think it's being received properly. What files beside nc and ncid are needed?

Hichhiker
01-14-2008, 08:03 PM
Is the DTivo in question "zippered" or manually set up?

Can you post here or PM me:

* Where you start yac2ncid from
* Contents of the config file
* and exact cut-and-paste of the output

"file not found" seems to indicate to me that something is not configured right, something is in the wrong dir, or something like that - i.e. should be easily fixable.

-HH

PortlandPaw
01-15-2008, 10:19 PM
It is a zippered drive -- not my preference, but I figured I'd better understand how most of the non-HD DTivos are set up these days.

I played around with the config files and AlphaWolf's busybox/nc until all loaded without error. Then when I tested it, the screen displayed " Poll device hung up" and the time. Debug output follows. Of concern is the "no config file," as there is one in the location specified. The alias file is a part of the zipper distribution, symlinked.


[Living Room S2]...[/]-# /var/DRH/hack/bin/ncid --program /var/DRH/hack/share/ncid/ncid-yac &
[1] 464
[Living Room S2]...[/]-# /var/DRH/hack/sbin/yac2ncid &
[2] 469
[Living Room S2]...[/]-# /var/DRH/hack/sbin/ncidd -D -C /var/DRH/hack/etc/ncidd.conf
Started: 01/16/2008 02:02
Server: ncidd 0.69
No config file: /var/DRH/hack/etc/ncidd.conf
Processed alias file: /var/hack/etc/ncid/ncidd.alias
Verbose level: 1
Modem initialized.
Modem set for CallerID.
Network Port: 3333
Wrote pid 488 in pidfile: /var/run/ncidd.pid
localhost: forward host lookup failed:
Fatal: Poll device hung up
Removed pidfile: /var/run/ncidd.pid
Terminated: 01/16/2008 02:02
[Living Room S2]...[/]-# localhost: forward host lookup failed:

I'm not too worried about this, as I have the non-YAC ncid working, but it is a puzzlement and maybe others are trying to get this to work.

Hichhiker
01-15-2008, 10:50 PM
It is a zippered drive -- not my preference, but I figured I'd better understand how most of the non-HD DTivos are set up these days.

Well, as far as I know "zipper" installs busybox that has nc, so you should not need to add anything. But it sounds like it is no longer an issue anyway




I played around with the config files and AlphaWolf's busybox/nc until all loaded without error. Then when I tested it, the screen displayed " Poll device hung up" and the time. Debug output follows. Of concern is the "no config file," as there is one in the location specified. The alias file is a part of the zipper distribution, symlinked.


From output you posted it seems like you are not having problem with yac2ncid but with ncidd server itself. But you are saying that ncid server works, which confuses me a bit.

As far as conf file, I would try moving the config file to "/var/hack/etc/ncid/" as I seem to recall that ncid is unfortunately partial to paths hardcoded at build time :-(

Once you get ncidd running, make sure yac2ncid.conf is configured correctly. Then kill yac2ncid if it is running and try starting it with "-v" flag.

When you send a test message from you should see something like:



Tivo# ./yac2ncid -v
yac2ncid: Enabling verbose mode due to command line option
yac2ncid: Auto-detecting the netcat type
yac2ncid: Detected BusyBox version of netcat
yac2ncid: Using BusyBox settings...
yac2ncid: Listening for new connections
yac2ncid: Got a message


See if you get a "Got a message" line once you send something from yac server - that means yac message was delivered to yac2ncid and also see if you get any errors after that that indicate what is not working - you can use Ctrl-C to abort yac2ncid after testing and run it normally after you are done

-HH

jlc
01-16-2008, 12:44 AM
It is a zippered drive -- not my preference, but I figured I'd better understand how most of the non-HD DTivos are set up these days.

I played around with the config files and AlphaWolf's busybox/nc until all loaded without error. Then when I tested it, the screen displayed " Poll device hung up" and the time. Debug output follows. Of concern is the "no config file," as there is one in the location specified. The alias file is a part of the zipper distribution, symlinked.


[Living Room S2]...[/]-# /var/DRH/hack/bin/ncid --program /var/DRH/hack/share/ncid/ncid-yac &
[1] 464
[Living Room S2]...[/]-# /var/DRH/hack/sbin/yac2ncid &
[2] 469
[Living Room S2]...[/]-# /var/DRH/hack/sbin/ncidd -D -C /var/DRH/hack/etc/ncidd.conf
Started: 01/16/2008 02:02
Server: ncidd 0.69
No config file: /var/DRH/hack/etc/ncidd.conf
Processed alias file: /var/hack/etc/ncid/ncidd.alias
Verbose level: 1
Modem initialized.
Modem set for CallerID.
Network Port: 3333
Wrote pid 488 in pidfile: /var/run/ncidd.pid
localhost: forward host lookup failed:
Fatal: Poll device hung up
Removed pidfile: /var/run/ncidd.pid
Terminated: 01/16/2008 02:02
[Living Room S2]...[/]-# localhost: forward host lookup failed:

I'm not too worried about this, as I have the non-YAC ncid working, but it is a puzzlement and maybe others are trying to get this to work.

I have some comments on your output::

You should always start ncidd first, and then the gateway (yac2ncid) and client (tivocid). You do not need to start ncid-yac unless ncidd gets the Caller ID directly from your modem and you want to send it to YAC clients.

The Fatal line indicates the modem disconnected. If ncidd detects that the modem disconnected, it terminates because it can no longer obtain Caller ID.

The localhost line is a kernel message, not a NCID message. It was sent to your terminal.

NCID indicated that the configuration file was not /var/DRH/hack/etc/ncidd.conf. Most likely it is a typo and it should really be /var/DRH/hack/etc/ncid/ncidd.conf

PortlandPaw
01-16-2008, 07:34 PM
That was a typo -- and probably most of the problem, but it's not solved yet. I thought I had it until I realized I still had the phone cord plugged into the TiVo and it was picking up the cid through the modem. I disconnected it and when the phone rings I get:

[Living Room S2]...[/var/DRH/hack/bin]-# localhost: forward host lookup failed:Then I get
Can't grab 0.0.0.0:10629 with bind when I run yac2ncid -v[/code]

jlc
01-17-2008, 01:14 AM
The localhost lookup problem seems like it is a problem with your /etc/hosts file. My series2 hosts file looks like this:


# Copyright (c) 2001 TiVo Inc.
127.0.0.1 localhost.localdomain localhost

If you do not have localhost line add it. If you are missing /etc/hosts, create one with the line. If that does not fix the problem, post the output of ifconfig. It should show your local loopback address as well as your IP address.

PortlandPaw
01-17-2008, 07:12 AM
I'm afraid my /etc/hosts file is identical to yours. Here's the out put from ifconfig:
[Living Room S2]...[/var/tmp]-# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:B6:00:6A:7E
inet addr:192.168.2.16 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:42581 errors:0 dropped:0 overruns:0 frame:0
TX packets:12870 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:22723434 (21.6 Mb) TX bytes:2306287 (2.1 Mb)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:14167 errors:0 dropped:0 overruns:0 frame:0
TX packets:14167 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:753485 (735.8 Kb) TX bytes:753485 (735.8 Kb)

jlc
01-17-2008, 10:21 AM
[Living Room S2]...[/var/DRH/hack/bin]-# localhost: forward host lookup failed:Then I get
Can't grab 0.0.0.0:10629 with bind when I run yac2ncid -v[/code]
When you run yac2ncid -v, before the phone rings, do you get the output Hitchhiker posted? You should get all the lines except the "Got a message line" If you do then I assume the above error message comes in place of his last line when you try a test call.

Did you change the sip2ncid.conf file? If it is not the default, could you post it also? Maybe you should also post the output of: "sh -x yac2ncid".

Could you post the output of "route -n" Maybe you do not have a default route set up back to your router IP address. When you tried to run the YAC client before you switched to NCID, did you get the same localhost error message above?

Hichhiker
01-17-2008, 05:51 PM
When you run yac2ncid -v, before the phone rings, do you get the output Hitchhiker posted? You should get all the lines except the "Got a message line" If you do then I assume the above error message comes in place of his last line when you try a test call.

Did you change the sip2ncid.conf file? If it is not the default, could you post it also? Maybe you should also post the output of: "sh -x yac2ncid".

Could you post the output of "route -n" Maybe you do not have a default route set up back to your router IP address. When you tried to run the YAC client before you switched to NCID, did you get the same localhost error message above?

All good suggestions, I would also try to see if there is something strange about the version of netcat (nc) you installed. Both errors appear to emanate from netcat, so its a good candidate for a troublemaker. "Zipper" drops busybox in /busybox and that version is known to work fine. Try setting NETCAT="/busybox/nc" in yac2ncid.conf.

-HH

PortlandPaw
01-17-2008, 07:20 PM
I'm making some progress...
I switched from the /busybox/nc to AlphaWolf's /tivo-bin/nc and got yac2ncid to load without the "can't grab" error.
[Living Room S2]...[/var/hack/TivoWebPlus/config]-# yac2ncid: Enabling verbose mode due to command line option
yac2ncid: Auto-detecting the netcat type
yac2ncid: Detected *Hobbit* version of netcat
yac2ncid: Using Hobbit settings...
yac2ncid: Listening for new connectionsBut with -v set, you see this when the phone rings:
yac2ncid: Got a message
localhost: forward host lookup failed:
yac2ncid: Got a message
localhost: forward host lookup failed:
yac2ncid: Got a message
localhost: forward host lookup failed:If I leave the phone line plugged in, the cid shows up on the screen; no phone line, no cid, so it's reading the TiVo modem and apparently reading the YAC server, but only the modem info is being displayed.

Here's the out put from route -n:
[Living Room S2]...[/]-# route -n
route_info, afname=inet, options=37
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
204.176.49.2 127.0.0.1 255.255.255.255 UGH 0 0 0 lo
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
204.176.49.0 127.0.0.1 255.255.255.0 UG 0 0 0 lo
0.0.0.0 192.168.2.1 0.0.0.0 UG 2 0 0 eth0

jlc
01-17-2008, 09:54 PM
Your output changed a lot. No longer do you have a localhost error. It seems that yac2ncid is using a hostname and your TiVo is failing to resolve it to a address. Normally, without yac2ncid.conf, yac2ncid uses localhost for the NCID server. With the default configuration file, yac2ncid uses 127.0.0.1 as the address for the NCID server.

You need to "sh -x yac2ncid" and see what NCIDHOST is set to. If NCIDHOST=localhost and NCIDSERVER=127.0.0.1:3333 in yac2ncid.conf then yac2ncid is not finding the configuration file. If this is true then a symbolic link will fix yac2ncid and eliminate the -C option you use when you start ncidd:

ln -s /var/DRH/hack /var/hack

PortlandPaw
01-18-2008, 08:35 AM
Here's the full output of sh -x yac 2ncid. You'll note that NCIDSERVER is not as you stated - it's localhost:3333. How do I remedy this? And thanks for all your help on this!
[Living Room S2]...[/var/DRH/hack/sbin]-# sh -x yac2ncid
++ basename yac2ncid
+ ME=yac2ncid
+ ME=yac2ncid
+++ dirname yac2ncid
++ cd .
++ pwd -P
+ MYDIR=/var/DRH/hack/sbin
+ SHELL_NAME=/usr/local/bin/bash
+ test -f /tvbin/tivoapp -a '' '!=' 1
++ type -p /usr/local/bin/bash
+ SHELL_PATH=
+ PIDFILE=/dev/null
+ set -e
+ CONFFILE=
+ ConfigDir=/var/hack/etc/ncid
+ VERBOSE=
+ YACPORT=10629
+ NCIDSERVER=localhost:3333
+ LINE=YAC
+ NETCAT=
+ NETCAT_SEND_OPTS=
+ NETCAT_LISTEN_OPTS=-p
+ NETCAT_BUSYBOX_SEND_OPTS=
+ NETCAT_BUSYBOX_LISTEN_OPTS=-p
+ NETCAT_HOBBIT_SEND_OPTS=-w1
+ NETCAT_HOBBIT_LISTEN_OPTS=-p
+ NETCAT_JACKSON_SEND_OPTS=-w1
+ NETCAT_JACKSON_LISTEN_OPTS=
+ NETCAT_CUSTOM_SEND_OPTS=-w1
+ NETCAT_CUSTOM_LISTEN_OPTS=-p
+ NCIDHOST=localhost
+ NCIDPORT=3333
++ findfile yac2ncid.conf '/var/DRH/hack/sbin:/var/DRH/hack/sbin/../etc:/var/hack/etc/ncid:~:/etc'
++ local filename=yac2ncid.conf
++ local 'path=/var/DRH/hack/sbin:/var/DRH/hack/sbin/../etc:/var/hack/etc/ncid:~:/etc'
++ local 'O_IFS=
'
++ local N_IFS=:
++ local fullfile=
++ IFS=:
++ IFS=

++ local fullfile=/var/DRH/hack/sbin/yac2ncid.conf
++ test -f /var/DRH/hack/sbin/yac2ncid.conf
++ IFS=:
++ IFS=

++ local fullfile=/var/DRH/hack/sbin/../etc/yac2ncid.conf
++ test -f /var/DRH/hack/sbin/../etc/yac2ncid.conf
++ IFS=:
++ IFS=

++ local fullfile=/var/hack/etc/ncid/yac2ncid.conf
++ test -f /var/hack/etc/ncid/yac2ncid.conf
++ IFS=:
++ IFS=

++ local 'fullfile=~/yac2ncid.conf'
++ test -f '~/yac2ncid.conf'
++ IFS=:
++ IFS=

++ local fullfile=/etc/yac2ncid.conf
++ test -f /etc/yac2ncid.conf
++ IFS=:
++ IFS=

+ CONFFILE=
+ isblank
+ test z == z
+ test z == z-v
++ echo localhost:3333
++ cut -d: -f1
+ NCIDHOST=localhost
++ echo localhost:3333
++ cut -s -d: -f2
+ NCIDPORT=3333
+ isblank
+ test z == z
++ which nc
+ NETCAT=/sbin/nc
+ test -x /sbin/nc
+ isblank
+ test z == z
+ msg Auto-detecting the netcat type
+ isblank
+ test z == z
+ true
++ /sbin/nc -h
++ head -1
++ cut '-d ' -f1
+ test 'z[v1.10]' == 'z[v1.10]'
+ msg Detected '*Hobbit*' version of netcat
+ isblank
+ test z == z
+ true
+ NETCAT_TYPE=HOBBIT
+ msg Using Hobbit settings...
+ isblank
+ test z == z
+ true
+ NETCAT_SEND_OPTS=-w1
+ NETCAT_LISTEN_OPTS=-p
+ msg Listening for new connections
+ isblank
+ test z == z
+ true
+ true
++ bash -c 'echo "$$ ">>/dev/null && exec /sbin/nc -l -p 10629'
Can't grab 0.0.0.0:10629 with bind
+ MSG=

Hichhiker
01-18-2008, 09:43 AM
Here's the full output of sh -x yac 2ncid. You'll note that NCIDSERVER is not as you stated - it's localhost:3333. How do I remedy this? And thanks for all your help on this!

A few things:

1 - can't bind error may indicate you already have a copy of yac2ncid running - check your processes

2 - I do not think it is finding the yac2ncid.conf file. To fix this either do a symlink like what JLC was saying (ln -s /var/DRH/hack /var/hack) or copy the conf file into same dir as the binary

3 - It is taking /sbin/nc as the netcat - if you are still having issues after doing steps above, try setting it to /busybox/nc in conf file. This version of nc is known to work. Your previous attempts may not have worked as it was not reading the config file.

-HH

jlc
01-18-2008, 01:45 PM
Here's the full output of sh -x yac 2ncid. You'll note that NCIDSERVER is not as you stated - it's localhost:3333. How do I remedy this? And thanks for all your help on this!
I posted about the NCIDSERVER value in yac2ncid.conf, not the default value provided by yac2ncid. I probably did not word it properly, but I wanted you to check the VALUE of NCIDSERVER in yac2ncid.conf. Your output is what I expected, including the default value of NCIDSERVER, if yac2ncid.conf was not found.

You can fix this in one of two ways: creating the link as I mentioned before, or copying the configuration file to /var/DRH/hack/bin as Hitchhiker suggested. I recommend creating the link so all configuration files will be used. I am assuming that you have no /var/hack directory.

Please note that you have a network configuration problem. Your TiVo should map localhost to 127.0.0.1, but it is not doing it even though your /etc/hosts file has the correct entry in it. Changing NCIDHOST to 127.0.0.1 gets around the problem.

PortlandPaw
01-18-2008, 11:03 PM
That did it.

To summarize:
1. Using either a standard ncid install or a zipper install, put yac2ncid and yac2ncid.conf (from the ncid package (http://downloads.sourceforge.net/ncid/ncid-0.69-1.mips-tivo.tgz?modtime=1195154108&big_mirror=0)) in the ./hack/bin directory
2. Edit yac2ncid.conf to point to nc (probably /busybox/nc or /tivo-bin/nc -- both work)
3. In this order, start with:
ncidd
yac2ncid &
tivocid &
(from the proper directories, of course, or with full path names)

It turns out to be that simple. Right now, I have both the TiVo modem and my computer YAC sending messages to the screen -- the modem message shows up first and is replaced and overwritten by the YAC message. So now I can unplug my telephone cord.

Thanks for all the help...sorry to make such a simple matter so complex!

PortlandPaw
01-18-2008, 11:35 PM
Please note that you have a network configuration problem. Your TiVo should map localhost to 127.0.0.1, but it is not doing it even though your /etc/hosts file has the correct entry in it. Changing NCIDHOST to 127.0.0.1 gets around the problem.I think this is by design in the Zipper, the idea being to confound attempts to contact the TiVo Mother Ship.