From berry_dijk@tasking.com Mon, 1 Nov 1999 09:13:51 +0100 (MET)
Date: Mon, 1 Nov 1999 09:13:51 +0100 (MET)
From: Berry Dijk berry_dijk@tasking.com
Subject: [Livid-dev] css-cat problems

Hi all,

Since I had some time left this weekend, I decided to try and see if I
could get a DVD to play under Linux. It worked, after some problems.
Here are my experiences. Maybe someone here with more knowledge knows
what went wrong.

tstdvd seemed to work right from the start. The only thing I noticed is
that every time I started with a new DVD, the first ./tstdvd always
reports a 'not authenticated'. I didn't write it down, sorry, but it
was not the last entry, but the one before that. Rerunning ./tstdvd
always resulted in correct entries. I don't know if this is to be
expected and it didn't seem to give any problems, so I just ignored it.

./css-cat gave me an .vob file which was much smaller then the
original. This happened independent of its arguments. I added some
printf's to the code and found out that most sectors were skipped on

		if (pes[0x03] < 0xbc) {
			++skipped; continue;
		}

The one DVD I tried this one had pes[0x03] == 0xbb for most of its
sectors. The .vob file that was produced could not be played.

So I replaced the un_css with the un_css for 0.4. That resulted in
correct .vob files. These I could play with mpeg2player with a
unbelievable 11 fps on my AMD K6-2 300. To improve that I rebuild the
mpeg2player with DGA support, but that caused in a segfault. gdb did
not give me any clues, because I am not familiar with multi-threaded
debugging.

I'm happy to do some more tests if it is needed. However, I do not have
a lot of spare time, so it could take a few days before I can do these
tests.

Keep up the good work,
-- 
Berry Dijk

From berry_dijk@tasking.com Tue, 2 Nov 1999 08:27:47 +0100 (MET)
Date: Tue, 2 Nov 1999 08:27:47 +0100 (MET)
From: Berry Dijk berry_dijk@tasking.com
Subject: [Livid-dev] css-cat problems

On  2 Nov, Derek Fawcus wrote:
> On Mon, Nov 01, 1999 at 09:13:51AM +0100, Berry Dijk wrote:
>> 
>> The one DVD I tried this one had pes[0x03] == 0xbb for most of its
>> sectors.
> 
>   Weird - what was the title?   I'll have to look up that start code
> later to see what it is.
> 

I've seen it with two titles at least: 'A bridge too far' (region 1)
and 'Blade Runner' (region 2). And just to make sure, I verified it
again yesterday night. BTW, this is the debugging I added. Pretty
straightforward I would say:

		if (pes[0x03] < 0xbc) {
+			fprintf(stderr, "%02x", pes[0x03]);
			++skipped; continue;
		}

>> So I replaced the un_css with the un_css for 0.4. That resulted in
>> correct .vob files.
> 
>   Could you please confirm that the patch "Charles M. Hannum"
> <root@ihack.net> sent does not work for you?
>
>   That version simply decrypted every sector that was encrypted
> irrespective of the type.  The later versions try to optimise
> the decryption.

I will check it later. I think it should work, because the un_css() from
css-auth 0.4 I'm using also decrypts every sector.
 
>> These I could play with mpeg2player with a unbelievable 11 fps
>> on my AMD K6-2 300.
> 
>   Guess what.  I've got the same CPU and get the same speed...
> 
> DF

The speed is what I expected. But since the Xserver uses about 30% of
the CPU, I hoped to get a better result with DGA. I also noticed 3D-NOW
defines in the NIST sources. Maybe enabling those will give me an extra
fps :-)

-- 
Berry Dijk

From derek@spider.com Tue, 2 Nov 1999 11:59:32 +0000
Date: Tue, 2 Nov 1999 11:59:32 +0000
From: Derek Fawcus derek@spider.com
Subject: [Livid-dev] css-cat problems

On Tue, Nov 02, 1999 at 08:27:47AM +0100, Berry Dijk wrote:
> On  2 Nov, Derek Fawcus wrote:
> > On Mon, Nov 01, 1999 at 09:13:51AM +0100, Berry Dijk wrote:
> >> 
> >> The one DVD I tried this one had pes[0x03] == 0xbb for most of its
> >> sectors.
> > 
> >   Weird - what was the title?   I'll have to look up that start code
> > later to see what it is.

  OK.  I looked it up.  It's actually a System header within the Pack
