ExtractStream + new SVR2000 FIXED!

rwaldin rwaldin at y...
Tue, 08 Jan 2002 20:26:05 -0000


--- In ExtractStream@y..., "Edmond E. Shwayri" <eshwayri@n...> wrote:
> I have figured out the problem. Here are my calculations based on
-w's 
> output :

Thanks for the feedback. Your results match what I suspect has been
the underlying problem with ExtractStreams FSID calculation. It
turns out that using masks of 0x3ffff and 0xfffff are only
approximations of the real solution. The 0x3ffff mask works best in
many situations on the SA TiVos and the 0xfffff mask works best on
many DTiVos.

The real solution seems to be in the metadata in the MFS partition
"headers". I found these structures:

http://pserver.samba.org/cgi-bin/cvsweb/tivo/vplay/mfs.h?rev=1.36

which along with some code:

http://pserver.samba.org/cgi-bin/cvsweb/tivo/vplay/mfs.c?rev=1.41

that uses them. With what I've learned already, I can tell that the
FSID calculation can be done precisely on all systems. 

I'd like to update the experimental version to do just that, and have
you all retest your systems and see if we have it right. That should
take me a day or two.

For those of you who would like to know more now, the real solution
appears to be something like:

fsidHash = fsid * 67289 % totalSectorsOnAllInodeZones;
virtualSector = fsidHash * 2;
i = 0;
while(zone[i].type == INODE_ZONE && zone[i].sectors <= virtualSector)
{
virtualSector -= zone[i].sectors;
}
sector = virtualSector + zone[i].start;
partition = i;

Turns out this works in both the SA and DTiVo cases, i.e. it's the
Grand Unified Theory of TiVo MFS. But in order to do this, you need
to have the list of zones and zone properties, and that's all found
in the MFS "headers". Many thanks to tridge for showing the way! I
may just end up using his code directly since it already does what we
need. Is there a reason why ExtractStream doesn't use his code?

-Ray