layer.  So it would appear that DVD allows these.  I'll add support
to css-cat for that.  I'm also interested to see if these packets
(containing system headers) are allowed to be encrypted.  Another
question would be are the system headers restricted to a fixed length
under DVD or are they normal variable length ones.

DF
-- 
Derek Fawcus                                                    derek@spider.com
Spider Software Ltd.                                        +44 (0) 131 475 7034
PGP/GnuPG Keys available

From alan@lxorguk.ukuu.org.uk Tue, 2 Nov 1999 12:16:31 +0000 (GMT)
Date: Tue, 2 Nov 1999 12:16:31 +0000 (GMT)
From: Alan Cox alan@lxorguk.ukuu.org.uk
Subject: [Livid-dev] css-cat problems

I tried the css tools and NIST player from CVS on the region 2 Zorro disk.
The css decode appears fine but the audio data on the main film makes the
AC3 decoder barf with !! Bad Exponent !!. Given the CRC's seem to have passed
I suspect this is AC3 not css-cat that is generating bad data ?

Alan

From derek@spider.com Tue, 2 Nov 1999 12:25:22 +0000
Date: Tue, 2 Nov 1999 12:25:22 +0000
From: Derek Fawcus derek@spider.com
Subject: [Livid-dev] css-cat problems

On Tue, Nov 02, 1999 at 12:16:31PM +0000, Alan Cox wrote:
> I tried the css tools and NIST player from CVS on the region 2 Zorro disk.
> The css decode appears fine but the audio data on the main film makes the
> AC3 decoder barf with !! Bad Exponent !!. Given the CRC's seem to have passed
> I suspect this is AC3 not css-cat that is generating bad data ?

Possibly. You can check by doing

css-cat -0 vobfile|ac3dec -

if that works it's the fault of the nist player, if it fails it's my fault.

there was a patch posted for resynicing the ac3 player.

DF
-- 
Derek Fawcus derek@spider.com
Spider Software Ltd. +44 (0) 131 475 7034
PGP/GnuPG Keys available

From alan@lxorguk.ukuu.org.uk Tue, 2 Nov 1999 12:26:01 +0000 (GMT)
Date: Tue, 2 Nov 1999 12:26:01 +0000 (GMT)
From: Alan Cox alan@lxorguk.ukuu.org.uk
Subject: [Livid-dev] css-cat problems

> Possibly. You can check by doing
> 
> css-cat -0 vobfile|ac3dec -

I've already tried that - it fails

Alan

From derek@spider.com Tue, 2 Nov 1999 12:46:40 +0000
Date: Tue, 2 Nov 1999 12:46:40 +0000
From: Derek Fawcus derek@spider.com
Subject: [Livid-dev] css-cat problems

--98e8jtXdkpgskNou
Content-Type: text/plain; charset=us-ascii

On Tue, Nov 02, 1999 at 12:26:01PM +0000, Alan Cox wrote:
> >   Possibly.  You can check by doing
> > 
> >     css-cat -0 vobfile|ac3dec -
> 
> I've already tried that - it fails

  bugger.

  Can you hack css-cat where it checks the following:

                if (pes[0x03] < 0xbc) {
                        ++skipped; continue;
                }

  and add a fprintf(stderr, value found at that offset) to see if it's
got a system header (value of 0xbb).

   another thing to try is simply to hack out all of the demux code in
css-cat (same as version 0.4),  then feed through:

   css-cat vobfile|my-extract_ac3 -|ac3dec -

  if that fails,  then it's almost certainly bug in ac3dec

DF
-- 
Derek Fawcus                                                    derek@spider.com
Spider Software Ltd.                                        +44 (0) 131 475 7034
PGP/GnuPG Keys available

Code

From aholtzma@ess4.engr.UVic.CA Tue, 2 Nov 1999 06:36:41 -0800
Date: Tue, 2 Nov 1999 06:36:41 -0800
From: Aaron Holtzman aholtzma@ess4.engr.UVic.CA
Subject: [Livid-dev] css-cat problems

It would seem that Alan Cox (alan@lxorguk.ukuu.org.uk) said:
> > Possibly. You can check by doing
> > 
> > css-cat -0 vobfile|ac3dec -
> 
> I've already tried that - it fails
> 
One more thing to try.

export AC3_DEBUG=1; css-cat -0 vobfile|ac3dec |grep crc

It will let you know if any frame CRCs failed. If the bitstream
is okay, then it's my problem. In that case, can you put the
problem ac3 stream somewhere on the web so I can take a look
at it? It could be using some weird mode that I've never seen
before. Thanks.

cheers,
aaron

From alan@irongate.swansea.linux.org.uk Wed, 3 Nov 1999 15:13:42 +0000 (GMT)
Date: Wed, 3 Nov 1999 15:13:42 +0000 (GMT)
From: Alan Cox alan@irongate.swansea.linux.org.uk
Subject: [Livid-dev] [patch]: auth problems

With the new patches on 2.2.13ac3 (test not yet out) I get failures from
the Toshiba Drive. With 2.3.25 unpatched it works

hdc: packet command error: status=0x51 { DriveReady SeekComplete Error }
hdc: packet command error: error=0x50
ATAPI device hdc:
  Error: Illegal request -- (Sense key=0x05)
  Invalid field in command packet -- (asc=0x24, ascq=0x00)
  The failed "Report Key" packet command was:
  "a4 00 00 00 00 00 00 00 00 00 3f 00 "
  Error in command packet byte 15543 bit 0

Alan

From axboe@image.dk Wed, 03 Nov 1999 18:08:34 +0100
Date: Wed, 03 Nov 1999 18:08:34 +0100
From: Jens Axboe axboe@image.dk
Subject: [Livid-dev] [patch]: auth problems

Alan Cox wrote:
> 
> With the new patches on 2.2.13ac3 (test not yet out) I get failures from
> the Toshiba Drive. With 2.3.25 unpatched it works
> 
> hdc: packet command error: status=0x51 { DriveReady SeekComplete Error }
> hdc: packet command error: error=0x50
> ATAPI device hdc:
>   Error: Illegal request -- (Sense key=0x05)
>   Invalid field in command packet -- (asc=0x24, ascq=0x00)
>   The failed "Report Key" packet command was:
>   "a4 00 00 00 00 00 00 00 00 00 3f 00 "
>   Error in command packet byte 15543 bit 0
> 
> Alan

Yup, there turned out to be a small problem with some drives. I'm not
home right now, but could you try the patch I posted this morning
(dvd-inc.diff)? I have one report that it works for him now. I'll
put up a new set when I get back today.

-- 
*  Jens Axboe <axboe@image.dk>
*  Linux CD-ROM Maintainer
*  http://www.kernel.dk

From alan@lxorguk.ukuu.org.uk Wed, 3 Nov 1999 19:41:21 +0000 (GMT)
Date: Wed, 3 Nov 1999 19:41:21 +0000 (GMT)
From: Alan Cox alan@lxorguk.ukuu.org.uk
Subject: [Livid-dev] DVD-auth/css cat problems

> One more thing to try.
> export AC3_DEBUG=1; css-cat -0 vobfile|ac3dec |grep crc

I've not been able to check this or the suggested patch to the css-cat
yet. It seems that Jens fix to 2.3.25 to sort out the IDE errors on some 
toshiba drives also managed to break mine that worked fine unpatched.

I'll let you know once I've figured out WTF is going on lower down. If
this doesn't help and you don't have a region locked drive (or it is reg2)
Building Number Three will buy you a copy of region 2 Zorro to debug.

Alan

From alan@lxorguk.ukuu.org.uk Wed, 3 Nov 1999 21:14:46 +0000 (GMT)
Date: Wed, 3 Nov 1999 21:14:46 +0000 (GMT)
From: Alan Cox alan@lxorguk.ukuu.org.uk
Subject: [Livid-dev] css-cat problems

>   Can you hack css-cat where it checks the following:
> 
>                 if (pes[0x03] < 0xbc) {
>                         ++skipped; continue;
>                 }
> 
>   and add a fprintf(stderr, value found at that offset) to see if it's
> got a system header (value of 0xbb).

Loads of them and an 0x01 at the start